Для полной картины, настройки Digium
extensions.conf[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp
[SIP-to-E1_port1]
exten => _X.,1,Verbose(2,${EXTEN} matches Rule SIP-to-E1_port1)
exten => _X.,n,execif($["${TOLOWER(${CALLERID(name)})}" = "anonymous"]?Set(CALLERID(num-pres)=prohib))
exten => _X.,n,GoSub(sub-failover,s,1(${EXTEN},gtw/port1:0))
exten => _X.,n,Hangup()
[E1_port1-to-SIP]
exten => _X.,1,Verbose(2,${EXTEN} matches Rule E1_port1-to-SIP)
exten => _X.,n,Proceeding()
exten => _X.,n,Wait(1)
exten => _X.,n,GoSub(sub-failover,s,1(${EXTEN},SIP/freeswitch1:0))
exten => _X.,n,Hangup()
[E1_port2-to-SIP]
exten => _X.,1,Verbose(2,${EXTEN} matches Rule E1_port2-to-SIP)
exten => _X.,n,Proceeding()
exten => _X.,n,Wait(1)
exten => _X.,n,GoSub(sub-failover,s,1(${EXTEN},SIP/freeswitch2:0))
exten => _X.,n,Hangup()
[SIP-to-E1_port2]
exten => _X.,1,Verbose(2,${EXTEN} matches Rule SIP-to-E1_port2)
exten => _X.,n,execif($["${TOLOWER(${CALLERID(name)})}" = "anonymous"]?Set(CALLERID(num-pres)=prohib))
exten => _X.,n,GoSub(sub-failover,s,1(${EXTEN},gtw/port2:0))
exten => _X.,n,Hangup()
[freeswitch1]
include => SIP-to-E1_port1
[freeswitch2]
include => SIP-to-E1_port2
[port1]
include => E1_port1-to-SIP
[port2]
include => E1_port2-to-SIP
[sub-failover]
exten => s,1,Verbose(2,Beginning failover)
exten => s,n(tryagain),Set(TARGET=${SHIFT(ARG2,:)})
exten => s,n,Set(ISFXS=${SHIFT(ARG2,:)})
exten => s,n,Gotoif($["${ARG1}"=""]?dialstrnoexten)
exten => s,n,Gotoif($["${ARG1}"="s"]?dialstrnoexten)
exten => s,n,Gotoif($["${ISFXS}"="1"]?dialstrnoexten)
exten => s,n,Set(DIALSTR=${TARGET}/${ARG1})
exten => s,n,Goto(dial)
exten => s,n(dialstrnoexten),Set(DIALSTR=${TARGET})
exten => s,n(dial),Dial(${DIALSTR})
exten => s,n,NoOp(${HANGUPCAUSE})
exten => s,n,Gotoif($["${HANGUPCAUSE}"="34"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="38"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="41"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="42"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="44"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="27"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="111"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="20"]?evalstring)
exten => s,n,Gotoif($["${HANGUPCAUSE}"="0"]?evalstring)
exten => s,n,Goto(return,1)
exten => s,n(evalstring),Gotoif($[${LEN(ARG2)}>0]?tryagain:return,1)
exten => return,1,Return()
sip.conf[general]
tcpbindaddr=
0.0.0.0:5060domainasrealm=no
tcpauthlimit=99
srvlookup=yes
sendrpid=no
registertimeout=20
maxexpiry=3600
tlsbindaddr=0.0.0.0
sdpsession=Digium Gateway
allowoverlap=yes
autodomain=no
minexpiry=60
allowexternaldomains=yes
pedantic=no
alwaysauthreject=no
externrefresh=180
tos_sip=cs3
tos_audio=ef
dtmfmode=rfc2833
dynamic_exclude_static=no
externtcpport=5060
jblog=no
match_auth_username=no
prematuremedia=yes
matchexternaddrlocally=no
tcpauthtimeout=30
useragent=Digium Gateway
udpbindaddr=
0.0.0.0:5060rtpend=10999
tcpenable=no
context=default
shrinkcallerid=yes
jbenable=yes
defaultexpiry=120
compactheaders=no
tlsenable=no
allowguest=no
jbforce=no
dnsrefreshinterval=300
sdpowner=root
auth_options_request=no
[authentication]
[freeswitch1]
qualify=no
nat=no
sendrpid=no
t38transport=udptl
usereqphone=no
timerb=32000
session-minse=90
allowoverlap=no
directmedia=no
insecure=port,invite
callingpres=allowed_not_screened
g726nonstandard=no
dtmfmode=auto
type=friend
use_q850_reason=no
rtpjittermode=static
rtp_engine=vocallo
session-refresher=uas
transport=udp
progressinband=never
timert1=500
t1min=500ms
session-timers=accept
allowtransfer=yes
disallow=all
context=freeswitch1
registertrying=no
rtpjitterdelay=50
trust_id_outbound=legacy
secret=***
trustrpid=no
host=dynamic
defaultuser=freeswitch1
promiscredir=no
preferred_codec_only=no
session-expires=1800
t38pt_udptl=no
max_forwards=70
allow=ulaw:20
allow=alaw:20
allow=g729:20
allow=g722:20
allow=gsm:20
allow=g726:20
requesturi_did=1
[freeswitch2]
qualify=no
nat=no
sendrpid=no
t38transport=udptl
usereqphone=no
timerb=32000
session-minse=90
allowoverlap=no
directmedia=no
insecure=port,invite
callingpres=allowed_not_screened
g726nonstandard=no
dtmfmode=rfc2833
type=friend
use_q850_reason=no
rtpjittermode=static
rtp_engine=vocallo
session-refresher=uas
transport=udp
progressinband=never
timert1=500
t1min=500ms
session-timers=accept
allowtransfer=yes
disallow=all
context=freeswitch2
registertrying=yes
rtpjitterdelay=50
trust_id_outbound=legacy
secret=***
trustrpid=no
host=dynamic
defaultuser=freeswitch2
promiscredir=no
preferred_codec_only=no
session-expires=1800
t38pt_udptl=no
max_forwards=70
allow=ulaw:20
allow=alaw:20
allow=g729:20
allow=g722:20
allow=gsm:20
allow=g726:20
requesturi_did=1
Кстати, делал как рекомендовали - добывлял префикс и отлавливал его на Digium.
При звонке на 2-ой порт, вот что в логах Digium:
Thu Feb 11 21:07:09 2016;192.168.8.31; <135>asterisk[11814]: VERBOSE[11846]: chan_sip.c:23378 in handle_request_invite: Using INVITE request as basis request - 1c43bf81-4b8d-1234-d085-00215e3f4ecc
Thu Feb 11 21:07:09 2016;192.168.8.31; <135>asterisk[11814]: VERBOSE[11846]: chan_sip.c:16391
in check_peer_ok: Found peer 'freeswitch1' for '484270114х' from 192.168.8.156:5080 Thu Feb 11 21:07:09 2016;192.168.8.31; <135>asterisk[11814]: VERBOSE[11846]: chan_sip.c:9456 in process_sdp: Peer audio RTP is at port
172.16.12.16:65190 Thu Feb 11 21:07:09 2016;192.168.8.31; <135>asterisk[11814]: VERBOSE[11846]: chan_sip.c:15815 in get_destination: Looking for 92714901 in freeswitch1 (domain 192.168.8.31)
Thu Feb 11 21:07:09 2016;192.168.8.31; <135>asterisk[11814]: VERBOSE[11846]: chan_sip.c:4267 in send_response: <--- Reliably Transmitting (no NAT) to
192.168.8.156:5080 ---> SIP/2.0 404 Not Found^M Via: SIP/2.0/UDP 192.168.8.156:5080;branch=z9hG4bKr090Dt24pj4UH;received=192.168.8.156;rport=5080^M From: "1010" <sip:484270114х@
192.168.8.156>;tag=94r63ZtDe6Q2S^M To: <
sip:9271...@192.168.8.31>;tag=as59982862^M Call-ID: 1c43bf81-4b8d-1234-d085-00215e3f4ecc^M CSeq: 87270951 INVITE^M Server: Digium Gateway^M Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH^M Supported: replaces, timer^M Content-Length: 0^M ^M <------------>
Thu Feb 11 21:07:09 2016;192.168.8.31; <133>asterisk[11814]: NOTICE[11846]: chan_sip.c:23552 in handle_request_invite:
Call from 'freeswitch1' (192.168.8.156:5080) to extension '92714901' rejected because extension not found in context 'freeswitch1'. Thu Feb 11 21:07:09 2016;192.168.8.31; <135>asterisk[11814]: VERBOSE[11846]: chan_sip.c:4027 in sip_scheddestroy: Scheduling destruction of SIP dialog '1c43bf81-4b8d-1234-d085-00215e3f4ecc' in 32000 ms (Method: INVITE)
Получается, что с FS он выходит через 1-ый sip аккаунт! Потом он не идёт, потомучто в маршрутизации данный префикс отлавливался со второго аккаунта и естественно он не подпадал не под одно правило!!!
Или что то не так понимаю, тогда как делает Digium сопоставление
Found peer 'freeswitch1' for '484270114х' from 192.168.8.156:5080 , если FS всё правильно отрабатывает и отправляет через 2-ю учётку
Вообщем для меня не понятно где проблема, может у кого будут какие-нибудь мысли?
Помогите пожалуйста разобраться в данной проблеме.