[asterisk-users] Continuing after a TIMEOUT(absolute)

Brendan Sterne brendan at callvine.com
Thu Apr 29 22:55:49 CDT 2010


Greetings,

I'm trying to continue to do some processing after a TIMEOUT 
(absolute).  In my dialplan below, when a call comes in to [default],  
I call macro-phonenum and pass it a timeout of 20 seconds.  macro- 
phonenum sets TIMEOUT(absolute), then loops saying the phone number  
that was called (in MACRO_EXTEN).  When the timeout expires I want to  
call my macro-hangup (so it can say "goodbye" or whatever).  But the  
system is just hanging up.  The dialplan and log output is below.  Any  
info is appreciated.  This is on version 1.6.0.5.



[macro-answer-and-join]
exten => s,1,NoOp()
exten => s,n,Answer()
exten => s,n,Wait(4)
exten => s,n,SendDTMF(1)
exten => s,n,Wait(1)
exten => s,n,SendDTMF(1)
exten => s,n,MacroExit

[macro-hangup]
exten => s,1,NoOp()
exten => s,n,Playback(goodbye)
exten => s,n,Hangup()
;
exten => T,1,NoOp()
exten => T,n,Playback(goodbye)
exten => T,n,Hangup()

[macro-phonenum]
exten => s,1,NoOp()
exten => s,n,Macro(answer-and-join)
exten => s,n,Set(TIMEOUT(absolute)=${ARG1})
exten => s,n,Set(i=1000)
exten => s,n,While($[${i} >= 1])
exten =>  s,n,SayDigits(${MACRO_EXTEN})
exten =>  s,n,Wait(5)
exten =>  s,n,Set(i=$[${i} - 1])
exten => s,n,EndWhile()
exten => s,n,MacroExit
;
exten => T,1,NoOp()
exten => T,n,Macro(hangup)
exten => T,n,MacroExit


[default]
exten => _X.,1,NoOp()
exten => _X.,n,Macro(phonenum,20)
exten => _X.,n,Macro(hangup)
;
exten => T,1,NoOp()
exten => T,n,Macro(hangup)



The log when the timeout occurs:

<snip> (I'm in macro-phonenum)
    -- <SIP/70.124.61.17-082a69a8> Playing 'digits/5.ulaw' (language  
'en')
     -- <SIP/70.124.61.17-082a69a8> Playing 'digits/1.ulaw' (language  
'en')
     -- <SIP/70.124.61.17-082a69a8> Playing 'digits/2.ulaw' (language  
'en')
     -- <SIP/70.124.61.17-082a69a8> Playing 'digits/1.ulaw' (language  
'en')
     -- <SIP/70.124.61.17-082a69a8> Playing 'digits/2.ulaw' (language  
'en')
     -- Executing [s at macro-phonenum:7] Wait("SIP/ 
70.124.61.17-082a69a8", "5") in new stack
   == Spawn extension (macro-phonenum, s, 7) exited non-zero on 'SIP/ 
70.124.61.17-082a69a8' in macro 'phonenum'
   == Spawn extension (macro-phonenum, s, 7) exited non-zero on 'SIP/ 
70.124.61.17-082a69a8'
Scheduling destruction of SIP dialog 'D8FE9724-1DD1-11B2-9F1A- 
A4EF9DB84584 at 192.168.1.98' in 32000 ms (Method: ACK)
set_destination: Parsing <sip:70.124.61.17:5060> for address/port to  
send to
set_destination: set destination to 70.124.61.17, port 5060
Reliably Transmitting (NAT) to 70.124.61.17:5060:
BYE sip:70.124.61.17:5060 SIP/2.0
<snip>



Cheers,
- Brendan

Brendan Sterne
QA Lead, Callvine






More information about the asterisk-users mailing list