I don't think the 'time' value is valid. If it incorporates whitespace, it needs to be: "new Date()".

--
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

Sent from my BlackBerry.
From: Kelvin Chua
Sent: Saturday, June 27, 2015 10:05
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Reply To: Kamailio (SER) - Users Mailing List
Subject: [SR-Users] invalid char in json text

Playing around with ndb_mongodb

getting this error:

ERROR: ndb_mongodb [mongodb_client.c:262]: mongodbc_exec_cmd(): Failed to run command: lexical error: invalid char in json text

query is very simple:
db.cdrs.insert({time:new Date(),src_user:"kelvin",term_ani:"14112",src_domain:"domain.com",src_ip:"0",dst_ouser:"18188",dst_user:"18112",dst_domain:"domain.com"})

which is inside a pv
mongodb_cmd("mgs1", "datab", "cdrs", "$var(MNG_MISSED)", "mgr1");

tried this:
insert({time:new Date(),src_user:"kelvin",term_ani:"14112",src_domain:"domain.com",src_ip:"0",dst_ouser:"18188",dst_user:"18112",dst_domain:"domain.com"})

and other combinations, same error

any ideas? i guess we need some more examples on the documentation


Kelvin Chua