<p>Michael Neuhauser <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14621">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjproject: clone sdp to protect against (nat) modifications<br><br>PJSIP, UDP transport with external_media_address and session timers<br>enabled. Connected to SIP server that is not in local net. Asterisk<br>initiated the connection and is refreshing the session after 150s<br>(timeout 300s). The 2nd refresh-INVITE triggered by the pjsip timer has<br>a malformed IP address in its SDP (garbage string). This only happens<br>when the SDP is modified by the nat-code to replace the local IP address<br>with the configured external_media_address.<br>Analysis: the code to modify the SDP (in<br>res_pjsip_session.c:session_outgoing_nat_hook() and also (redundantly?)<br>in res_pjsip_sdp_rtp.c:change_outgoing_sdp_stream_media_address()) uses<br>the tdata->pool to allocate the replacement string. But the same<br>pjmedia_sdp_stream that was modified for the 1st refresh-INVITE is also<br>used for the 2nd refresh-INVITE (because it is stored in pjmedia's<br>pjmedia_sdp_neg structure). The problem is, that at that moment, the<br>tdata->pool that holds the stringified external_media_address from the<br>1. refresh-INVITE has long been reused for something else.<br>Fix by Sauw Ming of pjproject (see<br>https://github.com/pjsip/pjproject/pull/2476): the local, potentially<br>modified pjmedia_sdp_stream is cloned in<br>pjproject/source/pjsip/src/pjmedia/sip_neg.c:process_answer() and the<br>clone is stored, thereby detaching from the tdata->pool (which is only<br>released *after* process_answer())<br><br>ASTERISK-28973<br>Reported-by: Michael Neuhauser<br><br>Change-Id: I272ac22436076596e06aa51b9fa23fd1c7734a0e<br>---<br>A third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch<br>1 file changed, 28 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/14621/2</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14621">change 14621</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14621"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I272ac22436076596e06aa51b9fa23fd1c7734a0e </div>
<div style="display:none"> Gerrit-Change-Number: 14621 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Michael Neuhauser <mike@firmix.at> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>