I've come up with a solution for this:

exten => rpm,1,System(curl --request POST --form 
file=@/var/lib/asterisk/sounds/recordings/${RecordedPersonalMessage}.wav<mailto:file=@/var/lib/asterisk/sounds/recordings/$%7bRecordedPersonalMessage%7d.wav>
http://soundfragmenthandler.company.local/soundfragmenthandler.ashx)

Not sure if it's the best way to do, but it works.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Grant Bagdasarian
Sent: dinsdag 15 januari 2013 12:01
To: [email protected]
Subject: [asterisk-users] POSTing recorded audio stream

Hello,

I quite don't understand how to send a recorded message during a call off to an 
HTTP handler using HTTP POST.
How do I access this file/audiostream in the dialplan?

I tried this:
exten => rpm,1,Set(RecordedPersonalMessage=${EPOCH})
exten => 
rpm,n,Record(/var/lib/asterisk/sounds/recordings/${RecordedPersonalMessage}:wav)
exten => 
rpm,n,Set(Result=${CURL(soundfragmenthandler.company.local/soundfragmenthandler.ashx,postdata_var1=/var/lib/asterisk/sounds/recordings/${RecordedPersonalMessage}.wav)})

I even tried it with the variable ${RECORDED_FILE} but that only posted the 
filename.

Am I accessing the file in the wrong way or is CURL not able to handle these 
types of things?

Regards,

Grant
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to