[Asterisk-Users] Need help with two-stage ringing macro

Daryl Jones daryl at tcomeng.com
Tue Jun 6 23:24:04 MST 2006


I've been using the following macro to ring SIP and IAX devices for a 
few seconds, and then add on a cell phone if there is no answer on the 
SIP or IAX device.  Periodic problems began a few versions ago and now 
the problem happens every time with 1.2.9 and 1.2.9.1. 

The problem is that when a call from the PRI falls through to voicemail, 
the call is dropped before the voicemail greeting is heard.  Debug shows 
that voicemail is starting and that Asterisk is dropping the call on the 
PRI.   Calls made from SIP or IAX devices work fine.


[macro-followme]
;
; "modified standard extension" macro for two-stage ringing.
;
;  It will call the destinations in ${ARG4} for ${ARG2} seconds, and
;  if that fails, the destinations in ${ARG5} for ${ARG3} seconds.  If
;  that also fails, it will send the call to voice mail for extension
;  ${ARG1}.
;
;  Note:  if you want it to ring phone1 first, then phone1 AND phone2
;  next, you have to list phone1 in both lists.  Otherwise it will
;  stop ringing on phone1.
;
;   ${ARG1} - voice mail context
;   ${ARG2} - Extension
;   ${ARG3} - Time to ring stage 1
;   ${ARG4} - Time to ring state 1 + 2
;   ${ARG5} - Device(s) to ring stage 1
;   ${ARG6} - Device(s) to ring stage 2
;
exten => s,1,SetCallerID(${CALLERIDNUM:-10:10}) ; Send only the last 10 
digits
exten => s,2,NoOp(CallerID After:${CALLERIDNUM})
exten => s,3,SetAccount(${ARG2})
exten => s,4,Dial(${ARG5},${ARG3},rt)           ; Ring the primary group
exten => s,5,Dial(${ARG5}&${ARG6},${ARG4},rt)  ; Add in the secondary group
exten => s,6,Voicemail(su${ARG2}@${ARG1})     ; send to vm as unavail
exten => s,7,Hangup
exten => s,106,Voicemail(sb${ARG2}@${ARG1})     ; send to vm w/ busy 
announce
exten => s,107,Hangup




More information about the asterisk-users mailing list