Please Help Record and forward

:confused:

Im looking to have a caller dial in, record a message and hang up, then I want asterisk to dial out and to a number and play the recording. I try something like this:

[inboud]
exten => s,1,wait(1.5)
exten => s,n,background(please-record-message-and-press-pound)
exten => s,n,Record(themessage:gsm)
exten => s,n,Hangup() ; <---- Stops here
exten => s,n,Dial(SIP/offlineuser)
exten => s,n,Playback(themessage)
exten => s,n,Hangup()

But the process stops at the first hangup, can anyone please help?

using your example (is [inboud] correct spelling ?) :

[inboud] exten => s,1,wait(1.5) exten => s,n,background(please-record-message-and-press-pound) exten => s,n,Record(themessage:gsm) exten => s,n,Hangup() ; <---- Stops here exten => h,1,Dial(SIP/offlineuser) exten => h,n,Playback(themessage) exten => h,n,Hangup()

But the process stops at the first hangup, can anyone please help?

It’s is normal for the thread to stop at a single hangup.
You can’t do anything about it in the dialplan directly.
What you can do is write a call file with the call settings you want.
Before hanging up copy it to /var/spool/asterisk/outgoing
asterisk outgoing spool directory.
The call file will then do the rest for you.
For details about auto-dial as always refer wiki
voip-info.org/tiki-index.php … o-dial+out

did you read my post ? using the ‘h’ extension, it’s possible to continue with the dialplan after a hangup.

Hi baconbuttie,
That is a way but what he wants is to playback the file and I don’t think

exten => h,1,Dial(SIP/offlineuser)
exten => h,n,Playback(themessage)

The second Playback will actually playback the message to the called
person.
He has to use auto-dial for this.

true enough … i’ll look into it again later when i’m back at the pc … maybe you could work something out for the guy ?

:open_mouth:

Ok, two things, I LOVE the idea of the h extension even if it doesn’t work for the dial I can use it to create the call file AFTER the caller hangs up, this is cool. (And I did not spell inbound correctly in my post)

I have tried manually creating a .call file and have had success getting it to actually initiate a call. However this is what happens, the destination number rings, I pick up the line and there is hangup… as I watch Asterisk, it appears that the message is played prior to the pickup of the line. So how do I detect when the line is answered to initiate the playback?

my call file looks like this:

Channel: SIP/1XXXXXXXXXX@osl
MaxRetries: 2
RetryTime: 60
WaitTime: 90
Context: dialout
Extension: s
Priority: 2

my dialplan looks like this

[dialout]
exten => s,1,Wait(1.5)
exten => s,n,Background(hello-world)
exten => s,n,Wait(1.5)
exten => s,n,Hangup

call file should jump to priority 1 and at priority 1 there should be answer

Channel: SIP/1XXXXXXXXXX@osl
MaxRetries: 2
RetryTime: 60
WaitTime: 90
Context: dialout
Extension: s
Priority: 1

so the dialplan should be:

[dialout]
exten => s,1,Answer()
exten => s,n,Wait(1.5)
exten => s,n,Background(hello-world)
exten => s,n,Wait(1.5)
exten => s,n,Hangup

:astonished:

Well, It seems my problem is a little deeper than just Asterisk.

I am using a Sipura SPA-3102, when an outbound call is initialized the SPA answers the call prior to dialing out. I only found this out after using an IAX trunk that I have from another provider where the .call file functioned as expected. I called support on the issue and they say that this is how the SPA is designed and there is no way to not have the SPA answer. Does anyone know a work around for that. The closest I can get is to dump the call into a context with a timeout the repeats. but this is not good.