<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;#this next part logs an error if the message has no expires info (scanner messages sent directly to proxy for instance)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(is_present_hf("Expires"))</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(i:10) := $hdr(Expires);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(i:10) := $ct.fields(expires);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if( $avp(i:10) &nbsp;== "0" )</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>...</div><div><br></div><div><br></div><div>Speaking of this, using a min_expires param to the registrar module seems to defeat allowing users to unregister by sending a expires of zero. &nbsp;I seem to remember it gets bumped to the min value. &nbsp;If true, I think there should be a check added in the minimum time check to let zero sneak through as is and remove the user from userloc table.</div><div><br></div><div>Richard</div><div><br></div><div><br></div><div><div>On Jul 8, 2010, at 5:33 AM, Premalatha Kuppan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>How do i check expiration for user, meaning to identify de-registration.<br>When user is de-registred; then the request comes with expires=0; how to get this field and check in opensips.cfg file ?<br><br>Any help ?<br>
<br>Thanks,<br>Prem<br><br><br><div class="gmail_quote">On Wed, Jul 7, 2010 at 7:42 PM, Premalatha Kuppan <span dir="ltr">&lt;<a href="mailto:premalatha@ngintech.com">premalatha@ngintech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks to all.<br><br>Its working now using $tu and avp_db_query.<br><br>&nbsp;$var(x)=$(tu{uri.user});<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; avp_db_query("INSERT INTO TESTTABLE (xxx,yyy,zzz) VALUES('$(var(x){s.select,0,_})','$(var(x){s.select,1,_})','$(var(x){s.select,2,_})')");<br>

<br>Now, have to look how to remove these entries during de-registration.<br><br>Thanks,<br>Prem<div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Wed, Jul 7, 2010 at 5:05 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Premalatha Kuppan wrote:<br>
&gt; Thanks. Corrected teh opensips.cfg file<br>
&gt;<br>
&gt; But the problem was due to this. by default DB URL was NULL. Now i<br>
&gt; have added the DB URL for avpops.<br>
&gt; # default URL<br>
&gt; modparam("avpops","db_url","<a href="mysql://user:passwd@host/database">mysql://user:passwd@host/database</a>")<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; But the value of $rU is NULL..am i placing it in wrong location?<br>
<br>
</div>In REGISTER requests, the RURI has only domain part (sip:<a href="http://opensips.org/" target="_blank">opensips.org</a>)<br>
so it is normal to have $rU NULL. If you need to identity of the user<br>
who registered, according to SIP, you have to look at the TO URI - so<br>
use $tu to get TO uri and use the URI transformation if you want to<br>
split in in username and domain (see<br>
<a href="http://www.opensips.org/Resources/DocsCoreTran16#toc17" target="_blank">http://www.opensips.org/Resources/DocsCoreTran16#toc17</a> ).<br>
<br>
<br>
Regards,<br>
Bogdan<br>
<div><br>
&gt; &nbsp;I want the userpart e.g: <a href="sip:userpart@domain">sip:userpart@domain</a> is the request uri; i<br>
&gt; need only userpart . I believe that would be stored in $rU; but tis<br>
&gt; coming as NULL. Which variable or where should i place this command<br>
&gt; for registration and de-registration.<br>
&gt;<br>
&gt; Any Idea ?<br>
&gt;<br>
&gt; On Wed, Jul 7, 2010 at 4:13 PM, mayamatakeshi &lt;<a href="mailto:mayamatakeshi@gmail.com" target="_blank">mayamatakeshi@gmail.com</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:mayamatakeshi@gmail.com" target="_blank">mayamatakeshi@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; On Wed, Jul 7, 2010 at 7:32 PM, Premalatha Kuppan<br>
</div><div><div></div><div>&gt; &nbsp; &nbsp; &lt;<a href="mailto:premalatha@ngintech.com" target="_blank">premalatha@ngintech.com</a> &lt;mailto:<a href="mailto:premalatha@ngintech.com" target="_blank">premalatha@ngintech.com</a>&gt;&gt; wrote:<br>

&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Hi,<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Iam using avp_db_query, but opensips is dead with following error,<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; During Registration, when the user is registered. I have to<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; parse and store th value in DB. So, included the avp_db_query<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; in this loop. Is this right one to do. I assume the value of<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; rU is NULL over here, probably its failing. Not sure :(<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Any insight &nbsp;?<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (is_method("REGISTER"))<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # authenticate the REGISTER requests<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; (uncomment to enable auth)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!www_authorize("10.140.1.110", "subscriber"))<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; www_challenge("10.140.1.110", "0");<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;if (!db_check_to())<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403","Forbidden auth ID");<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;}<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!save("location"))<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_reply_error();<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $var(x) = $rU ;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; avp_db_query("INSERT INTO TESTTABLE<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; (xxx,yyy,zzz)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; VALUES('$(var(x){s.select,0,_})','$var(x)({s.select,1,_})','$(var(x){s.select,2,_})'");<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Jul &nbsp;7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ERROR:avpops:fixup_db_query_avp: no db url defined to be used<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; by this function<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Jul &nbsp;7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; *ERROR:core:fix_actions: fixing failed (code=-6) at cfg line 351*<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Jul &nbsp;7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ERROR:core:main: failed to fix configuration with err code -6<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Clearly you misplaced the parenthesis:<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; $(var(x){s.select,0,_})',<br>
&gt; &nbsp; &nbsp; '$var(x)({s.select,1,_})',<br>
&gt; &nbsp; &nbsp; '$(var(x){s.select,2,_})'<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; _______________________________________________<br>
&gt; &nbsp; &nbsp; Users mailing list<br>
</div></div>&gt; &nbsp; &nbsp; <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>&gt;<br>
<div>&gt; &nbsp; &nbsp; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt;<br>
</div>&gt; ------------------------------------------------------------------------<br>
<div>&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
</div>--<br>
<div>Bogdan-Andrei Iancu<br>
OpenSIPS Bootcamp<br>
20 - 24 September 2010, Frankfurt, Germany<br>
<a href="http://www.voice-system.ro/" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
</div><div><div></div><div>Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote></div><br></body></html>