[Users] OpenSER crashes when attempting to use null avp variable

Ovidiu Sas sip.nslu at gmail.com
Fri Mar 23 16:32:37 CET 2007


Hi Daniel,


Maybe there should be some rules posted on the openser website about
mailing list usage, like "hit the reply to all button, not the just
the reply" ....

just my 2c


Regards,
Ovidiu Sas

On 3/23/07, Daniel-Constantin Mierla <daniel at voice-system.ro> wrote:
> Hello,
>
> On 03/23/07 13:59, Asterisk Expert wrote:
> > Hello Daniel,
> > I just figured out. I forgot to set db url for avpops :))
> > But in this case openser should not start and give error. not?
> does now, thanks for reporting (just committed on svn).
> > Instead it started and when executed mysql query, it crashed.
> > I have one more query. I read that if we set onreply_avp_mode=1 in tm
> > module, we can access avp variables in reply routes. I have done the
> > same. I set some avp value in request route and update mysql db based
> > on that value in reply route but I'm getting null :(
> > What do you think will be the problem?
> I will check it.
>
> Cheers,
> Daniel
>
> >
> >
> > On 3/23/07, *Daniel-Constantin Mierla* <daniel at voice-system.ro
> > <mailto:daniel at voice-system.ro> > wrote:
> >
> >     Hello,
> >
> >     i tried to reproduce, but I got no same result. If the avp is
> >     null, the
> >     returned values is false in comparisons.
> >
> >     Could you send log messages and backtrace?
> >
> >     Cheers,
> >     Daniel
> >
> >
> >     On 03/23/07 10:37, Asterisk Expert wrote:
> >     > Hello,
> >     > I'm using openser 1.2.0 . I have following section in my
> >     openser.cfg.
> >     >
> >     > avp_db_query("SELECT active, accountcode FROM openser_ip_auth WHERE
> >     > ip_addr='$src_ip'","$avp(s:active);$avp(s:accountcode)");
> >     >         xlog("L_INFO", "\n$avp(s:active):::$avp(s:accountcode)\n");
> >     >         if (!avp_check("$avp(s:active)","eq/1/I"))
> >     >         {
> >     >             xlog("L_ERR", "$si [$Tf]: $rm $fu -> $ru: REGISTER: bad
> >     > credentials, ask for credentials\n");
> >     >
> >     >             #authentication failed
> >     >             www_challenge("", "0");
> >     >             setflag(1);
> >     >             return;
> >     >         }
> >     > Basically I'm doing IP based authentication. I have used the similar
> >     > method in version 1.1 but openser 1.2.0 crashes if the query in
> >     > avp_db_query returns no rows which keeps those two avp variables
> >     null.
> >     > Is this a bug or I'm doing something wrong?
> >     > I also tried "==" operator for comparison but it crashes whenever it
> >     > is trying to access one of those two variables.
> >     > --
> >     > Regards
> >     > Ruchir Brahmbhatt
> >     > Ecosmob Technologies
> >     >
> >     ------------------------------------------------------------------------
> >     >
> >     > _______________________________________________
> >     > Users mailing list
> >     > Users at openser.org <mailto:Users at openser.org>
> >     > http://openser.org/cgi-bin/mailman/listinfo/users
> >     >
> >
> >
> >
> >
> > --
> > Regards
> > Ruchir Brahmbhatt
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>




More information about the sr-users mailing list