[asterisk-bugs] [JIRA] (ASTERISK-30362) res_pjsip_session: SDP o= header address changed in re-INVITE message

Vitezslav Novy (JIRA) noreply at issues.asterisk.org
Tue Dec 20 05:21:51 CST 2022


    [ https://issues.asterisk.org/jira/browse/ASTERISK-30362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=260963#comment-260963 ] 

Vitezslav Novy edited comment on ASTERISK-30362 at 12/20/22 5:21 AM:
---------------------------------------------------------------------

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


was (Author: vnovy):
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 on default route interface

> res_pjsip_session: SDP o= header address changed in re-INVITE message
> ---------------------------------------------------------------------
>
>                 Key: ASTERISK-30362
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30362
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip_session
>    Affects Versions: 18.10.1
>         Environment: Debian 11
>            Reporter: Vitezslav Novy
>            Assignee: Unassigned
>         Attachments: origin-addr.pcap
>
>
> 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. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list