Re: Custom Application recording problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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}/${number}) 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


[Index of Archives]     [Asterisk Announcements]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]