[Serusers] HELP: Why does my BYE go to the wrong port?

Java Rockx javarockx at gmail.com
Mon Mar 7 22:58:23 CET 2005


Awesome!!!

Actually because I use the permissions.so module I just did this:

if (!allow_trusted() && client_nat_test("3")) {
   fix_nated_contact();
   force_rport();
}

Of course I added 10.3.0.3 to my trusted MySQL table.

Thanks again,
Paul

On Mon, 7 Mar 2005 22:47:26 +0100, Greger V. Teigre <greger at teigre.com> wrote:
> Do something like:
> if(!src_ip==10.3.0.3 && client_nat_test("3") {
> assuming 10.3.0.3 is your Cisco GW.
> g-)
> 
> Java Rockx wrote:
> > Greg,
> >
> > I am using client_nat_test("3") in the INVITE handler. Are you saying
> > that I should not be calling fix_nated_contact() because the INVITE
> > was received on a different port than what the <contact> headers
> > shows?
> >
> > How do I test for this condition in ser.cfg?
> >
> > Right now I do this (using mediaproxy)
> >
> > if (client_nat_test("3")) {
> >    force_rport();
> >    fix_nated_contact();
> > };
> >
> > lookup("aliases");
> > ...
> > lookup("location") stuff
> >
> > Regards,
> > Paul
> >
> >
> > On Mon, 7 Mar 2005 22:27:34 +0100, Greger V. Teigre
> > <greger at teigre.com> wrote:
> >> Hi Paul,
> >> You are probably doing a fix_nated_contact() on the INVITE before
> >> sending it to the Grandstream. From the second INVITE message going
> >> to
> >> 66.90.46.29:5060:
> >> Contact: <sip:4073192279 at 10.3.0.3:57687>.
> >>
> >> You should exclude the GW from INVITE NAT processing as the initial
> >> INVITE is sent from a different port than what is found in the
> >> contact.
> >> g-)
> >>
> >> Java Rockx wrote:
> >>> Hi All.
> >>>
> >>> I'm using ser-0.9 with a Cisco 5300 for PSTN access. When I call
> >>> SIP->PSTN and hang up (from either the SIP phone or PSTN phone) that
> >>> the call is torn down properly and, if the BYE message is from the
> >>> SIP phone hanging up the BYE makes it to the 5300 on port 5060.
> >>>
> >>> But when I call from the PSTN->SIP phone, and hang up the SIP phone,
> >>> the BYE message seems to be sent to the wrong port on the 5300.
> >>>
> >>> Here is a complete SIP conversation where I have hung up the SIP
> >>> phone and the final BYE message was never received at the 5300
> >>> because it should have gone to port 5060.
> >>>
> >>> Can anyone help?
> >>> Regards,
> >>> Paul
> >>>
> >>>
> >>> U 2005/03/07 15:54:21.245525 10.3.0.3:57687 -> 10.3.0.221:5060
> >>> INVITE sip:3215591422 at 10.3.0.221:5060 SIP/2.0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060.
> >>> From: <sip:4073192279 at 10.3.0.3>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>.
> >>> Date: Mon, 07 Mar 2005 20:54:46 GMT.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> Supported: timer,100rel.
> >>> Min-SE:  120.
> >>> Cisco-Guid: 4179523188-2390823385-2262224790-352800044.
> >>> User-Agent: Cisco-SIPGateway/IOS-12.x.
> >>> Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER,
> >>> SUBSCRIBE, NOTIFY, INFO.
> >>> CSeq: 101 INVITE.
> >>> Max-Forwards: 6.
> >>> Remote-Party-ID:
> >>> <sip:4073192279 at 10.3.0.3>;party=calling;screen=yes;privacy=off.
> >>> Timestamp: 1110228886.
> >>> Contact: <sip:4073192279 at 10.3.0.3:5060>.
> >>> Expires: 180.
> >>> Allow-Events: telephone-event.
> >>> Content-Type: application/sdp.
> >>> Content-Length: 252.
> >>> .
> >>> v=0.
> >>> o=CiscoSystemsSIP-GW-UserAgent 9481 9806 IN IP4 10.3.0.3.
> >>> s=SIP Call.
> >>> c=IN IP4 10.3.0.3.
> >>> t=0 0.
> >>> m=audio 18582 RTP/AVP 18 19.
> >>> c=IN IP4 10.3.0.3.
> >>> a=rtpmap:18 G729/8000.
> >>> a=fmtp:18 annexb=yes.
> >>> a=rtpmap:19 CN/8000.
> >>> a=ptime:20.
> >>> a=qos:optional sendrecv.
> >>>
> >>> #
> >>> U 2005/03/07 15:54:21.258052 10.3.0.221:5060 -> 66.90.46.29:5060
> >>> INVITE sip:3215591422 at 192.168.0.83;user=phone SIP/2.0.
> >>> Record-Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> Via: SIP/2.0/UDP 10.3.0.221;branch=z9hG4bKbd16.fe09e763.0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> From: <sip:4073192279 at 10.3.0.3>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>.
> >>> Date: Mon, 07 Mar 2005 20:54:46 GMT.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> Supported: timer,100rel.
> >>> Min-SE:  120.
> >>> Cisco-Guid: 4179523188-2390823385-2262224790-352800044.
> >>> User-Agent: Cisco-SIPGateway/IOS-12.x.
> >>> Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER,
> >>> SUBSCRIBE, NOTIFY, INFO.
> >>> CSeq: 101 INVITE.
> >>> Max-Forwards: 5.
> >>> Remote-Party-ID:
> >>> <sip:4073192279 at 10.3.0.3>;party=calling;screen=yes;privacy=off.
> >>> Timestamp: 1110228886.
> >>> Contact: <sip:4073192279 at 10.3.0.3:57687>.
> >>> Expires: 180.
> >>> Allow-Events: telephone-event.
> >>> Content-Type: application/sdp.
> >>> Content-Length: 256.
> >>> .
> >>> v=0.
> >>> o=CiscoSystemsSIP-GW-UserAgent 9481 9806 IN IP4 10.3.0.3.
> >>> s=SIP Call.
> >>> c=IN IP4 10.3.0.221.
> >>> t=0 0.
> >>> m=audio 35448 RTP/AVP 18 19.
> >>> c=IN IP4 10.3.0.221.
> >>> a=rtpmap:18 G729/8000.
> >>> a=fmtp:18 annexb=yes.
> >>> a=rtpmap:19 CN/8000.
> >>> a=ptime:20.
> >>> a=qos:optional sendrecv.
> >>>
> >>> #
> >>> U 2005/03/07 15:54:21.259071 10.3.0.221:5060 -> 10.3.0.3:57687
> >>> SIP/2.0 100 trying -- your call is important to us.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> From: <sip:4073192279 at 10.3.0.3>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 101 INVITE.
> >>> Content-Length: 0.
> >>> .
> >>>
> >>> #
> >>> U 2005/03/07 15:54:21.293701 66.90.46.29:5060 -> 10.3.0.221:5060
> >>> SIP/2.0 100 trying.
> >>> Via: SIP/2.0/UDP 10.3.0.221;branch=z9hG4bKbd16.fe09e763.0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> From: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 101 INVITE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Content-Length: 0.
> >>> .
> >>>
> >>> #
> >>> U 2005/03/07 15:54:21.300280 66.90.46.29:5060 -> 10.3.0.221:5060
> >>> SIP/2.0 180 ringing.
> >>> Via: SIP/2.0/UDP 10.3.0.221;branch=z9hG4bKbd16.fe09e763.0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> Record-Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> From: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 101 INVITE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Content-Length: 0.
> >>> .
> >>>
> >>> #
> >>> U 2005/03/07 15:54:21.300654 10.3.0.221:5060 -> 10.3.0.3:57687
> >>> SIP/2.0 180 ringing.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> Record-Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> From: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 101 INVITE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Content-Length: 0.
> >>> .
> >>>
> >>> #
> >>> U 2005/03/07 15:54:23.016939 66.90.46.29:5060 -> 10.3.0.221:5060
> >>> SIP/2.0 200 OK.
> >>> Via: SIP/2.0/UDP 10.3.0.221;branch=z9hG4bKbd16.fe09e763.0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> Record-Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> From: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 101 INVITE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Contact: <sip:3215591422 at 192.168.0.83;user=phone>.
> >>> Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE.
> >>> Content-Type: application/sdp.
> >>> Content-Length: 151.
> >>> .
> >>> v=0.
> >>> o=3215591422 8000 8000 IN IP4 192.168.0.83.
> >>> s=SIP Call.
> >>> c=IN IP4 192.168.0.83.
> >>> t=0 0.
> >>> m=audio 5004 RTP/AVP 18.
> >>> a=rtpmap:18 G729/8000.
> >>> a=ptime:20.
> >>>
> >>> #
> >>> U 2005/03/07 15:54:23.019485 10.3.0.221:5060 -> 10.3.0.3:57687
> >>> SIP/2.0 200 OK.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060;rport=57687.
> >>> Record-Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> From: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 101 INVITE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Contact: <sip:3215591422 at 66.90.46.29:5060;user=phone>.
> >>> Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE.
> >>> Content-Type: application/sdp.
> >>> Content-Length: 150.
> >>> .
> >>> v=0.
> >>> o=3215591422 8000 8000 IN IP4 192.168.0.83.
> >>> s=SIP Call.
> >>> c=IN IP4 10.3.0.221.
> >>> t=0 0.
> >>> m=audio 35448 RTP/AVP 18.
> >>> a=rtpmap:18 G729/8000.
> >>> a=ptime:20.
> >>>
> >>> #
> >>> U 2005/03/07 15:54:23.032512 10.3.0.3:57307 -> 10.3.0.221:5060
> >>> ACK sip:10.3.0.221:5060;ftag=86D7FE3C-A26;lr SIP/2.0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060.
> >>> From: <sip:4073192279 at 10.3.0.3>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> Date: Mon, 07 Mar 2005 20:54:46 GMT.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> Route: <sip:3215591422 at 66.90.46.29:5060;user=phone>.
> >>> Max-Forwards: 6.
> >>> Content-Length: 0.
> >>> CSeq: 101 ACK.
> >>> .
> >>>
> >>> #
> >>> U 2005/03/07 15:54:23.032936 10.3.0.221:5060 -> 66.90.46.29:5060
> >>> ACK sip:3215591422 at 66.90.46.29:5060;user=phone SIP/2.0.
> >>> Record-Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> Via: SIP/2.0/UDP 10.3.0.221;branch=0.
> >>> Via: SIP/2.0/UDP  10.3.0.3:5060.
> >>> From: <sip:4073192279 at 10.3.0.3>;tag=86D7FE3C-A26.
> >>> To: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> Date: Mon, 07 Mar 2005 20:54:46 GMT.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> Max-Forwards: 5.
> >>> Content-Length: 0.
> >>> CSeq: 101 ACK.
> >>> .
> >>>
> >>> ##
> >>> U 2005/03/07 15:54:29.613662 66.90.46.29:5060 -> 10.3.0.221:5060
> >>> BYE sip:4073192279 at 10.3.0.3:57687 SIP/2.0.
> >>> Via: SIP/2.0/UDP 192.168.0.83;branch=z9hG4bKec7db34a51e476eb.
> >>> Route: <sip:10.3.0.221;ftag=86D7FE3C-A26;lr>.
> >>> From: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> To: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> Contact: <sip:3215591422 at 192.168.0.83;user=phone>.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 38096 BYE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Max-Forwards: 70.
> >>> Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE.
> >>> Content-Length: 0.
> >>> .
> >>>
> >>> #
> >>> U 2005/03/07 15:54:29.615293 10.3.0.221:5060 -> 10.3.0.3:57687
> >>> BYE sip:4073192279 at 10.3.0.3:57687 SIP/2.0.
> >>> Record-Route: <sip:10.3.0.221;ftag=ad3f03cb59e9e2ce;lr>.
> >>> Via: SIP/2.0/UDP 10.3.0.221;branch=z9hG4bK1c0d.f4b128f.0.
> >>> Via: SIP/2.0/UDP
> >>> 192.168.0.83;received=66.90.46.29;branch=z9hG4bKec7db34a51e476eb.
> >>> From: <sip:3215591422 at 10.3.0.221>;tag=ad3f03cb59e9e2ce.
> >>> To: <sip:4073192279 at 10.3.0.3:5060>;tag=86D7FE3C-A26.
> >>> Contact: <sip:3215591422 at 192.168.0.83;user=phone>.
> >>> Call-ID: F92183D5-8E8111D9-86D9CF96-15074D2C at 10.3.0.3.
> >>> CSeq: 38096 BYE.
> >>> User-Agent: Grandstream BT100 1.0.5.11.
> >>> Max-Forwards: 16.
> >>> Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE.
> >>> Content-Length: 0.
> >>> .
> >>>
> >>> _______________________________________________
> >>> Serusers mailing list
> >>> serusers at lists.iptel.org
> >>> http://lists.iptel.org/mailman/listinfo/serusers
>




More information about the sr-users mailing list