Подключил я к AS5350 Asterisk, хочется поделиться своими соображениями и услышать компетентные мнения.
Сразу к делу, всё работает по схеме см. рисунок 111.jpeg
Если звонит абонент Asteriska 771700 в PSTN ,в данном случае, на номер 675636, то в
поле Calling Party Number вместо номера 771700 «прилетает» ‘admin’
Calling Party Number i = 0x0180, 'admin'
Вот debug isdn q931 на AS5350
- Код: Выделить всё
трассировка звонка с 771700 на 675636
AS5350#debug isdn q931
debug isdn q931 is ON.
AS5350#term mon
AS5350#
*Jan 1 04:58:35.054: ISDN Se3/2:15 Q931: Applying typeplan for sw-type 0x12 is 0x0 0x1, Calling num admin
*Jan 1 04:58:35.054: ISDN Se3/2:15 Q931: Applying typeplan for sw-type 0x12 is 0x4 0x1, Called num 675636
*Jan 1 04:58:35.058: ISDN Se3/2:15 Q931: TX -> SETUP pd = 8 callref = 0x04E0
Sending Complete
Bearer Capability i = 0x8090A3
Standard = CCITT
Transfer Capability = Speech
Transfer Mode = Circuit
Transfer Rate = 64 kbit/s
Channel ID i = 0xA98381
Exclusive, Channel 1
Display i = '771700'
Calling Party Number i = 0x0180, 'admin'
Plan:ISDN, Type:Unknown
Called Party Number i = 0xC1, '675636'
Plan:ISDN, Type:Subscriber(local)
*Jan 1 04:58:35.066: ISDN Se3/3:15 Q931: RX <- SETUP pd = 8 callref = 0x04E0
Sending Complete
Bearer Capability i = 0x8090A3
Standard = CCITT
Transfer Capability = Speech
Transfer Mode = Circuit
Transfer Rate = 64 kbit/s
Channel ID i = 0xA98381
Exclusive, Channel 1
Display i = '771700'
Calling Party Number i = 0x0180, 'admin'
Plan:ISDN, Type:Unknown
Called Party Number i = 0xC1, '675636'
Plan:ISDN, Type:Subscriber(local)
*Jan 1 04:58:35.074: ISDN Se3/2:15 Q931: Applying typeplan for sw-type 0x12 is 0x0 0x1, Calling num admin
*Jan 1 04:58:35.078: ISDN Se3/2:15 Q931: Applying typeplan for sw-type 0x12 is 0x4 0x1, Called num 675636
*Jan 1 04:58:35.078: ISDN Se3/3:15 Q931: TX -> CALL_PROC pd = 8 callref = 0x84E0
Channel ID i = 0xA98381
Exclusive, Channel 1
*Jan 1 04:58:35.078: ISDN Se3/2:15 Q931: TX -> SETUP pd = 8 callref = 0x04E1
Sending Complete
Bearer Capability i = 0x8090A3
Standard = CCITT
Transfer Capability = Speech
Transfer Mode = Circuit
Transfer Rate = 64 kbit/s
Channel ID i = 0xA98382
Exclusive, Channel 2
Display i = '771700'
Calling Party Number i = 0x0180, 'admin'
Plan:ISDN, Type:Unknown
Called Party Number i = 0xC1, '675636'
Plan:ISDN, Type:Subscriber(local)
*Jan 1 04:58:35.082: ISDN Se3/2:15 Q931: RX <- CALL_PROC pd = 8 callref = 0x84E0
Channel ID i = 0xA98381
Exclusive, Channel 1
Cause i = 0x8290 - Normal call clearing
*Jan 1 04:58:42.458: ISDN Se3/3:15 Q931: TX -> RELEASE pd = 8 callref = 0x84EE
*Jan 1 04:58:42.462: ISDN Se3/2:15 Q931: RX <- RELEASE pd = 8 callref = 0x84EE
*Jan 1 04:58:42.462: ISDN Se3/2:15 Q931: TX -> DISCONNECT pd = 8 callref = 0x04EF
Cause i = 0x8290 - Normal call clearing
*Jan 1 04:58:42.466: ISDN Se3/2:15 Q931: TX -> RELEASE_COMP pd = 8 callref = 0x04EE
*Jan 1 04:58:42.466: ISDN Se3/3:15 Q931: RX <- DISCONNECT pd = 8 callref = 0x04EF
Cause i = 0x8290 - Normal call clearing
*Jan 1 04:58:42.470: ISDN Se3/3:15 Q931: RX <- RELEASE_COMP pd = 8 callref = 0x04EE
*Jan 1 04:58:42.470: ISDN Se3/3:15 Q931: TX -> RELEASE pd = 8 callref = 0x84EF
*Jan 1 04:58:42.474: ISDN Se3/2:15 Q931: RX <- RELEASE pd = 8 callref = 0x84EF
*Jan 1 04:58:42.478: ISDN Se3/2:15 Q931: TX -> RELEASE_COMP pd = 8 callref = 0x04EF
*Jan 1 04:58:42.482: ISDN Se3/3:15 Q931: RX <- RELEASE_COMP pd = 8 callref = 0x04EF
*Jan 1 04:58:42.482: ISDN Se3/2:15 Q931: TX -> DISCONNECT pd = 8 callref = 0x04F0
Cause i = 0x8290 - Normal call clearing
*Jan 1 04:58:42.486: ISDN Se3/3:15 Q931: RX <- DISCONNECT pd = 8 callref = 0x04F0
Cause i = 0x8290 - Normal call clearing
*Jan 1 04:58:42.490: ISDN Se3/3:15 Q931: TX -> RELEASE pd = 8 callref = 0x84F0
*Jan 1 04:58:42.494: ISDN Se3/2:15 Q931: RX <- RELEASE pd = 8 callref = 0x84F0
*Jan 1 04:58:42.494: ISDN Se3/2:15 Q931: TX -> DISCONNECT pd = 8 callref = 0x04F1
Cause i = 0x8290 - Normal call clearing
*Jan 1 04:58:42.494: ISDN Se3/2:15 Q931: TX -> RELEASE_COMP pd = 8 callref = 0x04F0
AS5350#
и нарезки такого ccsip all AS5350
- Код: Выделить всё
AS5350#debug ccsip a
AS5350#debug ccsip all
This may severely impact system performance. Continue? [confirm]
All SIP Call tracing is enabled
AS5350#term mon\
*Jan 1 19:48:01.991: //-1/xxxxxxxxxxxx/SIP/Info/HandleUdpSocketReads: Msg enqueued for SPI with IP addr: 192.168.50.109:5060
*Jan 1 19:48:01.991: //-1/xxxxxxxxxxxx/SIP/Transport/sipTransportProcessNWNewConnMsg: context=0x00000000
*Jan 1 19:48:01.995: //-1/xxxxxxxxxxxx/SIP/Transport/sipSPIUpdateResponseInfo: Dialog Transaction Address 192.168.50.109,Port 5060, Transport 1, SentBy Port 5060
*Jan 1 19:48:01.995: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:675636@192.168.50.119 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK2aef7841
Max-Forwards: 70
From: "771700" <sip:admin@192.168.50.109>;tag=as5226944e
To: <sip:675636@192.168.50.119>
Contact: <sip:admin@192.168.50.109:5060>
Call-ID: 16d5492d1f3c2d893cedf3fc0a70e7ca@192.168.50.109:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Date: Wed, 13 Jan 1999 00:16:07 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 347
v=0
o=root 1990677574 1990677574 IN IP4 192.168.50.109
s=Asterisk PBX 11.7.0~dfsg-1ubuntu1
c=IN IP4 192.168.50.109
t=0 0
m=audio 13100 RTP/AVP 0 8 3 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
Почему так происходит….
Смотрю в Asterisk ubuntu*CLI> sip set debug peer AS5350
- Код: Выделить всё
ubuntu*CLI> sip set debug peer AS5350
SIP Debugging Enabled for IP: 192.168.50.119
== Using SIP RTP CoS mark 5
-- Executing [675636@from-office:1] Dial("SIP/771700-00000f3e", "sip/675636@AS5350") in new stack
== Using SIP RTP CoS mark 5
Audio is at 13472
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding codec 100002 (gsm) to SDP
Adding codec 100008 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.50.119:5060:
INVITE sip:675636@192.168.50.119 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK08fd617a
Max-Forwards: 70
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>
Contact: <sip:admin@192.168.50.109:5060>
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Date: Wed, 13 Jan 1999 02:40:02 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 345
v=0
o=root 923979867 923979867 IN IP4 192.168.50.109
s=Asterisk PBX 11.7.0~dfsg-1ubuntu1
c=IN IP4 192.168.50.109
t=0 0
m=audio 13472 RTP/AVP 0 8 3 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
---
-- Called sip/675636@AS5350
<--- SIP read from UDP:192.168.50.119:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK08fd617a
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>;tag=41EB1DC-E6D
Date: Sat, 01 Jan 2000 19:11:57 GMT
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
Server: Cisco-SIPGateway/IOS-12.x
CSeq: 102 INVITE
Allow-Events: telephone-event
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
<--- SIP read from UDP:192.168.50.119:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK08fd617a
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>;tag=41EB1DC-E6D
Date: Sat, 01 Jan 2000 19:11:57 GMT
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
Server: Cisco-SIPGateway/IOS-12.x
CSeq: 102 INVITE
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER
Allow-Events: telephone-event
Contact: <sip:675636@192.168.50.119:5060>
Content-Disposition: session;handling=required
Content-Type: application/sdp
Content-Length: 253
v=0
o=CiscoSystemsSIP-GW-UserAgent 4250 1659 IN IP4 192.168.50.119
s=SIP Call
c=IN IP4 192.168.50.119
t=0 0
m=audio 17118 RTP/AVP 8 101
c=IN IP4 192.168.50.119
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
<------------->
--- (14 headers 11 lines) ---
list_route: hop: <sip:675636@192.168.50.119:5060>
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (gsm|ulaw|alaw|g729), peer - audio=(alaw)/video=(nothing)/text=(nothing), combined - (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.50.119:17118
-- SIP/AS5350-00000f3f is making progress passing it to SIP/771700-00000f3e
<--- SIP read from UDP:192.168.50.119:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK08fd617a
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>;tag=41EB1DC-E6D
Date: Sat, 01 Jan 2000 19:11:57 GMT
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
Server: Cisco-SIPGateway/IOS-12.x
CSeq: 102 INVITE
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER
Allow-Events: telephone-event
Contact: <sip:675636@192.168.50.119:5060>
Content-Type: application/sdp
Content-Length: 253
v=0
o=CiscoSystemsSIP-GW-UserAgent 4250 1659 IN IP4 192.168.50.119
s=SIP Call
c=IN IP4 192.168.50.119
t=0 0
m=audio 17118 RTP/AVP 8 101
c=IN IP4 192.168.50.119
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
<------------->
--- (13 headers 11 lines) ---
list_route: hop: <sip:675636@192.168.50.119:5060>
set_destination: Parsing <sip:675636@192.168.50.119:5060> for address/port to send to
set_destination: set destination to 192.168.50.119:5060
Transmitting (no NAT) to 192.168.50.119:5060:
ACK sip:675636@192.168.50.119:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK272db6f3
Max-Forwards: 70
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>;tag=41EB1DC-E6D
Contact: <sip:admin@192.168.50.109:5060>
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Content-Length: 0
---
-- SIP/AS5350-00000f3f answered SIP/771700-00000f3e
-- Locally bridging SIP/771700-00000f3e and SIP/AS5350-00000f3f
Scheduling destruction of SIP dialog '1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060' in 32000 ms (Method: INVITE)
set_destination: Parsing <sip:675636@192.168.50.119:5060> for address/port to send to
set_destination: set destination to 192.168.50.119:5060
Reliably Transmitting (no NAT) to 192.168.50.119:5060:
BYE sip:675636@192.168.50.119:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK61341071
Max-Forwards: 70
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>;tag=41EB1DC-E6D
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
CSeq: 103 BYE
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0
---
<--- SIP read from UDP:192.168.50.119:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.50.109:5060;branch=z9hG4bK61341071
From: "771700" <sip:admin@192.168.50.109>;tag=as074c419c
To: <sip:675636@192.168.50.119>;tag=41EB1DC-E6D
Date: Sat, 01 Jan 2000 19:12:10 GMT
Call-ID: 1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060
Server: Cisco-SIPGateway/IOS-12.x
Content-Length: 0
CSeq: 103 BYE
<------------->
--- (9 headers 0 lines) ---
Really destroying SIP dialog '1e5f9b3c679870d2761b157b52b0b9cf@192.168.50.109:5060' Method: INVITE
== Spawn extension (from-office, 675636, 1) exited non-zero on 'SIP/771700-00000f3e'
Делаю вывод, что в качестве Calling Party Number или как мы его называем номера «А»
AS5350 «цепляет» логин «admin», с которым она регистрируется на Asteriske или сам Asterisk
From: "771700" <sip:admin@192.168.50.109>;tag=as5226944e Contact: <sip:admin@192.168.50.109:5060>
«подставляет» логин «admin» вместо того реального Calling Party Number…..
Получается все звонки «наружу» в PSTN идут от имени «admin», за которым сам Asterisk «прячет» своих абонентов.…
Что бы это значило…
………………………………………………………………..
Правда не учёл ещё вот это:
«Если имя пользователя задано в параметре fromuser, при отправке вы-зова поставщику меняются поля From:(От:) и Contact:(Контакт:) сообщения INVITE. Этого может требовать сам поставщик, если он использует эти поля в процедуре аутентификации. »
из книжки Asterisk: Будущее телефонии . (Интересная книжка)
Если в файле sip.conf место fromuser указать user
Надо попробовать……..
-----------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------
И ещё есть вопрос по регистрации.
Я так понимаю что AS5350 регистрируется на Asteriske с логином и паролем:
sip-ua
authentication username admin password pass
тут вроде понятно. и при этом всё работает, не считая вышеуказанной проблемы с Calling Party Number.
Тогда кто эти персонажи;……….
registrar ipv4:192.168.50.119 expires 3600
sip-server ipv4:192.168.50.109
registrar - это тот кто регистрируется ?? в данном случае сам AS5350 - с ip=192.168.50.119 или тот кто регистрирует т.е Asterisk c ip=192.168.50.109
sip-server - с этим вроде бы ясно…, мы прописываем на AS5350 адрес сервера где будем получать услуги, в нашем случае адреса Asterisk и сервера совпадают. 192.168.50.109 .
Обратимся к книжке Asterisk: Будущее телефонии .
«Теперь в разделе [general]файла sip.conf требуется задать один дополнительный параметр: register. register (реестр) укажет поставщику
сервисов, куда направлять адресованные нам вызовы. Так Asterisk
говорит поставщику сервисов: «Эй! Если ты получил вызов ко мне,
пошли его на IP-адрес 10.251.55.100». Параметр register имеет следующий вид:
register => имяпользователя:секрет@мой.поставщик_сервисов.tld»
Вот я и пишу в sip.conf
register => admin:pass@192.168.50.119
если я на Asteriske, то поставщик услуг и шлюз это и есть AS5350 …
и получаю вот это.
- Код: Выделить всё
4 sip peers [Monitored: 0 online, 0 offline Unmonitored: 4 online, 0 offline]
[Jan 12 08:17:33] NOTICE[2030]: chan_sip.c:15099 sip_reg_timeout: -- Registration for 'admin@192.168.50.119' timed out, trying again (Attempt #2)
-- Got SIP response 503 "Service Unavailable" back from 192.168.50.119:5060
[Jan 12 08:17:53] NOTICE[2030]: chan_sip.c:15099 sip_reg_timeout: -- Registration for 'admin@192.168.50.119' timed out, trying again (Attempt #3)
-- Got SIP response 503 "Service Unavailable" back from 192.168.50.119:5060
[Jan 12 08:18:13] NOTICE[2030]: chan_sip.c:15099 sip_reg_timeout: -- Registration for 'admin@192.168.50.119' timed out, trying again (Attempt #4)
-- Got SIP response 503 "Service Unavailable" back from 192.168.50.119:5060
[Jan 12 08:18:33] NOTICE[2030]: chan_sip.c:15099 sip_reg_timeout: -- Registration for 'admin@192.168.50.119' timed out, trying again (Attempt #5)
-- Got SIP response 503 "Service Unavailable" back from 192.168.50.119:5060
[Jan 12 08:18:53] NOTICE[2030]: chan_sip.c:15099 sip_reg_timeout: -- Registration for 'admin@192.168.50.119' timed out, trying again (Attempt #6)
-- Got SIP response 503 "Service Unavailable" back from 192.168.50.119:5060
[Jan 12 08:19:13] NOTICE[2030]: chan_sip.c:15099 sip_reg_timeout: -- Registration for 'admin@192.168.50.119' timed out, trying again (Attempt #7)
=
Поэтому строка
;register => admin:pass@192.168.50.119
у меня закомментирована.....