[asterisk-users] Custom Application recording problem

Billy Kaye billy.kaye at crystal-int.com
Tue Apr 17 08:03:19 CDT 2012


Greetings Dale,

Thanks for the help I have updated my file to include the macro sample you
gave me.
The system can make the recordings once I daily the required extension in
this case 3552
--- config section for 3552 -----
exten => 3552,1,Macro(timo,contentdb)
exten => 3552,n,Hangup()

---Below is the macro section ------
[macro-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}/${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,Goto(4,1)
exten => 4,AGI($RecordingType}.php)
exten => i,1,Background(invalidentry)
exten => i,n,Goto(s,askuser)
exten => t,1,Playback(thankyoubye)
exten => t,n,Return

--------
The system does not seem to recognize the buttons that I press e.g. when I
presssed 1 it gave this error

 -- Invalid extension '1' in context 'from-internal' on SIP/261-0000005c
  == CDR updated on SIP/261-0000005c
    -- Executing [i at from-internal:1] BackGround("SIP/261-0000005c",
"invalidentry") in new stack
    -- <SIP/261-0000005c> Playing 'invalidentry.slin' (language 'en')

The detailed error log is further below

--------
Also one thing I have seen from the logs after giving the invalidentry error
it moves to another section in my
extensions_custom.conf called rsvp.
--------

-------------Below is the full extensions_custom.conf file ---------------
[from-internal-custom]
exten => 1234,1,Playback(demo-congrats)        ; extensions can dial 1234
exten => 1234,2,Hangup()
exten => h,1,Hangup()
include => agentlogin
include => conferences
include => calendar-event
include => weather-wakeup
include => timo
include => rsvp

exten => 3789,1,AGI(voicesms.php)

exten => 3552,1,Macro(timo,contentdb)
exten => 3552,n,Hangup()

[agentlogin]
exten => _*8888.,1,Set(AGENTNUMBER=${EXTEN:5})
exten => _*8888.,n,NoOp(AgentNumber is ${AGENTNUMBER})
exten => _*8888.,n,AgentLogin(${AGENTNUMBER})
exten => _*8888.,n,Hangup()

 
[mm-announce]
exten => 9999,1,Set(CALLERID(name)="MMGETOUT")
exten => 9999,n,Answer
exten => 9999,n,Playback(conf-will-end-in)
exten => 9999,n,Playback(digits/5)
exten => 9999,n,Playback(minutes)
exten => 9999,n,Hangup

[conferences]
;Used by cbEnd script to play end of conference warning
exten => 5555,1,Answer
exten => 5555,n,Wait(3)
exten => 5555,n,CBMysql()
exten => 5555,n,Hangup

[calendar-event]
exten => _*7899,1,Answer
exten => _*7899,2,Playback(${FILE_CALL})
exten => _*7899,3,Wait(2)
exten => _*7899,4,Hangup()

[weather-wakeup]
exten => *61,1,Answer
exten => *61,2,AGI(nv-weather.php)
exten => *61,3,Hangup



[rsvp]
exten=> 3589,1,Background(thanks)
exten=> 3589,2,Read(choice,,1)
exten => 3589,3,AGI(rsvp.php|${choice})
exten => i,1,Background(invalidentry)
exten => i,n,Goto(3589,2)
exten => t,1,Playback(thankyoubye)
exten => t,n,Hangup

exten => *62,1,Answer
exten => *62,2,AGI(wakeup.php)
exten => *62,3,Hangup

[macro-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}/${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,Goto(4,1)
exten => 4,AGI($RecordingType}.php)
exten => i,1,Background(invalidentry)
exten => i,n,Goto(s,askuser)
exten => t,1,Playback(thankyoubye)
exten => t,n,Return

----------Below is the full output from my logs when I call 3552---------
-- Executing [3552 at from-internal:1] Macro("SIP/261-0000005c",
"timo,contentdb") in new stack
    -- Executing [s at macro-timo:1] Set("SIP/261-0000005c",
"RecordingType=contentdb") in new stack
    -- Executing [s at macro-timo:2] Set("SIP/261-0000005c",
"TIMEOUT(digit)=2") in new stack
    -- Digit timeout set to 2.000
    -- Executing [s at macro-timo:3] Set("SIP/261-0000005c",
"TIMEOUT(response)=2") in new stack
    -- Response timeout set to 2.000
    -- Executing [s at macro-timo:4] Answer("SIP/261-0000005c", "") in new
stack
    -- Executing [s at macro-timo:5] NoOp("SIP/261-0000005c", "261") in new
stack
    -- Executing [s at macro-timo:6] Set("SIP/261-0000005c", "number=261") in
new stack
    -- Executing [s at macro-timo:7] NoOp("SIP/261-0000005c", "261") in new
stack
    -- Executing [s at macro-timo:8] BackGround("SIP/261-0000005c", "recmsg1")
in new stack
    -- <SIP/261-0000005c> Playing 'recmsg1.gsm' (language 'en')
    -- Executing [s at macro-timo:9] Record("SIP/261-0000005c",
"/var/www/html/timo/crystalrecords/contentdb/261.gsm") in new stack
    -- <SIP/261-0000005c> Playing 'beep.gsm' (language 'en')
    -- Executing [s at macro-timo:10] Playback("SIP/261-0000005c",
"/var/www/html/timo/crystalrecords/contentdb/261") in new stack
    -- <SIP/261-0000005c> Playing
'/var/www/html/timo/crystalrecords/contentdb/261.gsm' (language 'en')
    -- Executing [s at macro-timo:11] BackGround("SIP/261-0000005c", "ackrec")
in new stack
    -- <SIP/261-0000005c> Playing 'ackrec.gsm' (language 'en')
    -- Invalid extension '1' in context 'from-internal' on SIP/261-0000005c
  == CDR updated on SIP/261-0000005c
    -- Executing [i at from-internal:1] BackGround("SIP/261-0000005c",
"invalidentry") in new stack
    -- <SIP/261-0000005c> Playing 'invalidentry.slin' (language 'en')
    -- Executing [i at from-internal:2] Goto("SIP/261-0000005c", "3589,2") in
new stack
    -- Goto (from-internal,3589,2)
    -- Executing [3589 at from-internal:2] Read("SIP/261-0000005c",
"choice,,1") in new stack
    -- Accepting a maximum of 1 digits.
    -- User entered nothing.
    -- Executing [3589 at from-internal:3] AGI("SIP/261-0000005c", "rsvp.php|")
in new stack
    -- Executing [3589 at from-internal:4] Wait("SIP/261-0000005c", "1") in new
stack
    -- Executing [3589 at from-internal:5] Playback("SIP/261-0000005c",
"silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer") in
new stack
    -- <SIP/261-0000005c> Playing 'silence/1.gsm' (language 'en')
    -- <SIP/261-0000005c> Playing 'cannot-complete-as-dialed.gsm' (language
'en')
    -- <SIP/261-0000005c> Playing 'check-number-dial-again.gsm' (language
'en')
    -- Executing [3589 at from-internal:6] Wait("SIP/261-0000005c", "1") in new
stack
    -- Executing [3589 at from-internal:7] Congestion("SIP/261-0000005c", "20")
in new stack
  == Spawn extension (from-internal, 3589, 7) exited non-zero on
'SIP/261-0000005c'
    -- Executing [h at from-internal:1] Macro("SIP/261-0000005c", "hangupcall")
in new stack
    -- Executing [s at macro-hangupcall:1] GotoIf("SIP/261-0000005c",
"1?noautomon") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s at macro-hangupcall:3] NoOp("SIP/261-0000005c",
"TOUCH_MONITOR_OUTPUT=") in new stack
    -- Executing [s at macro-hangupcall:4] GotoIf("SIP/261-0000005c",
"1?noautomon2") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing [s at macro-hangupcall:6] NoOp("SIP/261-0000005c",
"MONITOR_FILENAME=") in new stack
    -- Executing [s at macro-hangupcall:7] GotoIf("SIP/261-0000005c",
"1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,10)
    -- Executing [s at macro-hangupcall:10] GotoIf("SIP/261-0000005c",
"1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,13)
    -- Executing [s at macro-hangupcall:13] GotoIf("SIP/261-0000005c",
"1?theend") in new stack
    -- Goto (macro-hangupcall,s,15)
    -- Executing [s at macro-hangupcall:15] Hangup("SIP/261-0000005c", "") in
new stack
  == Spawn extension (macro-hangupcall, s, 15) exited non-zero on
'SIP/261-0000005c' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on
'SIP/261-0000005c'

-----

Kind Regards 

Billy 


On 4/17/12 1:56 PM, "Dale Noll" <dnoll at wi.rr.com> wrote:

>    On 04/16/2012 04:09 PM, Billy Kaye wrote:
>>  Re: [asterisk-users] Custom Application recording problem Thanks Dale,
>>  
>>  Am not sure why it was working in 1.4 but for some reason it was ( Note : My
>> Asterisk is running bundled with Elastix).
>>  But any your suggestion worked very fine.
>>  
>>  
>  
>  Glad to hear it.
>  
>  
>>  Now am having one problem how can define those extensions only with in
>> different contexts, the problem I see is since am
>>  Building 3 recording applications only one will be able call its AGI file,
>>  
>>  Say if someone calls custom extension 1114
>>  They can record message
>>  -Press 1 to Replay Press 2 to Re-record or Press 3 to Save the file
>>  
>>  Also if someone calls custom extension 1115
>>  -Press 1 to Replay Press 2 to Re-record or Press 3 to Save the file
>>  
>>  Note Each save file selection calls a different AGI file
>>  
>>  E.g
>>  
>>  exten => 1,1,Goto,timo|3552|9
>>  exten => 2,1,Goto(3552,7) ; re-record message
>>  exten => 3,1,Goto(4,1)
>>  exten => 4,AGI(timorec.php)
>>  
>>  
>  
>  There a few ways to do it.  Probably the easiest to maintain in the long run
> would be via the use of a macro.
>  
>  [macro-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(crystalrecords/${RecordingType}/${number}.gsm)
>  exten => s,n(playmsg),Playback(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,AGI($RecordingType}.php)
>  
>  exten => i,1,Background(invalidentry)
>  exten => i,n,Goto(s,askuser)
>  
>  exten => t,1,Playback(thankyoubye)
>  exten => t,n,Return
>  
>  Here I have taken you original dialplan and created a macro out of it.  I
> made a few other changes such as using the 'n' priority and labels to make the
> macro easier to maintain later.
>  This macro takes an argument which would be the recording type.  I do not
> know what the three variations you need are, but that is not really relevant.
> When the macro is called, it will save the argument as a variable
> 'RecordingType' which is used elsewhere.  It saves the recording under a
> subdirectory of 'crystalrecords' that is the same name as the recording type.
> When saving the message, it also calls the AGI as RecordingType.php, so simply
> name the script the same as the recording type.
>  
>  Then, in your dialplan  you simply make calls to your macro with the correct
> argument.
>  
>  [from-internal-custom]
>  
>  exten => 1114,1,Macro(timo,type1)
>  exten => 1114,n,Hangup()
>  
>  exten => 1115,1,Macro(timo,type2)
>  exten => 1115,n,Hangup()
>  
>  exten => 1116,1,Macro(timo,type3)
>  exten => 1116,n,Hangup()
>  
>  
>  
>  Dale
>  
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120417/c9fc8ae1/attachment-0001.htm>


More information about the asterisk-users mailing list