Re: [SR-Users] avpops and mongo problem

2018-03-22 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi,

We're using kamailio 4.4.4
With a previous instance of this version, we did not have the problem, but the 
mongo setup was different.

> Sent: Wednesday, March 21, 2018 at 8:17 PM
> From: "Henning Westerholt" <h...@kamailio.org>
> To: sr-users@lists.kamailio.org
> Cc: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> Subject: Re: [SR-Users] avpops and mongo problem
>
> Am Mittwoch, 21. März 2018, 17:35:17 CET schrieb hdssdsdsdsfsdf 
> hdssdsdsdsfsdf:
> > I have kamailio setup that uses a mongo cluster, and everything works fine.
> > Only I have problems with the avpops module. The avp_db_load fails with
> > "field [attribute] not found in result iterator", even if the attribute
> > field is present in the object in mongo. Does anybody know what could be
> > going wrong?
> 
> Hello,
> 
> what version you are using? There has been some fixes beginning of march in 
> db_mongodb related to result iteration. This might be your problem as well.
> 
> The 5.1 branch contains the fix I mentioned.
> 
> Best regards,
> 
> Henning
> 
> 
> > 
> > === kamailio.cfg:
> > ...
> > #  avpops params 
> > modparam("avpops", "db_url", DBURL)
> > modparam("avpops", "avp_table", "usr_preferences")
> > 
> > ...
> > 
> > xlog("trying avp_db_load\n");
> > if (avp_db_load("$fu/username", "$avp(s:attributevalue)")) {
> > xlog("if succeeded\n");
> > }
> > xlog("if not succeeded\n");
> > ...
> > 
> > === mongo:
> > rs:SECONDARY> db.usr_preferences.find({"username":"1234567890"})
> > { "_id" : ObjectId("5ab22a5b384cd2aa0d4cf403"), "attribute" :
> > "attributevalue", "username" : "1234567890", "domain" : null, "value" :
> > "750", "uuid" : "", "type" : 0 }
> > ===
> >  syslog:
> > ...
> > Mar 21 17:15:16 c /opt/kamailio/sbin/kamailio[2544]: ERROR: 

[SR-Users] avpops and mongo problem

2018-03-21 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi all,

I have kamailio setup that uses a mongo cluster, and everything works fine. 
Only I have problems with the avpops module. The avp_db_load fails with "field 
[attribute] not found in result iterator", even if the attribute field is 
present in the object in mongo. Does anybody know what could be going wrong?

Thanks in advance, and kind regards,

===
kamailio.cfg:
...
#  avpops params 
modparam("avpops", "db_url", DBURL)
modparam("avpops", "avp_table", "usr_preferences")

...

xlog("trying avp_db_load\n");
if (avp_db_load("$fu/username", "$avp(s:attributevalue)")) {
xlog("if succeeded\n");
}
xlog("if not succeeded\n");
...
===
mongo:
rs:SECONDARY> db.usr_preferences.find({"username":"1234567890"})
{ "_id" : ObjectId("5ab22a5b384cd2aa0d4cf403"), "attribute" : "attributevalue", 
"username" : "1234567890", "domain" : null, "value" : "750", "uuid" : "", 
"type" : 0 }
===
syslog:
...
Mar 21 17:15:16 c /opt/kamailio/sbin/kamailio[2544]: ERROR: 

[SR-Users] (no subject)

2018-03-21 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi all,

I have kamailio setup that uses a mongo cluster, and everything works fine. 
Only I have problems with the avpops module. The avp_db_load fails with "field 
[attribute] not found in result iterator", even if the attribute field is 
present in the object in mongo. Does anybody know what could be going wrong?

Thanks in advance, and kind regards,

===
kamailio.cfg:
...
#  avpops params 
modparam("avpops", "db_url", DBURL)
modparam("avpops", "avp_table", "usr_preferences")

...

xlog("trying avp_db_load\n");
if (avp_db_load("$fu/username", "$avp(s:attributevalue)")) {
xlog("if succeeded\n");
}
xlog("if not succeeded\n");
...
===
mongo:
rs:SECONDARY> db.usr_preferences.find({"username":"1234567890"})
{ "_id" : ObjectId("5ab22a5b384cd2aa0d4cf403"), "attribute" : "attributevalue", 
"username" : "1234567890", "domain" : null, "value" : "750", "uuid" : "", 
"type" : 0 }
===
syslog:
...
Mar 21 17:15:16 c /opt/kamailio/sbin/kamailio[2544]: ERROR: 

Re: [SR-Users] authenticating to mongodb fails

2018-03-21 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi,

Thanks for the reply. Sorry for my late reply. I got things to work back then 
so the problem is solved. It was mostly my mistake, but in case it helps anyone 
in the future:

1 I needed to compile the mongocdriver with ssl: ./configure --enable-ssl
2 Not sure, but it might also have been relevant to change the dburi and 
include "=kamailio" as a parameter there (even if I think the 
"/kamailio?" might already have been enough for that).

Thanks again and kind regards,



> Sent: Thursday, November 23, 2017 at 10:20 AM
> From: "Daniel-Constantin Mierla" <mico...@gmail.com>
> To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org>, 
> "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> Subject: Re: [SR-Users] authenticating to mongodb fails
>
> Hello,
> 
> got distracted by other tasks, it's always good to send reminders if no
> reaction for long time ...
> 
> Looking now at the error messages, I see:
> 
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> [mongodb_connection.c:55]: db_mongodb_new_connection(): connection open to: 
> mongodb://kam:kam@localhost/kamailio
> 
> which means that mongoc_client_new() was happy and returned a connection 
> pointer.
> 
> But later:
> 
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> [db.c:403]: db_table_version(): no row for table location found
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> [db.c:439]: db_check_table_version(): invalid version 0 for table location 
> found, expected 8 (check table structure and table "version")
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR: usrloc 
> [dlist.c:659]: register_udomain(): error during table version check.
> 
> So the error is kamailio not retrieving the version for location table.
> 
> I guess you created the version "table", if it works without
> authentication, right?
> 
> If yes, can you see if the next article can provide you some hints:
> 
>   - http://mongoc.org/libmongoc/current/authentication.html
> 
> Cheers,
> Daniel
> 
> On 22.11.17 13:45, hdssdsdsdsfsdf hdssdsdsdsfsdf wrote:
> > Would it be useful to file a bugreport for this with the information 
> > provided? Or better to wait/research myself. Since the usage of mongodb 
> > authentication seems in line with what should work.
> >
> >> Sent: Monday, November 13, 2017 at 1:16 PM
> >> From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> >> To: sr-users@lists.kamailio.org
> >> Cc: "'Kamailio (SER) - Users Mailing List'" <sr-users@lists.kamailio.org>
> >> Subject: Re: [SR-Users] authenticating to mongodb fails
> >>
> >> Any idea if it's a setting that I can easily change that's wrong, or that 
> >> it's a bug?
> >>
> >>> Sent: Wednesday, November 08, 2017 at 1:49 PM
> >>> From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> >>> To: mico...@gmail.com
> >>> Cc: "'Kamailio (SER) - Users Mailing List'" <sr-users@lists.kamailio.org>
> >>> Subject: Re: [SR-Users] authenticating to mongodb fails
> >>>
> >>> That last email seems unrelated indeed. You were right about the logs. 
> >>> Below are the logs from syslog and the logs containing mongo in the debug 
> >>> logs. Please let me know if this format is not working for you or if you 
> >>> need more.
> >>>
> >>> If I start mongo without authentication *and* remove the "kam:kam@" in 
> >>> the debug url, everything works fine.
> >>>
> >>> in syslog:
> >>> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> >>> [db.c:314]: db_do_init2(): connection 0x7fe12901a318 not found in pool
> >>> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: 
> >>> db_mongodb [mongodb_connection.c:55]: db_mongodb_new_connection(): 
> >>> connection open to: mongodb://kam:kam@localhost/kamailio
> >>> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: 
> >>> db_mongodb [mongodb_dbase.c:851]: db_mongodb_query(): query to collection 
> >>> [version]
> >>> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: 
> >>> db_mongodb [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { 
> >>> "table_name" : "location" }
> >>> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: 
> >>> db_mong

Re: [SR-Users] authenticating to mongodb fails

2017-11-22 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Would it be useful to file a bugreport for this with the information provided? 
Or better to wait/research myself. Since the usage of mongodb authentication 
seems in line with what should work.

> Sent: Monday, November 13, 2017 at 1:16 PM
> From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> To: sr-users@lists.kamailio.org
> Cc: "'Kamailio (SER) - Users Mailing List'" <sr-users@lists.kamailio.org>
> Subject: Re: [SR-Users] authenticating to mongodb fails
>
> Any idea if it's a setting that I can easily change that's wrong, or that 
> it's a bug?
> 
> > Sent: Wednesday, November 08, 2017 at 1:49 PM
> > From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> > To: mico...@gmail.com
> > Cc: "'Kamailio (SER) - Users Mailing List'" <sr-users@lists.kamailio.org>
> > Subject: Re: [SR-Users] authenticating to mongodb fails
> >
> > That last email seems unrelated indeed. You were right about the logs. 
> > Below are the logs from syslog and the logs containing mongo in the debug 
> > logs. Please let me know if this format is not working for you or if you 
> > need more.
> > 
> > If I start mongo without authentication *and* remove the "kam:kam@" in the 
> > debug url, everything works fine.
> > 
> > in syslog:
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> > [db.c:314]: db_do_init2(): connection 0x7fe12901a318 not found in pool
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> > [mongodb_connection.c:55]: db_mongodb_new_connection(): connection open to: 
> > mongodb://kam:kam@localhost/kamailio
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> > [mongodb_dbase.c:851]: db_mongodb_query(): query to collection [version]
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> > [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "table_name" : 
> > "location" }
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> > [mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { 
> > "table_version" : 1 }
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> > [db_res.c:116]: db_new_result(): allocate 56 bytes for result set at 
> > 0x7fe12901a508
> > Nov  8 13:32:21 x mongod.27017[1290]: [thread1] connection accepted 
> > from 127.0.0.1:52663 #6 (1 connection now open)
> > Nov  8 13:32:21 x kamailio[2289]: loading modules under config path: 
> > /opt/kamailio/lib64/kamailio/modules
> > Nov  8 13:32:21 x kamailio[2289]: Listening on
> > Nov  8 13:32:21 x kamailio[2289]: udp: :5060
> > Nov  8 13:32:21 x kamailio[2289]: Aliases:
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> > [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> > [db.c:403]: db_table_version(): no row for table location found
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> > [db.c:439]: db_check_table_version(): invalid version 0 for table location 
> > found, expected 8 (check table structure and table "version")
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR: usrloc 
> > [dlist.c:659]: register_udomain(): error during table version check.
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> > [db_pool.c:100]: pool_remove(): removing connection from the pool
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR: registrar 
> > [reg_mod.c:566]: domain_fixup(): failed to register domain
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> > [route.c:1154]: fix_actions(): fixing failed (code=-1) at 
> > cfg:/opt/kamailio/etc/kamailio/kamailio.cfg:199
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> > [route.c:1154]: fix_actions(): fixing failed (code=-1) at 
> > cfg:/opt/kamailio/etc/kamailio/kamailio.cfg:223
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> > [route.c:1154]: fix_actions(): fixing failed (code=-1) at 
> > cfg:/opt/kamailio/etc/kamailio/kamailio.cfg:225
> > Nov  8 13:32:21 x mongod.27017[1290]: [conn6] end connection 
> > 127.0.0.1:52663 (1 connection now open)
> > Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: tm 
> > [t_funcs.c:86]: tm_shutdown(): DEBUG: tm_shutdown : start
> > Nov  8 13:32:21 x /opt/kamailio/sbin/ka

Re: [SR-Users] authenticating to mongodb fails

2017-11-13 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Any idea if it's a setting that I can easily change that's wrong, or that it's 
a bug?

> Sent: Wednesday, November 08, 2017 at 1:49 PM
> From: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> To: mico...@gmail.com
> Cc: "'Kamailio (SER) - Users Mailing List'" <sr-users@lists.kamailio.org>
> Subject: Re: [SR-Users] authenticating to mongodb fails
>
> That last email seems unrelated indeed. You were right about the logs. Below 
> are the logs from syslog and the logs containing mongo in the debug logs. 
> Please let me know if this format is not working for you or if you need more.
> 
> If I start mongo without authentication *and* remove the "kam:kam@" in the 
> debug url, everything works fine.
> 
> in syslog:
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> [db.c:314]: db_do_init2(): connection 0x7fe12901a318 not found in pool
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> [mongodb_connection.c:55]: db_mongodb_new_connection(): connection open to: 
> mongodb://kam:kam@localhost/kamailio
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> [mongodb_dbase.c:851]: db_mongodb_query(): query to collection [version]
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "table_name" : 
> "location" }
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> [mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { "table_version" 
> : 1 }
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> [db_res.c:116]: db_new_result(): allocate 56 bytes for result set at 
> 0x7fe12901a508
> Nov  8 13:32:21 x mongod.27017[1290]: [thread1] connection accepted from 
> 127.0.0.1:52663 #6 (1 connection now open)
> Nov  8 13:32:21 x kamailio[2289]: loading modules under config path: 
> /opt/kamailio/lib64/kamailio/modules
> Nov  8 13:32:21 x kamailio[2289]: Listening on
> Nov  8 13:32:21 x kamailio[2289]: udp: :5060
> Nov  8 13:32:21 x kamailio[2289]: Aliases:
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
> [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> [db.c:403]: db_table_version(): no row for table location found
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> [db.c:439]: db_check_table_version(): invalid version 0 for table location 
> found, expected 8 (check table structure and table "version")
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR: usrloc 
> [dlist.c:659]: register_udomain(): error during table version check.
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> [db_pool.c:100]: pool_remove(): removing connection from the pool
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR: registrar 
> [reg_mod.c:566]: domain_fixup(): failed to register domain
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> [route.c:1154]: fix_actions(): fixing failed (code=-1) at 
> cfg:/opt/kamailio/etc/kamailio/kamailio.cfg:199
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> [route.c:1154]: fix_actions(): fixing failed (code=-1) at 
> cfg:/opt/kamailio/etc/kamailio/kamailio.cfg:223
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: ERROR:  
> [route.c:1154]: fix_actions(): fixing failed (code=-1) at 
> cfg:/opt/kamailio/etc/kamailio/kamailio.cfg:225
> Nov  8 13:32:21 x mongod.27017[1290]: [conn6] end connection 
> 127.0.0.1:52663 (1 connection now open)
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: tm 
> [t_funcs.c:86]: tm_shutdown(): DEBUG: tm_shutdown : start
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: tm 
> [t_funcs.c:89]: tm_shutdown(): DEBUG: tm_shutdown : emptying hash table
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: tm 
> [t_funcs.c:91]: tm_shutdown(): DEBUG: tm_shutdown : removing semaphores
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: tm 
> [t_funcs.c:93]: tm_shutdown(): DEBUG: tm_shutdown : destroying tmcb lists
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: tm 
> [t_funcs.c:96]: tm_shutdown(): DEBUG: tm_shutdown : done
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: INFO:  
> [sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
> Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
> [mem/shm.c:174]: shm_core_lock_destroy(): destroying the shared memory lock
> Nov  8 13:32:21 x /opt/kamailio/sbin

Re: [SR-Users] authenticating to mongodb fails

2017-11-08 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
io: DEBUG:  [cfg.lex:1703]: pp_define(): 
defining id: MOD_db_mongodb
Nov  8 13:32:21 x kamailio: DEBUG:  [cfg.lex:1812]: pp_define_get(): 
### returning define ID [DBURL] value ["mongodb://kam:kam@localhost/kamailio"]
Nov  8 13:32:21 x kamailio: DEBUG:  [cfg.lex:1812]: pp_define_get(): 
### returning define ID [DBURL] value ["mongodb://kam:kam@localhost/kamailio"]
Nov  8 13:32:21 x kamailio: DEBUG:  [cfg.lex:1812]: pp_define_get(): 
### returning define ID [DBURL] value ["mongodb://kam:kam@localhost/kamailio"]
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[sr_module.c:694]: find_mod_export_record(): find_export_record: found 
 in module db_mongodb 
[/opt/kamailio/lib64/kamailio/modules/db_mongodb.so]
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[db.c:209]: db_bind_mod(): using db bind api for db_mongodb
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[sr_module.c:965]: init_mod(): db_mongodb
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
[db_mongodb_mod.c:98]: mod_init(): module initializing
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[sr_module.c:694]: find_mod_export_record(): find_export_record: found 
 in module db_mongodb 
[/opt/kamailio/lib64/kamailio/modules/db_mongodb.so]
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[db.c:209]: db_bind_mod(): using db bind api for db_mongodb
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[sr_module.c:694]: find_mod_export_record(): find_export_record: found 
 in module db_mongodb 
[/opt/kamailio/lib64/kamailio/modules/db_mongodb.so]
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG:  
[db.c:209]: db_bind_mod(): using db bind api for db_mongodb
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
[mongodb_connection.c:55]: db_mongodb_new_connection(): connection open to: 
mongodb://kam:kam@localhost/kamailio
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
[mongodb_dbase.c:851]: db_mongodb_query(): query to collection [version]
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
[mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "table_name" : 
"location" }
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
[mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { "table_version" : 
1 }
Nov  8 13:32:21 x /opt/kamailio/sbin/kamailio[2291]: DEBUG: db_mongodb 
[mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb


> Sent: Wednesday, November 08, 2017 at 9:21 AM
> From: "Daniel-Constantin Mierla" <mico...@gmail.com>
> To: tr...@lindows.org, "'Kamailio (SER) - Users Mailing List'" 
> <sr-users@lists.kamailio.org>, "'hdssdsdsdsfsdf hdssdsdsdsfsdf'" 
> <hdssdsdsdsf...@mail.com>
> Subject: Re: [SR-Users] authenticating to mongodb fails
>
> This last response was either misdirected (reply to wrong email) or
> lacks more details, because it feels somehow out of context...
> 
> Cheers,
> Daniel
> 
> 
> On 07.11.17 22:10, Trent wrote:
> > I went ahead and performed the firmware upgrade since it only takes less 
> > than 5 minutes to do.
> >
> > Do report your experience on this. 
> >
> >
> >
> > Trent Creekmore
> > Manager of Support
> > IP PBX Support
> > “Where the Support Comes before the Sale”
> > (408) 414-7515 Extension 404
> >
> >
> > -Original Message-
> > From: sr-users [mailto:sr-users-boun...@lists.kamailio.org] On Behalf Of 
> > Daniel-Constantin Mierla
> > Sent: Tuesday, November 7, 2017 10:46 AM
> > To: hdssdsdsdsfsdf hdssdsdsdsfsdf <hdssdsdsdsf...@mail.com>
> > Cc: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
> > Subject: Re: [SR-Users] authenticating to mongodb fails
> >
> > I do not see any log message with DEBUG (only INFO and WARNING), are you 
> > sure you set debug=3 properly?
> >
> > Cheers,
> > Daniel
> >
> >
> > On 07.11.17 16:43, hdssdsdsdsfsdf hdssdsdsdsfsdf wrote:
> >> Thanks for looking into this. I set debug=3 which gives the following 
> >> debug messages. I included the mongod messages, which show a connection 
> >> and end, but no succesful or failed authentication.
> >>
> >> nov  7 15:45:21 kamailio: INFO:  [sctp_core.c:75]: 
> >> sctp_core_check_support(): SCTP API not enabled - if you want to use 
> >> it, load sctp module Nov  7 15:45:22 kamailio: WARNING:  
> >> [socket_info.c:1303]: fix_hostname(): could not rev. resolve 
> >>  Nov  7 15:45:22 /opt/kamailio/sbin/kamailio[8905]: INFO: rr 
>

Re: [SR-Users] authenticating to mongodb fails

2017-11-07 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Thanks for looking into this. I set debug=3 which gives the following debug 
messages. I included the mongod messages, which show a connection and end, but 
no succesful or failed authentication.

nov  7 15:45:21 kamailio: INFO:  [sctp_core.c:75]: 
sctp_core_check_support(): SCTP API not enabled - if you want to use it, load 
sctp module
Nov  7 15:45:22 kamailio: WARNING:  [socket_info.c:1303]: fix_hostname(): 
could not rev. resolve 
Nov  7 15:45:22 /opt/kamailio/sbin/kamailio[8905]: INFO: rr 
[../outbound/api.h:54]: ob_load_api(): unable to import bind_ob - maybe module 
is not loaded
Nov  7 15:45:22 /opt/kamailio/sbin/kamailio[8905]: INFO: rr [rr_mod.c:174]: 
mod_init(): outbound module not available
Nov  7 15:45:22 /opt/kamailio/sbin/kamailio[8905]: INFO: usrloc [hslot.c:51]: 
ul_init_locks(): locks array size 1024
Nov  7 15:45:22 /opt/kamailio/sbin/kamailio[8905]: INFO: auth [auth_mod.c:333]: 
mod_init(): auth: qop set, but nonce-count (nc_enabled) support disabled
Nov  7 15:45:22 mongod.27017[8038]: [thread1] connection accepted from 
127.0.0.1:40737 #20 (2 connections now open)
Nov  7 15:45:22 /opt/kamailio/sbin/kamailio[8905]: INFO:  
[sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
Nov  7 15:45:22 mongod.27017[8038]: [conn20] end connection 127.0.0.1:40737 (2 
connections now open)



> Sent: Tuesday, November 07, 2017 at 3:38 PM
> From: "Daniel-Constantin Mierla" <mico...@gmail.com>
> To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org>, 
> "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> Subject: Re: [SR-Users] authenticating to mongodb fails
>
> Can you set debug=3 in kamailio.cfg and then look at debug messages to
> see there is some hint about what happens?
> 
> Cheers,
> Daniel
> 
> 
> On 07.11.17 15:11, hdssdsdsdsfsdf hdssdsdsdsfsdf wrote:
> > When I connect using mongo, the credentials work:
> >
> > $ mongo kamailio -u "kam" -p "kam"
> > MongoDB shell version v3.4.9
> > connecting to: mongodb://127.0.0.1:27017/kamailio
> > MongoDB server version: 3.4.9
> >> db.subscriber.find()
> > { "_id" : ObjectI ...
> >
> > But when I use the following DBURL in kamailio.cfg, kamailio fails to even 
> > login to mongo:
> >
> > #!define DBURL "mongodb://kam:kam@localhost/kamailio"
> >
> > If I disable mongodb authentication, kamailio starts up just fine again. 
> > Any idea what's going wrong here?
> >
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
> Kamailio World Conference - www.kamailioworld.com
> 
> 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] authenticating to mongodb fails

2017-11-07 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
When I connect using mongo, the credentials work:

$ mongo kamailio -u "kam" -p "kam"
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/kamailio
MongoDB server version: 3.4.9
> db.subscriber.find()
{ "_id" : ObjectI ...

But when I use the following DBURL in kamailio.cfg, kamailio fails to even 
login to mongo:

#!define DBURL "mongodb://kam:kam@localhost/kamailio"

If I disable mongodb authentication, kamailio starts up just fine again. Any 
idea what's going wrong here?

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] error using avp_db_load with mongodb

2017-07-31 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
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" <hdssdsdsdsf...@mail.com>
> To: sr-users@lists.kamailio.org
> Cc: sr-users@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" <hdssdsdsdsf...@mail.com>
> > To: sr-users@lists.kamailio.org
> > Cc: "Kamailio (SER) - Users Mailing List" <sr-users@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:5...@bla.bla", "type" : 0, "username" : "555", 
> > "domain" : null }
> > { "_id" : ObjectId("597b5d9a61d1521f067391ae"), "uuid" : "", "attribute" : 
> > "email", "value" : "sip:1...@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:  [usr_avp.c:424]: search_avp(): 0 ID or NULL NAME AVP!
> > 
> > 
> > > Sent: Monday, July 31, 2017 at 9:10 AM
> > > From: "Sebastian Damm" <d...@sipgate.de>
> > > To: "Kamailio (SER) - Users Mailing List" <sr-users@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
> > > <hdssdsdsdsf...@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@lists.kamailio.org
> > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > > 
> > 
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > 
> 
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] error using avp_db_load with mongodb

2017-07-31 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
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:5...@bla.bla", "type" : 0, "username" : "555", "domain" 
: null }
{ "_id" : ObjectId("597b5d9a61d1521f067391ae"), "uuid" : "", "attribute" : 
"email", "value" : "sip:1...@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:  [usr_avp.c:424]: search_avp(): 0 ID or NULL NAME AVP!


> Sent: Monday, July 31, 2017 at 9:10 AM
> From: "Sebastian Damm" <d...@sipgate.de>
> To: "Kamailio (SER) - Users Mailing List" <sr-users@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
> <hdssdsdsdsf...@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@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] error using avp_db_load with mongodb

2017-07-26 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi,

I've problems using avpops and mongodb, resulting in the error: "ERROR: avpops 
[avpops_impl.c:123]: dbrow2avp(): wrong field types in dbrow"

In the database:

> db.usr_preferences.find()
{ "_id" : ObjectId("5978ab2850d1be89eb15f434"), "uuid" : "", "attribute" : 
"email", "value" : "sip:5...@sip.bla.bla", "type" : 0, "username" : "555", 
"domain" : null }
> 

In kamailio.cfg:


...
#  avpops params 
modparam("avpops", "db_url", DBURL)
modparam("avpops", "avp_table", "usr_preferences")


...


if ($rU=~"^(555|222)$") {
xlog("bla01");
if (avp_db_load("$to/username", "$avp(s:email)")) {
xlog("bla02");
}
}
xlog("bla03");

...

The result in syslog:

ERROR: 

[SR-Users] forwarding multiple times

2017-04-24 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi all,

I'm trying to transmit a CANCEL sip message from one server to multiple other 
servers (using ds_select_domain and ds_next_domain). Ideally, I would simply 
use forward() multiple times. The problem is however, that this would apply the 
changes of forward() multiple times too, for example adding multiple 
via-headers. I tried to use forward() for the first transmission and then 
send() for the next ones, but it turns out send() uses the original message to 
send, and not the message as crafted by forward.

As such, it seems I need exactly what's in the middle of these: Either a 
forward that operates on the original message, or a send that operates on the 
message as crafter by previous forward. Does anyone know how to achieve this?

The only other solution I see is to manually write some forwarding routing, but 
it seems tedious to craft the via-headers and fix the domain to be forwarded to.

Thanks and cheers,

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] problem with avpops and mongodb modules

2017-04-18 Thread hdssdsdsdsfsdf hdssdsdsdsfsdf
Hi Daniel,

Together, these patches solved the issue.

To be sure, I could not test before, and the configuration is no longer exactly 
the same and I'm using ipv6 now. Still, the call forwarding code in 
kamailio.cfg did not change at all and is now working with mongodb too.

Thanks a lot again!

Cheers,

> Sent: Wednesday, March 08, 2017 at 12:26 AM
> From: "Daniel-Constantin Mierla" <mico...@gmail.com>
> To: "hdssdsdsdsfsdf hdssdsdsdsfsdf" <hdssdsdsdsf...@mail.com>
> Cc: sr-us...@lists.sip-router.org
> Subject: Re: [SR-Users] problem with avpops and mongodb modules
>
> Hello,
> 
> I pushed another patch to fix a similar case in a different function.
> Can you try with it (6bd32088de1d7ae816643aea4a60c70911e46b5e)?
> 
> Cheers,
> Daniel
> 
> 
> On 07/03/2017 14:50, hdssdsdsdsfsdf hdssdsdsdsfsdf wrote:
> > Hi, thanks, we have a similar error further on after succesfully applying 
> > your patch on 4.4.4. The setup is the same as it was before, and the result 
> > this time is:
> >
> > Mar  7 14:45:32 slb04 /usr/local/sbin/kamailio[28073]: ERROR: