Summary: | ASTERISK-30362: res_pjsip_session: SDP o= header address changed in re-INVITE message | ||
Reporter: | Vitezslav Novy (vnovy) | Labels: | |
Date Opened: | 2022-12-19 08:08:47.000-0600 | Date Closed: | |
Priority: | Minor | Regression? | |
Status: | Open/New | Components: | Resources/res_pjsip_session |
Versions: | 18.10.1 | Frequency of Occurrence | Occasional |
Related Issues: | |||
Environment: | Debian 11 | Attachments: | ( 0) origin-addr.pcap |
Description: | We noticed on one of our sites, that address in o= SDP header in re-INVITE message triggered by directmedia=ýes is different from address in first INVITE. It is violation of RFC 3264 sec. 8
Analyzing create_local_sdp() it seems that in our case the o= address in re-INVITE SDP is total last resort get by ast_sip_get_host_ip_string(). Anyway I'm not sure if local->con, which is source of o= address when it is set, is stable enough to guarantee same address during whole session. I have created patch for us which uses address from ast_sip_get_host_ip_string() for o= header in all cases and guarantees same address during session. | ||
Comments: | By: Asterisk Team (asteriskteam) 2022-12-19 08:08:52.431-0600 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur. Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/]. By: Vitezslav Novy (vnovy) 2022-12-19 08:15:44.813-0600 Patch mentioned in problem description By: Joshua C. Colp (jcolp) 2022-12-19 08:18:02.496-0600 I have removed the patch. Attached patches must be done with a signed contributor license agreement. By: Benjamin Keith Ford (bford) 2022-12-19 09:54:57.145-0600 If you would like to submit a patch, instructions on how to that can be found on the Gerrit wik page\[1\]. You'll need to have a license agreement, as Josh mentioned. If you don't want to go that route, can you provide a packet capture with the changed o= line? \[1\]: https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage By: Vitezslav Novy (vnovy) 2022-12-20 04:04:32.201-0600 I attach the packet capture of SIP communication with both phones in the call. Asterisk is 10.32.5.2 and phone in focus is 10.32.5.41 The first INVITE sent to the phone contains asterisk address 10.32.5.2 in SDP o= header. It is the address on interface used for communication with the phone. Re-INVITE sent to the phone contains address 10.0.5.15 which is on another asterisk interface used by default route. That's why I think address in re-INVITE is set by ast_sip_get_host_ip_string() as a last resorts source. The function takes the address from variable host_ip_ipv4_string in res_pjsip.c. And this variable is populated on module load by calling pj_gethostip() (pjproject/pjlib/src/pj/sock_common.c). This function prefers to return default route interface address |