[SR-Users] kamailio log dialog correlation

Ben Kaufman bkaufman at bcmone.com
Fri Jan 21 18:28:55 CET 2022


For line number:


  xlogl([ [facility,] level,] format)

Similar to xlog(), in addition prints configuration file line number at the beginning of message. https://kamailio.org/docs/modules/5.5.x/modules/xlog.html#xlog.f.xlogl




Ben Kaufman


-----Original Message-----
From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Chad
Sent: Wednesday, January 19, 2022 9:17 AM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>; marek <cervajs64 at gmail.com>
Subject: Re: [SR-Users] kamailio log dialog correlation

I wanted the same thing only with line number, in the end I had to do a global search and replace, I could not get it to work via a global param.
I even tried xlogl which just threw errors that no such command existed (even though it is listed in the docs: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2F5.0.x%2Fmodules%2Fxlog.html%23xlog.f.xlogl&data=04%7C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=uMbNUPXj2O0Z50s7JyzRldgsdjLliktD5%2FSmL32SLTw%3D&reserved=0).

Here is what I ended up with:
xlog("L_INFO", "### Something to log ### Line: $cfg(line)\n");

Maybe someone else knows more, but I could not get it to work without hardcoding it into every xlog call.

--
^C


On 1/19/22 7:06 AM, marek wrote:
> hi,
> 
> is it possible create log of SIP dialog like https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.asterisk.org%2Fwiki%2Fdisplay%2FAST%2FUnique%2BCall-ID%2BLogging&data=04%7C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=9O6Y47QgTBJJdRL9NOUsAaIdNz3peQzoZes8E6%2BHZpE%3D&reserved=0 ?
> 
> it looks like its possible like this
> 
>   xlog("L_INFO", "D$dlg(h_id)   something to log \n");
> 
> but i must copy $dlg(h_id) in every xlog
> 
> tried this
> 
> modparam("xlog", "prefix", "D$dlg(h_id)")
> 
> but it not works with variables
> 
> any other tips/ideas?
> 
> goal is to correlate logs for one dialog (call)
> 
> 
> thanks
> 
> Marek
> 
> 
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
>   * 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> s.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=04%7
> C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc18
> 18e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CT
> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI
> 6Mn0%3D%7C3000&sdata=vKjIzrpD7meLnncocL81A%2FxYSV1g26HiTjZLjiNHejQ
> %3D&reserved=0

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users at lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=04%7C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=vKjIzrpD7meLnncocL81A%2FxYSV1g26HiTjZLjiNHejQ%3D&reserved=0



More information about the sr-users mailing list