Нужно сделать переадресацию по указанию пользователя.
Есть два сервера, lst252 (на нем номер 4646, 4555), обслуживающий внутренних абонентов, и lst10 обслуживающих удаленных ( с номерами 4149, 4150).
Нужно, чтобы пользователь, набирал на трубке *21XXXX, где XXXX - номер с lst10, и попадал на него.
Прописал в
Код: Выделить всё
[default]
exten => _*21XXXX,1,Set(DB(REDIRECT/${CALLERID(num)})=${EXTEN:3})
exten => *22#,1,Set(NOREDIRNUM=${DB_DELETE(REDIRECT/${CALLERID(num)})})
;
exten => _46XX,1,Set(REDIRECTNUM=${DB(REDIRECT/${EXTEN})})
exten => _46XX,n,GotoIf($[${ISNULL(${REDIRECTNUM})}]?internal:redirect)
exten => _46XX,n(internal),Dial(SIP/${EXTEN})
exten => _46XX,n(redirect),Dial(SIP/lst10/${REDIRECTNUM})
;;
Звоню с 4150 на 4646.
В логе следующее:
Код: Выделить всё
== Using SIP RTP CoS mark 5
-- Executing [4646@default:1] Set("SIP/lst10-00000a82", "REDIRECTNUM=4149") in new stack
-- Executing [4646@default:2] GotoIf("SIP/lst10-00000a82", "0?internal:redirect") in new stack
-- Goto (default,4646,4)
-- Executing [4646@default:4] Dial("SIP/lst10-00000a82", "SIP/lst10/4149") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/lst10/4149
[Dec 5 14:36:54] NOTICE[23223][C-000005e8]: chan_sip.c:22932 handle_response_invite: Failed to authenticate on INVITE to '"Aleksandr Mihaylov" <sip:4150@192.168.101.252>;tag=as32ec9204'
-- SIP/lst10-00000a83 is circuit-busy
Сервера заведены друг на друга по сипу.
Вот их sip show peer
Код: Выделить всё
* Name : lst10
Description :
Secret : <Not set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : default
Record On feature : automon
Record Off feature : automon
Subscr.Cont. : default
Language :
Tonezone : <Not set>
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
Callgroup :
Pickupgroup :
Named Callgr :
Nam. Pickupgr:
MOH Suggest :
Mailbox :
VM Extension : asterisk
LastMsgsSent : 0/0
Call limit : 2147483647
Max forwards : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : no
Force rport : No
Symmetric RTP: No
ACL : No
DirectMedACL : No
T.38 support : Yes
T.38 EC mode : FEC
T.38 MaxDtgrm: -1
DirectMedia : No
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : No
DTMFmode : rfc2833
Timer T1 : 500
Timer B : 32000
ToHost : 192.168.101.10
Addr->IP : 192.168.101.10:5060
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
Def. Username:
SIP Options : replaces replace timer
Codecs : (alaw)
Codec Order : (alaw:20)
Auto-Framing : No
Status : Unmonitored
Useragent :
Reg. Contact :
Qualify Freq : 60000 ms
Keepalive : 0 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
RTP Engine : asterisk
Parkinglot :
Use Reason : No
Encryption : No
Код: Выделить всё
lst10*CLI> sip show peer lst252
* Name : lst252
Secret : <Not set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : default
Subscr.Cont. : <Not set>
Language :
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
Callgroup :
Pickupgroup :
MOH Suggest :
Mailbox :
VM Extension : asterisk
LastMsgsSent : 32767/65535
Call limit : 0
Max forwards : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : no
Force rport : Yes
ACL : No
DirectMedACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: -1
DirectMedia : No
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : Yes
DTMFmode : rfc2833
Timer T1 : 500
Timer B : 32000
ToHost : 192.168.101.252
Addr->IP : 192.168.101.252:5060
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
Def. Username:
SIP Options : replaces replace timer
Codecs : 0x8 (alaw)
Codec Order : (alaw:20)
Auto-Framing : No
Status : Unmonitored
Useragent :
Reg. Contact :
Qualify Freq : 60000 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
RTP Engine : asterisk
Parkinglot :
Use Reason : No
Encryption : No
Код: Выделить всё
[lst10]
type=friend
host=192.168.101.10
context=default
disallow=all
allow=alaw
canreinvite=no
Код: Выделить всё
[lst252]
type=friend
host=192.168.101.252
context=default
disallow=all
allow=alaw
canreinvite=no
nat=yes