[OpenSIPS-Users] mongo query and params confusion
Tito Cumpen
tito at xsvoce.com
Tue Sep 9 15:53:40 CEST 2014
Liviu,
Thanks for your reply
this worked for me cache_raw_query("mongodb:instance1","{
\"op\" : \"find\",\"query\": { \"User\" : \"$rU\"} }","$avp(mongo_result)");
The documentation is lacking the escape characters around the pseudo
variables. Unless this is assumed it should be added otherwise a JSON parse
error is thrown.
Ovidiu,
Thanks for the suggestions.
Thanks,
Tito
On Tue, Sep 9, 2014 at 7:55 AM, Liviu Chircu <liviu at opensips.org> wrote:
> Hello Tito,
>
> Either use the group name everywhere, or don't specify it at all in the
> modparam:
>
> modparam("db_cachedb","cachedb_url","mongodb://localhost ...
> or
> cache_raw_query("mongodb:instance1" ...
>
>
> Best regards,
>
> Liviu Chircu
> OpenSIPS Developerhttp://www.opensips-solutions.com
>
> On 09/09/2014 03:11 AM, Tito Cumpen wrote:
>
> Ovidiu,
>
>
> I have corrected the param and now I am seeing opensips start without a
> problem the query problem still persists with the error
>
> /sbin/opensips[22454]: ERROR:core:cachedb_raw_query: failed to get
> connection for grp name []
>
> I am not seeing any attempts being made from this server to the my mongo
> instance on the ingress interface. Any ideas??
>
>
>
> Thanks,
>
> Tito
>
>
>
> On Mon, Sep 8, 2014 at 8:01 PM, Ovidiu Sas <osas at voipembedded.com> wrote:
>
>> Here's what works for me (I use both mongo and cache):
>> loadmodule "cachedb_mongodb.so"
>> modparam("cachedb_mongodb",
>> "cachedb_url","mongodb:instance1://localhost:27017/db.collection")
>> loadmodule "db_cachedb.so"
>>
>> modparam("db_cachedb","cachedb_url","mongodb:instance1://localhost:27017/db.collection")
>>
>> You have the wrong module name (cachedb_mongo vs. cachedb_mongodb)
>>
>> Regards,
>> Ovidiu Sas
>>
>> On Mon, Sep 8, 2014 at 7:50 PM, Tito Cumpen <tito at xsvoce.com> wrote:
>> > Hello Group,
>> >
>> >
>> > I am perplexed about what the correct params are to point opensips to an
>> > instance of mongodb
>> >
>> >
>> > I am currently using these
>> >
>> >
>> > loadmodule "db_cachedb.so"
>> >
>> > loadmodule "cachedb_mongodb.so"
>> >
>> >
>> >
>> modparam("cachedb_mongo","cachedb_url","mongodb:instance1://162.XXX.XX.XXXX:27017/AOR.Location")
>> >
>> > which triggers this error
>> >
>> > Parameter <cachedb_url> not found in module <cachedb_mongo> - can't set
>> >
>> > Alternatively I have tried using :
>> >
>> >
>> >
>> modparam("db_cachedb","cachedb_url","mongodb:instance1://162.XX.XX.XX:27017/AOR.Location")
>> >
>> > which would cause the following error when running this query
>> >
>> > cache_raw_query("mongodb","{ \"op\" : \"find\", \"ns\" :
>> > \"AOR.Location\", \"query\": {\"User\" : $rU} }","$avp(mongo_result)");
>> >
>> >
>> > ERROR:core:cachedb_raw_query: failed to get connection for grp name [}
>> >
>> > I am using Opensips version 1.11
>> >
>> > Thanks
>> >
>> >
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opensips.org
>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>>
>> --
>> VoIP Embedded, Inc.
>> http://www.voipembedded.com
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> 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/20140909/37541fb0/attachment.htm>
More information about the Users
mailing list