Откуда: Москва
Сообщений: 44
|
Проблема при установке переадресации.
Добрый день! Прошу помощи в решении следующего вопроса. Возникла необходимость установки переадресаций на абонентах.
Схема следующая: абонент получает номер телефона в коде 84991234567. Этот номер приходит на EWSD, а далее по PRI пробрасывается на asterisk.
На asterisk'е он попадает в контекст incoming_pri, в котором проверяется, есть ли у абонента переадресация или нет. Если есть,то переадресация выполняется, если нет, то номер по SIP пробрасывается на SoftSwitch и уходит на абонента.
Проблема собственно в следующем: когда выполняется переадресация должно приходить 3 поля (номер с которого звонили, номер с которого произошла переадресация и номер куда произошла переадресация)
В итоге вызов проходит, но на EWSD не видно номера КУДА ПРОИЗОШЛА ПЕРЕАДРЕСАЦИЯ.
В ответ приходит:
< Cause (len= 6) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Public network serving the local user (2)
< Ext: 1 Cause: Info. element nonexist or not implemented (99), class = Protocol Error (e.g. unknown message) (6) ]
< Cause data 1: 98 (152, Non-Locking Shift To Codeset 0 IE)
< Cause data 2: 74 (116, Redirecting Number IE)
Как я понимаю, это говорит о том, что сообщение не поддерживается EWSD. Может быть, кто-нибудь сталкивался с данной проблемой.
Дебаг PRI:
Входящий по PRI:
< Protocol Discriminator: Q.931 (8) len=48
< TEI=0 Call Ref: len= 2 (reference 150/0x96) (Sent from originator)
< Message Type: SETUP (5)
< [04 03 80 90 a3]
< Bearer Capability (len= 5) [ Ext: 1 Q.931 Std: 0 Info transfer capability: Speech (0)
< Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
< User information layer 1: A-Law (35)
< [18 03 a9 83 83]
< Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
< ChanSel: As indicated in following octets
< Ext: 1 Coding: 0 Number Specified Channel Type: 3
< Ext: 1 Channel: 3 Type: CPE]
< [6c 0d 00 81 38 34 39 39 34 31 38 30 30 32 31]
< Calling Number (len=15) [ Ext: 0 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0)
< Presentation: Presentation permitted, user number passed network screening (1) '84991234567' ]
< [70 0c 81 38 34 39 39 34 31 38 30 32 30 32]
< Called Number (len=14) [ Ext: 1 TON: Unknown Number Type (0) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) '84990000000' ]
< [7d 02 91 81]
< IE: High-layer Compatibility (len = 4)
-- Making new call for cref 150
Received message for call 0x92f9c90 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
-- Processing Q.931 Call Setup
-- Processing IE 4 (cs0, Bearer Capability)
-- Processing IE 24 (cs0, Channel Identification)
-- Processing IE 108 (cs0, Calling Party Number)
-- Processing IE 112 (cs0, Called Party Number)
-- Processing IE 125 (cs0, High-layer Compatibility)
q931.c:6871 post_handle_q931_message: Call 150 enters state 6 (Call Present). Hold state: Unknown
q931.c:4524 q931_call_proceeding: Call 150 enters state 9 (Incoming Call Proceeding). Hold state: Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=10
> TEI=0 Call Ref: len= 2 (reference 150/0x96) (Sent to originator)
> Message Type: CALL PROCEEDING (2)
TEI=0 Transmitting N(S)=44, window is open V(A)=44 K=7
> Protocol Discriminator: Q.931 (8) len=10
> TEI=0 Call Ref: len= 2 (reference 150/0x96) (Sent to originator)
> Message Type: CALL PROCEEDING (2)
> [18 03 a9 83 83]
> Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
> ChanSel: As indicated in following octets
> Ext: 1 Coding: 0 Number Specified Channel Type: 3
> Ext: 1 Channel: 3 Type: CPE]
-- Accepting call from '84991234567' to '84990000000' on channel 0/3, span 1
Звонок ложится на dialplan:
-- Executing [84990000000@incoming_pri:1] NoOp("DAHDI/1-1", """ <84991234567>") in new stack
-- Executing [84990000000@incoming_pri:2] Set("DAHDI/1-1", "diviact_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:3] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:4] GotoIf("DAHDI/1-1", "1?:okdiviact") in new stack
-- Executing [84990000000@incoming_pri:5] Set("DAHDI/1-1", "diviparact0_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:6] Set("DAHDI/1-1", "diviparact1_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:7] Set("DAHDI/1-1", "diviparact2_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:8] Set("DAHDI/1-1", "diviparact3_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:9] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:10] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:11] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:12] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:13] GotoIf("DAHDI/1-1", "1?:okdiviparact0") in new stack
-- Executing [84990000000@incoming_pri:14] Set("DAHDI/1-1", "diviciclact0_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:15] Set("DAHDI/1-1", "diviciclact1_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:16] Set("DAHDI/1-1", "diviciclact2_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:17] Set("DAHDI/1-1", "diviciclact3_84990000000=") in new stack
-- Executing [84990000000@incoming_pri:18] GotoIf("DAHDI/1-1", "1?:okdiviciclact0") in new stack
-- Executing [84990000000@incoming_pri:19] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:20] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:21] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:22] NoOp("DAHDI/1-1", "") in new stack
-- Executing [84990000000@incoming_pri:23] Gosub("DAHDI/1-1", "divipriext|84990000000|1") in new stack
-- Executing [84990000000@divipriext:1] Set("DAHDI/1-1", "CALLERID(num)=4991234567") in new stack
-- Executing [84990000000@divipriext:2] SetCallerPres("DAHDI/1-1", "allowed_not_screened") in new stack
-- Executing [84990000000@divipriext:3] Set("DAHDI/1-1", "CALLERID(RDNIS)=84990000000") in new stack
-- Executing [84990000000@divipriext:4] Dial("DAHDI/1-1", "DAHDI/g1/84991111111") in new stack
-- Making new call for cref 32805
-- Requested transfer capability: 0x00 - SPEECH
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=60
> TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent from originator)
> Message Type: SETUP (5)
TEI=0 Transmitting N(S)=37, window is open V(A)=36 K=7
> Protocol Discriminator: Q.931 (8) len=60
> TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent from originator)
> Message Type: SETUP (5)
> [04 03 80 90 a3]
> Bearer Capability (len= 5) [ Ext: 1 Q.931 Std: 0 Info transfer capability: Speech (0)
> Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
> User information layer 1: A-Law (35)
> [18 03 a1 83 83]
> Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Preferred Dchan: 0
> ChanSel: As indicated in following octets
> Ext: 1 Coding: 0 Number Specified Channel Type: 3
> Ext: 1 Channel: 3 Type: CPE]
> [6c 0c 21 81 34 39 39 34 31 38 30 30 32 31]
> Calling Number (len=14) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
> Presentation: Presentation permitted, user number passed network screening (1) '4991234567' ]
> [70 0c 80 38 39 31 36 36 36 36 33 38 39 38]
> Called Number (len=14) [ Ext: 1 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0) '84991111111' ]
> [74 0e 21 00 8f 38 34 39 39 34 31 38 30 32 30 32]
> Redirecting Number (len=16) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
> Ext: 0 Presentation: Presentation permitted, user number not screened (0)
> Ext: 1 Reason: Forwarded unconditionally (15) '84990000000' ]
> [a1]
> Sending Complete (len= 1)
Звонок уходит на абонента C:
q931.c:4959 q931_setup: Call 32805 enters state 1 (Call Initiated). Hold state: Unknown
-- Called g1/84991111111
< Protocol Discriminator: Q.931 (8) len=14
< TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent to originator)
< Message Type: STATUS (125)
< [08 04 82 e3 98 74]
< Cause (len= 6) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Public network serving the local user (2)
< Ext: 1 Cause: Info. element nonexist or not implemented (99), class = Protocol Error (e.g. unknown message) (6) ]
< Cause data 1: 98 (152, Non-Locking Shift To Codeset 0 IE)
< Cause data 2: 74 (116, Redirecting Number IE)
< [14 01 01]
< Call State (len= 3) [ Ext: 0 Coding: CCITT (ITU) standard (0) Call state: Call Initiated (1)
Received message for call 0x9598d30 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
-- Processing IE 8 (cs0, Cause)
-- Processing IE 20 (cs0, Call State)
< Protocol Discriminator: Q.931 (8) len=10
< TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent to originator)
< Message Type: CALL PROCEEDING (2)
< [18 03 a9 83 83]
< Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
< ChanSel: As indicated in following octets
< Ext: 1 Coding: 0 Number Specified Channel Type: 3
< Ext: 1 Channel: 3 Type: CPE]
Received message for call 0x9598d30 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
-- Processing IE 24 (cs0, Channel Identification)
q931.c:6998 post_handle_q931_message: Call 32805 enters state 3 (Outgoing Call Proceeding). Hold state: Unknown
-- DAHDI/3-1 is proceeding passing it to DAHDI/1-1
< Protocol Discriminator: Q.931 (8) len=5
< TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent to originator)
< Message Type: ALERTING (1)
Received message for call 0x9598d30 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
q931.c:6888 post_handle_q931_message: Call 32805 enters state 4 (Call Delivered). Hold state: Unknown
-- DAHDI/3-1 is ringing
q931.c:4552 q931_alerting: Call 149 enters state 7 (Call Received). Hold state: Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: ALERTING (1)
TEI=0 Transmitting N(S)=38, window is open V(A)=38 K=7
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: ALERTING (1)
> [1e 02 81 88]
> Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Private network serving the local user (1)
> Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]
< Protocol Discriminator: Q.931 (8) len=30
< TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent to originator)
< Message Type: CONNECT (7)
< [29 05 0a 09 14 0b 15]
< Time Date (len= 7) [ 10-09-20 11:21 ]
< [4c 10 00 83 38 31 30 37 39 31 36 36 36 36 33 38 39 38]
< Connected Number (len=18) [ Ext: 0 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0)
< Ext: 1 Presentation: Presentation allowed of network provided number (3) '74991111111' ]
Происходит соединение с номером 74991111111.
Received message for call 0x9598d30 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
-- Processing IE 41 (cs0, Date/Time)
-- Processing IE 76 (cs0, Connected Number)
q931.c:6919 post_handle_q931_message: Call 32805 enters state 10 (Active). Hold state: Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=5
> TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent from originator)
> Message Type: CONNECT ACKNOWLEDGE (15)
TEI=0 Transmitting N(S)=39, window is open V(A)=39 K=7
> Protocol Discriminator: Q.931 (8) len=5
> TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent from originator)
> Message Type: CONNECT ACKNOWLEDGE (15)
-- DAHDI/3-1 answered DAHDI/1-1
q931.c:4683 q931_connect: Call 149 enters state 8 (Connect Request). Hold state: Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=14
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: CONNECT (7)
TEI=0 Transmitting N(S)=40, window is open V(A)=39 K=7
> Protocol Discriminator: Q.931 (8) len=14
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: CONNECT (7)
> [18 03 a9 83 81]
> Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
> ChanSel: As indicated in following octets
> Ext: 1 Coding: 0 Number Specified Channel Type: 3
> Ext: 1 Channel: 1 Type: CPE]
> [1e 02 81 82]
> Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Private network serving the local user (1)
> Ext: 1 Progress Description: Called equipment is non-ISDN. (2) ]
-- Native bridging DAHDI/1-1 and DAHDI/3-1
< Protocol Discriminator: Q.931 (8) len=5
< TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent from originator)
< Message Type: CONNECT ACKNOWLEDGE (15)
Received message for call 0x92f9c90 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
q931.c:7024 post_handle_q931_message: Call 149 enters state 10 (Active). Hold state: Unknown
< Protocol Discriminator: Q.931 (8) len=13
< TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent to originator)
< Message Type: DISCONNECT (69)
< [08 02 80 90]
< Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: User (0)
< Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
< [1e 02 82 88]
< Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Public network serving the local user (2)
< Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]
Received message for call 0x9598d30 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
-- Processing IE 8 (cs0, Cause)
-- Processing IE 30 (cs0, Progress Indicator)
-- Found active call: 0x9598d30 cref:32805
q931.c:7201 post_handle_q931_message: Call 32805 enters state 12 (Disconnect Indication). Hold state: Unknown
-- Channel 0/3, span 1 got hangup request, cause 16
q931_hangup: other hangup
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Disconnect Indication, peerstate Disconnect Request, hold-state Unknown
q931.c:4721 q931_release: Call 32805 enters state 19 (Release Request). Hold state: Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent from originator)
> Message Type: RELEASE (77)
TEI=0 Transmitting N(S)=41, window is open V(A)=41 K=7
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent from originator)
> Message Type: RELEASE (77)
> [08 02 81 90]
> Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
> Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
-- Hungup 'DAHDI/3-1'
== Spawn extension (divipriext, 84990000000, 4) exited non-zero on 'DAHDI/1-1'
q931_hangup: other hangup
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Active, peerstate Active, hold-state Unknown
q931.c:4768 q931_disconnect: Call 149 enters state 11 (Disconnect Request). Hold state: Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: DISCONNECT (69)
TEI=0 Transmitting N(S)=42, window is open V(A)=41 K=7
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: DISCONNECT (69)
> [08 02 81 90]
> Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
> Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
-- Hungup 'DAHDI/1-1'
< Protocol Discriminator: Q.931 (8) len=5
< TEI=0 Call Ref: len= 2 (reference 37/0x25) (Sent to originator)
< Message Type: RELEASE COMPLETE (90)
Received message for call 0x9598d30 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
q931.c:7083 post_handle_q931_message: Call 32805 enters state 0 (Null). Hold state: Unknown
q931_hangup: other hangup
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Null, peerstate Null, hold-state Unknown
NEW_HANGUP DEBUG: Destroying the call, ourstate Null, peerstate Null, hold-state Unknown
< Protocol Discriminator: Q.931 (8) len=5
< TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent from originator)
< Message Type: RELEASE (77)
Received message for call 0x92f9c90 on 0x9591bd0 TEI/SAPI 0/0, call->pri is 0x9591bd0 TEI/SAPI 0/0
q931.c:7123 post_handle_q931_message: Call 149 enters state 0 (Null). Hold state: Unknown
q931_hangup: other hangup
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Null, peerstate Release Request, hold-state Unknown
> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: RELEASE COMPLETE (90)
TEI=0 Transmitting N(S)=43, window is open V(A)=43 K=7
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 149/0x95) (Sent to originator)
> Message Type: RELEASE COMPLETE (90)
> [08 02 81 90]
> Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
> Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
q931_hangup: other hangup
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Null, peerstate Null, hold-state Unknown
NEW_HANGUP DEBUG: Destroying the call, ourstate Null, peerstate Null, hold-state Unknown
localhost*CLI>
Конфигурация chan_dahdi.conf
[trunkgroups]
[channels]
group=1
context=incoming_pri
signalling=pri_cpe
switchtype=euroisdn
pridialplan => unknown
prilocaldialplan => national
hidecallerid=no
callwaiting=no
callwaitingcallerid=yes
threewaycalling=no
transfer=yes
cancallforward=no
echocancel=no
echocancelwhenbridged=no
pickupgroup=1
callgroup=1
immediate=no
callprogress=no
callerid=asreceived
channel => 1-15,17-30
overlapdial=no
resetinterval=never
relaxdtmf=yes
rxgain=0.3
txgain=0.3
faxdetect=both
faxbuffers=>8,full
Конфигурация extensions_divi.conf.
[incoming_pri] ; входящий звонок приходит из PRI и уходит в PRI, если есть переадресация. Если нет, то в SIP.
exten => _849XXXXXXXX,1,NoOp(${CALLERID(all)})
exten => _849XXXXXXXX,n,Set(diviact_${EXTEN}=${DB(diviact/diviactvar_${EXTEN})})
exten => _849XXXXXXXX,n,NoOp(${diviact_${EXTEN}})
exten => _849XXXXXXXX,n,GotoIf($[${ISNULL(${diviact_${EXTEN}})}]?:okdiviact)
; При параллельном вызове, должен проверяться на существование 0 номер, при удалении его, на его место должен вставать следующий по-списку за ним.
exten => _849XXXXXXXX,n,Set(diviparact0_${EXTEN}=${DB(diviparact/diviparactvar0_${EXTEN})})
exten => _849XXXXXXXX,n,Set(diviparact1_${EXTEN}=${DB(diviparact/diviparactvar1_${EXTEN})})
exten => _849XXXXXXXX,n,Set(diviparact2_${EXTEN}=${DB(diviparact/diviparactvar2_${EXTEN})})
exten => _849XXXXXXXX,n,Set(diviparact3_${EXTEN}=${DB(diviparact/diviparactvar3_${EXTEN})})
; Аналогично с параллельным вызовом. Если нулевого номера нет, то осуществляем сдвиг номеров и переход к соответсвующей метке в диалплане.
exten => _849XXXXXXXX,n,NoOp(${diviparact0_${EXTEN}})
exten => _849XXXXXXXX,n,NoOp(${diviparact1_${EXTEN}})
exten => _849XXXXXXXX,n,NoOp(${diviparact2_${EXTEN}})
exten => _849XXXXXXXX,n,NoOp(${diviparact3_${EXTEN}})
exten => _849XXXXXXXX,n,GotoIf($[${ISNULL(${diviparact0_${EXTEN}})}]?:okdiviparact0)
exten => _849XXXXXXXX,n,Set(diviciclact0_${EXTEN}=${DB(diviciclact/diviciclactvar0_${EXTEN})})
exten => _849XXXXXXXX,n,Set(diviciclact1_${EXTEN}=${DB(diviciclact/diviciclactvar1_${EXTEN})})
exten => _849XXXXXXXX,n,Set(diviciclact2_${EXTEN}=${DB(diviciclact/diviciclactvar2_${EXTEN})})
exten => _849XXXXXXXX,n,Set(diviciclact3_${EXTEN}=${DB(diviciclact/diviciclactvar3_${EXTEN})})
exten => _849XXXXXXXX,n,GotoIf($[${ISNULL(${diviciclact0_${EXTEN}})}]?:okdiviciclact0)
exten => _849XXXXXXXX,n,NoOp(${diviciclact0_${EXTEN}})
exten => _849XXXXXXXX,n,NoOp(${diviciclact1_${EXTEN}})
exten => _849XXXXXXXX,n,NoOp(${diviciclact2_${EXTEN}})
exten => _849XXXXXXXX,n,NoOp(${diviciclact3_${EXTEN}})
exten => _849XXXXXXXX,n,Dial(SIP/TRUNK/${EXTEN})
exten => _849XXXXXXXX,n,Hangup()
exten => _849XXXXXXXX,n(okdiviact),Gosub(divipri,${EXTEN},1)
exten => _849XXXXXXXX,n,Hangup()
exten => _849XXXXXXXX,n(okdiviparact0),Gosub(diviparpri,${EXTEN},1)
exten => _849XXXXXXXX,n,Hangup()
exten => _849XXXXXXXX,n(okdiviciclact0),Gosub(diviciclpri,${EXTEN},1)
; Обычная переадресация на один номер телефона
[divipri]
exten => _849XXXXXXXX,1,Set(diviact_${EXTEN}=${DB(diviact/diviactvar_${EXTEN})})
;exten => _849XXXXXXXX,n,Set(CALLERID(num)=${EXTEN:1})
;exten => _849XXXXXXXX,n,Set(CALLERID(rdnis)=${EXTEN:1})
exten => _849XXXXXXXX,n,Set(CALLERID(num)=${CALLERID(ani):1})
exten => _849XXXXXXXX,n,Set(CALLERID(rdnis)=${CALLERID(ani):1})
exten => _849XXXXXXXX,n,Dial(DAHDI/g1/${diviact_${EXTEN}})
exten => _849XXXXXXXX,n,Hangup()
[divipriext]
exten => _849XXXXXXXX,1,Set(CALLERID(num)=${CALLERID(ani):1})
exten => _849XXXXXXXX,n,SetCallerPres(allowed_not_screened)
exten => _849XXXXXXXX,n,Set(CALLERID(RDNIS)=${EXTEN})
;ПРобовал и RDNIS и DNID
;exten => _849XXXXXXXX,n,Set(CALLERID(DNID)=${EXTEN})
exten => _849XXXXXXXX,n,Dial(DAHDI/g1/${diviact_${EXTEN}})
exten => _849XXXXXXXX,n,Hangup()
; Параллельная переадресация для PRI
[divipripar]
exten => _849XXXXXXXX,1,Set(CALLERID(rdnis)=${EXTEN})
exten => _849XXXXXXXX,n,Dial(dahdi/g2/${diviparact0_${EXTEN}}&dahdi/g2/${diviparact1_${EXTEN}}&dahdi/g2/${diviparact2_${EXTEN}}&dahdi/g2/${diviparact3_${EXTEN}})
exten => _849XXXXXXXX,n,Hangup()
; Цикличная переадресация для PRI
[diviciclpri]
exten => _849XXXXXXXX,1,Set(CALLERID(rdnis)=${EXTEN})
exten => _849XXXXXXXX,n,Dial(dahdi/g2/${diviciclact0_${EXTEN}},10)
exten => _849XXXXXXXX,n,Dial(dahdi/g2/${diviciclact1_${EXTEN}},10)
exten => _849XXXXXXXX,n,Dial(dahdi/g2/${diviciclact2_${EXTEN}},10)
exten => _849XXXXXXXX,n,Dial(dahdi/g2/${diviciclact3_${EXTEN}},10)
exten => _849XXXXXXXX,n,Hangup()
[root@localhost asterisk]#
Пока пробую только безусловную переадресацию. Остальные я не трогал. Работаю с контекстом divipri. Переадресация происходит с номера в коде 84990000000 на номер 84991111111.
84991234567 - номер с которого звоню (А номер)
84990000000 - номер на который я звоню (Б номер)
84991111111 - номер на который происходит переадресация с номера Б (С номер)
|