Receiving the following message on the node receiving usr_loc via DMQ, for each location received:
DEBUG: dmq [worker.c:87]: worker_loop(): dmq_worker [0 54958] lock acquired DEBUG: dmq_usrloc [usrloc_sync.c:460]: usrloc_dmq_handle_msg(): dmq message received from sip:usrloc@x.x.x.x DEBUG: dmq_usrloc [usrloc_sync.c:405]: usrloc_dmq_execute_action(): Received DMQ_UPDATE. Update contact info... ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
Any input is appreciated.
Thanks, -dan
Hi Dan,
Which version are you using?
Can you share your dmq_usrloc mod params and also your call to the save() function?
Cheers,
Charles
On Thu, 6 Sep 2018 at 05:14, Daniel W. Graham dan@cmsinter.net wrote:
Receiving the following message on the node receiving usr_loc via DMQ, for each location received:
DEBUG: dmq [worker.c:87]: worker_loop(): dmq_worker [0 54958] lock acquired
DEBUG: dmq_usrloc [usrloc_sync.c:460]: usrloc_dmq_handle_msg(): dmq message received from sip:usrloc@x.x.x.x
DEBUG: dmq_usrloc [usrloc_sync.c:405]: usrloc_dmq_execute_action(): Received DMQ_UPDATE. Update contact info...
ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
Any input is appreciated.
Thanks,
-dan _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
v 5.1.5
modparam("dmq", "server_address", "sip:x.x.x.x:5060") modparam("dmq", "notification_address", "sip:y.y.y.y:5060") modparam("dmq", "multi_notify", 1) modparam("dmq", "num_workers", 2) modparam("dmq", "worker_usleep", 0) modparam("dmq", "ping_interval", 90)
modparam("dmq_usrloc", "enable", 1) modparam("dmq_usrloc", "sync", 0) modparam("dmq_usrloc", "usrloc_domain", "location")
My initial assumption was that dmq_handle_message() handled everything.
I have since added if (dmq_is_from_node()) { if (!save("location")) { xlogl("L_ERR", "Error saving contact\n"); } }
Now results in:
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database
-dan
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Charles Chance Sent: Thursday, September 6, 2018 6:01 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] DMQ - Failed to get domain
Hi Dan,
Which version are you using?
Can you share your dmq_usrloc mod params and also your call to the save() function?
Cheers,
Charles
On Thu, 6 Sep 2018 at 05:14, Daniel W. Graham <dan@cmsinter.netmailto:dan@cmsinter.net> wrote: Receiving the following message on the node receiving usr_loc via DMQ, for each location received:
DEBUG: dmq [worker.c:87]: worker_loop(): dmq_worker [0 54958] lock acquired DEBUG: dmq_usrloc [usrloc_sync.c:460]: usrloc_dmq_handle_msg(): dmq message received from sip:usrloc@x.x.x.x DEBUG: dmq_usrloc [usrloc_sync.c:405]: usrloc_dmq_execute_action(): Received DMQ_UPDATE. Update contact info... ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
Any input is appreciated.
Thanks, -dan _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Charles Chance Managing Director
t. 0330 120 1200 m. 07932 063 891
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.
Correction:
if (!save("location", "0x02")) { …..
-dan
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Daniel W. Graham Sent: Thursday, September 6, 2018 1:59 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] DMQ - Failed to get domain
v 5.1.5
modparam("dmq", "server_address", "sip:x.x.x.x:5060") modparam("dmq", "notification_address", "sip:y.y.y.y:5060") modparam("dmq", "multi_notify", 1) modparam("dmq", "num_workers", 2) modparam("dmq", "worker_usleep", 0) modparam("dmq", "ping_interval", 90)
modparam("dmq_usrloc", "enable", 1) modparam("dmq_usrloc", "sync", 0) modparam("dmq_usrloc", "usrloc_domain", "location")
My initial assumption was that dmq_handle_message() handled everything.
I have since added if (dmq_is_from_node()) { if (!save("location")) { xlogl("L_ERR", "Error saving contact\n"); } }
Now results in:
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database
-dan
From: sr-users <sr-users-bounces@lists.kamailio.orgmailto:sr-users-bounces@lists.kamailio.org> On Behalf Of Charles Chance Sent: Thursday, September 6, 2018 6:01 AM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Subject: Re: [SR-Users] DMQ - Failed to get domain
Hi Dan,
Which version are you using?
Can you share your dmq_usrloc mod params and also your call to the save() function?
Cheers,
Charles
On Thu, 6 Sep 2018 at 05:14, Daniel W. Graham <dan@cmsinter.netmailto:dan@cmsinter.net> wrote: Receiving the following message on the node receiving usr_loc via DMQ, for each location received:
DEBUG: dmq [worker.c:87]: worker_loop(): dmq_worker [0 54958] lock acquired DEBUG: dmq_usrloc [usrloc_sync.c:460]: usrloc_dmq_handle_msg(): dmq message received from sip:usrloc@x.x.x.x DEBUG: dmq_usrloc [usrloc_sync.c:405]: usrloc_dmq_execute_action(): Received DMQ_UPDATE. Update contact info... ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
Any input is appreciated.
Thanks, -dan _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Charles Chance Managing Director
t. 0330 120 1200 m. 07932 063 891
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.
Hello,
On Thu, 6 Sep 2018 at 19:00, Daniel W. Graham dan@cmsinter.net wrote:
v 5.1.5
modparam("dmq", "server_address", "sip:x.x.x.x:5060")
modparam("dmq", "notification_address", "sip:y.y.y.y:5060")
modparam("dmq", "multi_notify", 1)
modparam("dmq", "num_workers", 2)
modparam("dmq", "worker_usleep", 0)
modparam("dmq", "ping_interval", 90)
modparam("dmq_usrloc", "enable", 1)
modparam("dmq_usrloc", "sync", 0)
modparam("dmq_usrloc", "usrloc_domain", "location")
My initial assumption was that dmq_handle_message() handled everything.
It does.
I have since added
if (dmq_is_from_node()) {
if (!save("location")) { xlogl("L_ERR", "Error saving contact\n"); }
}
This will not work.
Now results in:
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value
ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value
ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed
ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database
Which db_mode are you using for usrloc?
Cheers,
Charles
dbmode = 4 on the host acting as registrar. dbmode = 3 on the host receiving replicated usr_loc.
-dan
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Charles Chance Sent: Thursday, September 6, 2018 3:12 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] DMQ - Failed to get domain
Hello,
On Thu, 6 Sep 2018 at 19:00, Daniel W. Graham <dan@cmsinter.netmailto:dan@cmsinter.net> wrote: v 5.1.5
modparam("dmq", "server_address", "sip:x.x.x.x:5060") modparam("dmq", "notification_address", "sip:y.y.y.y:5060") modparam("dmq", "multi_notify", 1) modparam("dmq", "num_workers", 2) modparam("dmq", "worker_usleep", 0) modparam("dmq", "ping_interval", 90)
modparam("dmq_usrloc", "enable", 1) modparam("dmq_usrloc", "sync", 0) modparam("dmq_usrloc", "usrloc_domain", "location")
My initial assumption was that dmq_handle_message() handled everything.
It does.
I have since added if (dmq_is_from_node()) { if (!save("location")) { xlogl("L_ERR", "Error saving contact\n"); } }
This will not work.
Now results in:
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database
Which db_mode are you using for usrloc?
Cheers,
Charles
-- Charles Chance Managing Director
t. 0330 120 1200 m. 07932 063 891
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.
dmq_usrloc is designed for replication of in-memory contacts and typically removes the need for using a database altogether. If you do still have a need for the database then you probably want to be using db_mode 1 or 2 (and the same on both nodes).
I have never tried using db_mode 3 on a receiving (or any for that matter) node - can you try with an alternative mode and let me know if you still have the same issue? If the issue remains, please share your usrloc params for both servers.
Charles
On Thu, 6 Sep 2018 at 20:23, Daniel W. Graham dan@cmsinter.net wrote:
dbmode = 4 on the host acting as registrar.
dbmode = 3 on the host receiving replicated usr_loc.
-dan
*From:* sr-users sr-users-bounces@lists.kamailio.org * On Behalf Of *Charles Chance *Sent:* Thursday, September 6, 2018 3:12 PM *To:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *Subject:* Re: [SR-Users] DMQ - Failed to get domain
Hello,
On Thu, 6 Sep 2018 at 19:00, Daniel W. Graham dan@cmsinter.net wrote:
v 5.1.5
modparam("dmq", "server_address", "sip:x.x.x.x:5060")
modparam("dmq", "notification_address", "sip:y.y.y.y:5060")
modparam("dmq", "multi_notify", 1)
modparam("dmq", "num_workers", 2)
modparam("dmq", "worker_usleep", 0)
modparam("dmq", "ping_interval", 90)
modparam("dmq_usrloc", "enable", 1)
modparam("dmq_usrloc", "sync", 0)
modparam("dmq_usrloc", "usrloc_domain", "location")
My initial assumption was that dmq_handle_message() handled everything.
It does.
I have since added
if (dmq_is_from_node()) {
if (!save("location")) { xlogl("L_ERR", "Error saving contact\n"); }
}
This will not work.
Now results in:
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value
ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value
ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed
ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database
Which db_mode are you using for usrloc?
Cheers,
Charles
--
*Charles Chance* Managing Director
t. 0330 120 1200 m. 07932 063 891
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB. _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
My intent is to run in memory only except on one node which writes to database for reporting use.
If this is not possible I will use an alternate for the database host.
Just to note, same issue is present for dialog module, in this case dialogs sync fine but nothing is written to the database. …. modparam("dialog", "enable_dmq", 1) modparam("dialog", "db_mode", 1) ----(Set to 0 on sender) ….
Contact replication is still not working though, even with db_mode=4 on both nodes, still getting: ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
# kamctl ul show { "jsonrpc": "2.0", "result": { "Domains": [] }, "id": 1366 }
Send: modparam("usrloc", "db_url", DBURL) modparam("usrloc", "db_mode", 4) modparam("usrloc", "use_domain", 0) modparam("usrloc", "nat_bflag", FLB_NATB) modparam("dmq_usrloc", "enable", 1) modparam("dmq_usrloc", "sync", 1)
Receive: modparam("usrloc", "db_url", DBURL) modparam("usrloc", "db_mode", 4) modparam("usrloc", "use_domain", 0) modparam("dmq_usrloc", "enable", 1) modparam("dmq_usrloc", "sync", 0)
-dan
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Charles Chance Sent: Friday, September 7, 2018 1:27 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] DMQ - Failed to get domain
dmq_usrloc is designed for replication of in-memory contacts and typically removes the need for using a database altogether. If you do still have a need for the database then you probably want to be using db_mode 1 or 2 (and the same on both nodes).
I have never tried using db_mode 3 on a receiving (or any for that matter) node - can you try with an alternative mode and let me know if you still have the same issue? If the issue remains, please share your usrloc params for both servers.
Charles
On Thu, 6 Sep 2018 at 20:23, Daniel W. Graham <dan@cmsinter.netmailto:dan@cmsinter.net> wrote: dbmode = 4 on the host acting as registrar. dbmode = 3 on the host receiving replicated usr_loc.
-dan
From: sr-users <sr-users-bounces@lists.kamailio.orgmailto:sr-users-bounces@lists.kamailio.org> On Behalf Of Charles Chance Sent: Thursday, September 6, 2018 3:12 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Subject: Re: [SR-Users] DMQ - Failed to get domain
Hello,
On Thu, 6 Sep 2018 at 19:00, Daniel W. Graham <dan@cmsinter.netmailto:dan@cmsinter.net> wrote: v 5.1.5
modparam("dmq", "server_address", "sip:x.x.x.x:5060") modparam("dmq", "notification_address", "sip:y.y.y.y:5060") modparam("dmq", "multi_notify", 1) modparam("dmq", "num_workers", 2) modparam("dmq", "worker_usleep", 0) modparam("dmq", "ping_interval", 90)
modparam("dmq_usrloc", "enable", 1) modparam("dmq_usrloc", "sync", 0) modparam("dmq_usrloc", "usrloc_domain", "location")
My initial assumption was that dmq_handle_message() handled everything.
It does.
I have since added if (dmq_is_from_node()) { if (!save("location")) { xlogl("L_ERR", "Error saving contact\n"); } }
This will not work.
Now results in:
ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location ERROR: <core> [db.c:463]: db_use_table(): invalid parameter value ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database
Which db_mode are you using for usrloc?
Cheers,
Charles
-- Charles Chance Managing Director
t. 0330 120 1200 m. 07932 063 891
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB. _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Charles Chance Managing Director
t. 0330 120 1200 m. 07932 063 891
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.
On Fri, 7 Sep 2018 at 14:40, Daniel W. Graham dan@cmsinter.net wrote:
My intent is to run in memory only except on one node which writes to database for reporting use.
If this is not possible I will use an alternate for the database host.
It is possible, although you should use mode 1 or 2. Mode 3 is DB only and 4 only reads on startup (nothing written).
Just to note, same issue is present for dialog module, in this case dialogs sync fine but nothing is written to the database.
….
modparam("dialog", "enable_dmq", 1)
modparam("dialog", "db_mode", 1) ----(Set to 0 on sender)
….
Contact replication is still not working though, even with db_mode=4 on both nodes, still getting:
ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
# kamctl ul show
{
"jsonrpc": "2.0",
"result": {
"Domains": []
},
"id": 1366
}
I suspect here is your issue - although it's difficult to know based on the information provided why there are no domains in the list.
Was this command issued on the sender or receiver? If the receiver, do you have a call to save() in your config? I believe this is parsed at startup to determine which domains to create in memory - so realistically, the configs on all nodes should be identical (or at least contain the same REGISTER handling logic).
Otherwise, did you have this working without DMQ replication (i.e. replicating via DB only)?
Cheers,
Charles
Yes, that output was from receiver. When using DB only and no DMQ, things work fine.
No, I don’t have any calls to save on receiver or register handling in general. I was under the impression that DMQ / dmq_usrloc module handled this transparently.
I have tried this previously though with no luck: if (dmq_is_from_node()) { if (!save("location")) { … Receiver gets KDMQ message from sender, does the module then expose this to Kamailio as a normal REGISTER request based on user part of to header being ‘usrloc’?
I’ve shifted to using t_replicate and am happy with the results, but can still leverage DMQ so I’d like to get a working implementation.
-dan
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Charles Chance Sent: Wednesday, September 12, 2018 7:06 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] DMQ - Failed to get domain
On Fri, 7 Sep 2018 at 14:40, Daniel W. Graham <dan@cmsinter.netmailto:dan@cmsinter.net> wrote: My intent is to run in memory only except on one node which writes to database for reporting use.
If this is not possible I will use an alternate for the database host.
It is possible, although you should use mode 1 or 2. Mode 3 is DB only and 4 only reads on startup (nothing written).
Just to note, same issue is present for dialog module, in this case dialogs sync fine but nothing is written to the database. …. modparam("dialog", "enable_dmq", 1) modparam("dialog", "db_mode", 1) ----(Set to 0 on sender) ….
Contact replication is still not working though, even with db_mode=4 on both nodes, still getting: ERROR: dmq_usrloc [usrloc_sync.c:70]: add_contact(): Failed to get domain
# kamctl ul show { "jsonrpc": "2.0", "result": { "Domains": [] }, "id": 1366 }
I suspect here is your issue - although it's difficult to know based on the information provided why there are no domains in the list.
Was this command issued on the sender or receiver? If the receiver, do you have a call to save() in your config? I believe this is parsed at startup to determine which domains to create in memory - so realistically, the configs on all nodes should be identical (or at least contain the same REGISTER handling logic).
Otherwise, did you have this working without DMQ replication (i.e. replicating via DB only)?
Cheers,
Charles
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.
Hi,
On Wed, 12 Sep 2018 at 20:57, Daniel W. Graham dan@cmsinter.net wrote:
Yes, that output was from receiver. When using DB only and no DMQ, things work fine.
No, I don’t have any calls to save on receiver or register handling in general. I was under the impression that DMQ / dmq_usrloc module handled this transparently.
Apologies, I don't think I've explained it very clearly.
You must include register handling in the config of the receiving node, not to handle the KDMQ messages - they will be taken care of by dmq_handle_message() - but because on Kamailio startup, the usrloc module looks for calls to save() in the config in order to initiate the domains in memory. Since you don't have any, this is why `kamctl ul show` indicates there are no domains, and also why when dmq_usrloc receives a replicated contact, you see the error `add_contact(): Failed to get domain`. This is not a dmq thing, but a usrloc thing in general.
Please try including the same register handling code in your receiver config as you have in your sender config - even if the receiver will never handle registers directly. This is so that the usrloc module can properly initialise the domains in memory on startup. In a typical clustered environment, this will generally happen out-of-the-box, since all nodes will be identical, anyway, in order to enable load balancing/failover between them.
I have tried this previously though with no luck:
if (dmq_is_from_node()) {
if (!save("location")) {
…
Receiver gets KDMQ message from sender, does the module then expose this to Kamailio as a normal REGISTER request based on user part of to header being ‘usrloc’?
This will not work because dmq_usrloc serializes the updated contact details into the KDMQ message and then deserializes/handles the update directly the other side. It does not get exposed to the receiving Kamailio as a normal REGISTER.
I’ve shifted to using t_replicate and am happy with the results, but can still leverage DMQ so I’d like to get a working implementation.
Using DMQ is without a doubt far simpler and more flexible.
Charles