[SR-Users] error using avp_db_load with mongodb

hdssdsdsdsfsdf hdssdsdsdsfsdf hdssdsdsdsfsdf at mail.com
Mon Jul 31 11:59:27 CEST 2017


And apologies. Solved it. It was indeed the type problem, where I had to insert the "type" field as "NumberInt(0)" to prevent it from turning into a float (which the "typeof" command I use to check if they were the same type didn't show as different, but just as a number).

> Sent: Monday, July 31, 2017 at 11:51 AM
> From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsfsdf at mail.com>
> To: sr-users at lists.kamailio.org
> Cc: sr-users at lists.kamailio.org
> Subject: Re: [SR-Users] error using avp_db_load with mongodb
>
> Correction, the error is actually:
> ERROR: avpops [avpops_impl.c:123]: dbrow2avp(): wrong field types in dbrow
> 
> 
> > Sent: Monday, July 31, 2017 at 10:55 AM
> > From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsfsdf at mail.com>
> > To: sr-users at lists.kamailio.org
> > Cc: "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org>
> > Subject: Re: [SR-Users] error using avp_db_load with mongodb
> >
> > Thanks, I changed that, but that doesn't deal with the original problem.
> > 
> > I still have the situation where I've two mongodb entries that are completely similar:
> > { "_id" : ObjectId("597b5698e498421a40458dc3"), "uuid" : "", "attribute" : "email", "value" : "sip:555 at bla.bla", "type" : 0, "username" : "555", "domain" : null }
> > { "_id" : ObjectId("597b5d9a61d1521f067391ae"), "uuid" : "", "attribute" : "email", "value" : "sip:123 at bla.bla", "type" : 0, "username" : "666", "domain" : null }
> > 
> > with:
> > avp_db_load("$tu/username", "$avp(s:email)")
> > 
> > succeeding on the first entry (when $tu contains 555) and failing on the second entry (when $tu contains 666), with error message:
> > 
> > ERROR: <core> [usr_avp.c:424]: search_avp(): 0 ID or NULL NAME AVP!
> > 
> > 
> > > Sent: Monday, July 31, 2017 at 9:10 AM
> > > From: "Sebastian Damm" <damm at sipgate.de>
> > > To: "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org>
> > > Subject: Re: [SR-Users] error using avp_db_load with mongodb
> > >
> > > Hi,
> > > 
> > > On Fri, Jul 28, 2017 at 6:03 PM, hdssdsdsdsfsdf hdssdsdsdsfsdf
> > > <hdssdsdsdsfsdf at mail.com> wrote:
> > > >                         if (avp_db_load("$to/username", "$avp(s:email)")) {
> > > >                                 xlog("bla02");
> > > >                         }
> > > 
> > > $to is not a valid pseudo variable. You probably want to replace
> > > "$to/username" by "$tU" or "$rU" or some variable where the user you
> > > are searching is written in the SIP packet.
> > > 
> > > BR
> > > Sebastian
> > > 
> > > _______________________________________________
> > > Kamailio (SER) - Users Mailing List
> > > sr-users at lists.kamailio.org
> > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > > 
> > 
> > _______________________________________________
> > Kamailio (SER) - Users Mailing List
> > sr-users at lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > 
> 
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 



More information about the sr-users mailing list