[Home]

Summary:ASTERISK-25071: RFC3581 compliance
Reporter:Oleg Rabinovich (olegrtecno)Labels:
Date Opened:2015-05-08 01:33:17Date Closed:2015-05-11 05:53:57
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:13.3.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 6.5Attachments:( 0) extensions.conf
( 1) messages
( 2) reg_n_call.pcap
( 3) RFC3581.patch
( 4) sip.conf
Description:I am connecting to Asterisk via Kamailio SIP proxy (version 4.2.3). The client, MicroSIP-3.6.3 is behind NAT. Kamailio SIP proxy adds ";rport" to via headers in order to receive the traffic back from the server, according to RFC 3581. However, I fail to dial that client, as Asterisk dials directly to the client (public address) instead of my Kamailio box. This issue is similar to ASTERISK-7276, however, it's different in the sense that SIP request (INVITE) that is not routed correctly is a separate request from the one (REGISTER) that includes ";rport".

I am attaching a patch that fixes the issue in my environment. Please, review it and let me know if this is a correct direction or am I missing something.
Comments:By: Oleg Rabinovich (olegrtecno) 2015-05-10 07:12:43.641-0500

Submitted the patch via Gerrit

By: Joshua C. Colp (jcolp) 2015-05-10 07:23:23.618-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. Please read over the Asterisk Issue Guidelines [1] which discusses the information necessary for your issue to be resolved and the format that information needs to be in. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected and the location of documentation that led you to that expectation.
3. The behavior you actually encountered.

To demonstrate the issue in detail, please include Asterisk log files generated per the instructions on the wiki [2]. If applicable, please ensure that protocol-level trace debugging is enabled, e.g., 'sip set debug on' if the issue involves chan_sip, and configuration information such as dialplan and channel configuration.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[2] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Oleg Rabinovich (olegrtecno) 2015-05-11 05:38:15.359-0500

messages: asterisk log file with verbose and debug enabled
reg_n_call.pcap: network capture taken at Asterisk machine during two SIP clients registration and call initiation.

By: Oleg Rabinovich (olegrtecno) 2015-05-11 05:48:37.154-0500

Scenario description:
- Two SIP clients (100 and 101) registering on Asterisk box via SIP proxy (Kamailio)
- One SIP client trying to call another one and the call fails.

Expected behavior: Asterisk to use a proxy address to call routing
Actual behavior: log message "[May 11 05:45:47] DEBUG[28030] chan_sip.c: Store REGISTER's Contact header for call routing." and as a result Asterisk sending INVITE directly to SIP client

Note: when enabled "nat=force_rport" option in sip.conf, the call works as expected, however, I would expect ";rport" option in "via" field of REGISTER request to make that effect.

By: Oleg Rabinovich (olegrtecno) 2015-05-11 05:51:00.690-0500

Also attached a pcap file with the network capture taken at the Asterisk box.
Asterisk machine: 23.246.211.133
SIP proxy: 159.122.0.248
Both SIP clients are behind NAT: 192.116.52.233

By: Joshua C. Colp (jcolp) 2015-05-11 05:53:58.048-0500

Your expectation would be incorrect. 'rport' received on a request is only for responses to that specific request. It should have no bearing on subsequent requests. 'force_rport' is the correct option for this scenario. Unfortunately in chan_sip it is poorly named for what it is doing, this was changed in chan_pjsip to be more reflective of what is going on.