<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Yes, the presence of a To tag differentiates in-dialog requests from initial ones.<br><br><div id="AppleMailSignature">-- Alex</div><div><br>On Mar 20, 2018, at 8:03 PM, David Villasmil <<a href="mailto:david.villasmil.work@gmail.com">david.villasmil.work@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>Hello guys,</div><div><br></div><div>I want to execute an sql only for INITIAL INVITEs, I'm trying like:</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px;white-space:pre"><div><span style="color:rgb(212,212,212)">#</span><span style="color:rgb(212,212,212)">!</span><span style="color:rgb(212,212,212)">ifdef WITH_DID_VALIDATE</span></div><div><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)">(</span><span style="color:rgb(212,212,212)">!</span><span style="color:rgb(212,212,212)">has_totag()) {</span></div><div><span style="color:rgb(212,212,212)"> sql_query(</span><span style="color:rgb(206,145,120)">"acd"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">"select * from did_numbers where didNumber = '$tU' and active = 'Y'"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">"ra"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)"> xlog(</span><span style="color:rgb(206,145,120)">"L_ERR"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">"[REQUEST_ROUTE] number of rows in table domain: $dbr(ra=>rows)</span><span style="color:rgb(215,186,125)">\n</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)">( </span><span style="color:rgb(156,220,254)">$dbr</span><span style="color:rgb(212,212,212)">(ra</span><span style="color:rgb(212,212,212)">=></span><span style="color:rgb(212,212,212)">rows)</span><span style="color:rgb(212,212,212)">==</span><span style="color:rgb(181,206,168)">0</span><span style="color:rgb(212,212,212)"> ) {</span></div><div><span style="color:rgb(212,212,212)"> xlog(</span><span style="color:rgb(206,145,120)">"L_ERR"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">"[REQUEST_ROUTE] DID Number validation returned [$dbr(ra=>rows)], not responding to this request</span><span style="color:rgb(215,186,125)">\n</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(197,134,192)">exit</span><span style="color:rgb(212,212,212)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)"> sql_result_free(</span><span style="color:rgb(206,145,120)">"ra"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)">#</span><span style="color:rgb(212,212,212)">!</span><span style="color:rgb(212,212,212)">endif</span></div><div><span style="color:rgb(212,212,212)"></span></div></div><br></div><div>But, say I remove the DID from the allowed list while a call is going on. Then responses to the allowed INVITE would not be processed.</div><div><br></div><div>How would I limit that to ONLY the INITIAL INVITE? Should I use has_totag?</div><div><br></div><div>Thanks!</div><div><br></div><div>David</div><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div></div>
</div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aZGF2aWQudmlsbGFzbWlsLndvcmtAZ21haWwuY29t&type=zerocontent&guid=0981219f-1dba-4c2e-a589-162f36d408a0"><font color="#ffffff" size="1">ᐧ</font></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a></span><br><span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></body></html>