Re: Синхронизация по PRI
Добавлено: 09 дек 2022, 15:45
Еще небльшое дополнение по текущему диалплану. По факту я использую дефолтный диалплан сгенерированный FreePBX в который я лишь добавил исходящие маршруты через веб-морду и поправил руками функцию CALLERPRES заменив на CALLERID, согласно рекомендациям.
Код: Выделить всё
dialplan show macro-outbound-callerid
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:
Код: Выделить всё
[ Context 'macro-outbound-callerid' created by 'pbx_config' ]
's' => 1. Noop(${REALCALLERIDNUM}) [pbx_config]
2. Noop(${KEEPCID}) [pbx_config]
3. Noop(${OUTKEEPCID_${ARG1}}) [pbx_config]
4. ExecIf($["${CALLINGNAMEPRES_SV}" != ""]?Set(CALLERID(name-pres)=${CALLINGNAMEPRES_SV})) [pbx_config]
5. ExecIf($["${CALLINGNUMPRES_SV}" != ""]?Set(CALLERID(num-pres)=${CALLINGNUMPRES_SV})) [pbx_config]
6. Set(HOTDESCKCHAN=${CUT(CHANNEL,/,2)}) [pbx_config]
7. Set(HOTDESKEXTEN=${CUT(HOTDESCKCHAN,-,1)}) [pbx_config]
8. Set(HOTDESKCALL=0) [pbx_config]
9. ExecIf($["${DB(EDEVICE/${HOTDESKEXTEN}/user)}"="DummyUser"]?Set(HOTDESKCALL=1)) [pbx_config]
10. ExecIf($[${HOTDESKCALL}=1]?Set(CALLERID(name)=${DB(EDEVICE/${HOTDESKEXTEN}/location)})) [pbx_config]
11. Set(ALLOWTHISROUTE=NO) [pbx_config]
12. ExecIf($["${EMERGENCYROUTE}" = "YES"]?Set(ALLOWTHISROUTE=YES)) [pbx_config]
13. ExecIf($[${HOTDESKCALL}= 1 & ${ALLOWTHISROUTE} = NO ]?Hangup()) [pbx_config]
14. ExecIf($["${REALCALLERIDNUM:1:2}" = ""]?Set(REALCALLERIDNUM=${CALLERID(number)})) [pbx_config]
15. ExecIf($[$["${CIDMASQUERADING}" = "TRUE"] & $[$["${AMPUSER}" = ""] | $["${AMPUSER}" = "${DB(AMPUSER/${FROMEXTEN}/cidnum)}"]]]?Set(AMPUSER=${FROMEXTEN})) [pbx_config]
[start] 16. GotoIf($[ $[${LEN(${REALCALLERIDNUM})} = 0] | $["${KEEPCID}" != "TRUE"] | $["${OUTKEEPCID_${ARG1}}" = "on"] ]?normcid) [pbx_config]
17. Set(USEROUTCID=${CALLERID(name)} <${REALCALLERIDNUM}>) [pbx_config]
18. GotoIf($["${CIDMASQUERADING}" = "TRUE"]?normcid) [pbx_config]
19. GotoIf($["${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "" & "${DB(DEVICE/${REALCALLERIDNUM}/user)}" = ""]?bypass) [pbx_config]
[normcid] 20. Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)}) [pbx_config]
[bypass] 21. Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)}) [pbx_config]
22. ExecIf($[${HOTDESKCALL}= 1]?Set(EMERGENCYCID=${DB(EDEVICE/${HOTDESKEXTEN}/emergency_cid)})) [pbx_config]
23. Set(TRUNKOUTCID=${OUTCID_${ARG1}}) [pbx_config]
24. GotoIf($["${EMERGENCYROUTE:1:2}" = "" | "${EMERGENCYCID:1:2}" = ""]?trunkcid) [pbx_config]
25. Set(CALLERID(all)=${EMERGENCYCID}) [pbx_config]
26. GotoIf($["${CALLERID(name)}" = ""]?cnum) [pbx_config]
27. Set(CDR(outbound_cnam)=${CALLERID(name)}) [pbx_config]
[cnum] 28. Set(CDR(outbound_cnum)=${CALLERID(num)}) [pbx_config]
[exit] 29. MacroExit() [pbx_config]
[trunkcid] 30. ExecIf($[${LEN(${TRUNKOUTCID})} != 0]?Set(CALLERID(all)=${TRUNKOUTCID})) [pbx_config]
[usercid] 31. ExecIf($[${LEN(${USEROUTCID})} != 0]?Set(CALLERID(all)=${USEROUTCID})) [pbx_config]
32. ExecIf($[${LEN(${TRUNKCIDOVERRIDE})} != 0 | ${LEN(${FORCEDOUTCID_${ARG1}})} != 0]?Set(CALLERID(all)=${IF($[${LEN(${FORCEDOUTCID_${ARG1}})}=0]?${TRUNKCIDOVERRIDE}:${FORCEDOUTCID_${ARG1}})})) [pbx_config]
33. ExecIf($["${QCALLBACK}" = "1" & ${LEN(${FORCEDOUTCID_${ARG1}})} = 0]?Set(CALLERID(all)=${REALCALLERIDNUM})) [pbx_config]
34. ExecIf($[${LEN(${AMPUSER})} = 0 & ${LEN(${USEROUTCID})} = 0 & "${OUTKEEPCID_${ARG1}}" ="off" & ${LEN(${REALCALLERIDNUM})} != 0 ]?Set(CALLERID(all)=${REALCALLERIDNUM})) [pbx_config]
35. Set(TIOHIDE=no) [pbx_config]
36. Set(CDR(outbound_cnum)=${CALLERID(num)}) [pbx_config]
37. Set(CDR(outbound_cnam)=${CALLERID(name)}) [pbx_config]
Include => 'macro-outbound-callerid-custom' [pbx_config]
-= 1 extension (37 priorities) in 1 context. =-