[OpenSIPS-Users] URI PARSING

Premalatha Kuppan premalatha at ngintech.com
Wed Jul 7 13:01:04 CEST 2010


Thanks. Corrected teh opensips.cfg file

But the problem was due to this. by default DB URL was NULL. Now i have
added the DB URL for avpops.

# default URL
modparam("avpops","db_url","mysql://user:passwd@host/database")

But the value of $rU is NULL..am i placing it in wrong location?
 I want the userpart e.g: sip:userpart at domain is the request uri; i need
only userpart . I believe that would be stored in $rU; but tis coming as
NULL. Which variable or where should i place this command for registration
and de-registration.

Any Idea ?

On Wed, Jul 7, 2010 at 4:13 PM, mayamatakeshi <mayamatakeshi at gmail.com>wrote:

>
>
> On Wed, Jul 7, 2010 at 7:32 PM, Premalatha Kuppan <premalatha at ngintech.com
> > wrote:
>
>> Hi,
>>
>> Iam using avp_db_query, but opensips is dead with following error,
>>
>> 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 :(
>>
>> Any insight  ?
>>
>> if (is_method("REGISTER"))
>>         {
>>                 # authenticate the REGISTER requests (uncomment to enable
>> auth)
>>                 if (!www_authorize("10.140.1.110", "subscriber"))
>>                 {
>>                         www_challenge("10.140.1.110", "0");
>>                         exit;
>>                 }
>>
>>              #  if (!db_check_to())
>>              #  {
>>              #          sl_send_reply("403","Forbidden auth ID");
>>              #          exit;
>>              #  }
>>
>>                 if (!save("location"))
>>                         sl_reply_error();
>>
>>                 $var(x) = $rU ;
>>                 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,_})'");
>>                 exit;
>>         }
>>
>>
>> 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
>> Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]: *ERROR:core:fix_actions:
>> fixing failed (code=-6) at cfg line 351*
>> Jul  7 06:25:16 204548-4 /usr/local/sbin/opensips[17791]: ERROR:core:main:
>> failed to fix configuration with err code -6
>>
>
> Clearly you misplaced the parenthesis:
>
>
> $(var(x){s.select,0,_})',
> '$var(x)({s.select,1,_})',
> '$(var(x){s.select,2,_})'
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100707/19174467/attachment.htm 


More information about the Users mailing list