<HTML>
<HEAD>
<TITLE>Re: [asterisk-users] Custom Application recording problem</TITLE>
</HEAD>
<BODY>
<FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Dale,<BR>
<BR>
Thanks for the correction gosub() worked. There was a problem with pressing option 3 so I removed extension 4. <BR>
Below is the final [sub-timo]<BR>
[sub-timo]<BR>
exten => s,1,Set(RecordingType=${ARG1})<BR>
exten => s,n,Set(TIMEOUT(digit)=2) ; Set Digit Timeout to 5 seconds<BR>
exten => s,n,Set(TIMEOUT(response)=2) ; Set Response Timeout to 10 seconds<BR>
exten => s,n,Answer<BR>
exten => s,n,NoOp(${CALLERID(num)})<BR>
exten => s,n,Set(number=${CALLERID(num)})<BR>
exten => s,n,NoOp(${number})<BR>
exten => s,n(recordmsg),Background(recmsg1) ;"Please say yo message after the beep and end with a hash" <BR>
exten => s,n,Record(/var/www/html/timo/crystalrecords/${RecordingType}/${number}.wav)<BR>
exten => s,n(playmsg),Playback(/var/www/html/timo/crystalrecords/${RecordingType}/${number})<BR>
exten => s,n(askuser),Background(ackrec) ;"Press 1 to replay or 2 to re-record, 3 to save "<BR>
exten => s,11,WaitExten(5)<BR>
exten => 1,1,Goto(s,playmsg)<BR>
exten => 2,1,Goto(s,recordmsg) ; re-record message<BR>
exten => 3,1,AGI(${RecordingType}.php)<BR>
exten => s,1,Background(invalidentry)<BR>
exten => s,n,Goto(s,askuser)<BR>
exten => t,1,Playback(thankyoubye)<BR>
exten => t,n,Return<BR>
<BR>
<BR>
Inorder for the system to recognize invalid selections, I also changed <BR>
<FONT COLOR="#0000FE">exten => i,1,Background(invalidentry)<BR>
exten => i,n,Goto(s,askuser)<BR>
<BR>
To <BR>
</FONT>exten => s,1,Background(invalidentry)<BR>
exten => s,n,Goto(s,askuser)<BR>
<BR>
Thank you very much for the help.<BR>
<BR>
Kind Regards<BR>
<BR>
Billy <BR>
<BR>
<BR>
On 4/17/12 11:11 PM, "Dale Noll" <dnoll@wi.rr.com> wrote:<BR>
<BR>
<FONT COLOR="#0000FF">> Billy,<BR>
> <BR>
> I really should have had my coffee before answering you previous <BR>
> message. My head was in the wrong place (not saying where) and I sent <BR>
> you down the wrong path.<BR>
> <BR>
> Macro() is not the answer because of the WaitExten(). When WaitExten is <BR>
> used in a Macro(), it does not match within the macro, it matches an <BR>
> extension within the context where the macro was called. This is what <BR>
> is causing your errors.<BR>
> <BR>
> What you really should do is use gosub(), not macro().<BR>
> <BR>
> Here is the recording routine<BR>
> <BR>
> [sub-timo]<BR>
> exten => s,1,Set(RecordingType=${ARG1})<BR>
> exten => s,n,Set(TIMEOUT(digit)=2) ; Set Digit Timeout to 5 <BR>
> seconds<BR>
> exten => s,n,Set(TIMEOUT(response)=2) ; Set Response Timeout to <BR>
> 10 seconds<BR>
> exten => s,n,Answer<BR>
> exten => s,n,NoOp(${CALLERID(num)})<BR>
> exten => s,n,Set(number=${CALLERID(num)})<BR>
> exten => s,n,NoOp(${number})<BR>
> exten => s,n(recordmsg),Background(recmsg1) ;"Please say yo message <BR>
> after the beep and end with a hash"<BR>
> exten => <BR>
> s,n,Record(/var/www/html/timo/crystalrecords/${RecordingType}/${number}.gsm)<BR>
> exten => <BR>
> s,n(playmsg),Playback(/var/www/html/timo/crystalrecords/${RecordingType}/${num<BR>
> ber})<BR>
> exten => s,n(askuser),Background(ackrec) ;"Press 1 to replay or 2 to <BR>
> re-record, 3 to save "<BR>
> exten => s,11,WaitExten(5)<BR>
> exten => 1,1,Goto(s,playmsg)<BR>
> exten => 2,1,Goto(s,recordmsg) ; re-record message<BR>
> exten => 3,1,Goto(4,1)<BR>
> exten => 4,1,AGI($RecordingType}.php)<BR>
> exten => 4,n,Return()<BR>
> exten => i,1,Background(invalidentry)<BR>
> exten => i,n,Goto(s,askuser)<BR>
> exten => t,1,Playback(thankyoubye)<BR>
> exten => t,n,Return<BR>
> <BR>
> <BR>
> I know big change there eh? Note: I did make some changes to extension <BR>
> 4, but that was fix syntax error, not because of the change from macro <BR>
> to gosub.<BR>
> <BR>
> <BR>
> The difference is really how you call it.<BR>
> <BR>
> exten => 3552,1,Gosub(sub-timo,s,1(contentdb))<BR>
> exten => 3552,n,Hangup()<BR>
> <BR>
> <BR>
> Also note. I have not tested this code. I have something similar in <BR>
> place, but not your specific code.<BR>
> <BR>
> Oh. You should be able to remove the 'include => timo' from the<BR>
> [from-internal-custom] context.<BR>
> <BR>
> <BR>
> Dale<BR>
> <BR>
> --<BR>
> _____________________________________________________________________<BR>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --<BR>
> New to Asterisk? Join us for a live introductory webinar every Thurs:<BR>
> <a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a><BR>
> <BR>
> asterisk-users mailing list<BR>
> To UNSUBSCRIBE or update options visit:<BR>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><BR>
</FONT></SPAN></FONT></FONT>
</BODY>
</HTML>