[asterisk-users] Custom Application recording problem
Billy Kaye
billy.kaye at crystal-int.com
Wed Apr 18 16:09:16 CDT 2012
Hi Dale,
Thanks for the correction gosub() worked. There was a problem with pressing
option 3 so I removed extension 4.
Below is the final [sub-timo]
[sub-timo]
exten => s,1,Set(RecordingType=${ARG1})
exten => s,n,Set(TIMEOUT(digit)=2) ; Set Digit Timeout to 5
seconds
exten => s,n,Set(TIMEOUT(response)=2) ; Set Response Timeout to 10
seconds
exten => s,n,Answer
exten => s,n,NoOp(${CALLERID(num)})
exten => s,n,Set(number=${CALLERID(num)})
exten => s,n,NoOp(${number})
exten => s,n(recordmsg),Background(recmsg1) ;"Please say yo message after
the beep and end with a hash"
exten =>
s,n,Record(/var/www/html/timo/crystalrecords/${RecordingType}/${number}.wav)
exten =>
s,n(playmsg),Playback(/var/www/html/timo/crystalrecords/${RecordingType}/${n
umber})
exten => s,n(askuser),Background(ackrec) ;"Press 1 to replay or 2 to
re-record, 3 to save "
exten => s,11,WaitExten(5)
exten => 1,1,Goto(s,playmsg)
exten => 2,1,Goto(s,recordmsg) ; re-record message
exten => 3,1,AGI(${RecordingType}.php)
exten => s,1,Background(invalidentry)
exten => s,n,Goto(s,askuser)
exten => t,1,Playback(thankyoubye)
exten => t,n,Return
Inorder for the system to recognize invalid selections, I also changed
exten => i,1,Background(invalidentry)
exten => i,n,Goto(s,askuser)
To
exten => s,1,Background(invalidentry)
exten => s,n,Goto(s,askuser)
Thank you very much for the help.
Kind Regards
Billy
On 4/17/12 11:11 PM, "Dale Noll" <dnoll at wi.rr.com> wrote:
> Billy,
>
> I really should have had my coffee before answering you previous
> message. My head was in the wrong place (not saying where) and I sent
> you down the wrong path.
>
> Macro() is not the answer because of the WaitExten(). When WaitExten is
> used in a Macro(), it does not match within the macro, it matches an
> extension within the context where the macro was called. This is what
> is causing your errors.
>
> What you really should do is use gosub(), not macro().
>
> Here is the recording routine
>
> [sub-timo]
> exten => s,1,Set(RecordingType=${ARG1})
> exten => s,n,Set(TIMEOUT(digit)=2) ; Set Digit Timeout to 5
> seconds
> exten => s,n,Set(TIMEOUT(response)=2) ; Set Response Timeout to
> 10 seconds
> exten => s,n,Answer
> exten => s,n,NoOp(${CALLERID(num)})
> exten => s,n,Set(number=${CALLERID(num)})
> exten => s,n,NoOp(${number})
> exten => s,n(recordmsg),Background(recmsg1) ;"Please say yo message
> after the beep and end with a hash"
> exten =>
> s,n,Record(/var/www/html/timo/crystalrecords/${RecordingType}/${number}.gsm)
> exten =>
> s,n(playmsg),Playback(/var/www/html/timo/crystalrecords/${RecordingType}/${num
> ber})
> exten => s,n(askuser),Background(ackrec) ;"Press 1 to replay or 2 to
> re-record, 3 to save "
> exten => s,11,WaitExten(5)
> exten => 1,1,Goto(s,playmsg)
> exten => 2,1,Goto(s,recordmsg) ; re-record message
> exten => 3,1,Goto(4,1)
> exten => 4,1,AGI($RecordingType}.php)
> exten => 4,n,Return()
> exten => i,1,Background(invalidentry)
> exten => i,n,Goto(s,askuser)
> exten => t,1,Playback(thankyoubye)
> exten => t,n,Return
>
>
> I know big change there eh? Note: I did make some changes to extension
> 4, but that was fix syntax error, not because of the change from macro
> to gosub.
>
>
> The difference is really how you call it.
>
> exten => 3552,1,Gosub(sub-timo,s,1(contentdb))
> exten => 3552,n,Hangup()
>
>
> Also note. I have not tested this code. I have something similar in
> place, but not your specific code.
>
> Oh. You should be able to remove the 'include => timo' from the
> [from-internal-custom] context.
>
>
> Dale
>
> --
> _____________________________________________________________________
> -- 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120419/1092213f/attachment.htm>
More information about the asterisk-users
mailing list