Don't forget, patterns (for matching) must begin with an underscore (_)

I find it nicer to just use ${MACRO_EXTEN} rather than declaring $ {ARG1} for the sake of it.

---------
exten => _71XXXX,1,Answer()
exten => _71XXXX,2,Macro(71macro)
exten => _71XXXX,3,Hangup()

[macro-71macro]
exten => s,1,Dial(${MACRO_EXTEN},30,t) ; Ring the interface, 20 seconds maximum exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => s-BUSY,1,Voicemail(bs${MACRO_EXTEN}) ; If busy, send to voicemail w/ busy announce ; you may want to use a variable such as ${MACRO_OFFSET} to exit back to where you called the macro in the dialplan with a Goto(). exten => s-NOANSWER,1,Voicemail(us${MACRO_EXTEN}) ; If unavailable, send to voicemail w/ unavail announce ; you may want to use a variable such as ${MACRO_OFFSET} to exit back to where you called the macro in the dialplan with a Goto(). exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
---------

btw.. its late and I have not double checked it so expect it not to work :)

Regards,

Nathan


exten => 71XXXX,1,Answer()
exten => 71XXXX,2,Macro(71macro,${EXTEN})
exten => 71XXXX,3,Hangup()


[macro-71macro]

exten => s,1,Dial(SIP/${ARG1},30,tr)
exten => s,2,VoiceMail(${ARG1})
exten => s,3,PlayBack(vm-goodbye)






On 06/01/2006, at 6:27 PM, scott wrote:

Hi All

I am trying to simplify a dialplan for a few thousand users.
Would what I have below work?

If someone dials exten 710001 would it go through answer and then to the macro to try dialing the SIP phone thats registered on 710001 and then onto voicemail if no answer or not signed on?


exten => 71XXXX,1,Answer()
exten => 71XXXX,2,Macro(71macro,${EXTEN})
exten => 71XXXX,3,Hangup()


[macro-71macro]

exten => s,1,Dial(SIP/${ARG1},30,tr)
exten => s,2,VoiceMail(${ARG1})
exten => s,3,PlayBack(vm-goodbye)


Many Thanks in Advance
Scott Pinhorne
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to