Нормализация набираемого номера телефона
Шаблон для исходящих на примере маршрута для провайдера Mango
Отсечение "999"






Last updated
Was this helpful?
Шаблон для исходящих на примере маршрута для провайдера Mango






Last updated
Was this helpful?
Was this helpful?
[all_peers](+)
exten => _999XXXXXXXXXXX,1,Set(OUT_CALL_PREFIX=999)
same => n,Goto(all_peers,${EXTEN:3},1)[outgoing-custom]
exten => _[0-9*#+a-zA-Z]!,1,NoOp()
same => n,ExecIf($["${NEW_DST_EXTEN}x" != "x"]?return)
same => n,Set(NEW_DST_EXTEN=${OUT_CALL_PREFIX}${EXTEN})
same => n,GosubIf($["${OUT_CALL_PREFIX}x" != "x"]?outgoing,${OUT_CALL_PREFIX}${EXTEN},1)
same => n,return
exten => _[hit],1,Hangup()[internal-originate](+)
exten => _XXX!,1,Set(pt1c_cid=${FILTER(\*\#\+1234567890,${pt1c_cid})})
same => n,ExecIf($[ ${LEN(${CALLERID(num)})} == 14 ]?Set(__OUT_CALL_PREFIX=7${pt1c_cid:0:3}))
same => n,ExecIf($[ ${LEN(${CALLERID(num)})} == 14 ]?Set(pt1c_cid=7${pt1c_cid:3}))
same => n,Set(MASTER_CHANNEL(ORIGINATE_DST_EXTEN)=${pt1c_cid})
same => n,Set(number=${FILTER(\*\#\+1234567890,${EXTEN})})
same => n,ExecIf($["${EXTEN}" != "${number}"]?Goto(${CONTEXT},${number},$[${PRIORITY} + 1]))
same => n,Set(__IS_ORGNT=${EMPTY})
same => n,Gosub(interception_start,${EXTEN},1)
same => n,ExecIf($["${pt1c_cid}x" != "x"]?Set(CALLERID(num)=${pt1c_cid}))
same => n,ExecIf($["${origCidName}x" != "x"]?Set(CALLERID(name)=${origCidName}))
same => n,GosubIf($["${DIALPLAN_EXISTS(${CONTEXT}-custom,${EXTEN},1)}" == "1"]?${CONTEXT}-custom,${EXTEN},1)
same => n,ExecIf($["${SRC_QUEUE}x" != "x"]?Goto(internal-originate-queue,${EXTEN},1))
same => n,ExecIf($["${CUT(CHANNEL,\;,2)}" == "2"]?Set(__PT1C_SIP_HEADER=${SIPADDHEADER}))
same => n,ExecIf($["${PJSIP_ENDPOINT(${EXTEN},auth)}x" == "x"]?Goto(internal-num-undefined,${EXTEN},1))
same => n,Gosub(set-dial-contacts,${EXTEN},1)
same => n,ExecIf($["${FIELDQTY(DST_CONTACT,&)}" != "1" && "${ALLOW_MULTY_ANSWER}" != "1"]?Set(__PT1C_SIP_HEADER=${EMPTY_VAR}))
same => n,ExecIf($["${DST_CONTACT}x" != "x"]?Dial(${DST_CONTACT},${ringlength},TtekKHhb(originate-create-channel,${EXTEN},1)U(originate-answer-channel),s,1)))
exten => _[hit],1,Gosub(interception_bridge_result,${EXTEN},1)
same => n,Hangup