<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div> #this next part logs an error if the message has no expires info (scanner messages sent directly to proxy for instance)</div><div> if(is_present_hf("Expires"))</div><div> $avp(i:10) := $hdr(Expires);</div><div> else</div><div> $avp(i:10) := $ct.fields(expires);</div><div> if( $avp(i:10) == "0" )</div><div> {</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. I seem to remember it gets bumped to the min value. 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"><<a href="mailto:premalatha@ngintech.com">premalatha@ngintech.com</a>></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> $var(x)=$(tu{uri.user});<br> 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"><<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>></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>
> Thanks. Corrected teh opensips.cfg file<br>
><br>
> But the problem was due to this. by default DB URL was NULL. Now i<br>
> have added the DB URL for avpops.<br>
> # default URL<br>
> modparam("avpops","db_url","<a href="mysql://user:passwd@host/database">mysql://user:passwd@host/database</a>")<br>
><br>
><br>
><br>
> 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>
> I want the userpart e.g: <a href="sip:userpart@domain">sip:userpart@domain</a> is the request uri; i<br>
> need only userpart . I believe that would be stored in $rU; but tis<br>
> coming as NULL. Which variable or where should i place this command<br>
> for registration and de-registration.<br>
><br>
> Any Idea ?<br>
><br>
> On Wed, Jul 7, 2010 at 4:13 PM, mayamatakeshi <<a href="mailto:mayamatakeshi@gmail.com" target="_blank">mayamatakeshi@gmail.com</a><br>
</div><div>> <mailto:<a href="mailto:mayamatakeshi@gmail.com" target="_blank">mayamatakeshi@gmail.com</a>>> wrote:<br>
><br>
><br>
><br>
> On Wed, Jul 7, 2010 at 7:32 PM, Premalatha Kuppan<br>
</div><div><div></div><div>> <<a href="mailto:premalatha@ngintech.com" target="_blank">premalatha@ngintech.com</a> <mailto:<a href="mailto:premalatha@ngintech.com" target="_blank">premalatha@ngintech.com</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> Iam using avp_db_query, but opensips is dead with following error,<br>
><br>
> During Registration, when the user is registered. I have to<br>
> parse and store th value in DB. So, included the avp_db_query<br>
> in this loop. Is this right one to do. I assume the value of<br>
> rU is NULL over here, probably its failing. Not sure :(<br>
><br>
> Any insight ?<br>
><br>
> if (is_method("REGISTER"))<br>
> {<br>
> # authenticate the REGISTER requests<br>
> (uncomment to enable auth)<br>
> if (!www_authorize("10.140.1.110", "subscriber"))<br>
> {<br>
> www_challenge("10.140.1.110", "0");<br>
> exit;<br>
> }<br>
><br>
> # if (!db_check_to())<br>
> # {<br>
> # sl_send_reply("403","Forbidden auth ID");<br>
> # exit;<br>
> # }<br>
><br>
> if (!save("location"))<br>
> sl_reply_error();<br>
><br>
> $var(x) = $rU ;<br>
> avp_db_query("INSERT INTO TESTTABLE<br>
> (xxx,yyy,zzz)<br>
> VALUES('$(var(x){s.select,0,_})','$var(x)({s.select,1,_})','$(var(x){s.select,2,_})'");<br>
> exit;<br>
> }<br>
><br>
><br>
> Jul 7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
> ERROR:avpops:fixup_db_query_avp: no db url defined to be used<br>
> by this function<br>
> Jul 7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
> *ERROR:core:fix_actions: fixing failed (code=-6) at cfg line 351*<br>
> Jul 7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
> ERROR:core:main: failed to fix configuration with err code -6<br>
><br>
><br>
> Clearly you misplaced the parenthesis:<br>
><br>
><br>
> $(var(x){s.select,0,_})',<br>
> '$var(x)({s.select,1,_})',<br>
> '$(var(x){s.select,2,_})'<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
</div></div>> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><br>
<div>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
><br>
</div>> ------------------------------------------------------------------------<br>
<div>><br>
> _______________________________________________<br>
> 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>
><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>