<h3>Description</h3>
<p>When sending a multipart INVITE with a part having the following content type  <strong>application/vnd.3gpp.mcptt-info+xml</strong>  there is a parse error on content type header causing for eg we can't force rtpproxy to replace ports on a call leg.</p>
<p>From <strong>parse_content.c</strong> implementation It seems numbers are not accepted inside a content type header. (<a href="https://github.com/kamailio/kamailio/blob/master/src/core/parser/parse_content.c">https://github.com/kamailio/kamailio/blob/master/src/core/parser/parse_content.c</a>)</p>
<p>This might cause issues  with MCPTT Rel 13 3GPP specs (<a href="http://www.arib.or.jp/english/html/overview/doc/STD-T63V12_20/5_Appendix/Rel13/24/24381-d20.pdf">http://www.arib.or.jp/english/html/overview/doc/STD-T63V12_20/5_Appendix/Rel13/24/24381-d20.pdf</a>)  or other content type defined by 3gpp ( eg of other content types defined in iana like <a href="https://www.iana.org/assignments/media-types/application/3gpp-ims+xml">https://www.iana.org/assignments/media-types/application/3gpp-ims+xml</a> , etc.)</p>
<p>See attached conversation in user-list <a href="http://lists.sip-router.org/pipermail/sr-users/2017-April/096594.html">http://lists.sip-router.org/pipermail/sr-users/2017-April/096594.html</a></p>
<h3>Troubleshooting</h3>
<p>See below attached logs generated by Kamailio when processing that INVITE and a sample of  INVITE message causing the issue (cut&paste from wireshark)</p>
<h4>Reproduction</h4>
<p>See attached INVITE or just send a multipart INVITE with a body part that has content type  application/vnd.3gpp.mcptt-info+xml</p>
<h4>Log Messages</h4>
<p>See log messages generated when trying to force rtpproxy</p>
<p>Apr  3 18:31:21 mcptt /usr/sbin/kamailio[3232]: INFO: <script>: forcing RTP<br>
proxy for INVITE message</p>
<p>Apr  3 18:31:21 mcptt /usr/sbin/kamailio[3232]: ERROR: <br>
[core/parser/parse_content.c:370]: decode_mime_type():<br>
ERROR:decode_mime_type: parse error near in<br>
[application/vnd.3gpp.mcptt-info+xml] char[51][3] offset=16</p>
<h4>SIP Traffic</h4>
<p>INVITE sip:<a href="mailto:mcpttparticipating@genaker.net">mcpttparticipating@genaker.net</a> SIP/2.0<br>
Record-Route: sip:10.1.1.123:6074;transport=tcp;lr=on;ftag=i3b01a;nat=yes<br>
Call-ID: db6b10362447354bc9819df9a9046ecb@10.1.1.222<br>
CSeq: 1 INVITE<br>
From: sip:blue1@genaker.net;tag=i3b01a<br>
To: sip:ccw@genaker.net;poc-group=blues<br>
Via: SIP/2.0/TCP 10.1.1.123:6074;branch=z9hG4bK15a9.1c063dec40e772152f44c026a1627082.0;i=f<br>
Via: SIP/2.0/TCP 10.1.1.222:5070;received=10.1.1.222;rport=55173;branch=z9hG4bK-363135-1750dc6e97437e4788f446f2d818b60a<br>
Max-Forwards: 69<br>
Contact: sip:blue1@10.1.1.222:55173;transport=tcp;+g.3gpp.mcptt;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mcptt";isfocus<br>
Accept-Contact: *;+g.3gpp.mcptt;require;explicit<br>
Accept-Contact: *;+g.3gpp.icsi-ref="urn:urn-7:3gpp-service.ims.icsi.mcptt";require;explicit<br>
P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mcptt<br>
P-Preferred-Identity: sip:blue1@genaker.net<br>
User-Agent: PoC-client/3GPP-Rel13 GenakerPTT/v2.03.01 - [f661833_334]d/BV6000/SDK23/FplatinumMcptt<br>
Session-Expires: 3600<br>
Min-SE: 90<br>
Supported: replaces, 100rel, timer, norefersub, timer, answermode, eventlist<br>
Resource-Priority: mcpttp.5<br>
Content-Type: multipart/mixed;boundary=gnkboundary<br>
Content-Length: 997</p>
<p>--gnkboundary<br>
Content-Type: application/sdp</p>
<p>v=0<br>
o=- 3626700268 3626700268 IN IP4 10.1.1.222<br>
s=spimedia<br>
c=IN IP4 10.1.1.222<br>
t=0 0<br>
a=X-nat:0<br>
m=audio 10002 RTP/AVP 106<br>
a=rtcp:10003 IN IP4 10.1.1.222<br>
i=speech<br>
a=rtpmap:106 AMR-WB/16000<br>
a=fmtp:106 mode-change-period=1; mode-change-capability=2; mode-change-neighbor=0; max-red=0<br>
a=sendrecv<br>
a=ptime:100<br>
a=maxptime:400<br>
m=application 10003 udp MCPTT<br>
a=fmtp:MCPTT mc_queueing;mc_priority=1</p>
<p>--gnkboundary<br>
Content-Type: application/vnd.3gpp.mcptt-info+xml</p>



chat

sip:ccw@genaker.net;poc-group=blues


urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF



<p>--gnkboundary--</p>
<h3>Possible Solutions</h3>
<p>Accept numbers in the content type header</p>
<p>Maybe accepting numbers on following definition at the same <strong>parse_content.c</strong> file:</p>
<p>#define is_mime_char(<em>c</em>) <br>
(isalpha((int)<em>c</em>) || (<em>c</em>)=='-' || (<em>c</em>)=='+' || (<em>c</em>)=='.' || (<em>c</em>)=='_')</p>
<h3>Additional Information</h3>
<p>[root@mcptt ~]# kamailio -v<br>
version: kamailio 5.0.0 (x86_64/linux)<br>
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES<br>
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DsEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled on 19:22:29 Mar 16 2017 with gcc 4.8.5</p>
<ul>
<li><strong>Operating System</strong>:<br>
CentOS7<br>
Linux dev 3.10.0-514.10.2.el7.x86_64 <a href="https://github.com/kamailio/kamailio/issues/1" class="issue-link js-issue-link" data-url="https://github.com/kamailio/kamailio/issues/1" data-id="31891578" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#1</a> SMP Fri Mar 3 00:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux</li>
</ul>

<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/1053">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZQmYMa-Asj89ByEe0zlBUoj0I5Ioks5rsRyrgaJpZM4MxxcR">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36Zcs_P7bZLLxtqYIWPMW8SCmea8K8ks5rsRyrgaJpZM4MxxcR.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/1053"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Problem parsing  content-type with numbers in multipart INVITE (#1053)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1053"}}}</script>