Addendum to P1->P3 situation:
It may be not that clear, but I have successfully make the call, but I have no audio and I keep getting ICMP port unreachable for rtp packets…
As for P3->P1:
when calling P1 from P3 I use it just like you have written.
(note that P1 has number 3066)
exten => 3066,1,Dial(SIP/avaya.proxy/3066)
This is cli output
== Using SIP RTP CoS mark 5
-- Executing [3066@users:1] Dial("SIP/p3-0074db00", "SIP/avaya.proxy/3066") in new stack
== Using SIP RTP CoS mark 5
-- Called avaya.proxy/3066
-- SIP/avaya.proxy-00751ec0 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
-- Auto fallthrough, channel 'SIP/p3-0074db00' status is 'CONGESTION'
And here is the SIP debug P3->P1
<--- SIP read from UDP://192.168.26.9:5060 --->
INVITE sip:3066@192.168.26.12 SIP/2.0
Via: SIP/2.0/UDP 192.168.26.9;branch=z9hG4bKc0a81a090000014747fc932b000063e90000007b;rport
From: "unknown" <sip:p3@192.168.26.12>;tag=55309f16de
To: <sip:3066@192.168.26.12>
Contact: <sip:p3@192.168.26.9>
Call-ID: 2063629B03BC49A1A4D375410EAD29620xc0a81a09
CSeq: 1 INVITE
Max-Forwards: 70
User-Agent: SJphone/1.65.377a (SJ Labs)
Content-Length: 247
Content-Type: application/sdp
Supported: replaces,norefersub,timer
v=0
o=- 3416723883 3416723883 IN IP4 192.168.26.9
s=SJphone
c=IN IP4 192.168.26.9
t=0 0
m=audio 49170 RTP/AVP 0 101
c=IN IP4 192.168.26.9
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=setup:active
a=sendrecv
<------------->
<--- Transmitting (no NAT) to 192.168.26.9:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.26.9;branch=z9hG4bKc0a81a090000014747fc932b000063e90000007b;received=192.168.26.9;rport=5060
From: "unknown" <sip:p3@192.168.26.12>;tag=55309f16de
To: <sip:3066@192.168.26.12>
Call-ID: 2063629B03BC49A1A4D375410EAD29620xc0a81a09
CSeq: 1 INVITE
User-Agent: Asterisk PBX 1.6.0-beta4
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
Contact: <sip:3066@192.168.26.12>
Content-Length: 0
<------------>
<------------>
Reliably Transmitting (no NAT) to 147.x.x.43:5060:
INVITE sip:3066@147.x.x.43 SIP/2.0
Via: SIP/2.0/UDP 81.x.x.93:5060;branch=z9hG4bK7c99d412;rport
Max-Forwards: 70
From: "VoIP Phone no.3" <sip:p3@81.x.x.93>;tag=as23dc4156
To: <sip:3066@147.x.x.43>
Contact: <sip:p3@81.x.x.93>
Call-ID: 3534744d0d7e0b7c4e61d3c774d1ee85@81.x.x.93
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.0-beta4
Date: Wed, 09 Apr 2008 09:58:50 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 518
v=0
o=root 389775737 389775737 IN IP4 81.x.x.93
s=Asterisk PBX 1.6.0-beta4
c=IN IP4 81.x.x.93
t=0 0
m=audio 16554 RTP/AVP 0 3 8 112 5 10 7 97 111 9 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:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
<------------>
<--- SIP read from UDP://147.x.x.43:32870 --->
SIP/2.0 100 Trying
From: "VoIP Phone no.3" <sip:p3@81.x.x.93>;tag=as23dc4156
To: <sip:3066@147.x.x.43>
Call-ID: 3534744d0d7e0b7c4e61d3c774d1ee85@81.x.x.93
CSeq: 102 INVITE
Via: SIP/2.0/UDP 81.x.x.93:5060;received=81.x.x.93;branch=z9hG4bK7c99d412;rport=5060
Content-Length: 0
Organization: vutbr.cz
Server: Avaya SIP Enablement Services
<------------->
<--- SIP read from UDP://147.x.x.43:32870 --->
SIP/2.0 404 User Not Found
From: "VoIP Phone no.3" <sip:p3@81.x.x.93>;tag=as23dc4156
To: <sip:3066@147.x.x.43>;tag=774507390C57466DB59145DB29B863DF1207735083230310
Call-ID: 3534744d0d7e0b7c4e61d3c774d1ee85@81.x.x.93
CSeq: 102 INVITE
Via: SIP/2.0/UDP 81.x.x.93:5060;received=81.x.x.93;branch=z9hG4bK7c99d412;rport=5060
Content-Length: 0
Organization: vutbr.cz
Server: Avaya SIP Enablement Services
And here for comparison SIP debug from wireshark of P2->P1 that is working (P1 has number 3066 and P2 has 3077)
Request-Line: INVITE sip:3066@avaya.proxy SIP/2.0
Message Header
Via: SIP/2.0/UDP 81.x.x.86;branch=z9hG4bK51130a560000108b47fc9c5a00005e4100000434;rport
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>
Contact: <sip:3077@81.x.x.86>
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 1 INVITE
Max-Forwards: 70
User-Agent: SJphone/1.65.377a (SJ Labs)
Content-Length: 363
Content-Type: application/sdp
Supported: replaces,norefersub,timer
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 3416726234 3416726234 IN IP4 81.x.x.86
Session Name (s): SJphone
Connection Information (c): IN IP4 81.x.x.86
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 49162 RTP/AVP 3 97 98 8 0 101
Connection Information (c): IN IP4 81.x.x.86
Media Attribute (a): rtpmap:3 GSM/8000
Media Attribute (a): rtpmap:97 iLBC/8000
Media Attribute (a): rtpmap:98 iLBC/8000
Media Attribute (a): fmtp:98 mode=20
Media Attribute (a): rtpmap:8 PCMA/8000
Media Attribute (a): rtpmap:0 PCMU/8000
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): fmtp:101 0-16
Media Attribute (a): setup:actpass
Media Attribute (a): sendrecv
Status-Line: SIP/2.0 100 Trying
Message Header
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 1 INVITE
Via: SIP/2.0/UDP 81.x.x.86;received=81.x.x.86;branch=z9hG4bK51130a560000108b47fc9c5a00005e4100000434;rport=5060
Content-Length: 0
Organization: avaya.proxy
Server: Avaya SIP Enablement Services
Status-Line: SIP/2.0 407 Proxy Authentication Required
Message Header
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>;tag=774507390C57466DB59145DB29B863DF1207737952230532
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 1 INVITE
Via: SIP/2.0/UDP 81.x.x.86;received=81.x.x.86;branch=z9hG4bK51130a560000108b47fc9c5a00005e4100000434;rport=5060
Content-Length: 0
Proxy-Authenticate: Digest realm="avaya.proxy",domain="avaya.proxy",nonce="MTIwNzczNzk1MjpTREZTZXJ2ZXJTZWNyZXRLZXk6MTM1OTYwODI3MA==",algorithm=MD5
Server: Avaya SIP Enablement Services
Organization: avaya.proxy
Request-Line: ACK sip:3066@avaya.proxy SIP/2.0
Message Header
Via: SIP/2.0/UDP 81.x.x.86;branch=z9hG4bK51130a560000108b47fc9c5a00005e4100000434;rport
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>;tag=774507390C57466DB59145DB29B863DF1207737952230532
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 1 ACK
Max-Forwards: 70
User-Agent: SJphone/1.65.377a (SJ Labs)
Content-Length: 0
Request-Line: INVITE sip:3066@avaya.proxy SIP/2.0
Message Header
Via: SIP/2.0/UDP 81.x.x.86;branch=z9hG4bK51130a560000108c47fc9c5a00005b8b00000437;rport
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>
Contact: <sip:3077@81.x.x.86>
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 2 INVITE
Max-Forwards: 70
User-Agent: SJphone/1.65.377a (SJ Labs)
Content-Length: 363
Content-Type: application/sdp
Supported: replaces,norefersub,timer
Proxy-Authorization: Digest username="3077",realm="avaya.proxy",nonce="MTIwNzczNzk1MjpTREZTZXJ2ZXJTZWNyZXRLZXk6MTM1OTYwODI3MA==",uri="sip:3066@avaya.proxy",response="beb6d47bcfb672060b1769767f3acea5",algorithm=MD5
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 3416726234 3416726234 IN IP4 81.x.x.86
Session Name (s): SJphone
Connection Information (c): IN IP4 81.x.x.86
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 49162 RTP/AVP 3 97 98 8 0 101
Connection Information (c): IN IP4 81.x.x.86
Media Attribute (a): rtpmap:3 GSM/8000
Media Attribute (a): rtpmap:97 iLBC/8000
Media Attribute (a): rtpmap:98 iLBC/8000
Media Attribute (a): fmtp:98 mode=20
Media Attribute (a): rtpmap:8 PCMA/8000
Media Attribute (a): rtpmap:0 PCMU/8000
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): fmtp:101 0-16
Media Attribute (a): setup:actpass
Media Attribute (a): sendrecv
Status-Line: SIP/2.0 100 Trying
Message Header
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 2 INVITE
Via: SIP/2.0/UDP 81.x.x.86;received=81.x.x.86;branch=z9hG4bK51130a560000108c47fc9c5a00005b8b00000437;rport=5060
Content-Length: 0
Organization: avaya.proxy
Server: Avaya SIP Enablement Services
Status-Line: SIP/2.0 180 Ringing
Message Header
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>;tag=0095de5714dd1bad346db14700
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 2 INVITE
Via: SIP/2.0/UDP 81.x.x.86;received=81.x.x.86;branch=z9hG4bK51130a560000108c47fc9c5a00005b8b00000437;rport=5060
Record-Route: <sip:147.x.x.50:5061;lr;transport=tls>
Record-Route: <sip:147.x.x.43:5060;lr>
Contact: "OptimSys, 1" <sip:3066@147.x.x.50:5061;transport=tls>
P-Asserted-Identity: "OptimSys, 1" <sip:3066@avaya.proxy:5061>
Supported: 100rel,timer,replaces,join,histinfo
Allow: INVITE,CANCEL,BYE,ACK,PRACK,SUBSCRIBE,NOTIFY,REFER,OPTIONS
Server: Avaya CM/R013x.01.2.632.1
Content-Type: application/sdp
Content-Length: 171
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 1 2 IN IP4 147.x.x.50
Session Name (s): -
Connection Information (c): IN IP4 147.x.x.57
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 2252 RTP/AVP 8 101
Media Attribute (a): rtpmap:8 PCMA/8000
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): fmtp:101 0-16
Status-Line: SIP/2.0 200 OK
Message Header
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>;tag=0095de5714dd1bad346db14700
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 2 INVITE
Via: SIP/2.0/UDP 81.x.x.86;received=81.x.x.86;branch=z9hG4bK51130a560000108c47fc9c5a00005b8b00000437;rport=5060
Record-Route: <sip:147.x.x.50:5061;lr;transport=tls>
Record-Route: <sip:147.x.x.43:5060;lr>
Contact: "OptimSys, 1" <sip:3066@147.x.x.50:5061;transport=tls>
P-Asserted-Identity: "OptimSys, 1" <sip:3066@avaya.proxy:5061>
Supported: 100rel,timer,replaces,join,histinfo
Allow: INVITE,CANCEL,BYE,ACK,PRACK,SUBSCRIBE,NOTIFY,REFER,OPTIONS
Server: Avaya CM/R013x.01.2.632.1
Session-Expires: 1800;refresher=uas
Require: timer
Content-Type: application/sdp
Content-Length: 171
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 1 2 IN IP4 147.x.x.50
Session Name (s): -
Connection Information (c): IN IP4 147.x.x.57
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 2252 RTP/AVP 8 101
Media Attribute (a): rtpmap:8 PCMA/8000
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): fmtp:101 0-16
Request-Line: ACK sip:3066@147.x.x.50:5061;transport=tls SIP/2.0
Message Header
Via: SIP/2.0/UDP 81.x.x.86;branch=z9hG4bK51130a560000108c47fc9c62000001bf0000043c;rport
From: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
To: <sip:3066@avaya.proxy>;tag=0095de5714dd1bad346db14700
Contact: <sip:3077@81.x.x.86>
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 2 ACK
Max-Forwards: 70
User-Agent: SJphone/1.65.377a (SJ Labs)
Content-Length: 0
Route: <sip:147.x.x.43:5060;lr>,<sip:147.x.x.50:5061;transport=tls;lr>
Proxy-Authorization: Digest username="3077",realm="avaya.proxy",nonce="MTIwNzczNzk1MjpTREZTZXJ2ZXJTZWNyZXRLZXk6MTM1OTYwODI3MA==",uri="sip:3066@avaya.proxy",response="beb6d47bcfb672060b1769767f3acea5",algorithm=MD5
Request-Line: BYE sip:3077@81.x.x.86 SIP/2.0
Message Header
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 1 BYE
From: sip:3066@avaya.proxy;tag=0095de5714dd1bad346db14700
To: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
Via: SIP/2.0/UDP 147.x.x.43:5060;branch=z9hG4bK0313033683032383932d3a2.0,SIP/2.0/TLS 147.x.x.50;psrrposn=1;received=147.x.x.50;branch=z9hG4bK0c280ea5714dd1bdd346db14700
Content-Length: 0
Max-Forwards: 69
User-Agent: Avaya CM/R013x.01.2.632.1
Record-Route: <sip:147.x.x.43:5060;lr>
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP 147.x.x.43:5060;branch=z9hG4bK0313033683032383932d3a2.0;received=147.x.x.43,SIP/2.0/TLS 147.x.x.50;branch=z9hG4bK0c280ea5714dd1bdd346db14700;received=147.x.x.50;psrrposn=1
From: <sip:3066@avaya.proxy>;tag=0095de5714dd1bad346db14700
To: "unknown" <sip:3077@avaya.proxy>;tag=88dac737ec
Contact: <sip:3077@81.x.x.86>
Call-ID: 1880A3DF756043C6A97D8279566D0D7A0x51130a56
CSeq: 1 BYE
Content-Length: 0
Record-Route: <sip:147.x.x.43:5060;lr>
Server: SJphone/1.65.377a (SJ Labs)
Supported: replaces,norefersub,timer