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(&quot;INSERT INTO TESTTABLE (xxx,yyy,zzz) VALUES(&#39;$(var(x){s.select,0,_})&#39;,&#39;$(var(x){s.select,1,_})&#39;,&#39;$(var(x){s.select,2,_})&#39;)&quot;);<br>
<br>Now, have to look how to remove these entries during de-registration.<br><br>Thanks,<br>Prem<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">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 class="im">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(&quot;avpops&quot;,&quot;db_url&quot;,&quot;mysql://user:passwd@host/database&quot;)<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 class="im"><br>
&gt;  I want the userpart e.g: sip:userpart@domain 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">mayamatakeshi@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:mayamatakeshi@gmail.com">mayamatakeshi@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     On Wed, Jul 7, 2010 at 7:32 PM, Premalatha Kuppan<br>
</div><div><div></div><div class="h5">&gt;     &lt;<a href="mailto:premalatha@ngintech.com">premalatha@ngintech.com</a> &lt;mailto:<a href="mailto:premalatha@ngintech.com">premalatha@ngintech.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         Hi,<br>
&gt;<br>
&gt;         Iam using avp_db_query, but opensips is dead with following error,<br>
&gt;<br>
&gt;         During Registration, when the user is registered. I have to<br>
&gt;         parse and store th value in DB. So, included the avp_db_query<br>
&gt;         in this loop. Is this right one to do. I assume the value of<br>
&gt;         rU is NULL over here, probably its failing. Not sure :(<br>
&gt;<br>
&gt;         Any insight  ?<br>
&gt;<br>
&gt;         if (is_method(&quot;REGISTER&quot;))<br>
&gt;                 {<br>
&gt;                         # authenticate the REGISTER requests<br>
&gt;         (uncomment to enable auth)<br>
&gt;                         if (!www_authorize(&quot;10.140.1.110&quot;, &quot;subscriber&quot;))<br>
&gt;                         {<br>
&gt;                                 www_challenge(&quot;10.140.1.110&quot;, &quot;0&quot;);<br>
&gt;                                 exit;<br>
&gt;                         }<br>
&gt;<br>
&gt;                      #  if (!db_check_to())<br>
&gt;                      #  {<br>
&gt;                      #          sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);<br>
&gt;                      #          exit;<br>
&gt;                      #  }<br>
&gt;<br>
&gt;                         if (!save(&quot;location&quot;))<br>
&gt;                                 sl_reply_error();<br>
&gt;<br>
&gt;                         $var(x) = $rU ;<br>
&gt;                         avp_db_query(&quot;INSERT INTO TESTTABLE<br>
&gt;         (xxx,yyy,zzz)<br>
&gt;         VALUES(&#39;$(var(x){s.select,0,_})&#39;,&#39;$var(x)({s.select,1,_})&#39;,&#39;$(var(x){s.select,2,_})&#39;&quot;);<br>
&gt;                         exit;<br>
&gt;                 }<br>
&gt;<br>
&gt;<br>
&gt;         Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
&gt;         ERROR:avpops:fixup_db_query_avp: no db url defined to be used<br>
&gt;         by this function<br>
&gt;         Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
&gt;         *ERROR:core:fix_actions: fixing failed (code=-6) at cfg line 351*<br>
&gt;         Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]:<br>
&gt;         ERROR:core:main: failed to fix configuration with err code -6<br>
&gt;<br>
&gt;<br>
&gt;     Clearly you misplaced the parenthesis:<br>
&gt;<br>
&gt;<br>
&gt;     $(var(x){s.select,0,_})&#39;,<br>
&gt;     &#39;$var(x)({s.select,1,_})&#39;,<br>
&gt;     &#39;$(var(x){s.select,2,_})&#39;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     Users mailing list<br>
</div></div>&gt;     <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
<div class="im">&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>
&gt;<br>
</div>&gt; ------------------------------------------------------------------------<br>
<div class="im">&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">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 class="im">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 class="h5">Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">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>