1 | изначальная версия редактировать | |
есть *, есть agi-rad-auth.agi на perl
хочу сделать:
при звонке на номер 100 -- безусловная переадресация на некий внешний номер 79001234567, при этом чтобы было два плеча соединения:
1 это звонок откуда-нибудь на 100,
2 звонок от имени и за счёт абонента 100 во внешку
для этого в extensions.conf:
exten => _X.,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=${CDR(accountcode)}&DNID=${EXTEN})
exten => _X.,n,Goto(dial:default,${DNID},1)
exten => _X.,n,Hangup()
[dial:transfer]
exten => 100,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=100&DNID=79001234567)
exten => 100,n,Goto(dial:mobile,79001234567,1)
exten => 100,n,Hangup
при звонке:
-- Executing [100@default:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- context = default
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: SUCKER !!! Account Code = 101 CLID = 101 DNID = 100, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-time value=210909
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 100|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@default:2] Goto("SIP/101-0000245f", "dial:default|100|1") in new stack
-- Goto (dial:default,100,1)
-- Executing [100@dial:default:1] GotoIf("SIP/101-0000245f", "1?5:2") in new stack
-- Goto (dial:default,100,5)
-- Executing [100@dial:default:5] Goto("SIP/101-0000245f", "dial:default-2|100|1") in new stack
-- Goto (dial:default-2,100,1)
-- Executing [100@dial:default-2:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- context = dial:default-2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: SUCKER !!! Account Code = 101 CLID = 101 DNID = 79001234567, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-time value=2526
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 79001234567|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@dial:default-2:2] Dial("SIP/101-0000245f", "SIP/79001234567@cisco|25") in new stack
-- Called 79001234567@cisco
-- SIP/cisco-00002460 is making progress passing it to SIP/101-0000245f
звонок проходит, всё прекрасно. кроме одного: в биллинге вижу соединение только 100 и 101 за счёт вызывающего 101, в Master.csv -- отображается как звонок с 101 на 79001234567, а звонок со 100 во внешку не виден вообще больше нигде. подскажите, как мне правильно сделать, чтобы:
2 | No.2 Revision редактировать |
есть *, есть agi-rad-auth.agi на perl
хочу сделать:
при звонке на номер 100 -- безусловная переадресация на некий внешний номер 79001234567, при этом чтобы было два плеча соединения:
1 это звонок откуда-нибудь на 100,
2 звонок от имени и за счёт абонента 100 во внешку
для этого в extensions.conf:
exten => _X.,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=${CDR(accountcode)}&DNID=${EXTEN})
exten => _X.,n,Goto(dial:default,${DNID},1)
exten => _X.,n,Hangup()
[dial:transfer]
exten => 100,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=100&DNID=79001234567)
exten => 100,n,Goto(dial:mobile,79001234567,1)
exten => 100,n,Hangup
при звонке:
-- Executing [100@default:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- context = default
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: SUCKER !!! Account Code = 101 CLID = 101 DNID = 100, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-time value=210909
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 100|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@default:2] Goto("SIP/101-0000245f", "dial:default|100|1") in new stack
-- Goto (dial:default,100,1)
-- Executing [100@dial:default:1] GotoIf("SIP/101-0000245f", "1?5:2") in new stack
-- Goto (dial:default,100,5)
-- Executing [100@dial:default:5] Goto("SIP/101-0000245f", "dial:default-2|100|1") in new stack
-- Goto (dial:default-2,100,1)
-- Executing [100@dial:default-2:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- context = dial:default-2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: SUCKER !!! Account Code = 101 CLID = 101 DNID = 79001234567, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-time value=2526
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 79001234567|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@dial:default-2:2] Dial("SIP/101-0000245f", "SIP/79001234567@cisco|25") in new stack
-- Called 79001234567@cisco
-- SIP/cisco-00002460 is making progress passing it to SIP/101-0000245f
звонок проходит, всё прекрасно. кроме одного: в связки с биллингом:
при втором вызове agi-скрипта всё равно передаются старые переменные почему-то. т.о.,в биллинге вижу соединение только 100 и 101 за
счёт вызывающего 101, в Master.csv -- отображается как звонок с 101 на 79001234567, а звонок со 100 во внешку не виден вообще больше нигде. подскажите, как мне правильно сделать, чтобы:
3 | No.3 Revision редактировать |
есть *, есть agi-rad-auth.agi на perl
хочу сделать:
при звонке на номер 100 -- безусловная переадресация на некий внешний номер 79001234567, при этом чтобы было два плеча соединения:
1 это звонок откуда-нибудь на 100,
2 звонок от имени и за счёт абонента 100 во внешку
для этого в extensions.conf:
exten => _X.,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=${CDR(accountcode)}&DNID=${EXTEN})
exten => _X.,n,Goto(dial:default,${DNID},1)
exten => _X.,n,Hangup()
[dial:transfer]
exten => 100,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=100&DNID=79001234567)
exten => 100,n,Goto(dial:mobile,79001234567,1)
exten => 100,n,Hangup
при звонке:
-- Executing [100@default:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- context = default
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: SUCKER !!! Account Code = 101 CLID = 101 DNID = 100, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-time value=210909
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 100|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@default:2] Goto("SIP/101-0000245f", "dial:default|100|1") in new stack
-- Goto (dial:default,100,1)
-- Executing [100@dial:default:1] GotoIf("SIP/101-0000245f", "1?5:2") in new stack
-- Goto (dial:default,100,5)
-- Executing [100@dial:default:5] Goto("SIP/101-0000245f", "dial:default-2|100|1") in new stack
-- Goto (dial:default-2,100,1)
-- Executing [100@dial:default-2:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- context = dial:default-2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: SUCKER !!! Account Code = 101 CLID = 101 DNID = 79001234567, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-time value=2526
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 79001234567|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@dial:default-2:2] Dial("SIP/101-0000245f", "SIP/79001234567@cisco|25") in new stack
-- Called 79001234567@cisco
-- SIP/cisco-00002460 is making progress passing it to SIP/101-0000245f
звонок проходит, всё прекрасно. кроме связки с биллингом:
при втором вызове agi-скрипта всё равно передаются старые переменные почему-то. т.о.,в биллинге вижу соединение только 100 и 101 за
счёт вызывающего 101, в Master.csv -- отображается как звонок с 101 на 79001234567, а звонок со 100 во внешку не виден вообще больше нигде. подскажите, как мне правильно сделать, чтобы:
4 | No.4 Revision редактировать |
есть *, есть agi-rad-auth.agi на perl
хочу сделать:
при звонке на номер 100 -- безусловная переадресация на некий внешний номер 79001234567, при этом чтобы было два плеча соединения:
1 это звонок откуда-нибудь на 100,
2 звонок от имени и за счёт абонента 100 во внешку
для этого в extensions.conf:
exten => _X.,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=${CDR(accountcode)}&DNID=${EXTEN})
exten => _X.,n,Goto(dial:default,${DNID},1)
exten => _X.,n,Hangup()
[dial:transfer]
exten => 100,1,AGI(agi-rad-auth.agi,Mode=Account&CLID=100&DNID=79001234567)
exten => 100,n,Goto(dial:mobile,79001234567,1)
exten => 100,n,Hangup
при звонке:
-- Executing [100@default:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- context = default
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: SUCKER !!! Account Code = 101 CLID = 101 DNID = 100, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-credit-time value=210909
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=101&DNID=100: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 100|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@default:2] Goto("SIP/101-0000245f", "dial:default|100|1") in new stack
-- Goto (dial:default,100,1)
-- Executing [100@dial:default:1] GotoIf("SIP/101-0000245f", "1?5:2") in new stack
-- Goto (dial:default,100,5)
-- Executing [100@dial:default:5] Goto("SIP/101-0000245f", "dial:default-2|100|1") in new stack
-- Goto (dial:default-2,100,1)
-- Executing [100@dial:default-2:1] AGI("SIP/101-0000245f", "agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567") in new stack
-- Launched AGI Script /usr/local/share/asterisk/agi-bin/agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: AGI Environment Dump:
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- accountcode = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callerid = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- calleridname = 101
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingani2 = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingpres = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callingtns = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- callington = 0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- channel = SIP/101-0000245f
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- context = dial:default-2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- dnid = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- enhanced = 0.0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- extension = 100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- language = ru
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- priority = 1
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- rdnis = unknown
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- request = agi-rad-auth.agi
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- type = SIP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: -- uniqueid = 1316499228.12397
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: SUCKER !!! Account Code = 101 CLID = 101 DNID = 79001234567, Password = passwd
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: RADIUS server response type = 2
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=User-Service-Type value=Framed
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Framed-Protocol value=PPP
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=Acct-Interim-Interval value=100
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-amount value=75.80
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-credit-time value=2526
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-return-code value=0
-- agi-rad-auth.agi|Mode=Account&CLID=100&DNID=79001234567: attr: name=h323-currency value=USD
-- AGI Script Executing Application: (UserEvent) Options: (_SIP_Auth|User-Name: 101|DNID: 79001234567|Channel: SIP/101-0000245f)
-- AGI Script agi-rad-auth.agi completed, returning 0
-- Executing [100@dial:default-2:2] Dial("SIP/101-0000245f", "SIP/79001234567@cisco|25") in new stack
-- Called 79001234567@cisco
-- SIP/cisco-00002460 is making progress passing it to SIP/101-0000245f
звонок проходит, всё прекрасно. кроме связки с биллингом:
при втором вызове agi-скрипта всё равно передаются старые переменные почему-то. т.о.,в биллинге вижу соединение только 100 и 101 за
счёт вызывающего 101, в Master.csv -- отображается как звонок с 101 на 79001234567, а звонок со 100 во внешку не виден вообще больше нигде. подскажите, как мне правильно сделать, чтобы:
Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании
Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией
GNU GPL.