[SR-Users] kamailio log dialog correlation

Chad ccolumbu at hotmail.com
Mon Jan 24 18:17:07 CET 2022


Are you running 5.5?
Do you have log_prefix_mode=1
If set to 1, then the log prefix is evaluated before/after each config action (needs to be set when the log_prefix has 
variables that are different based on the context of config execution, e.g., $cfg(line)).

BTW "grep cfgutils /etc/kamailio/kamailio.cfg" may not be good enough, because the loadmodule "cfgutils.so" might be 
inside of an if statement.
You also need to make sure it is actually loaded above the log_prefix line where you use it.

I don't know how to show the loaded modules, probably some kamcli command will show you, did you search the internet for 
the answer to that?

--
^C


On 1/24/22 7:41 AM, marek wrote:
> 
> [root at sbc~]# grep cfgutils /etc/kamailio/kamailio.cfg
> loadmodule "cfgutils.so"
> 
> is there a way how can i check if module is loaded without errors? (something like Asterisk's "module show like")
> 
> kamailio 5.5.3
> 
> Marek
> 
> 
> Dne 22/01/2022 v 17:27 Chad napsal(a):
>> loadmodule "cfgutils.so"
>>
>>
>> -- 
>> ^C
>>
>>
>> On 1/22/22 2:36 AM, marek wrote:
>>> thanks
>>>
>>> now i understand difference between log_prefix and modparam("xlog", "prefix", "something")
>>>
>>> so i'm trying this
>>>
>>> log_prefix="{D$dlg(h_id) $cfg(route)}"
>>>
>>> but i got this
>>>
>>> ERROR: <core> [core/pvapi.c:924]: pv_parse_spec2(): error searching pvar "cfg"
>>> ERROR: <core> [core/pvapi.c:1127]: pv_parse_spec2(): wrong char [r/114] in [$cfg(route)] at [5 (5)]
>>> ERROR: <core> [core/dprint.c:463]: log_prefix_init(): wrong format[{D$dlg(h_id) $cfg(route)}]
>>>
>>> it's the same if its used in
>>>
>>> xlog("L_INFO", "D$dlg(h_id) $cfg(route) some log")
>>>
>>> do you think there is a module missing?
>>>
>>> Marek
>>>
>>>
>>> Dne 19/01/2022 v 16:23 Henning Westerholt napsal(a):
>>>> Hello,
>>>>
>>>> you could try to use log_prefix. Have not tried it yet with a dialog variable.
>>>>
>>>> http://www.kamailio.org/wiki/cookbooks/5.5.x/core#log_prefix
>>>>
>>>> Regarding output of a line number, you could try to use this one:
>>>>
>>>> http://www.kamailio.org/wiki/cookbooks/5.4.x/pseudovariables#cfg_key_-_config_file_attributes
>>>>
>>>> Cheers,
>>>>
>>>> Henning
>>>>
>>>
>>> __________________________________________________________
>>> 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://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> __________________________________________________________
> 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://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list