<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9291">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_messaging:  Allow application/* for in-dialog MESSAGEs<br><br>In addition to text/* content types, incoming_in_dialog_request now<br>accepts application/* content types.<br><br>ASTERISK-27942<br><br>Change-Id: I4e54d8cc6158dc47eb8fdd6ba0108c6fd53f2818<br>---<br>M res/res_pjsip_messaging.c<br>1 file changed, 6 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/91/9291/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c<br>index 38d0813..8afb8bc 100644<br>--- a/res/res_pjsip_messaging.c<br>+++ b/res/res_pjsip_messaging.c<br>@@ -80,19 +80,21 @@<br>  * \internal<br>  * \brief Checks to make sure the request has the correct content type.<br>  *<br>- * \details This module supports the following media types: "text/\*".<br>+ * \details This module supports the following media types: "text/\*", "application/\*".<br>  * Return unsupported otherwise.<br>  *<br>  * \param rdata The SIP request<br>  */<br>-static enum pjsip_status_code check_content_type_any_text(const pjsip_rx_data *rdata)<br>+static enum pjsip_status_code check_content_type_in_dialog(const pjsip_rx_data *rdata)<br> {<br>    int res = PJSIP_SC_UNSUPPORTED_MEDIA_TYPE;<br>    pj_str_t text = { "text", 4};<br>+      pj_str_t application = { "application", 11};<br> <br>     /* We'll accept any text/ content type */<br>         if (rdata->msg_info.msg->body && rdata->msg_info.msg->body->len<br>-               && pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &text) == 0) {<br>+         && (pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &text) == 0<br>+                   || pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &application) == 0)) {<br>          res = PJSIP_SC_OK;<br>    } else if (rdata->msg_info.ctype<br>           && pj_stricmp(&rdata->msg_info.ctype->media.type, &text) == 0) {<br>@@ -800,7 +802,7 @@<br>           return 0;<br>     }<br> <br>- code = check_content_type_any_text(rdata);<br>+   code = check_content_type_in_dialog(rdata);<br>   if (code != PJSIP_SC_OK) {<br>            send_response(rdata, code, dlg, tsx);<br>                 return 0;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9291">change 9291</a>. To unsubscribe, 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/9291"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I4e54d8cc6158dc47eb8fdd6ba0108c6fd53f2818 </div>
<div style="display:none"> Gerrit-Change-Number: 9291 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>