Hi Kamailio community.
There are a few fields in the usrloc cache I am interested in accessing at runtime to influence routing decisions. I can use SQLops to achieve the same functionality, however I'm interested in minimizing DB operations. I would like to know if there is a generally accepted approach to retrieving this information from the memory-hosted usrloc cache rather than dipping into the database.
On Sep 19, 2024, at 11:37 AM, Knserbrave via sr-users sr-users@lists.kamailio.org wrote:
Hi Kamailio community.
There are a few fields in the usrloc cache I am interested in accessing at runtime to influence routing decisions. I can use SQLops to achieve the same functionality, however I'm interested in minimizing DB operations. I would like to know if there is a generally accepted approach to retrieving this information from the memory-hosted usrloc cache rather than dipping into the database.
A few ways you could do this…
One way would be to run a ul.lookup and read the user-agent:
kamcmd ul.lookup location [AOR]
Regards,
Fred Posner Contact via https://fredoso.com
Thanks but I'm looking for accessing the information during transaction creation.
Kevin Kaczmarski
Sr Cloud Telecom Eng
[https://storage-use.letsignit.com/62cd82a381ae3c4fac02bff8/generated/effects...]
[https://storage-use.letsignit.com/62cd82a381ae3c4fac02bff8/generated/effects...]
[https://storage-use.letsignit.com/62cd82a381ae3c4fac02bff8/generated/effects...]
kkaczmarski@sorenson.com
[https://storage-use.letsignit.com/62cd82a381ae3c4fac02bff8/generated/effects...]
[https://storage-use.letsignit.com/62cd82a381ae3c4fac02bff8/generated/effects...]
4192 Riverboat Rd. | Salt Lake City, UT 84123
[Sorenson Communications]https://cloud.letsignit.com/collect/bc/6501e2b9d89c19bed43f99f6?p=KUhgtPwzDKnrWXZecjf8E81VkrtxDHXe5DwMkOKpigeHuim7AraYO_53TvXXfDsWlWcWllzIsjyZ1Ub3x4R8sUtgvRzSjvAohuxGSYj458rvdXIr0AOzgTlaO7R7CFQ5
[https://storage-use.letsignit.com/62cd82a381ae3c4fac02bff8/generated/effects...]
CONFIDENTIALITY NOTICE. The information contained in this e-mail transmission and any documents, files or previous e-mail messages attached to it, may contain confidential and proprietary information and is intended only for the use of the intended recipient. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify me by reply email or by telephone, and destroy the original transmission and its attachments without reading them or saving them to disk.
FEDERAL LAW PROHIBITS ANYONE BUT REGISTERED USERS WITH HEARING LOSS CAPTIONED TELEPHONES WITH THE CAPTIONS TURNED ON. IP Captioned Telephone Service may use a live operator. The operator generates captions of what the other party to the call says. These captions are then sent to your phone. There is a cost for each minute of captions generated, paid from a federally administered fund.
________________________________ From: Fred Posner via sr-users sr-users@lists.kamailio.org Sent: Thursday, September 19, 2024 1:31 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Fred Posner fred@qxork.com Subject: [SR-Users] Re: Accessing User-Agent from usrloc at runtime.
[You don't often get email from sr-users@lists.kamailio.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
[EXTERNAL]
On Sep 19, 2024, at 11:37 AM, Knserbrave via sr-users sr-users@lists.kamailio.org wrote:
Hi Kamailio community.
There are a few fields in the usrloc cache I am interested in accessing at runtime to influence routing decisions. I can use SQLops to achieve the same functionality, however I'm interested in minimizing DB operations. I would like to know if there is a generally accepted approach to retrieving this information from the memory-hosted usrloc cache rather than dipping into the database.
A few ways you could do this…
One way would be to run a ul.lookup and read the user-agent:
kamcmd ul.lookup location [AOR]
Regards,
Fred Posner Contact via https://fredoso.com
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
On Sep 19, 2024, at 2:25 PM, Kevin Kaczmarski KKaczmarski@sorenson.com wrote:
Thanks but I'm looking for accessing the information during transaction creation.
See $ua
https://www.kamailio.org/wikidocs/cookbooks/5.8.x/pseudovariables/#ua-user-a...
—fred
Thanks Fred. Is it true that $ua will only access the User-Agent value of the current request? That will definitely work for me if the header is present in an initial INVITE, however I'm considering the case where the header is only present in the REGISTER and not in subsequent requests from the endpoint.
If I use SQLops I can just select from the location table, but I want to rely on DMQ more than DB for usrloc.
________________________________ From: Fred Posner via sr-users sr-users@lists.kamailio.org Sent: Thursday, September 19, 2024 2:28 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Fred Posner fred@qxork.com Subject: [SR-Users] Re: Accessing User-Agent from usrloc at runtime.
[You don't often get email from sr-users@lists.kamailio.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
[EXTERNAL]
On Sep 19, 2024, at 2:25 PM, Kevin Kaczmarski KKaczmarski@sorenson.com wrote:
Thanks but I'm looking for accessing the information during transaction creation.
See $ua
https://www.kamailio.org/wikidocs/cookbooks/5.8.x/pseudovariables/#ua-user-a...
—fred
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
On Sep 19, 2024, at 2:45 PM, Kevin Kaczmarski KKaczmarski@sorenson.com wrote:
Thanks Fred. Is it true that $ua will only access the User-Agent value of the current request? That will definitely work for me if the header is present in an initial INVITE, however I'm considering the case where the header is only present in the REGISTER and not in subsequent requests from the endpoint.
If I use SQLops I can just select from the location table, but I want to rely on DMQ more than DB for usrloc.
There’s reg_fecth_contacts and associated $ulc values.
if (reg_fetch_contacts("location", "$ru", "whatever")){ xinfo("$cfg(route) - callee=>aor: $(ulc(whatever=>aor))\n"); xinfo("$cfg(route) - $rU is regged to server id $(ulc(whatever=>server_id)[0]) \n"); xinfo("$cfg(route) - $rU regged with ua $(ulc(whatever=>user_agent)[0]) \n"); }
Regards,
Fred Posner
Thank you Fred. This looks like exactly what I'm after. I appreciate your help.
________________________________ From: Fred Posner via sr-users sr-users@lists.kamailio.org Sent: Thursday, September 19, 2024 2:53 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Fred Posner fred@qxork.com Subject: [SR-Users] Re: Accessing User-Agent from usrloc at runtime.
[EXTERNAL]
On Sep 19, 2024, at 2:45 PM, Kevin Kaczmarski KKaczmarski@sorenson.com wrote:
Thanks Fred. Is it true that $ua will only access the User-Agent value of the current request? That will definitely work for me if the header is present in an initial INVITE, however I'm considering the case where the header is only present in the REGISTER and not in subsequent requests from the endpoint.
If I use SQLops I can just select from the location table, but I want to rely on DMQ more than DB for usrloc.
There’s reg_fecth_contacts and associated $ulc values.
if (reg_fetch_contacts("location", "$ru", "whatever")){ xinfo("$cfg(route) - callee=>aor: $(ulc(whatever=>aor))\n"); xinfo("$cfg(route) - $rU is regged to server id $(ulc(whatever=>server_id)[0]) \n"); xinfo("$cfg(route) - $rU regged with ua $(ulc(whatever=>user_agent)[0]) \n"); }
Regards,
Fred Posner
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: