Den 15.04.2010 13:27, skrev Klaus Darilion:
How would you
have written it?
I prefer this logic:
...
if (loose_route()) {
if (!has_totag()) {
xlog("L_WARN","$ci loose_route request without to-tag, 403...\n");
sl_send_reply("403", "out-of-dialog loose_route not allowed");
exit;
}
... loose..route..processing
... NAT traversal...rtpproxy....
t_relay();
}
...
initial call setup ...
...
Nice :)
Trace the scenario with ngrep and take a look at the
SDPs if they are
rewritten properly.
I'm not able to spot any errors, the only error I'm able to see is that
it seems to work one way.
If A sends a fax to B
This works with T.38:
asterisk A <-> sipprovider <-> our trunk <-> kamailio/rtpp <->
asterisk
<-> asterisk B (our asterisk)
This fails with T.38, but works with G.711:
asterisk B -> asterisk -> kamailio/rtpp -> our trunk -> asterisk ->
asterisk A
Could also be an Asterisk (A: 1.6.2.5/tested with 1.6.2.7rc, B: 1.6.2.6)
or FFA bug. But if I try to send the FAX directly via SIP from A <-> B
without the proxy everything works OK, so therefore I believe the
problem are related to my kamailio configuration.
Post the ngrep dump of the 2 different processes.
I have been debugging this problem little bit more. The re-invite test
showed precisely the same with x-lite on hold as
with t.38 re-invite.
If I call out and place a call on hold, I'm able to continue the call
for about 20 seconds until the call was aborted. If
I call into the same extension there are no problems to continue the
call after "on hold". So just as the fax, the problem
only occurs for outgoing calls, not inbound. I also tested with a
cellular phone, just to eliminate the other end.
Here are some ncat captures of the t.38 scenario that fails.
ASTERISK B:
#############################################################################################################################$
U PUBLIC-IP-TO-PROXY:5060 -> IP-TO-ASTERISK:5060
INVITE sip:FAXNUMBER@IP-TO-ASTERISK:5060 SIP/2.0..Via: SIP/2.0/UDP
PUBLIC-IP-TO-PROXY;branch=z9hG4bK61a.7e6809b3.0..Vi
a: SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B5afc10d34f983f6e..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02b1
6fe7..To: "FAX"
<sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as56fa57a3..Call-ID:
15180894487146a33b3f3bac366bc0bb@PUBLIC-IP-TO-PROXY
..CSeq: 17055 INVITE..Max-Forwards: 70..Allow:
INVITE,ACK,CANCEL,BYE,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDAT
E,OPTIONS,MESSAGE,PUBLISH..Accept: application/sdp, application/isup,
application/dtmf, application/dtmf-relay,
multipart/mixed..Contact:
<sip:SENDTONUMBER@IP-TO-SONUS-TRUNK:5060>..Supported:
timer..Session-Expires: 1800;refresher=uas.
.Min-SE: 90..Content-Length: 323..Content-Disposition: session;
handling=required..Content-Type: application/sdp
....v=0..o=Sonus_UAC 23586 20272 IN IP4 IP-TO-SONUS-TRUNK..s=SIP
Media Capabilities..c=IN IP4 PUBLIC-IP-TO-PROXY..t=0 0..m=
image 35298 udptl
t38..a=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxM
axBuffer:262..a=T38FaxMaxDatagram:176..a=T38FaxUdpEC:t38UDPRedundancy..a=sendrecv..a=nortpproxy:yes..
###
U IP-TO-ASTERISK:5060 -> PUBLIC-IP-TO-PROXY:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP
PUBLIC-IP-TO-PROXY;branch=z9hG4bK61a.7e6809b3.0;received=PUBLIC-IP-TO-PROXY..Via:
SIP/2.
0/UDP IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B5afc10d34f983f6e..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02b16fe7..To:
"FAX" <sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as56fa57a3..Call-ID:
15180894487146a33b3f3bac366bc0bb@PUBLIC-IP-TO-PROXY..CS
eq: 17055 INVITE..Server: Asterisk PBX 1.6.2.6..Allow: INVITE, ACK,
CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIF
Y, INFO..Supported: replaces, timer..Require: timer..Session-Expires:
1800;refresher=uas..Contact: <sip:FAXNUMBER@
IP-TO-ASTERISK>..Content-Type: application/sdp..Content-Length:
276....v=0..o=root 1138957066 1138957067 IN IP4 IP-TO-ASTERISK
..s=Asterisk PBX 1.6.2.6..c=IN IP4 IP-TO-ASTERISK..t=0 0..m=image
4400 udptl t38..a=T38FaxVersion:0.
.a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxDatagram:1400..a=T38FaxUdpEC:t38UDPRedu
ndancy..
#############################################################################################################################$
KAMAILIO PROXY ETH0:
U PUBLIC-IP-TO-PROXY:5060 -> IP-TO-ASTERISK:5060
INVITE sip:FAXNUMBER@IP-TO-ASTERISK:5060 SIP/2.0..Via: SIP/2.0/UDP
PUBLIC-IP-TO-PROXY;branch=z9hG4bK6d41.d083efb2.0..Via: SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B44d12570046e38f1..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02ec0fad.
.To: "FAX"
<sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as6196c897..Call-ID:
58b69aef10209bf30e38c5371ebb29cf@PUBLIC-IP-TO-PROXY..CSeq: 15775
INVITE..Max-Forwards: 70..Allow:
INVITE,ACK,CANCEL,BYE,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,M
ESSAGE,PUBLISH..Accept: application/sdp, application/isup,
application/dtmf, application/dtmf-relay, multipart/mixed..Contact:
<sip:SENDTONUMBER@IP-TO-SONUS-TRUNK:5060>..Supported:
timer..Session-Expires: 1800;refresher=uas..Min-SE: 90..Cont
ent-Length: 322..Content-Disposition: session;
handling=required..Content-Type: application/sdp....v=0..o=Sonus_UAC
9775 15421 IN IP4 IP-TO-SONUS-TRUNK..s=SIP Media Capabilities..c=IN IP4
PUBLIC-IP-TO-PROXY..t=0 0..m=image 35292 udptl t38..a
=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxBuffer:262..a=T38FaxMaxDatagram:176..a=T38FaxUdpEC:t38UDPRedundancy..a=sendrecv..a=nortpproxy:yes..
###
U IP-TO-ASTERISK:5060 -> PUBLIC-IP-TO-PROXY:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP
PUBLIC-IP-TO-PROXY;branch=z9hG4bK6d41.d083efb2.0;received=PUBLIC-IP-TO-PROXY..Via:
SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B44d12570046e38f1..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02ec0fad..To: "FAX
" <sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as6196c897..Call-ID:
58b69aef10209bf30e38c5371ebb29cf@PUBLIC-IP-TO-PROXY..CSeq: 15775
INVITE..Server: Asterisk PBX 1.6.2.6..Allow: INVITE, ACK, CANCEL,
OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO..Su
pported: replaces, timer..Require: timer..Session-Expires:
1800;refresher=uas..Contact:
<sip:FAXNUMBER@IP-TO-ASTERISK>..Content-Type:
application/sdp..Content-Length: 276....v=0..o=root 1675681328
1675681329 IN IP4 IP-TO-ASTERISK..s=
Asterisk PBX 1.6.2.6..c=IN IP4 IP-TO-ASTERISK..t=0 0..m=image 4852
udptl
t38..a=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxDatagram:1400..a=T38FaxUdpEC:t38UDPRedundancy..
KAMAILIO PROXY ETH1:
U IP-TO-SONUS-TRUNK:5060 -> LOCAL-IP-TO-PROXY:5060
INVITE sip:FAXNUMBER@IP-TO-ASTERISK:5060 SIP/2.0..Via: SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B48cc1116e608d4ed..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02f86d27..To: "FAX"
<sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as279d4a05..Call-I
D: 101766785455b9020d350d300cb15082@PUBLIC-IP-TO-PROXY..CSeq: 24873
INVITE..Max-Forwards: 70..Allow:
INVITE,ACK,CANCEL,BYE,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH..Accept:
application/sdp, application/isup, appl
ication/dtmf, application/dtmf-relay, multipart/mixed..Contact:
<sip:SENDTONUMBER@IP-TO-SONUS-TRUNK:5060>..Route:
<sip:LOCAL-IP-TO-PROXY:5060;r2=on;lr;ftag=as279d4a05>..Route:
<sip:PUBLIC-IP-TO-PROXY:5060;r2=on;lr;ftag=as279d4a05>..Supported: timer..
Session-Expires: 1800;refresher=uas..Min-SE: 90..Content-Length:
301..Content-Disposition: session; handling=required..Content-Type:
application/sdp....v=0..o=Sonus_UAC 18853 20363 IN IP4
IP-TO-SONUS-TRUNK..s=SIP Media Capabilities..c=IN
IP4 RTP-IP-TO-SONUSTRUNK..t=0 0..m=image 7994 udptl
t38..a=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxBuffer:262..a=T38FaxMaxDatagram:176..a=T38FaxUdpEC:t38UDPRedundancy..a=sendrecv..
####
U LOCAL-IP-TO-PROXY:5060 -> IP-TO-SONUS-TRUNK:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B48cc1116e608d4ed..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02f86d27..To: "FAX"
<sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as279d4a05..Call-ID:
101766785455b9020d350d300cb150
82@PUBLIC-IP-TO-PROXY..CSeq: 24873 INVITE..Server: Asterisk PBX
1.6.2.6..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE,
NOTIFY, INFO..Supported: replaces, timer..Require:
timer..Session-Expires: 1800;refresher=uas..Contact:
<sip:FAXNUMBER@IP-TO-ASTERISK>..Content-Type:
application/sdp..Content-Length: 293....v=0..o=root 1135418376
1135418377 IN IP4 IP-TO-ASTERISK..s=Asterisk PBX 1.6.2.6..c=IN IP4
LOCAL-IP-TO-PROXY..t=0 0..m=image 35324 udptl t38..a=T38FaxVe
rsion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxDatagram:1400..a=T38FaxUdpEC:t38UDPRedundancy..a=nortpproxy:yes..
U IP-TO-SONUS-TRUNK:5060 -> LOCAL-IP-TO-PROXY:5060
INVITE sip:FAXNUMBER@IP-TO-ASTERISK:5060 SIP/2.0..Via: SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B48cc1116e608d4ed..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02f86d27..To: "FAX"
<sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as279d4a05..Call-I
D: 101766785455b9020d350d300cb15082@PUBLIC-IP-TO-PROXY..CSeq: 24873
INVITE..Max-Forwards: 70..Allow:
INVITE,ACK,CANCEL,BYE,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH..Accept:
application/sdp, application/isup, appl
ication/dtmf, application/dtmf-relay, multipart/mixed..Contact:
<sip:SENDTONUMBER@IP-TO-SONUS-TRUNK:5060>..Route:
<sip:LOCAL-IP-TO-PROXY:5060;r2=on;lr;ftag=as279d4a05>..Route:
<sip:PUBLIC-IP-TO-PROXY:5060;r2=on;lr;ftag=as279d4a05>..Supported: timer..
Session-Expires: 1800;refresher=uas..Min-SE: 90..Content-Length:
301..Content-Disposition: session; handling=required..Content-Type:
application/sdp....v=0..o=Sonus_UAC 18853 20363 IN IP4
IP-TO-SONUS-TRUNK..s=SIP Media Capabilities..c=IN
IP4 RTP-IP-TO-SONUSTRUNK..t=0 0..m=image 7994 udptl
t38..a=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxBuffer:262..a=T38FaxMaxDatagram:176..a=T38FaxUdpEC:t38UDPRedundancy..a=sendrecv..
####
U LOCAL-IP-TO-PROXY:5060 -> IP-TO-SONUS-TRUNK:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP
IP-TO-SONUS-TRUNK:5060;branch=z9hG4bK02B48cc1116e608d4ed..From:
<sip:SENDTONUMBER@PUBLIC-IP-TO-PROXY>;tag=gK02f86d27..To: "FAX"
<sip:FAXNUMBER@PUBLIC-IP-TO-PROXY>;tag=as279d4a05..Call-ID:
101766785455b9020d350d300cb150
82@PUBLIC-IP-TO-PROXY..CSeq: 24873 INVITE..Server: Asterisk PBX
1.6.2.6..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE,
NOTIFY, INFO..Supported: replaces, timer..Require:
timer..Session-Expires: 1800;refresher=uas..Contact:
<sip:FAXNUMBER@IP-TO-ASTERISK>..Content-Type:
application/sdp..Content-Length: 293....v=0..o=root 1135418376
1135418377 IN IP4 IP-TO-ASTERISK..s=Asterisk PBX 1.6.2.6..c=IN IP4
LOCAL-IP-TO-PROXY..t=0 0..m=image 35324 udptl t38..a=T38FaxVe
rsion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxDatagram:1400..a=T38FaxUdpEC:t38UDPRedundancy..a=nortpproxy:yes..
ASTERISK A:
(REMOTE TESTSITE CONNECTED TO PHONZO, ONE PROVIDER KNOWN TO PROVIDE
FUNCTIONING T.38 SERVICES)
########################
U ASTERISK-TESTSITE-IP:5060 -> 80.232.37.178:5060
INVITE sip:80.232.37.178:5061 SIP/2.0..Via: SIP/2.0/UDP
85.165.146.221:5060;branch=z9hG4bK7726391b;rport..Route: <sip:80.232.37
.178;ftag=b1ae9fe1eb7f13837782c9061d653c57;lr>..Max-Forwards:
70..From: <sip:47SENDTONUMBER@80.232.37.178>;tag=as61e4a63c..To: 6970
8347
<sip:FAXNUMBER@80.232.37.178>;tag=b1ae9fe1eb7f13837782c9061d653c57..Contact:
<sip:SENDTONUMBER@85.165.146.221>..Call-ID: 3D1965
63-47C711DF-AC2A9E0C-AB1DB137@80.232.37.179..CSeq: 102
INVITE..User-Agent: none..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFE
R, SUBSCRIBE, NOTIFY, INFO..Supported: replaces, timer..Content-Type:
application/sdp..Content-Length: 268....v=0..o=root 10588
12562 1058812563 IN IP4 85.165.146.221..s=Asterisk PBX 1.6.2.5..c=IN
IP4 85.165.146.221..t=0 0..m=image 4810 udptl t38..a=T38Fa
xVersion:0..a=T38MaxBitRate:14400..a=T38FaxRateManagement:transferredTCF..a=T38FaxMaxDatagram:849..a=T38FaxUdpEC:t38UDPFEC..
######
U 80.232.37.178:5060 -> ASTERISK-TESTSITE-IP:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP
85.165.146.221:5060;branch=z9hG4bK7726391b;rport=5060..Record-Route:
<sip:80.232.37.178;ftag=a
s61e4a63c;lr>..From:
<sip:47SENDTONUMBER@80.232.37.178>;tag=as61e4a63c..To: FAXNUMBER
<sip:FAXNUMBER@80.232.37.178>;tag=b1ae9fe1eb7f1
3837782c9061d653c57..Call-ID:
3D196563-47C711DF-AC2A9E0C-AB1DB137@80.232.37.179..CSeq: 102
INVITE..Server: Sippy..Contact: Anon
ymous <sip:80.232.37.178:5061>..Content-Length: 220..Content-Type:
application/sdp....v=0..o=Sippy 144528972 1 IN IP4 80.232.37
.178..s=SIP Call..t=0 0..m=image 17772 udptl t38..c=IN IP4
80.232.37.179..a=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxRat
eManagement:transferredTCF..a=T38FaxMaxDatagram:72..