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 parse and store th value in DB. So, included the avp_db_query in this loop. Is this right one to do. I assume the value of rU is NULL over here, probably its failing. Not sure :(<br>
<br>Any insight  ?<br><br>if (is_method(&quot;REGISTER&quot;))<br>        {<br>                # authenticate the REGISTER requests (uncomment to enable auth)<br>                if (!www_authorize(&quot;10.140.1.110&quot;, &quot;subscriber&quot;))<br>
                {<br>                        www_challenge(&quot;10.140.1.110&quot;, &quot;0&quot;);<br>                        exit;<br>                }<br><br>             #  if (!db_check_to())<br>             #  {<br>
             #          sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);<br>             #          exit;<br>             #  }<br><br>                if (!save(&quot;location&quot;))<br>                        sl_reply_error();<br>
              <br>                $var(x) = $rU ;<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>
                exit;<br>        }<br><br><br>Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]: ERROR:avpops:fixup_db_query_avp: no db url defined to be used by this function<br>Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]: <b>ERROR:core:fix_actions: fixing failed (code=-6) at cfg line 351</b><br>
Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]: ERROR:core:main: failed to fix configuration with err code -6<br><br>Thanks,<br>Prem<br><br><br><br><div class="gmail_quote">On Tue, Jul 6, 2010 at 7:57 PM, Brett Nemeroff <span dir="ltr">&lt;<a href="mailto:brett@nemeroff.com">brett@nemeroff.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;"><div class="im">On Tue, Jul 6, 2010 at 9:19 AM, Premalatha Kuppan <span dir="ltr">&lt;<a href="mailto:premalatha@ngintech.com" target="_blank">premalatha@ngintech.com</a>&gt;</span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

My Purpose:<br><br>1. At Opensips, iam getting registration request as sip:aaa_bbb_cc@domain.<br>So, i need to parse this &quot;username: aaa_bbb_ccc&quot; and store it in MySQL DB as aaa,bbb,ccc against the coulmn a,b,c.<br>



<br>2. When user is registred, the URL has to be parsed and stored. During de-registration corresponding entries from the MYSQL table should be deleted.<br><br>3. In test.sh: iam parsing the username e.g &quot;aaa_bbb_ccc&quot; and rewriting it as &quot;aaa&quot;,&quot;bbb&quot;,&quot;ccc&quot; and storing it in MySQL DB.<br>



<br>Now to integrate with OpenSIPS as a fisrt step during registration , iam using exec_msg to execute this test.sh.<br><br>Is there any other solution, i can do it. ?<br><br></blockquote><div><br></div></div><div>Ok, well the registrar module has a lot of mechanism to store registrations already. So I&#39;d definitely look at using those. For your custom parsing needs, I&#39;d look at using the &quot;select&quot; pseudo-var transformation.... You&#39;ll need to check on the exact syntax, but it&#39;ll be something like:</div>


<div><br></div><div>$(rU{s.select,1,_})  # is bbb</div><div><br></div><div>Then you can use avp_db_query to push that direct to the database like:</div><div><br></div><div>avp_db_query(&quot;INSERT INTO MyFunnyRegistration VALUES($(rU{s.select,0,_}),$(rU{s.select,1,_}),$(rU{s.select,2,_}));</div>


<div><br></div><div><br></div><div>That should get you going on something. :)</div><div>-Brett</div><div><br></div></div>
<br>_______________________________________________<br>
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>
<br></blockquote></div><br>