<h3>Description</h3>
<p>In plain Kamailio language, we used the following line:</p>
<pre><code>if ( sdp_with_transport("RTP/SAVP") ) {
</code></pre>
<p>Now we wanted to convert that to Kemi. Turns out, the <code>sdp_with_transport()</code> function is not exported to Kemi. So we thought, we could use <code>sdp_transport()</code> to work around the missing function. This works as long as there is only one transport in SDP.</p>
<p>But if a phone sends two media streams in SDP, one with RTP/AVP and one with RTP/SAVP, <code>sdp_transport()</code> will return <code>-2</code>.</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Send an INVITE to Kamailio and try to get the transport type into a variable with <code> sdp_transport()</code>. This can be done for example with a snom phone where in the rtp section of the identity configuration the parameter "RTP/SAVP" is set to "optional".</p>
<h4>Log Messages</h4>
<pre><code>Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: app_jsdt [app_jsdt_api.c:996]: sr_kemi_jsdt_exec_func_ex(): param[0] for: sdp_transport is str: $avp(mediaTransport)
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: <core> [core/usr_avp.c:887]: parse_avp_ident(): Parsing 'mediaTransport'
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: <core> [core/pvapi.c:368]: pv_cache_add(): pvar [$avp(mediaTransport)] added in cache
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: sdpops [sdpops_mod.c:1214]: sdp_transport_helper(): stream 0 of 0 - transport [RTP/SAVP]
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: sdpops [sdpops_mod.c:1214]: sdp_transport_helper(): stream 1 of 0 - transport [RTP/AVP]
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: sdpops [sdpops_mod.c:1219]: sdp_transport_helper(): no common transport 
</code></pre>
<h3>Additional Information</h3>
<p>We are still running Kamailio 5.1.x, but as far as I could see, the behavior has not changed since then.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2194?email_source=notifications&email_token=ABO7UZPXFZPS36KTLU6FQ5LQ5BSUFA5CNFSM4KFHCRT2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFKT6TA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNBLF7RDDLC5TUVGK3Q5BSUFANCNFSM4KFHCRTQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMJSIF4UKYLSYHQFC3Q5BSUFA5CNFSM4KFHCRT2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFKT6TA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2194?email_source=notifications\u0026email_token=ABO7UZPXFZPS36KTLU6FQ5LQ5BSUFA5CNFSM4KFHCRT2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFKT6TA",
"url": "https://github.com/kamailio/kamailio/issues/2194?email_source=notifications\u0026email_token=ABO7UZPXFZPS36KTLU6FQ5LQ5BSUFA5CNFSM4KFHCRT2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFKT6TA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>