<div dir="auto"><div>Any idea?<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 24 Jun 2020, 14:26 Mojtaba, <<a href="mailto:mespio@gmail.com">mespio@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span>Hello,</span></div><div><span>Some confusing things while developing in Kamailio:<br></span></div><div><span>In is_method_f function in textops module, the code checks the HDR_CSEQ_F in msg also, and if the method name appears in CSEQ_F, The result is returned TRUE.<br></span></div><div><span>These question will arise why in this function, the CSEQ field in message will check?<br></span></div><div><table><tbody><tr><td id="m_5126204793022076968gmail-LC3498"><span>if</span>(<span>parse_headers</span>(msg, HDR_CSEQ_F, <span>0</span>)!=<span>0</span> || msg-><span>cseq</span>==<span>NULL</span>)</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3499"> {</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3500"> <span>LM_ERR</span>(<span><span>"</span>cannot parse cseq header<span>\n</span><span>"</span></span>);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3501"> <span>return</span> -<span>1</span>; <span><span>/*</span> should it be 0 ?!?! <span>*/</span></span></td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3502"> }</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3503"> <span>if</span>(m-><span>s</span>==<span>0</span>)</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3504"> <span>return</span> (<span>get_cseq</span>(msg)-><span>method_id</span>&m-><span>len</span>)?<span>1</span>:-<span>1</span>;</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3505"> <span>else</span></td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3506"> <span>return</span> (<span>get_cseq</span>(msg)-><span>method_id</span>==METHOD_OTHER</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3507"> && <span>get_cseq</span>(msg)-><span>method</span>.<span>len</span>==m-><span>len</span></td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="m_5126204793022076968gmail-LC3508"> && (<span>strncasecmp</span>(<span>get_cseq</span>(msg)-><span>method</span>.<span>s</span>, m-><span>s</span>,</td>
</tr>
<tr>
</tr></tbody></table> m-><span>len</span>)==<span>0</span>))?<span>1</span>:-<span>1</span>;</div><div><br></div><div>I think it would be nice to add new function like: is_cseq_method_f in module to avoid some problem understanding.</div><br><div><div>-- <br><div dir="ltr" data-smartmail="gmail_signature">--Mojtaba Esfandiari.S</div></div></div></div>
</blockquote></div></div></div>