[general]
static = yes
writeprotect = no
autofallthrough = yes
clearglobalvars = yes
priorityjumping = no
extenpatternmatchnew = no
[globals]
TOUCH_MONITOR_FORMAT = wav_alaw
TOUCH_MIXMONITOR_FORMAT = wav_alaw
DIALOPTIONS = tTkKWwXx
PRESS5TOLEVMSG_ENABLE = 0
ABSOLUTE_TIMEOUT = 10000000
RINGTIME = 60
SunNumDelimiter = # 
ENABLECLIP = 0 
PORTABILYCACHDAY = 136416
trunk-MariaSIM = YSGSM/1
CID_trunk_1 = 
YSGSMCHAN_1=1
trunk-MariaSIM_PORT=1
trunk-MariaSIM_BUNIT=60
trunk-MariaSIM_DISABLE=0
trunk-MariaSIM_OUTSUNUMBER=0
YSGSMPORT_DISABLE_1=0
YSGSMPORT_BUNIT_1=60
trunk-iax-3 = IAX2/3
CID_trunk-iax-3 = 
trunk-iax-2 = IAX2/2
CID_trunk-iax-2 = 


[Local_Default_CallingRules]
include = set-cf-default
include = en-always-cf
include = dis-always-cf
include = en-busy-cf
include = dis-busy-cf
include = en-noanswer-cf
include = dis-noanswer-cf
include = set-cf-number
include = set-cf-vm
include = en-dnd
include = dis-dnd
include = default
[macro-stdexten]
exten = s,1,Set(IsFromOutside=0)
exten = s,2,Gotoif($[${LEN(${FromSystemAlert})}>0]?sys-dial,1)})
#exten = s,3,GotoIf(${DB_EXISTS(oblacklist/${ARG1})}?Blacklist-Handle,s,1)
exten = s,n,Macro(realstexten,${ARG1},${DIALPARAM_OF_EXTEN${ARG1}},${DIALOPTIONS})
[macro-stdexten-fromoutside]
exten = s,1,Set(IsFromOutside=1)
exten = s,2,Macro(realstexten,${ARG1},${ARG2},${DIALOPTIONS})
[macro-realstexten]
exten = s,1,Set(DYNAMIC_FEATURES=twstart)
#exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1)
exten = s,n,Set(TIMEOUT(absolute)=${ABSOLUTE_TIMEOUT})
exten = s,n,Set(CKTSETTRANSFER=0)
exten = s,n,Set(REALARG1=${ARG1})
exten = s,n,Set(RINGTIME=${IF($[${LEN(${RINGTIME_${REALARG1}})} > 0]?${RINGTIME_${REALARG1}}:${RINGTIME})})
exten = s,n,CktStdCall(srtpfor,${ARG2},novalue)
exten = s,n,Set(_SIPSRTP=${SIPPEER(${CKTSTDCALLRESULT},srtpcapable)})
exten = s,n,Dial(${ARG2},${RINGTIME},${ARG3})
exten = s,n,Goto(s-${DIALSTATUS},1)
exten = _s-.,1,Hangup
exten = 1-out,1,Hangup
exten = h,1,GotoIf($[${EXISTS(${CALLBACK_TIMEOUT})}]?2:11)
exten = h,2,GotoIf($[${CUT(CHANNEL,/,1)}=YSGSM]?3:11)
exten = h,3,Set(chancb=${CUT(CHANNEL,/,2)})
exten = h,4,Set(chancb=${YSGSMCHAN_${CUT(chancb,-,1)}})
exten = h,5,GotoIf(${DB_EXISTS(duration/${chancb})}?h,6:h,5)
exten = h,6,Set(DB(duration/${chancb})=0)
exten = h,7,Set(DBILLSEC=${CDR(billsec)})
exten = h,8,Set(BILLING_UNIT=${YSGSMPORT_BUNIT_${chancb}})
exten = h,9,Set(DSECOND=$[${DBILLSEC}+${IF($[$[${DBILLSEC}%${BILLING_UNIT}]=0]?0:$[${BILLING_UNIT}-$[${DBILLSEC}%${BILLING_UNIT}]])}])
exten = h,10,Set(DB(duration/${chancb})=$[${DB(duration/${chancb})}+$[${DSECOND}/${BILLING_UNIT}]])
[default]
exten = h,1,NOOP(no thing to do)
exten = h,2,Hangup()
[Always-Hangup]
exten = s,1,Hangup
[Blacklist-Handle]
exten = s,1,Answer()
exten = s,n,wait(1)
exten = s,n,playback(ss-noservice)
exten = s,n,Hangup()
[macro-trunkdial-failover-0.4]
exten = s,1,NOOP(do call out)
exten = s,2,NOOP(BLACKLIST)
exten = s,3,Gotoif($[${LEN(${ARG$[${ARG1}+4]})}>0]?4:5)
exten = s,4,Authenticate(${ARG$[${ARG1}+4]})
exten = s,5,Set(TCOUNT=4)
exten = s,6,GotoIf($[${LEN(${STRATEGY})}>0]?7:10)
exten = s,7,Set(TCOUNT=${IF($[${LEN(${${TCOUNT_INDEX}})}>0]?${${TCOUNT_INDEX}}:4)})
exten = s,8,Set(TCOUNT=${IF($[$[${TCOUNT}-3]>${ARG1}]?4:${TCOUNT})})
exten = s,9,Set(${TCOUNT_INDEX}=${IF($[$[${TCOUNT}-3]>=${ARG1}]?4:$[${TCOUNT}+1])})
exten = s,10,Set(BEGINCOUNT=${TCOUNT})
;exten = s,11,Set(CDR(userfield)=${IF($[${CDR(userfield)}=CallBack]?CallBack:Outbound)})
exten = s,n,Set(OldCallerID=${CALLERID(num)})
exten = s,n,Set(OldCallerName=${CALLERID(name)})
exten = s,n,Set(TOUCH_MONITOR=${OldCallerID}-${ARG3})
exten = s,n,NOOP(${DOD_${ARG${TCOUNT}}_${OldCallerID}})
exten = s,n,Set(DLSTAT=UNKNOW})
exten = s,n,SetCktCustom(sendrpid,no,no)
exten = s,n,Gotoif(${ARG1}>0?1-dial,3)
exten = 1-dial,1,Set(${TCOUNT_INDEX}=${IF($[$[${TCOUNT}-3]>=${ARG1}]?4:$[${TCOUNT}+1])})
exten = 1-dial,2,GotoIf($[${TCOUNT}=${BEGINCOUNT}]?1-out,1)
exten = 1-dial,3,GotoIf($[${LEN(${STRATEGY})}>0]?4:19)
exten = 1-dial,4,GotoIf($[${STRATEGY}<2]?19)
exten = 1-dial,5,Set(MINTCOUNT=${TCOUNT})
exten = 1-dial,6,Set(MINDURA=${DB(duration/${${ARG${TCOUNT}}_PORT})})
exten = 1-dial,7,Set(TINDEX=${TCOUNT})
exten = 1-dial,8,ChanIsAvail(${${ARG${TINDEX}}})
exten = 1-dial,9,GotoIf($[${ISNULL(${AVAILORIGCHAN})}|$[${${ARG${TINDEX}}_DISABLE}=1]]?16)
exten = 1-dial,10,GotoIf(${DB_EXISTS(maxduration/${${ARG${TINDEX}}_PORT})}?11:13)
exten = 1-dial,11,GotoIf($[${DB(maxduration/${${ARG${TINDEX}}_PORT})}=0]?13)
exten = 1-dial,12,GotoIf($[$[${DB(duration/${${ARG${TINDEX}}_PORT})}*${${ARG${TINDEX}}_BUNIT}]>=${DB(maxduration/${${ARG${TINDEX}}_PORT})}]?16)
exten = 1-dial,13,GotoIf($[${DB(duration/${${ARG${TINDEX}}_PORT})}>${MINDURA}]?16)
exten = 1-dial,14,Set(MINTCOUNT=${TINDEX})
exten = 1-dial,15,Set(MINDURA=${DB(duration/${${ARG${TINDEX}}_PORT})})
exten = 1-dial,16,Set(TINDEX=$[${TINDEX}+1])
exten = 1-dial,17,GotoIf($[$[${TINDEX}-3]<=${ARG1}]?8)
exten = 1-dial,18,Set(TCOUNT=${MINTCOUNT})
exten = 1-dial,19,Set(SINGAL_TIMEOUT=${IF($[${LEN(${SINGAL_DUR_TIMEOUT_GSM${${ARG${TCOUNT}}_PORT}})}>0]?${SINGAL_DUR_TIMEOUT_GSM${${ARG${TCOUNT}}_PORT}}:${ABSOLUTE_TIMEOUT})})
exten = 1-dial,20,Set(SINGAL_TIMEOUT=${IF($[${SINGAL_TIMEOUT}>${ABSOLUTE_TIMEOUT}]?${ABSOLUTE_TIMEOUT}:${SINGAL_TIMEOUT})})
exten = 1-dial,21,Set(SINGAL_TIMEOUT=${IF($[${LEN(${CALLBACK_TIMEOUT})}>0]?${CALLBACK_TIMEOUT}:${SINGAL_TIMEOUT})})
exten = 1-dial,22,Set(TIMEOUT(absolute)=${SINGAL_TIMEOUT})
exten = 1-dial,23,GotoIf(${DB_EXISTS(maxduration/${${ARG${TCOUNT}}_PORT})}?24:29)
exten = 1-dial,24,GotoIf($[${DB(maxduration/${${ARG${TCOUNT}}_PORT})}=0]?29)
exten = 1-dial,25,Set(DBALANCE=$[${DB(maxduration/${${ARG${TCOUNT}}_PORT})}-$[${DB(duration/${${ARG${TCOUNT}}_PORT})}*${${ARG${TCOUNT}}_BUNIT}]])
exten = 1-dial,26,GotoIf($[${DBALANCE}<=0]?2-dial,1)
exten = 1-dial,27,Set(DBALANCE=${IF($[${DBALANCE}>${${ARG${TCOUNT}}_BUNIT}]?${DBALANCE}:${${ARG${TCOUNT}}_BUNIT})})
exten = 1-dial,28,Set(TIMEOUT(absolute)=${IF($[${DBALANCE}>${SINGAL_TIMEOUT}]?${SINGAL_TIMEOUT}:${DBALANCE})})
exten = 1-dial,29,GotoIf($[$[${TCOUNT}-3]>${ARG1}]?1-out,1)
exten = 1-dial,30,Gotoif($[${LEN(${DOD_${ARG${TCOUNT}}_${OldCallerID}})} > 2]?setdod,1:1-dial,31)
exten = 1-dial,31,Set(CALLERID(name)=${IF($[${LEN(${CID_${ARG${TCOUNT}}})} > 2]?${CID_${ARG${TCOUNT}}}:${CALLERID(name)})})
exten = 1-dial,32,Set(CALLERID(num)=${IF($[${LEN(${CID_${ARG${TCOUNT}}})} > 2]?${CID_${ARG${TCOUNT}}}:${CALLERID(num)})})
exten = 1-dial,33,GotoIf($[${CUT(CHANNEL,/,1)}=YSGSM]?1-dial,36)
exten = 1-dial,34,GotoIf($[${${ARG${TCOUNT}}_DISABLE}=1]?2-dial,1)
exten = 1-dial,35,Set(SUBNUMBERFORMAT=${IF($[${${ARG${TCOUNT}}_OUTSUNUMBER} = 1]?${CALLERID(name)}:"")})
exten = 1-dial,36,Set(_SIPSRTP=${SIPPEER(${ARG${TCOUNT}},srtpcapable)})
exten = 1-dial,37,Set(OUTDIALOPT=${IF($[${LEN(${RINGTONE-${ARG${TCOUNT}}})} > 0]?tTkKWwXxr:${DIALOPTIONS})})
exten = 1-dial,38,Set(DIALNUMBER=${IF($[${LEN(${${ARG${TCOUNT}}_HIDENUM})}>0]?/#31#${ARG2}${PREFIX_${ARG${TCOUNT}}}${ARG3}:/${ARG2}${PREFIX_${ARG${TCOUNT}}}${ARG3})})
exten = 1-dial,39,GotoIf(${DB_EXISTS(oblacklist/${DIALNUMBER:1})}?Blacklist-Handle,s,1)
exten = 1-dial,40,GotoIf($[${LEN(${ROUTER_OUT_ACCOUNT_FMT})}>0]?41:42)
exten = 1-dial,41,Set(DIALNUMBER=${IF($[${DIALNUMBER:1}=s]?"":${DIALNUMBER})})
exten = 1-dial,42,GotoIf($[${LEN(${ACCOUNT_IN_TRUNKGROUP})}>0]?43:45)
exten = 1-dial,43,Set(TMPTRUNK=${CUT(${ARG${TCOUNT}},/,2)})
exten = 1-dial,44,Set(DIALNUMBER=${IF($[${TMPTRUNK:0:5}!=trunk]?"":${DIALNUMBER})})
exten = 1-dial,45,Set(DIALNUMBER=${IF($[${LEN(${SUBNUMBERFORMAT})}>0]?${DIALNUMBER}${SunNumDelimiter}${CALLERID(name)}:${DIALNUMBER})})
exten = 1-dial,46,Set(ACCOUNT_RINGTIME=${IF($[${LEN(${DIALNUMBER})}>0]?"":${RINGTIME})})
exten = 1-dial,47,GotoIf($[$[${CUT(CHANNEL,/,1)}!=YSGSM] & $[${ENABLECLIP}=1]]?48:53)
exten = 1-dial,48,AGI(/bin/autoclip,add,${REALSRCTRUNK},${OldCallerID},${ARG${TCOUNT}},${ARG3})
exten = 1-dial,49,Set(INNUMBER=${OldCallerID})
exten = 1-dial,50,Set(SRCTRUNK=${REALSRCTRUNK})
exten = 1-dial,51,Set(DSTTRUNK=${ARG${TCOUNT}})
exten = 1-dial,52,Set(OUTNUMBER=${ARG3})
exten = 1-dial,53,Dial(${${ARG${TCOUNT}}}${DIALNUMBER},${ACCOUNT_RINGTIME},${OUTDIALOPT})
exten = 1-dial,n,Goto(1-${DIALSTATUS},1)
exten = setdod,1,Set(CALLERID(name)=${DOD_${ARG${TCOUNT}}_${OldCallerID}})
exten = setdod,2,Set(CALLERID(num)=${DOD_${ARG${TCOUNT}}_${OldCallerID}})
exten = setdod,3,Goto(1-dial,33)
exten = 1-BUSY,1,Set(DLSTAT=9-${DIALSTATUS})
exten = 1-BUSY,2,hangup()
exten = 1-CHANUNAVAIL,1,Set(DLSTAT=9-${DIALSTATUS})
exten = 1-CHANUNAVAIL,2,GotoIf($[$[${CUT(CHANNEL,/,1)}!=YSGSM] & $[${ENABLECLIP}=1]]?3:4)
exten = 1-CHANUNAVAIL,3,AGI(/bin/autoclip,del,${INNUMBER},${SRCTRUNK},${OUTNUMBER},${DSTTRUNK})
exten = 1-CHANUNAVAIL,4,Goto(2-dial,1))
exten = 1-CONGESTION,1,Set(DLSTAT=9-${DIALSTATUS})
exten = 1-CONGESTION,2,GotoIf($[$[${CUT(CHANNEL,/,1)}!=YSGSM] & $[${ENABLECLIP}=1]]?3:4)
exten = 1-CONGESTION,3,AGI(/bin/autoclip,del,${INNUMBER},${SRCTRUNK},${OUTNUMBER},${DSTTRUNK})
exten = 1-CONGESTION,4,Goto(2-dial,1)
exten = 1-EMPTYNUMBER,1,GotoIf($[${CUT(CHANNEL,/,1)}=YSGSM]?4:2)
exten = 1-EMPTYNUMBER,2,Gotoif($[${ENABLECLIP}=1]?3:4)
exten = 1-EMPTYNUMBER,3,AGI(/bin/autoclip,del,${INNUMBER},${SRCTRUNK},${OUTNUMBER},${DSTTRUNK})
exten = 1-EMPTYNUMBER,4,hangup()
exten = 2-dial,1,Set(TCOUNT=$[${TCOUNT}+1])
exten = 2-dial,2,Set(TCOUNT=${IF($[$[${TCOUNT}-3]>${ARG1}]?4:${TCOUNT})})
exten = 2-dial,3,Set(CALLERID(num)=${OldCallerID})
exten = 2-dial,4,Set(CALLERID(name)=${OldCallerName})
exten = 2-dial,5,Goto(1-dial,1)
exten = 1-out,1,Noop(all-busy-now-try-call-later)
exten = 1-out,2,Hangup()
exten = 9-BUSY,1,Noop(all-busy-now-try-call-later)
exten = 9-BUSY,2,Hangup()
exten = 9-CHANUNAVAIL,1,Noop(all-busy-now-try-call-later)
exten = 9-CHANUNAVAIL,2,Hangup()
exten = 9-CONGESTION,1,Noop(all-busy-now-try-call-later)
exten = 9-CONGESTION,2,Hangup()
exten = h,1,Gotoif($[${ENABLECLIP}=1]?2:4)
exten = h,2,Set(DELALL=${IF($[${CUT(CHANNEL,/,1)}=YSGSM]?1:0)})
exten = h,3,AGI(/bin/autoclip,del,${INNUMBER},${SRCTRUNK},${OUTNUMBER},${DSTTRUNK},${DELALL})
exten = h,4,GotoIf($[${CUT(${ARG${TCOUNT}},/,1)}=YSGSM]?5:12)
exten = h,5,Set(GSMPORT=${${ARG${TCOUNT}}_PORT})
exten = h,6,GotoIf(${DB_EXISTS(duration/${GSMPORT})}?h,8:h,7)
exten = h,7,Set(DB(duration/${GSMPORT})=0)
exten = h,8,Set(DBILLSEC=${CDR(billsec)})
exten = h,9,Set(BILLING_UNIT=${${ARG${TCOUNT}}_BUNIT})
exten = h,10,Set(DSECOND=$[${DBILLSEC}+${IF($[$[${DBILLSEC}%${BILLING_UNIT}]=0]?0:$[${BILLING_UNIT}-$[${DBILLSEC}%${BILLING_UNIT}]])}])
exten = h,11,Set(DB(duration/${GSMPORT})=$[${DB(duration/${GSMPORT})}+$[${DSECOND}/${BILLING_UNIT}]])
exten = h,12,GotoIf($[${EXISTS(${CALLBACK_TIMEOUT})}]?13:22)
exten = h,13,GotoIf($[${CUT(CHANNEL,/,1)}=YSGSM]?14:22)
exten = h,14,Set(chancb=${CUT(CHANNEL,/,2)})
exten = h,15,Set(chancb=${YSGSMCHAN_${CUT(chancb,-,1)}})
exten = h,16,GotoIf(${DB_EXISTS(duration/${chancb})}?h,18:h,17)
exten = h,17,Set(DB(duration/${chancb})=0)
exten = h,18,Set(DBILLSEC=${CDR(billsec)})
exten = h,19,Set(BILLING_UNIT=${YSGSMPORT_BUNIT_${chancb}})
exten = h,20,Set(DSECOND=$[${DBILLSEC}+${IF($[$[${DBILLSEC}%${BILLING_UNIT}]=0]?0:$[${BILLING_UNIT}-$[${DBILLSEC}%${BILLING_UNIT}]])}])
exten = h,21,Set(DB(duration/${chancb})=$[${DB(duration/${chancb})}+$[${DSECOND}/${BILLING_UNIT}]])

[asterisk_guitools]
exten = play_file,1,Answer
exten = play_file,n,Playback(${var1})
exten = play_file,n,Hangup

[DLPN_BalanceAlert]
exten = _X.,1,Answer
exten = _X.,n,Set(CALLERID(num)=BalanceAlarm${BGSMPORT})
exten = _X.,n,Set(CALLERID(name)=BalanceAlarm${BGSMPORT})
exten = _X.,n,Set(CDR(userfield)=Alarm)
exten = _X.,n,Playback(${BALERTPROMPT})
exten = _X.,n,Hangup
exten = h,1,GotoIf($[${CUT(CHANNEL,/,1)}=YSGSM]?2:10)
exten = h,2,Set(chancb=${CUT(CHANNEL,/,2)})
exten = h,3,Set(tmpport=${YSGSMCHAN_${CUT(chancb,-,1)}})
exten = h,4,GotoIf(${DB_EXISTS(duration/${tmpport})}?h,6:h,5)
exten = h,5,Set(DB(duration/${tmpport})=0)
exten = h,6,Set(DBILLSEC=${CDR(billsec)})
exten = h,7,Set(BILLING_UNIT=${YSGSMPORT_BUNIT_${tmpport}})
exten = h,8,Set(DSECOND=$[${DBILLSEC}+${IF($[$[${DBILLSEC}%${BILLING_UNIT}]=0]?0:$[${BILLING_UNIT}-$[${DBILLSEC}%${BILLING_UNIT}]])}])
exten = h,9,Set(DB(duration/${tmpport})=$[${DB(duration/${tmpport})}+$[${DSECOND}/${BILLING_UNIT}]])

[DLPN_SystemAlert]
exten = _X.,1,Answer
exten = _X.,n,Set(CALLERID(num)=ALARM)
exten = _X.,n,Set(CALLERID(name)=ALARM)
exten = _X.,n,Set(CDR(userfield)=Alarm)
exten = _X.,n,Playback(${SYSALERTPROMPT})
exten = _X.,n,Hangup
exten = h,1,GotoIf($[${CUT(CHANNEL,/,1)}=YSGSM]?2:10)
exten = h,2,Set(chancb=${CUT(CHANNEL,/,2)})
exten = h,3,Set(tmpport=${YSGSMCHAN_${CUT(chancb,-,1)}})
exten = h,4,GotoIf(${DB_EXISTS(duration/${tmpport})}?h,6:h,5)
exten = h,5,Set(DB(duration/${tmpport})=0)
exten = h,6,Set(DBILLSEC=${CDR(billsec)})
exten = h,7,Set(BILLING_UNIT=${YSGSMPORT_BUNIT_${tmpport}})
exten = h,8,Set(DSECOND=$[${DBILLSEC}+${IF($[$[${DBILLSEC}%${BILLING_UNIT}]=0]?0:$[${BILLING_UNIT}-$[${DBILLSEC}%${BILLING_UNIT}]])}])
exten = h,9,Set(DB(duration/${tmpport})=$[${DB(duration/${tmpport})}+$[${DSECOND}/${BILLING_UNIT}]])

[Voip-Account-3]
exten = s/_.,1,Set(REALSRCTRUNK=trunk-3)
exten = s/_.,2,Macro(Routein_IP_GSM_1,0,${EXTEN})
exten = _./_.,1,Set(REALSRCTRUNK=trunk-3)
exten = _./_.,2,Macro(Routein_IP_GSM_1,0,${EXTEN})
[Voip-Account-2]

[from-trunk]
[from-gsm1]
exten = h,1,Hangup()
exten = s,1,Set(REALSRCTRUNK=)
exten = s,2,Macro(Routein_GSM_IP_default,0,${EXTEN})
exten = _.,1,Set(REALSRCTRUNK=)
exten = _.,2,Macro(Routein_GSM_IP_default,0,${EXTEN})

[macro-Routein_GSM_IP_default]
exten = s,1,Set(CDR(userfield)=MOBILE->IP)
exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1)
exten = s,n,Set(ROUTER_OUT_ACCOUNT_FMT=1)
exten = s,n,Macro(trunkdial-failover-0.4,1,,${ARG2},trunk-iax-3,)
exten = s,102,Goto(Blacklist-Handle,s,1)

[macro-Routein_IP_GSM_1]
exten = s,1,Set(CDR(userfield)=IP->MOBILE)
exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1)
exten = s,n,Goto(Routeout_IP_GSM_1,${ARG2},1)
exten = s,102,Goto(Blacklist-Handle,s,1)

[Routeout_GSM_IP_default]
exten = h,1,Hangup()
exten = _.,1,Set(ORGINEXTEN=${EXTEN})
exten = _.,n,Set(ORGINCONTEXT=${IF($[${LEN(${ORGINCONTEXT})} > 0]?${ORGINCONTEXT}: ${CONTEXT})})
exten = _.,n,Noop(It is not module or trunk group)
exten = _.,n,Macro(trunkdial-failover-0.4,1,,${EXTEN:0},trunk-iax-3,)
exten = _.,100,Hangup()
exten = T,1,Goto(${ORGINEXTEN},100)
exten = e,1,Goto(${ORGINEXTEN},100)

[Routeout_IP_GSM_1]
exten = h,1,Hangup()
exten = _.,1,Set(ORGINEXTEN=${EXTEN})
exten = _.,n,Set(ORGINCONTEXT=${IF($[${LEN(${ORGINCONTEXT})} > 0]?${ORGINCONTEXT}: ${CONTEXT})})
exten = _.,n,Noop(It is not module or trunk group)
exten = _.,n,Macro(trunkdial-failover-0.4,1,,${EXTEN:0},trunk-MariaSIM,)
exten = _.,100,Hangup()
exten = T,1,Goto(${ORGINEXTEN},100)
exten = e,1,Goto(${ORGINEXTEN},100)


