;--------------------------------------------------------------------------
; Macro-stdexten Dial Configuration Info
; Use this info for mapping out macro-stdexten below. this is just some
; basic info to help you
;--------------------------------------------------------------------------
;[macro-dial]
; add some abilities to Dial(Technology/resource[&Technology2/resource2...][|timeout][|options][|URL]):
; ${ARG1} - Technology/resource[&Technology2/resource2...] (like SIP/2201)
; ${ARG2} - timeout in seconds
; ${ARG3} - Dial command options
; ${ARG4} - URL (see Dial command for info)
; ${ARG5} - Group name (used if you want to limit the number of calls in any way)
; ${ARG6} - Max. group number (maximum number of concurrent calls you want to allow for that group)
; ${ARG7} - Caller ID name (typically for outgoing calls only)
; ${ARG8} - Caller ID number (typically for outgoing calls only)
; ${ARG9} - CDR account name (over-rides account group setting in sip.conf or iax.conf)
; ${ARG10} - voicemail to send to if noanswer (typically for incoming calls only)
; Usage instructions:
; for an outgoing call, in extensions.conf you just list multiple lines like:
; exten => s,1,Macro(superdial,IAX2/voipjet/${tfnumber},,,,voip,${MAXVOIPCALLS},yourname,8005551234,voipjet)
; exten => s,2,Macro(superdial,IAX2/alpeh-com/${tfnumber},,,,voip,${MAXVOIPCALLS},yourname,8005551234,aleph)
; and it will take the first one that is available
;
; it also works for incoming like so ..
; exten => s,1,Wait(2)
; exten => s,2,Macro(superdial,${PHONE1},15,Ttm,,pstn,${MAXPSTNCALLS},${CALLERIDNAME},${CALLERIDNUM},pstn,u${GENERALVM})
; exten => s,3,Macro(superdial,${PHONE1},15,Ttm,,pstn,${MAXPSTNCALLS},${CALLERIDNAME},${CALLERIDNUM},pstn,u${GENERALVM})
; exten => s,4,Voicemail(b${GENERALVM})
; and then goes to unavailable voicemail if one times out .. otherwise (eg if busy) it tries the next extension
; if all are busy or unavailable .. it gets to the last priority which is the busy voicemail
;
;exten => s,1,SetGroup(${ARG5})
;exten => s,2,CheckGroup(${ARG6}) ; jump to 103 if count on group ${ARG5} is already at ${ARG6}
;exten => s,3,GotoIf($["${ARG7}" = ""]?macro-superdial,s,5)
;exten => s,4,SetCallerIDName(${ARG7}) ; skip this if ARG7 is empty
;exten => s,5,GotoIf($["${ARG8}" = ""]?macro-superdial,s,7)
;exten => s,6,SetCIDNum(${ARG8}) ; skip this if ARG8 is empty
;exten => s,7,GotoIf($["${ARG9}" = ""]?macro-superdial,s,9)
;exten => s,8,SetAccount(${ARG9}) ; skip this if ARG9 is empty
;exten => s,9,Dial(${ARG1},${ARG2},${ARG3},${ARG4})
;exten => s,10,Goto(s-${DIALSTATUS},1)
;exten => s,103,Goto(s-CHANUNAVAIL,1)
;exten => s-BUSY,1,Noop
;exten => s-NOANSWER,1,GotoIf($["${ARG10}" = ""]?macro-superdial,s-NOANSWER,3)
;exten => s-NOANSWER,2,Voicemail(${ARG10})
;exten => s-NOANSWER,3,Noop
;exten => _s-.,1,Noop
;