<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 5: Code-Review-1</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think this will work but i'd like to propose an alternative...<br>Instead of creating a body supplement module, create a body generator module that registers as "cpim-pidf+xml".  In that module's allocate_body callback, call ast_sip_pubsub_generate_body_content for "pidf+xml".  That will give you an ast_str with the normal pidf+xml in it.  You can then call pj_xml_parse to turn it into an XML node and return that as the body.  When your generate_body_content function gets called, you just add your cisco specific stuff.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This way you don't have to mess with res_pjsip_pubsub and mung up the provided accept based on the UA.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Regardless of the solution, the big question is... Will this apply to ALL Cisco phones and/or all phones that ask for "cpim-pidf+xml" or is it only some Cisco phones or some firmwares?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;"><br>Will look into creating something like you describe but it may take some time (primarily code was PoC for others to test).</p><p style="white-space: pre-wrap; word-wrap: break-word;">As for the second part, ALL Cisco phones.. no idea (only have access to 7941/2 and 7961/2), we would need someone who has the newer 8xxx series etc. The 'bug' appears to be across all 79xx firmware I have tried (8.x/9.x) though and the phone is rather old now.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13162">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13162/3/res/res_pjsip_pubsub.c">File res/res_pjsip_pubsub.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13162/3/res/res_pjsip_pubsub.c@854">Patch Set #3, Line 854:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">            alloc_size = pj_strlen(&user_agent_header->hvalue) + 1;<br>                user_agent = ast_alloca(alloc_size);<br>          ast_copy_pj_str(user_agent, &user_agent_header->hvalue, alloc_size);<br><br>         if (strstr(user_agent,"Cisco"))<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I think you could simplify this with: […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Have updated in v5 with that style.. seems to still work.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13162/3/res/res_pjsip_pubsub.c@858">Patch Set #3, Line 858:</a> <code style="font-family:monospace,monospace">         if (strstr(user_agent,"Cisco"))</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I realise this is probably 'too' generic but need others especially with non 79xx handsets to trial see if they complain. We could restrict to Cisco-CP79 instead if desired.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13162">change 13162</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/+/13162"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib5a2944de0e280d3c92eed42d91a0bcb0bcf387c </div>
<div style="display:none"> Gerrit-Change-Number: 13162 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: snuffy <snuffy22@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 13 Nov 2019 05:05:17 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>