[Freeswitch-dev] bad REGISTER processing

kokoska rokoska kokoska.rokoska at post.cz
Thu Apr 10 14:42:47 EDT 2008


Hi all,
I'm back and the bug too :-)

Now I try to setup NAT handling:

<variable name='sip-force-contact' value='NDLB-connectile-dysfunction'/>

and FreeSWITCH starts to rewrite contact (append port 5060) like in 
previous case...

Best regards,

kokoska.rokoska


kokoska rokoska napsal(a):
> Hi all,
> 
> I just start to play with Freeswitch and first thing I discover is bad 
> REGISTER processing in mod_sofia :-(
> 
> The problem is, that Sofia modifies Contact header (append port 5060 
> which is not in original REGISTER request) in 200 OK reply and thus a ot 
> of clients refuses it (for example SJPhone, Nokia E series etc.).
> Full debug is included at the end of my e-mail.
> 
> 
> In this manner Freeswitch behaviour IMO violates rfc3261:
> 
> 19.1.4 URI Comparison
> ...
> 
> A URI omitting any component with a default value will not
> match a URI explicitly containing that component with its
> default value.  For instance, a URI omitting the optional port
> component will not match a URI explicitly declaring port 5060.
> The same is true for the transport-parameter, ttl-parameter,
> user-parameter, and method components.
> 
> Defining sip:user at host to not be equivalent to
> sip:user at host:5060 is a change from RFC 2543.  When deriving
> addresses from URIs, equivalent addresses are expected from
> equivalent URIs.  The URI sip:user at host:5060 will always
> resolve to port 5060.  The URI sip:user at host may resolve to
> other ports through the DNS SRV mechanisms detailed in [4].
> ...
> 
> 
> Could you please tell me how to configure mod_sofia to properly handle 
> REGISTER request?
> 
> Thanx a lot, regards
> 
> kokoska.rokoska
> 
> 
> ----------------------------
> SIP debug made with SJPhone:
> 
> 2008-04-06 08:26:36.093 UDP LOCAL->192.168.1.128:5065
> REGISTER sip:192.168.1.128:5065 SIP/2.0
> Via: SIP/2.0/UDP 
> 192.168.1.101;branch=z9hG4bKc0a801650000001e47f8893c000053f900000006;rport
> From: "unknown" <sip:1000 at 192.168.1.128:5065>;tag=42f1ed397
> To: <sip:1000 at 192.168.1.128:5065>
> Contact: <sip:1000 at 192.168.1.101>
> Call-ID: 02C388469A134FC18B97E294E4BD845C0xc0a80165
> CSeq: 3 REGISTER
> Max-Forwards: 70
> User-Agent: SJphone/1.65.377a (SJ Labs)
> Content-Length: 0
> 
> 
> 2008-04-06 08:26:36.109 UDP 192.168.1.128:5065->LOCAL
> SIP/2.0 401 Unauthorized
> Via: SIP/2.0/UDP 
> 192.168.1.101;branch=z9hG4bKc0a801650000001e47f8893c000053f900000006;rport=5060 
> 
> From: "unknown" <sip:1000 at 192.168.1.128:5065>;tag=42f1ed397
> To: <sip:1000 at 192.168.1.128:5065>;tag=vHv1X7K9yemUe
> Call-ID: 02C388469A134FC18B97E294E4BD845C0xc0a80165
> CSeq: 3 REGISTER
> User-Agent: FreeSWITCH-mod_sofia/1.0.pre4-8038
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, 
> NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH
> Supported: 100rel, precondition, timer
> WWW-Authenticate: Digest realm="192.168.1.128", 
> nonce="3a4ee704-f9a9-4789-9853-e8e8d6b562e9", algorithm=MD5, qop="auth"
> Content-Length: 0
> 
> 
> 2008-04-06 08:26:36.109 UDP LOCAL->192.168.1.128:5065
> REGISTER sip:192.168.1.128:5065 SIP/2.0
> Via: SIP/2.0/UDP 
> 192.168.1.101;branch=z9hG4bKc0a801650000001f47f8893c00007cb100000008;rport
> From: "unknown" <sip:1000 at 192.168.1.128:5065>;tag=42f1ed397
> To: <sip:1000 at 192.168.1.128:5065>
> Contact: <sip:1000 at 192.168.1.101>
> Call-ID: 02C388469A134FC18B97E294E4BD845C0xc0a80165
> CSeq: 4 REGISTER
> Max-Forwards: 70
> User-Agent: SJphone/1.65.377a (SJ Labs)
> Content-Length: 0
> Authorization: Digest 
> username="1000",realm="192.168.1.128",nonce="3a4ee704-f9a9-4789-9853-e8e8d6b562e9",uri="sip:192.168.1.128:5065",response="cd1a36378bdb3efaabcfa263a6b9f24c",algorithm=MD5,cnonce="5536ed3a7",qop=auth,nc=00000001 
> 
> 
> 
> 2008-04-06 08:26:36.109 UDP 192.168.1.128:5065->LOCAL
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 
> 192.168.1.101;branch=z9hG4bKc0a801650000001f47f8893c00007cb100000008;rport=5060 
> 
> From: "unknown" <sip:1000 at 192.168.1.128:5065>;tag=42f1ed397
> To: <sip:1000 at 192.168.1.128:5065>;tag=XtNtZ24cvQaea
> Call-ID: 02C388469A134FC18B97E294E4BD845C0xc0a80165
> CSeq: 4 REGISTER
> Contact: "user" <sip:1000 at 192.168.1.101:5060>;expires=60
> User-Agent: FreeSWITCH-mod_sofia/1.0.pre4-8038
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, 
> NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH
> Supported: 100rel, precondition, timer
> Content-Length: 0
> 
> 
> 10:26:36 SIP.Registration WARNING   Registrar did not registered none of 
> our contacts!
> 10:26:36 SIP.Registration NOTICE    Foreign contacts returned by the 
> server: sip:1000 at 192.168.1.101:5060
> 10:26:36 SIP.Registration INFO      Not registered 
> sip:1000 at 192.168.1.128:5065
> 10:26:36 SIP.RegistrationClient INFO      Registration reattempt 
> scheduled after 60 seconds
> 10:26:36 SIP.Network DEBUG
> 2008-04-06 08:26:36.234 UDP 192.168.1.128:5065->LOCAL
> NOTIFY sip:1000 at 192.168.1.101:5060 SIP/2.0
> Via: SIP/2.0/UDP 192.168.1.128:5065;rport;branch=z9hG4bKc5ZBa6F96yHee
> Max-Forwards: 70
> From: <sip:1000 at 192.168.1.128>;tag=y3eK1XNgS000N
> To: <sip:1000 at 192.168.1.128>
> Call-ID: feef82f8-7e55-122b-fb8d-000854d1424f
> CSeq: 97616858 NOTIFY
> Contact: <sip:mod_sofia at 192.168.1.128:5065>
> User-Agent: FreeSWITCH-mod_sofia/1.0.pre4-8038
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, 
> NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH
> Supported: 100rel, precondition, timer
> Event: message-summary
> Subscription-State: terminated;timeout
> Content-Type: application/simple-message-summary
> Content-Length: 65
> 
> Messages-Waiting: no
> Message-Account: sip:1000 at 192.168.1.128
> 
> 
> 10:26:36 SIP.Network DEBUG
> 2008-04-06 08:26:36.234 UDP LOCAL->192.168.1.128:5065
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 
> 192.168.1.128:5065;branch=z9hG4bKc5ZBa6F96yHee;rport=5065;received=192.168.1.128 
> 
> From: <sip:1000 at 192.168.1.128>;tag=y3eK1XNgS000N
> To: "unknown" <sip:1000 at 192.168.1.128>;tag=6c19ed424
> Call-ID: feef82f8-7e55-122b-fb8d-000854d1424f
> CSeq: 97616858 NOTIFY
> Content-Length: 0
> Server: SJphone/1.65.377a (SJ Labs)
> 




More information about the Freeswitch-dev mailing list