Схема такая: [analog phone] <---> {m200} <--e1--> {cisco} <---> {*} <---> [ip phone] Настройки из sip.conf для cisco ---------------------- [cisco] context=pstn-incoming type=friend host=192.168.11.120 insecure=very dtmfmode=rfc2833 allow=all ---------------------- для ip phone. Номер 214059 ------------------------- [214059] context=local-phones type=friend username=214059 secret=214214 host=dynamic ------------------------- настройки из extensions.conf ------------------------- [bogon-calls] include => lan-phones exten => _9.,2,Congestion [pstn-incoming] include => lan-phones [local-phones] include => pstn-outbound include => lan-phones [pstn-outbound] exten => _9.,1,Dial(SIP/${EXTEN:1}@cisco,20) exten => _9.,2,Congestion [lan-phones] exten => 214059,1,Dial(SIP/214059,20) exten => 214059,2,Hangup ------------------------- Звонок с analog phone (214020) на ip phone (214059) работает. Пробуем позвонить с ip phone (214059) на analog phone (214020) при это в логах вот что: на циску пакеты даже не уходят (на машине с * запущен tcpdump) *************************************************************** <--- SIP read from 192.168.11.123:5060 ---> REGISTER sip:192.168.11.124 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK443738D0 CSeq: 3361 REGISTER To: Expires: 900 From: Call-ID: 1193929882@192.168.11.123 Content-Length: 0 User-Agent: kphone/4.2 Event: registration Allow-Events: presence Contact: ;methods="INVITE, MESSAGE, INFO, SUBSCRIBE, OPTIONS, BYE, CANCEL, NOTIFY, ACK, REFER" <-------------> --- (12 headers 0 lines) --- Using latest REGISTER request as basis request Sending to 192.168.11.123 : 5060 (no NAT) <--- Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK443738D0;received=192.168.11.123 From: To: Call-ID: 1193929882@192.168.11.123 CSeq: 3361 REGISTER User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 <------------> <--- Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK443738D0;received=192.168.11.123 From: To: ;tag=as0a53f2fa Call-ID: 1193929882@192.168.11.123 CSeq: 3361 REGISTER User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="16552637" Content-Length: 0 <------------> Scheduling destruction of SIP dialog '1193929882@192.168.11.123' in 32000 ms (Method: REGISTER) <--- SIP read from 192.168.11.123:5060 ---> REGISTER sip:192.168.11.124 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK7C8CBE93 CSeq: 3362 REGISTER To: Authorization: Digest username="214059", realm="asterisk", nonce="16552637", uri="sip:192.168.11.124", cnonce="abcdefghi", nc=00000001, response="2b0aa4d4f308cae79e183370891fd896", opaque="", algorithm="MD5" Expires: 900 From: Call-ID: 1193929882@192.168.11.123 Content-Length: 0 User-Agent: kphone/4.2 Event: registration Allow-Events: presence Contact: ;methods="INVITE, MESSAGE, INFO, SUBSCRIBE, OPTIONS, BYE, CANCEL, NOTIFY, ACK, REFER" <-------------> --- (13 headers 0 lines) --- Using latest REGISTER request as basis request Sending to 192.168.11.123 : 5060 (no NAT) <--- Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK7C8CBE93;received=192.168.11.123 From: To: Call-ID: 1193929882@192.168.11.123 CSeq: 3362 REGISTER User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 <------------> -- Registered SIP '214059' at 192.168.11.123 port 5060 expires 900 -- Saved useragent "kphone/4.2" for peer 214059 <--- Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK7C8CBE93;received=192.168.11.123 From: To: ;tag=as0a53f2fa Call-ID: 1193929882@192.168.11.123 CSeq: 3362 REGISTER User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Expires: 900 Contact: ;expires=900 Date: Thu, 05 Jul 2007 08:58:52 GMT Content-Length: 0 <------------> Scheduling destruction of SIP dialog '1193929882@192.168.11.123' in 32000 ms (Method: REGISTER) <--- SIP read from 192.168.11.123:5060 ---> INVITE sip:9214020@192.168.11.124 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK71DAC439 CSeq: 1580 INVITE To: Content-Type: application/sdp From: ;tag=549EF8FC Call-ID: 659162755@192.168.11.123 Subject: sip:214059@192.168.11.124 Content-Length: 232 User-Agent: kphone/4.2 Contact: v=0 o=username 0 0 IN IP4 192.168.11.123 s=The Funky Flow c=IN IP4 192.168.11.123 t=0 0 m=audio 32864 RTP/AVP 0 97 8 3 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:97 iLBC/8000 a=fmtp:97 mode=30 <-------------> --- (11 headers 11 lines) --- Sending to 192.168.11.123 : 5060 (no NAT) Using INVITE request as basis request - 659162755@192.168.11.123 <--- Reliably Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 407 Proxy Authentication Required Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK71DAC439;received=192.168.11.123 From: ;tag=549EF8FC To: ;tag=as219d6edd Call-ID: 659162755@192.168.11.123 CSeq: 1580 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="545a29e9" Content-Length: 0 <------------> Scheduling destruction of SIP dialog '659162755@192.168.11.123' in 32000 ms (Method: INVITE) Found user '214059' <--- SIP read from 192.168.11.123:5060 ---> ACK sip:9214020@192.168.11.124 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK71DAC439 CSeq: 1580 ACK To: ;tag=as219d6edd From: ;tag=549EF8FC Call-ID: 659162755@192.168.11.123 Content-Length: 0 User-Agent: kphone/4.2 Contact: <-------------> --- (9 headers 0 lines) --- <--- SIP read from 192.168.11.123:5060 ---> INVITE sip:9214020@192.168.11.124 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK57360059 CSeq: 1581 INVITE To: Proxy-Authorization: Digest username="214059", realm="asterisk", nonce="545a29e9", uri="sip:9214020@192.168.11.124", cnonce="abcdefghi", nc=00000001, response="fd2f2499de32b7693801f473604d3ef1", opaque="", algorithm="MD5" Content-Type: application/sdp From: ;tag=549EF8FC Call-ID: 659162755@192.168.11.123 Subject: sip:214059@192.168.11.124 Content-Length: 232 User-Agent: kphone/4.2 Contact: v=0 o=username 0 0 IN IP4 192.168.11.123 s=The Funky Flow c=IN IP4 192.168.11.123 t=0 0 m=audio 32864 RTP/AVP 0 97 8 3 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:97 iLBC/8000 a=fmtp:97 mode=30 <-------------> --- (12 headers 11 lines) --- Sending to 192.168.11.123 : 5060 (no NAT) Using INVITE request as basis request - 659162755@192.168.11.123 Found user '214059' Found RTP audio format 0 Found RTP audio format 97 Found RTP audio format 8 Found RTP audio format 3 Peer audio RTP is at port 192.168.11.123:32864 Found description format PCMU for ID 0 Found description format GSM for ID 3 Found description format PCMA for ID 8 Found description format iLBC for ID 97 Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x40e (gsm|ulaw|alaw|ilbc)/video=0x0 (nothing), combined - 0xe (gsm|ulaw|alaw) Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing) Peer audio RTP is at port 192.168.11.123:32864 Looking for 9214020 in local-phones (domain 192.168.11.124) list_route: hop: <--- Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK57360059;received=192.168.11.123 From: ;tag=549EF8FC To: Call-ID: 659162755@192.168.11.123 CSeq: 1581 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 <------------> -- Executing [9214020@local-phones:1] Dial("SIP/214059-0820dab8", "SIP/214020@cisco|20") in new stack Audio is at 192.168.11.124 port 10868 Adding codec 0x4 (ulaw) to SDP Adding codec 0x2 (gsm) to SDP Adding codec 0x8 (alaw) to SDP Adding codec 0x10 (g726aal2) to SDP Adding codec 0x20 (adpcm) to SDP Adding codec 0x40 (slin) to SDP Adding codec 0x80 (lpc10) to SDP Adding codec 0x400 (ilbc) to SDP Adding codec 0x800 (g726) to SDP Adding non-codec 0x1 (telephone-event) to SDP Reliably Transmitting (no NAT) to 192.168.11.120:5060: INVITE sip:214020@192.168.11.120 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.124:5060;branch=z9hG4bK0b6b4987;rport From: "214059" ;tag=as59330d19 To: Contact: Call-ID: 2559adbd47880cf343a170534a4c68ab@192.168.11.124 CSeq: 102 INVITE User-Agent: Asterisk PBX Max-Forwards: 70 Date: Thu, 05 Jul 2007 08:58:57 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Content-Type: application/sdp Content-Length: 473 v=0 o=root 4851 4851 IN IP4 192.168.11.124 s=session c=IN IP4 192.168.11.124 t=0 0 m=audio 10868 RTP/AVP 0 3 8 112 5 10 7 97 111 101 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:112 AAL2-G726-32/8000 a=rtpmap:5 DVI4/8000 a=rtpmap:10 L16/8000 a=rtpmap:7 LPC/8000 a=rtpmap:97 iLBC/8000 a=fmtp:97 mode=30 a=rtpmap:111 G726-32/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - a=ptime:20 a=sendrecv --- -- Called 214020@cisco <--- SIP read from 192.168.11.120:5060 ---> SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.11.124:5060;branch=z9hG4bK0b6b4987;rport From: "214059" ;tag=as59330d19 To: ;tag=4C96F2D1-127A Date: Thu, 05 Jul 2007 08:58:47 GMT Call-ID: 2559adbd47880cf343a170534a4c68ab@192.168.11.124 Server: Cisco-SIPGateway/IOS-12.x CSeq: 102 INVITE Allow-Events: telephone-event Content-Length: 0 <-------------> --- (10 headers 0 lines) --- <--- SIP read from 192.168.11.120:5060 ---> SIP/2.0 404 Not Found Via: SIP/2.0/UDP 192.168.11.124:5060;branch=z9hG4bK0b6b4987;rport From: "214059" ;tag=as59330d19 To: ;tag=4C96F2D1-127A Date: Thu, 05 Jul 2007 08:58:47 GMT Call-ID: 2559adbd47880cf343a170534a4c68ab@192.168.11.124 Server: Cisco-SIPGateway/IOS-12.x CSeq: 102 INVITE Allow-Events: telephone-event Content-Length: 0 <-------------> --- (10 headers 0 lines) --- Transmitting (no NAT) to 192.168.11.120:5060: ACK sip:214020@192.168.11.120 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.124:5060;branch=z9hG4bK0b6b4987;rport From: "214059" ;tag=as59330d19 To: ;tag=4C96F2D1-127A Contact: Call-ID: 2559adbd47880cf343a170534a4c68ab@192.168.11.124 CSeq: 102 ACK User-Agent: Asterisk PBX Max-Forwards: 70 Content-Length: 0 --- -- SIP/cisco-08212870 is circuit-busy == Everyone is busy/congested at this time (1:0/1/0) -- Executing [9214020@local-phones:2] Congestion("SIP/214059-0820dab8", "") in new stack <--- Transmitting (no NAT) to 192.168.11.123:5060 ---> SIP/2.0 503 Service Unavailable Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK57360059;received=192.168.11.123 From: ;tag=549EF8FC To: ;tag=as38a39c3c Call-ID: 659162755@192.168.11.123 CSeq: 1581 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 X-Asterisk-HangupCause: Unallocated (unassigned) number X-Asterisk-HangupCauseCode: 1 <------------> == Spawn extension (local-phones, 9214020, 2) exited non-zero on 'SIP/214059-0820dab8' <--- SIP read from 192.168.11.123:5060 ---> ACK sip:9214020@192.168.11.124 SIP/2.0 Via: SIP/2.0/UDP 192.168.11.123;branch=z9hG4bK57360059 CSeq: 1581 ACK To: ;tag=as38a39c3c From: ;tag=549EF8FC Call-ID: 659162755@192.168.11.123 Content-Length: 0 User-Agent: kphone/4.2 Contact: <-------------> --- (9 headers 0 lines) --- Really destroying SIP dialog '2559adbd47880cf343a170534a4c68ab@192.168.11.124' Method: INVITE Really destroying SIP dialog '659162755@192.168.11.123' Method: ACK *********************************************************************************************