Re: [SR-Users] Problem with auth_ephemeral and parse_uri(): bad port in uri

2022-01-24 Thread Henning Westerholt
Hello Vlad,

this sounds then like a bug/incompatibility in the Kamailio parser together 
with the module. I have not checked the RFC, but this can be done later.

Please open an issue on our tracker about it with the details from this e-mail, 
and also Kamailio version/cfg details from your earlier e-mail.

Cheers,

Henning

-- 
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com

-Original Message-
From: sr-users  On Behalf Of Vlasis 
Chatzistavrou
Sent: Monday, January 24, 2022 3:00 PM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Problem with auth_ephemeral and parse_uri(): bad port 
in uri

Hi Henning,

I just tried the default IETF format ("1") but I get the same error from
Kamailio:

Jan 24 13:57:59 enswitch43 /sbin/kamailio[432531]: DEBUG: {1 988 REGISTER 
fm2l7am7uggc2gc7jslpfj} sanity [sanity.c:817]: 
check_parse_uris(): parsing From URI
Jan 24 13:57:59 enswitch43 /sbin/kamailio[432531]: DEBUG: {1 988 REGISTER 
fm2l7am7uggc2gc7jslpfj}  [core/parser/parse_uri.c:1296]: 
parse_uri(): bad port in uri (error at char 2 in state 2) parsed: 
(20) / (35) Jan 24 
13:57:59 enswitch43 /sbin/kamailio[432531]: WARNING: {1 988 REGISTER 
fm2l7am7uggc2gc7jslpfj} sanity [sanity.c:820]: 
check_parse_uris(): failed to parse From uri

In this case 35189 is the user and 1643036115 is the timestamp.

REGISTER sip:192.168.2.99 SIP/2.0
Via: SIP/2.0/WSS 192.0.2.155;branch=z9hG4bK4638021
Max-Forwards: 70
To: "3518929" 
From: "3518929" ;tag=puibbfcnui
Call-ID: fm2l7am7uggc2gc7jslpfj
CSeq: 988 REGISTER
Contact: 
;reg-id=1;+sip.instance="";expires=300
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: path, gruu, outbound
User-Agent: Raspberry Phone (SipJS - 0.11.6)
Content-Length: 0


Kamailio still treats the number after : as the port.


On 3/1/2022 18:54, Henning Westerholt wrote:
> Hello,
>
> have you already tried to use the default username format "1", the IETF 
> format? This might be better for Kamailio.
>
> If this solves the problem, the mode 0 should probably be removed then.
>
> Cheers,
>
> Henning
>


__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@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@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


Re: [SR-Users] kamailio log dialog correlation

2022-01-24 Thread Ovidiu Sas
Hello Chad,

See inline.

On Mon, Jan 24, 2022 at 12:18 PM Chad  wrote:
>
> Are you running 5.5?
Yes.

> 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)).
The $ci is evaluated only once for each received request/reply.
There's no need to re-evaluate for each route.
There are special cases when re-evaluation is necessary: when changing
the message and changes are forced to be applied inside the script or
when async operations are performed and variables inside the prefix
can change. None of these applies to your deployment.

> 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'm not sure I follow you here. The modules are loaded before the
script is evaluated.

> 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?
I don't need to search, I know the answer :)
Here's the command: kamctl rpc core.modules


I'm not trying to push anything on you. If you don't feel comfortable
running logs in "verbose" mode and prefer to reproduce and
troubleshoot issues after business hours, that's totally fine.

-ovidiu

> -
> ^C
>
>
> On 1/24/22 7:41 AM, marek wrote:
> >
> > [root@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/pvapi.c:924]: pv_parse_spec2(): error searching pvar 
> >>> "cfg"
> >>> ERROR:  [core/pvapi.c:1127]: pv_parse_spec2(): wrong char [r/114] 
> >>> in [$cfg(route)] at [5 (5)]
> >>> ERROR:  [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@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@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@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



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@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


Re: [SR-Users] kamailio log dialog correlation

2022-01-24 Thread Chad

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@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/pvapi.c:924]: pv_parse_spec2(): error searching pvar "cfg"
ERROR:  [core/pvapi.c:1127]: pv_parse_spec2(): wrong char [r/114] in 
[$cfg(route)] at [5 (5)]
ERROR:  [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@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@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@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


Re: [SR-Users] kamailio log dialog correlation

2022-01-24 Thread marek

[root@sbc ~]# kamcmd core.modules |grep cfgutils
cfgutils

so, it's loaded

any other ideas why i cant use cfg() variables?

thanks

Marek


Dne 24/01/2022 v 16:56 Henning Westerholt napsal(a):

Hello,

something like this?

root@kam02 # kamcmd core.modules
dmq_usrloc
dmq
[..]
tm
corex
kex
jsonrpcs
xhttp
db_mysql

Cheers,

Henning


__
Kamailio - Users Mailing List - Non Commercial Discussions
 * sr-users@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


Re: [SR-Users] kamailio log dialog correlation

2022-01-24 Thread Henning Westerholt
Hello,

something like this?

root@kam02 # kamcmd core.modules
dmq_usrloc
dmq
[..]
tm
corex
kex
jsonrpcs
xhttp
db_mysql

Cheers,

Henning
-- 
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

-Original Message-
From: sr-users  On Behalf Of marek
Sent: Monday, January 24, 2022 4:41 PM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] kamailio log dialog correlation


[root@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/pvapi.c:924]: pv_parse_spec2(): error searching 
>> pvar "cfg"
>> ERROR:  [core/pvapi.c:1127]: pv_parse_spec2(): wrong char 
>> [r/114] in [$cfg(route)] at [5 (5)]
>> ERROR:  [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@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@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@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


Re: [SR-Users] kamailio log dialog correlation

2022-01-24 Thread Social Boh
check the Kamailio LOG. is the module generates some error you can see 
the data on the LOG


---
I'm SoCIaL, MayBe

El 24/01/2022 a las 10:41 a. m., marek escribió:


[root@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/pvapi.c:924]: pv_parse_spec2(): error searching 
pvar "cfg"
ERROR:  [core/pvapi.c:1127]: pv_parse_spec2(): wrong char 
[r/114] in [$cfg(route)] at [5 (5)]
ERROR:  [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@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@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@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


Re: [SR-Users] kamailio log dialog correlation

2022-01-24 Thread marek


[root@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/pvapi.c:924]: pv_parse_spec2(): error searching 
pvar "cfg"
ERROR:  [core/pvapi.c:1127]: pv_parse_spec2(): wrong char 
[r/114] in [$cfg(route)] at [5 (5)]
ERROR:  [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@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@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


Re: [SR-Users] Problem with auth_ephemeral and parse_uri(): bad port in uri

2022-01-24 Thread Vlasis Chatzistavrou

Hi Henning,

I just tried the default IETF format ("1") but I get the same error from 
Kamailio:


Jan 24 13:57:59 enswitch43 /sbin/kamailio[432531]: DEBUG: {1 988 
REGISTER fm2l7am7uggc2gc7jslpfj} sanity [sanity.c:817]: 
check_parse_uris(): parsing From URI
Jan 24 13:57:59 enswitch43 /sbin/kamailio[432531]: DEBUG: {1 988 
REGISTER fm2l7am7uggc2gc7jslpfj}  [core/parser/parse_uri.c:1296]: 
parse_uri(): bad port in uri (error at char 2 in state 2) parsed: 
(20) / (35)
Jan 24 13:57:59 enswitch43 /sbin/kamailio[432531]: WARNING: {1 988 
REGISTER fm2l7am7uggc2gc7jslpfj} sanity [sanity.c:820]: 
check_parse_uris(): failed to parse From uri


In this case 35189 is the user and 1643036115 is the timestamp.

REGISTER sip:192.168.2.99 SIP/2.0
Via: SIP/2.0/WSS 192.0.2.155;branch=z9hG4bK4638021
Max-Forwards: 70
To: "3518929" 
From: "3518929" ;tag=puibbfcnui
Call-ID: fm2l7am7uggc2gc7jslpfj
CSeq: 988 REGISTER
Contact: 
;reg-id=1;+sip.instance="";expires=300

Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: path, gruu, outbound
User-Agent: Raspberry Phone (SipJS - 0.11.6)
Content-Length: 0


Kamailio still treats the number after : as the port.


On 3/1/2022 18:54, Henning Westerholt wrote:

Hello,

have you already tried to use the default username format "1", the IETF format? 
This might be better for Kamailio.

If this solves the problem, the mode 0 should probably be removed then.

Cheers,

Henning




__
Kamailio - Users Mailing List - Non Commercial Discussions
 * sr-users@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


[SR-Users] Append HF don't work in event_route

2022-01-24 Thread Arnaud
Hello,

I'm trying to connect kamailio to Microsoft Teams.
Dispatch is correctly configured and sended.
Following this tutorial : https://skalatan.de/en/blog/kamailio-sbc-teams, I
added an Event_Route to add contact header to SIP OPTION from dispath to MS
:

event_route[tm:local-request] {
   xlog("*** tm:local-request *** ");
if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {
   xlog("L_INFO", "Append new contact !\n");
   append_hf("Contact: \r\n");
}
xlog("L_INFO", "Sent out tm request: $mb\n");
}

When I check the log to see my sended frame, I don't see a contact header
field :
INFO: