Re: [SR-Users] BYE and TCP

2021-01-11 Thread Kjeld Flarup

Hi Daniel

The Record route in the INVITE from 194.247.61.26 sets this pair

Record-Route: 

Record-Route: 



The Bye requests this route

Route: 


Route: 

But the real port on 194.255.22.44 is 36059

It is my invite to 194.247.61.26 that sets the 7071 port, which 
automatically comes from the listen statement.
I suspect that it might work if the invite was using 36059, but how can 
I know this port, if the NAT router decides to map it to another port.



What is the correct behaviour. Should my Kamailio somehow set the 
correct port?


Should the providers Kamailio rewrite the route information?

Or something else?



 Med Liberalistiske Hilsner --
   Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
   Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
   Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk

On 1/11/21 10:18 AM, Daniel-Constantin Mierla wrote:


The From/To/Call-ID are not used to match the connection. The 
connection is matched based on target IP and port. For BYE, these are 
taken from Route header, if there is one for next hop, otherwise it is 
the request URI. Check these two to see if something is not as 
expected. Otherwise, you have to discuss with the provider and see the 
reason it returns back the 477 response.


Cheers,
Daniel

On 08.01.21 20:36, Kjeld Flarup wrote:


Happy New Year everyone.


I haven't solved this problem yet. Although is it not critical, it is 
a bit annoying.


I have tried to simplify things, and have a reference setup that works.
My linphone sends a TCP call and my Asterisk answers, plays a speak 
and hangs up.



If I instead sends the call to my PBX, which handles the 
authentication via UAC, it fails with this error, which the customer 
site also generated.


Status-Line: SIP/2.0 477 Unfortunately error on sending to next
hop occurred (477/SL)

Unfortunately the error is not generated by my Kamailio, but by a 
Kamailio at the provider, when it gets a Bye forwarded via their SBC.



I have attached a capture which the provider send me. This is the setup

linphone -> My Kamailio PBX (194.255.22.44:36089) -> provider
Kamailio(194.247.61.26) -> SBC(194.247.61.32) -> provider
Kamailio(194.247.61.26) -> my Asterisk (194.255.22.44:45075)

A note on the providers Kamailio. It listens on both port 5060 and 
5070, and both UDP/TCP.
It is also used as access point for both my PBX and my Asterisk, thus 
the trace may be a little confusing to read.


As far as I can see, the provider Kamailio gets the correct To/From 
and CallID in the bye. Thus it should be able to match the TCP 
connection.

The flow is also clean, there is no change of ports etc.



I have this reference setup which works

linphone -> provider Kamailio -> SBC -> provider Kamailio -> my
Asterisk

The only differences towards the reference I can see these. I do not 
have a capture from the provider on this.


  * There is an extra Via step.
  * Contact points to the Linphone IP, not the Kamailio IP

Any hint will be appreciated.



 Med Liberalistiske Hilsner --
Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
Den ikke akademiske hjemmeside for liberalismen -www.liberalismen.dk
On 11/9/20 12:06 PM, Daniel-Constantin Mierla wrote:


Hello,

there is no association between a SIP call and a TCP connection. SIP 
is not designed on TCP streams, the forwarding is based on the 
headers. It doesn't matter if there are messages belonging to same 
call or not, they can share same connection, or can open a new one...


The BYE from caller gets to 194.247.61.32:5040, which cannot deliver 
it further based on Route header. The system at 194.247.61.26:5070 
must be able to accept connections on advertised port of the Route 
address. Again, connection interruption can happen from various 
cases, it cannot rely on ephemeral ports, but on what the SIP system 
advertises as "listen" address.


One can play with tcp port aliases, look at Kamailio core cookbook, 
in case 194.247.61.32:5040 can do that. But that is not the proper 
way for server to server communication, there will be cases when the 
connection will be cut for various reasons (can be also the IP 
routes in the path that get congested).


Otherwise, you can follow the code of tcp_send() function in the 
tcp_main.c from core to see how tcp connection is matched, there are 
various cases there, also a matter of the config parameters.


Cheers,
Daniel

On 09.11.20 10:13, Kjeld Flarup wrote:

Hello

I have attached a pcap received from the provider.

It is quite informative as it shows bits of how they forward the call.

We send to 194.247.61.26 which is a Kamailio proxy, that forwards 
the call to a SBC  194.247.61.32


My guess is that the  194.247.61.26 kamailio gets confused, and 
does not match the BYE with the ongoing TCP 

Re: [SR-Users] Using websockets with kamailio 5.4

2021-01-11 Thread Jeremy McNamara
Hi Daniel - Google is your friend.  I use it often.
https://github.com/havfo/WEBRTC-to-SIP
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] TSILO - transaction is not suspended

2021-01-11 Thread Jeremy McNamara
I can confirm using $http_req(suspend)=0 before calling http_async_query()
resolves our issue - Thank you
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Profile name as variable in set_dlg_profile

2021-01-11 Thread Ovidiu Sas
Hello Alex,

More or less, the same thing would apply to "profiles_no_value" with
variable support.
There is a need for a dynamic way to store those dynamic profiles.
Maybe we need to add a parameter to control the size of the profile hash table.

-ovidiu

On Mon, Jan 11, 2021 at 2:03 PM Alex Balashov  wrote:
>
> Ovidiu,
>
> See my previously expressed concern about data structures underneath.
>
> —
> Sent from my iPad
>
> > On Jan 11, 2021, at 1:57 PM, Ovidiu Sas  wrote:
> >
> > Having support for variables for "profiles_no_value" would be more or
> > less the same thing as having a "profiles_with_value" with a key
> > "general" or "default".
> > The gain for adding this functionality would be minimal.
> >
> > Regards,
> > Ovidiu Sas
> >
> >> On Mon, Jan 11, 2021 at 1:45 PM Muhammad Sohaib  
> >> wrote:
> >>
> >> Thank you Daniel for the explanation.
> >>
> >> I managed to achieve the goal by "profiles_with_value" parameter and 
> >> passed "$rU" but each user might have multiple numbers so I had to  
> >> get_profile_size for each number.
> >>
> >> However, adding support for variables would be a great help.
> >>
> >> I will give a try to the KSA module later.
> >>
> >>> On Mon, 11 Jan 2021 at 14:56, Daniel-Constantin Mierla 
> >>>  wrote:
> >>>
> >>> Hello,
> >>>
> >>> I haven't checked the code, but I think that the function was designed 
> >>> with static parameter to be able to lookup the profile structure at 
> >>> startup and keep the pointer to it in order to be faster at runtime.
> >>>
> >>> Adding support for variables is possible of course, it would require a 
> >>> bit of c development.
> >>>
> >>> At this moment you can use embedded scripting (e.g., Lua, Python, 
> >>> JavaScript, ... see app_lua, ...) and execute functions via KSR module, 
> >>> i.e.,:
> >>>
> >>>  - 
> >>> http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile
> >>>
> >>> Cheers,
> >>> Daniel
> >>>
>  On 08.01.21 07:44, Muhammad Sohaib wrote:
> >>>
> >>> Is it possible to insert the current dialog into the profile by using the 
> >>> following way?
> >>>
> >>> modparam("dialog", "profiles_no_value", "mytest;xyz")
> >>>
> >>> $var(profilename)="xyz";
> >>> set_dlg_profile(" $var(profilename) ");
> >>>
> >>> Currently it is giving errors and not allowing to use variable instead of 
> >>> static profile name.
> >>>
> >>> Or is there any alternative to pass profile name as variable?
> >>>
> >>> ---
> >>> Thanks,
> >>>
> >>> ___
> >>> Kamailio (SER) - Users Mailing List
> >>> sr-users@lists.kamailio.org
> >>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> >>>
> >>> --
> >>> Daniel-Constantin Mierla -- www.asipto.com
> >>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> >>> Funding: https://www.paypal.me/dcmierla
> >>
> >>
> >>
> >> --
> >> Thanks,
> >> ___
> >> Kamailio (SER) - Users Mailing List
> >> sr-users@lists.kamailio.org
> >> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> >
> >
> >
> > --
> > VoIP Embedded, Inc.
> > http://www.voipembedded.com
> >
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



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

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Profile name as variable in set_dlg_profile

2021-01-11 Thread Alex Balashov
Ovidiu,

See my previously expressed concern about data structures underneath.

—
Sent from my iPad

> On Jan 11, 2021, at 1:57 PM, Ovidiu Sas  wrote:
> 
> Having support for variables for "profiles_no_value" would be more or
> less the same thing as having a "profiles_with_value" with a key
> "general" or "default".
> The gain for adding this functionality would be minimal.
> 
> Regards,
> Ovidiu Sas
> 
>> On Mon, Jan 11, 2021 at 1:45 PM Muhammad Sohaib  wrote:
>> 
>> Thank you Daniel for the explanation.
>> 
>> I managed to achieve the goal by "profiles_with_value" parameter and passed 
>> "$rU" but each user might have multiple numbers so I had to  
>> get_profile_size for each number.
>> 
>> However, adding support for variables would be a great help.
>> 
>> I will give a try to the KSA module later.
>> 
>>> On Mon, 11 Jan 2021 at 14:56, Daniel-Constantin Mierla  
>>> wrote:
>>> 
>>> Hello,
>>> 
>>> I haven't checked the code, but I think that the function was designed with 
>>> static parameter to be able to lookup the profile structure at startup and 
>>> keep the pointer to it in order to be faster at runtime.
>>> 
>>> Adding support for variables is possible of course, it would require a bit 
>>> of c development.
>>> 
>>> At this moment you can use embedded scripting (e.g., Lua, Python, 
>>> JavaScript, ... see app_lua, ...) and execute functions via KSR module, 
>>> i.e.,:
>>> 
>>>  - 
>>> http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile
>>> 
>>> Cheers,
>>> Daniel
>>> 
 On 08.01.21 07:44, Muhammad Sohaib wrote:
>>> 
>>> Is it possible to insert the current dialog into the profile by using the 
>>> following way?
>>> 
>>> modparam("dialog", "profiles_no_value", "mytest;xyz")
>>> 
>>> $var(profilename)="xyz";
>>> set_dlg_profile(" $var(profilename) ");
>>> 
>>> Currently it is giving errors and not allowing to use variable instead of 
>>> static profile name.
>>> 
>>> Or is there any alternative to pass profile name as variable?
>>> 
>>> ---
>>> Thanks,
>>> 
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>> 
>>> --
>>> Daniel-Constantin Mierla -- www.asipto.com
>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>> Funding: https://www.paypal.me/dcmierla
>> 
>> 
>> 
>> --
>> Thanks,
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> 
> 
> -- 
> VoIP Embedded, Inc.
> http://www.voipembedded.com
> 
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Profile name as variable in set_dlg_profile

2021-01-11 Thread Ovidiu Sas
Having support for variables for "profiles_no_value" would be more or
less the same thing as having a "profiles_with_value" with a key
"general" or "default".
The gain for adding this functionality would be minimal.

Regards,
Ovidiu Sas

On Mon, Jan 11, 2021 at 1:45 PM Muhammad Sohaib  wrote:
>
> Thank you Daniel for the explanation.
>
> I managed to achieve the goal by "profiles_with_value" parameter and passed 
> "$rU" but each user might have multiple numbers so I had to  get_profile_size 
> for each number.
>
> However, adding support for variables would be a great help.
>
> I will give a try to the KSA module later.
>
> On Mon, 11 Jan 2021 at 14:56, Daniel-Constantin Mierla  
> wrote:
>>
>> Hello,
>>
>> I haven't checked the code, but I think that the function was designed with 
>> static parameter to be able to lookup the profile structure at startup and 
>> keep the pointer to it in order to be faster at runtime.
>>
>> Adding support for variables is possible of course, it would require a bit 
>> of c development.
>>
>> At this moment you can use embedded scripting (e.g., Lua, Python, 
>> JavaScript, ... see app_lua, ...) and execute functions via KSR module, 
>> i.e.,:
>>
>>   - 
>> http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile
>>
>> Cheers,
>> Daniel
>>
>> On 08.01.21 07:44, Muhammad Sohaib wrote:
>>
>> Is it possible to insert the current dialog into the profile by using the 
>> following way?
>>
>> modparam("dialog", "profiles_no_value", "mytest;xyz")
>>
>> $var(profilename)="xyz";
>> set_dlg_profile(" $var(profilename) ");
>>
>> Currently it is giving errors and not allowing to use variable instead of 
>> static profile name.
>>
>> Or is there any alternative to pass profile name as variable?
>>
>> ---
>> Thanks,
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Funding: https://www.paypal.me/dcmierla
>
>
>
> --
> Thanks,
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



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

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Profile name as variable in set_dlg_profile

2021-01-11 Thread Alex Balashov
Another I would have with using values is performance. Profiles with value are 
presumably a hash table underneath. If so, wouldn’t stacking a bunch of dialogs 
under the same value key just result in a small number of long bucket collision 
chains?

—
Sent from mobile, with due apologies for brevity and errors.

> On Jan 11, 2021, at 1:45 PM, Muhammad Sohaib  wrote:
> 
> 
> Thank you Daniel for the explanation.
> 
> I managed to achieve the goal by "profiles_with_value" parameter and passed 
> "$rU" but each user might have multiple numbers so I had to  get_profile_size 
> for each number.
> 
> However, adding support for variables would be a great help.
> 
> I will give a try to the KSA module later.
> 
>> On Mon, 11 Jan 2021 at 14:56, Daniel-Constantin Mierla  
>> wrote:
>> Hello,
>> 
>> I haven't checked the code, but I think that the function was designed with 
>> static parameter to be able to lookup the profile structure at startup and 
>> keep the pointer to it in order to be faster at runtime.
>> 
>> Adding support for variables is possible of course, it would require a bit 
>> of c development.
>> 
>> At this moment you can use embedded scripting (e.g., Lua, Python, 
>> JavaScript, ... see app_lua, ...) and execute functions via KSR module, 
>> i.e.,:
>> 
>>   - 
>> http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile
>> 
>> Cheers,
>> Daniel
>> 
>> On 08.01.21 07:44, Muhammad Sohaib wrote:
>>> Is it possible to insert the current dialog into the profile by using the 
>>> following way?
>>> 
>>> modparam("dialog", "profiles_no_value", "mytest;xyz")
>>> 
>>> $var(profilename)="xyz";
>>> set_dlg_profile(" $var(profilename) ");
>>> 
>>> Currently it is giving errors and not allowing to use variable instead of 
>>> static profile name. 
>>> 
>>> Or is there any alternative to pass profile name as variable?
>>> 
>>> ---
>>> Thanks,
>>> 
>>> 
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> -- 
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Funding: https://www.paypal.me/dcmierla
> 
> 
> -- 
> Thanks,
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Profile name as variable in set_dlg_profile

2021-01-11 Thread Muhammad Sohaib
Thank you Daniel for the explanation.

I managed to achieve the goal by "profiles_with_value" parameter and passed
"$rU" but each user might have multiple numbers so I had to
get_profile_size for each number.

However, adding support for variables would be a great help.

I will give a try to the KSA module later.

On Mon, 11 Jan 2021 at 14:56, Daniel-Constantin Mierla 
wrote:

> Hello,
>
> I haven't checked the code, but I think that the function was designed
> with static parameter to be able to lookup the profile structure at startup
> and keep the pointer to it in order to be faster at runtime.
>
> Adding support for variables is possible of course, it would require a bit
> of c development.
>
> At this moment you can use embedded scripting (e.g., Lua, Python,
> JavaScript, ... see app_lua, ...) and execute functions via KSR module,
> i.e.,:
>
>   -
> http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile
>
> Cheers,
> Daniel
> On 08.01.21 07:44, Muhammad Sohaib wrote:
>
> Is it possible to insert the current dialog into the profile by using the
> following way?
>
> modparam("dialog", "profiles_no_value", "mytest;xyz")
>
> $var(profilename)="xyz";
> set_dlg_profile(" $var(profilename) ");
>
> Currently it is giving errors and not allowing to use variable instead of
> static profile name.
>
> Or is there any alternative to pass profile name as variable?
>
> ---
> Thanks,
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
>

-- 
Thanks,
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Unload UAC remote registry

2021-01-11 Thread David Villasmil
Also, that's a pretty old version, try to upgrade.

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337


On Wed, Dec 23, 2020 at 2:29 PM E. Schmidbauer 
wrote:

> You could use RPC.
> I built a wrapper service for RPC which exposes REST endpoints. Take a
> look here:
>  https://github.com/voipxswitch/kamailio-jsonrpc-client
>
> On Tue, Dec 22, 2020, 8:34 AM Javier Valencia  wrote:
>
>> Hello,
>>
>> I'm on Kamailio 4.4.7 and I'm trying to do uac.reg_refresh over a row non
>> existing on DB to try to unload, but data still persist on Kamailio.
>>
>> How to unload only one registry from UACs remote registrations when
>> delete a record from DB without do a uac.reg_reload?
>>
>> UAC remote registrations is above 2k rows, I don't know if it's much or
>> not.
>>
>> Regards, JV
>>
>>
>> --
>> [image: Logo] 
>> Javier Valencia | CTO
>> Centro de Negocios Martín Buendía
>> Camino de las Cañadas, nº 1C, Portal 1, 2ºG
>> 29649 Mijas (Málaga)
>> [image: #] 951562080 (T) <951562080> | 687486759 (M) <687486759>
>> [image: #] www.voiper.es
>> --
>>
>> AVISO LEGAL
>> ---
>>
>> Este mensaje contiene información confidencial destinada para ser leída
>> exclusivamente por el destinatario. Queda prohibida la reproducción,
>> publicación, divulgación, total o parcial del mensaje así como el uso no
>> autorizados por el emisor. En caso de recibir el mensaje por error, se ruega
>> su comunicación al remitente lo antes posible. Por favor, indique
>> inmediatamente si usted o su empresa no aceptan comunicaciones de este tipo
>> por Internet.
>>
>> Las opiniones, conclusiones y demás información incluida en este mensaje que
>> no esté relacionada con asuntos profesionales de SMART RECARGAS, S.L, se
>> entenderá que nunca se ha dado, ni está respaldado por el mismo.
>>
>> Responsable del Tratamiento de Datos
>> 
>> SMART RECARGAS , SL
>> Camino de las Cañadas, 1C PORTAL 1 2º G
>> 29651 MIJAS COSTA (MALAGA)
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Source Port on TLS OPTIONS from Dispatcher

2021-01-11 Thread Charles Phillips
That is what I figured was happening.  I have tried sending it back to a 
standard routing block, but perhaps I am doing it incorrectly.

When I try to send it back to a regular routing block I get the following error:

CRITICAL: tm [tm.c:1754]: _w_t_relay_to(): unsupported route type: 64

Config:

event_route[tm:local-request] {
sip_trace();
if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {
$var(domain) = $fd;
append_hf("Contact: \r\n");
xlog("L_INFO", “TEAMS Contact: $var(domain)\r\n");
route(TEAMS_SEND);
}
xlog("L_INFO", "Sent out tm request: $mb\n");
}

route[TEAMS_SEND] {
$var(domain) = $fd;
$xavp(tls=>server_name) = $var(domain);
$xavp(tls[0]=>server_id) = $var(domain);
$du = "sip:$var(domain):5061;transport=tls"; 
t_relay();
}


For testing, I also tried generating the packets in a normal route using 
t_uac_send and controlling it with rtimer.  As ugly a hack that this approach 
is, it did manage to create the packets and set the xavp as required (although, 
it certainly wouldn’t help dispatcher know if a gateway is offline…).  
Additional trouble is that if a second domain attempts to send OPTIONS packets 
in the while loop (see below) it goes out the same TLS connection, so it is 
rejected.

Config:

route["PING-TEAMS"] {
sql_query("db", "select domain from domain;", "domain_list");
$var(i) = 0;
while ($dbr(domain_list=>[$var(i),0]) != $null) {
$var(domain) = $dbr(domain_list=>[$var(i),0]);
xlog(“OPTIONS from domain name $var(domain)");
$xavp(tls=>server_name) = $var(domain);
$xavp(tls[0]=>server_id) = $var(domain);
$du = "sip:$var(domain):5061;transport=tls"; 
t_uac_send ("OPTIONS", "sip:$var(domain):5061;transport=tls", 
"sip:sip3.pstnhub.microsoft.com;transport=tls", "", "From: 
sip:$var(domain)\r\nTo: 
sip:sip3.pstnhub.microsoft.com;transport=tls\r\nContact: 
\r\n", "");
sleep(2);
t_uac_send ("OPTIONS", "sip:$var(domain):5061;transport=tls", 
"sip:sip2.pstnhub.microsoft.com;transport=tls", "", "From: 
sip:$var(domain)\r\nTo: 
sip:sip2.pstnhub.microsoft.com;transport=tls\r\nContact: 
\r\n", "");
sleep(2);
t_uac_send ("OPTIONS", "sip:$var(domain):5061;transport=tls", 
"sip:sip.pstnhub.microsoft.com;transport=tls", "", "From: 
sip:$var(domain)\r\nTo: sip:sip.pstnhub.microsoft.com;transport=tls\r\nContact: 
\r\n", "");
sleep(5);
$var(i) = $var(i) + 1; 
   
}
}

200 from MS on domain 0:

2021/01/11 08:48:31.291048 52.114.7.24:5061 -> *myip*:52606
SIP/2.0 200 OK
FROM: ;tag=3393f0703fb0ccaca74109ff37de39f5-5a503a0a
TO: 
CSEQ: 10 OPTIONS
CALL-ID: 0f37a09f409a4e41-24410@127.0.0.1
VIA: SIP/2.0/TLS 
*myip*:5061;branch=z9hG4bK9306.42d92227.0
CONTENT-LENGTH: 0
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY
SERVER: Microsoft.PSTNHub.SIPProxy v.2020.12.28.1 i.ASEA.0


403 from MS on domain 1:

2021/01/11 08:49:39.755005 52.114.7.24:5061 -> *myip*:52606
SIP/2.0 403 Forbidden
FROM: ;tag=3393f0703fb0ccaca74109ff37de39f5-69555a28
TO: 
CSEQ: 10 OPTIONS
CALL-ID: 0f37a09f409a4e44-24410@127.0.0.1
VIA: SIP/2.0/TLS 
*myip*:5061;branch=z9hG4bK4306.973e1562.0
REASON: Q.850;cause=63;text="00cce062-66c6-45a4-8b5c-ccd48b71a9f6;Provided 
Trunk FQDN '101.sbc.*mydomain*.net' is not allowed. Connection allows
ollowing fqdns: 100.sbc.*mydomain*.net, 100.sbc.*mydomain*.net."
CONTENT-LENGTH: 0
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY
SERVER: Microsoft.PSTNHub.SIPProxy v.2020.12.28.1 i.ASEA.0



- Charles Phillips




> On Jan 11, 2021, at 4:13 AM, Daniel-Constantin Mierla  
> wrote:
> 
> Hello,
> 
> the xavp_cfg set in the event_route is not propagated (kept) to the moment 
> when the message is sent out to tls. The event_route[tm:local-request] is 
> executed when the local request is constructed, terminated before sending 
> out, so whatever avp/xavp is set in the event route are deleted when the 
> block execution is terminated.
> 
> It requires another solution here, I am thinking about what can be done and 
> will be added soon in the master branch.
> 
> Meanwhile, a workaround is to look traffic back to kamailio so the routing 
> happens over request_route block, where you can set the xavp.
> 
> Cheers,
> Daniel
> 
> On 08.01.21 22:23, Charles Phillips wrote:
>> Thanks Daniel, I needed some certainty to get unstuck.  It appears that the 
>> problem is actually related to the TLS config.  I am using multiple TLS 
>> configs, so it looks like the problem may be that the server_name server_id 
>> are not being set, so the reply is returning to the default TLS config.  Not 
>> to mention that when I set the testing domains certs under the default 
>> config, it works...
>> 
>> This is observed in the logs:
>> 
>> tls_get_connect_server_name(): xavp with outbound server name not found
>> tls_get_connect_server_id(): xavp with outbound server id not found
>> tls_complete_init(): 

Re: [SR-Users] Different responses for domain.dump

2021-01-11 Thread Javier Valencia

thx Daniel!


El 11/1/21 a las 10:28, Daniel-Constantin Mierla escribió:


Hello,

do not attach screenshots when you can just copy the output, it 
makes the message harder to see and also affects mobile connectivity.


First the 4.4.7 is really old and not maintained. You should upgrade 
to 5.4.x or at least 5.3.x.


Initially the rpc commands where not jsonrpc complied, the kamcmd was 
able to display the response no matter was compliant or not, but other 
tools were stricter. Newer versions should have that fixed, in the way 
that it is a proper jsonrpc response with an array of domains, in this 
particular case.


Cheers,
Daniel

On 08.01.21 11:07, Javier Valencia wrote:


Hi there!

I'm getting different responses from Kamailio 4.4.7 when domain.dump 
exec;


From *kamcmd*:


I'm getting two domains; .es and .net.

Request to jsonrpc-s module:


Response from jsonrpc-s module:


And now, I'm getting only one domain.

What's I'm doing wrong?



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla --www.asipto.com
www.twitter.com/miconda  --www.linkedin.com/in/miconda
Funding:https://www.paypal.me/dcmierla
<>___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] uac.reg_refresh command

2021-01-11 Thread Daniel-Constantin Mierla
How do you pass it as a string? Can you give an example?

Daniel

On 11.01.21 11:34, Javier Valencia wrote:
>
> It's a number but passed as string.
>
>
> El 11/1/21 a las 11:24, Daniel-Constantin Mierla escribió:
>
>> Hello,
>>
>> is the parameter a number or a string?
>>
>> Cheers,
>> Daniel
>>
>> On 22.12.20 16:16, Javier Valencia wrote:
>>>
>>> Hello,
>>>
>>> I'm playing with RPC on my Kamailio 4.4.7, and I getting rare
>>> behaivor with *uac.reg_refresh* command.
>>>
>>> When I run it thru kamcmd like docs describes, this is without
>>> *l_uuid* parameter, I'm geting "*error: 500 - Invalid Parameters*"
>>> output. And when I run with *l_uuid* parameter, I get no output. But
>>> in both cases, Kamalio don't refresh data from DB.
>>>
>>> But I run this command thru HTTP (JSONRPC-S), both call modes are
>>> equivalent. With or without l_uuid parameter geting no output and
>>> refresh data from DB.
>>>
>>> It's a normal behaivor?
>>>
>>> Regards, JV
>>>
>>>
>>> -- 
>>> Logo 
>>>
>>> 
>>> Javier Valencia | CTO
>>> Centro de Negocios Martín Buendía
>>> Camino de las Cañadas, nº 1C, Portal 1, 2ºG
>>> 29649 Mijas (Málaga)
>>>
>>> #   951562080 (T)  | 687486759 (M) 
>>> #   www.voiper.es 
>>>
>>> 
>>> AVISO LEGAL
>>> ---
>>>
>>> Este mensaje contiene información confidencial destinada para ser leída
>>> exclusivamente por el destinatario. Queda prohibida la reproducción,
>>> publicación, divulgación, total o parcial del mensaje así como el uso no
>>> autorizados por el emisor. En caso de recibir el mensaje por error, se ruega
>>> su comunicación al remitente lo antes posible. Por favor, indique
>>> inmediatamente si usted o su empresa no aceptan comunicaciones de este tipo
>>> por Internet.
>>>
>>> Las opiniones, conclusiones y demás información incluida en este mensaje que
>>> no esté relacionada con asuntos profesionales de SMART RECARGAS, S.L, se
>>> entenderá que nunca se ha dado, ni está respaldado por el mismo.
>>>
>>> Responsable del Tratamiento de Datos
>>> 
>>> SMART RECARGAS , SL
>>> Camino de las Cañadas, 1C PORTAL 1 2º G
>>> 29651 MIJAS COSTA (MALAGA)
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> -- 
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Funding: https://www.paypal.me/dcmierla
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] uac.reg_refresh command

2021-01-11 Thread Javier Valencia

It's a number but passed as string.


El 11/1/21 a las 11:24, Daniel-Constantin Mierla escribió:


Hello,

is the parameter a number or a string?

Cheers,
Daniel

On 22.12.20 16:16, Javier Valencia wrote:


Hello,

I'm playing with RPC on my Kamailio 4.4.7, and I getting rare 
behaivor with *uac.reg_refresh* command.


When I run it thru kamcmd like docs describes, this is without 
*l_uuid* parameter, I'm geting "*error: 500 - Invalid Parameters*" 
output. And when I run with *l_uuid* parameter, I get no output. But 
in both cases, Kamalio don't refresh data from DB.


But I run this command thru HTTP (JSONRPC-S), both call modes are 
equivalent. With or without l_uuid parameter geting no output and 
refresh data from DB.


It's a normal behaivor?

Regards, JV


--
Logo 


Javier Valencia | CTO
Centro de Negocios Martín Buendía
Camino de las Cañadas, nº 1C, Portal 1, 2ºG
29649 Mijas (Málaga)

#   951562080 (T)  | 687486759 (M) 
#   www.voiper.es 


AVISO LEGAL
---

Este mensaje contiene información confidencial destinada para ser leída
exclusivamente por el destinatario. Queda prohibida la reproducción,
publicación, divulgación, total o parcial del mensaje así como el uso no
autorizados por el emisor. En caso de recibir el mensaje por error, se ruega
su comunicación al remitente lo antes posible. Por favor, indique
inmediatamente si usted o su empresa no aceptan comunicaciones de este tipo
por Internet.

Las opiniones, conclusiones y demás información incluida en este mensaje que
no esté relacionada con asuntos profesionales de SMART RECARGAS, S.L, se
entenderá que nunca se ha dado, ni está respaldado por el mismo.

Responsable del Tratamiento de Datos

SMART RECARGAS , SL
Camino de las Cañadas, 1C PORTAL 1 2º G
29651 MIJAS COSTA (MALAGA)

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla --www.asipto.com
www.twitter.com/miconda  --www.linkedin.com/in/miconda
Funding:https://www.paypal.me/dcmierla
<>___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] list myself values

2021-01-11 Thread Javier Valencia

thx Dan!


El 11/1/21 a las 10:59, Daniel-Constantin Mierla escribió:


Hello,

there are rpc commands to list the listen socket, the host aliases and 
domain module records (only if you have register_myself 1, they count).


All these values are matched again myself.

Cheers,
Daniel

On 30.12.20 10:30, Javier Valencia wrote:


Hi, a question from a Kamailio newbie.

How can I list or show variable *myself* values?

Regards, JV




___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla --www.asipto.com
www.twitter.com/miconda  --www.linkedin.com/in/miconda
Funding:https://www.paypal.me/dcmierla
<>___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] uac.reg_refresh command

2021-01-11 Thread Daniel-Constantin Mierla
Hello,

is the parameter a number or a string?

Cheers,
Daniel

On 22.12.20 16:16, Javier Valencia wrote:
>
> Hello,
>
> I'm playing with RPC on my Kamailio 4.4.7, and I getting rare behaivor
> with *uac.reg_refresh* command.
>
> When I run it thru kamcmd like docs describes, this is without
> *l_uuid* parameter, I'm geting "*error: 500 - Invalid Parameters*"
> output. And when I run with *l_uuid* parameter, I get no output. But
> in both cases, Kamalio don't refresh data from DB.
>
> But I run this command thru HTTP (JSONRPC-S), both call modes are
> equivalent. With or without l_uuid parameter geting no output and
> refresh data from DB.
>
> It's a normal behaivor?
>
> Regards, JV
>
>
> -- 
> Logo 
>
>   
> Javier Valencia | CTO
> Centro de Negocios Martín Buendía
> Camino de las Cañadas, nº 1C, Portal 1, 2ºG
> 29649 Mijas (Málaga)
>
> # 951562080 (T)  | 687486759 (M) 
> # www.voiper.es 
>
> 
> AVISO LEGAL
> ---
>
> Este mensaje contiene información confidencial destinada para ser leída
> exclusivamente por el destinatario. Queda prohibida la reproducción,
> publicación, divulgación, total o parcial del mensaje así como el uso no
> autorizados por el emisor. En caso de recibir el mensaje por error, se ruega
> su comunicación al remitente lo antes posible. Por favor, indique
> inmediatamente si usted o su empresa no aceptan comunicaciones de este tipo
> por Internet.
>
> Las opiniones, conclusiones y demás información incluida en este mensaje que
> no esté relacionada con asuntos profesionales de SMART RECARGAS, S.L, se
> entenderá que nunca se ha dado, ni está respaldado por el mismo.
>
> Responsable del Tratamiento de Datos
> 
> SMART RECARGAS , SL
> Camino de las Cañadas, 1C PORTAL 1 2º G
> 29651 MIJAS COSTA (MALAGA)
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] UAC module registrations interval

2021-01-11 Thread Daniel-Constantin Mierla
Hello,

look at the replies of registrations and see what is the expires value
coming back in the contact headers.

Cheers,
Daniel

On 23.12.20 11:54, Javier Valencia wrote:
>
> Hi there,
>
> I'm using Kamailio 4.4.7 with UAC remote registrations module.
>
> In my database have all rows with expires column value's 3600, and my
> PBX (asterisk) min, max and default expires to 3600. But I can see how
> Kamailio it's sending REGISTER each 150segs.
>
> UAC module parameters values;
>
> modparam("uac", "reg_db_url", "mysql://XXX")
> modparam("uac", "reg_db_table", "uacreg")
> modparam("uac", "reg_contact_addr", "XXX")
> modparam("uac", "reg_timer_interval", 5)
> modparam("uac", "reg_retry_interval", 60)
>
> My uacreg table it's above 2k rows.
>
> Regards, JV
>
>
> -- 
> Logo 
>
>   
> Javier Valencia | CTO
> Centro de Negocios Martín Buendía
> Camino de las Cañadas, nº 1C, Portal 1, 2ºG
> 29649 Mijas (Málaga)
>
> # 951562080 (T)  | 687486759 (M) 
> # www.voiper.es 
>
> 
> AVISO LEGAL
> ---
>
> Este mensaje contiene información confidencial destinada para ser leída
> exclusivamente por el destinatario. Queda prohibida la reproducción,
> publicación, divulgación, total o parcial del mensaje así como el uso no
> autorizados por el emisor. En caso de recibir el mensaje por error, se ruega
> su comunicación al remitente lo antes posible. Por favor, indique
> inmediatamente si usted o su empresa no aceptan comunicaciones de este tipo
> por Internet.
>
> Las opiniones, conclusiones y demás información incluida en este mensaje que
> no esté relacionada con asuntos profesionales de SMART RECARGAS, S.L, se
> entenderá que nunca se ha dado, ni está respaldado por el mismo.
>
> Responsable del Tratamiento de Datos
> 
> SMART RECARGAS , SL
> Camino de las Cañadas, 1C PORTAL 1 2º G
> 29651 MIJAS COSTA (MALAGA)
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] how does rtjson work?

2021-01-11 Thread Daniel-Constantin Mierla
The To header has no relevance in routing, only the address in the first
line of the request (r-uri) really matters for initial requests.

On the other hand, the error message you pasted below is related to
nathelper.

Cheers,
Daniel

On 25.12.20 22:46, Syed Shahryar wrote:
> My use case is such that I want to be able to send a SIP MESSAGE
> destined for a single username to multiple users. In order to be able
> to map that target username to multiple usernames, I tried using
> rtjson and evapi/http (to generate the routing json), but none of them
> worked.
>
> Is it the right approach? Is there any other way to programmatically
> generate multiple targets for SIP request? I am familiar with dynamic
> routing but I need more flexibility.
>
> Initially, I tried sending the request to a different username but
> that didn't work and got the following message in the http async
> result route.
>
> kamailio    | 19(25) ERROR: nathelper [nathelper.c:1461]: sdp_1918():
> Unable to parse sdp body
> kamailio    | 19(25) NOTICE:  [core/kemi.c:124]:
> sr_kemi_core_notice(): In evapi msg branch
> kamailio    | 28(34) NOTICE: {2 6661 MESSAGE q6hikd6tumsr1dh35kvj}
>  [core/kemi.c:124]: sr_kemi_core_notice(): In evapi reply branch 
>
> The message was received on the originally requested to user and also
> $tu still points to the original user instead of the new user even
> after executing the following code.
>
> KSR.rtjson.init_routes(response);
> KSR.rtjson.push_routes();
> KSR.nathelper.fix_nated_contact(); 
>
> In http response, I receive the following and don't see any rtjson
> errors when init_routes is executed on it.
>
> {"version":"1.0","routing":"parallel","routes":[{"headers":{"from":{"display":"test_1","uri":"sip:*test_1*@test.com:9908
> "},"to":{"display":"test_4","uri":"sip:*test_4*@test.com
> :9908"},"extra":""},"branch_flags":8,"fr_timer":5000,"fr_inv_timer":3}]}
>
> Please note that the request was sent to *test_2*@test.com
> . I have tried other combinations of above but
> nothing works.
>
> I have already searched on Google and read relevant articles and blog
> posts. 
>
> Thanks
> -- 
> --
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee, you
> should not disseminate, distribute or copy this email. Please notify
> the sender immediately by email if you have received this email by
> mistake and delete this email from your system. Email transmission
> cannot be guaranteed to be secure or error-free, as information could
> be intercepted, corrupted, lost, destroyed, arrive late or incomplete,
> or contain viruses. The sender, therefore, does not accept liability
> for any errors or omissions in the contents of this message which
> arise as a result of email transmission. If verification is required,
> please request a hard-copy version.
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] list myself values

2021-01-11 Thread Daniel-Constantin Mierla
Hello,

there are rpc commands to list the listen socket, the host aliases and
domain module records (only if you have register_myself 1, they count).

All these values are matched again myself.

Cheers,
Daniel

On 30.12.20 10:30, Javier Valencia wrote:
>
> Hi, a question from a Kamailio newbie.
>
> How can I list or show variable *myself* values?
>
> Regards, JV
>
>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Profile name as variable in set_dlg_profile

2021-01-11 Thread Daniel-Constantin Mierla
Hello,

I haven't checked the code, but I think that the function was designed
with static parameter to be able to lookup the profile structure at
startup and keep the pointer to it in order to be faster at runtime.

Adding support for variables is possible of course, it would require a
bit of c development.

At this moment you can use embedded scripting (e.g., Lua, Python,
JavaScript, ... see app_lua, ...) and execute functions via KSR module,
i.e.,:

  -
http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile

Cheers,
Daniel

On 08.01.21 07:44, Muhammad Sohaib wrote:
> Is it possible to insert the current dialog into the profile by using
> the following way?
>
> modparam("dialog", "profiles_no_value", "mytest;xyz")
>
> $var(profilename)="xyz";
> set_dlg_profile(" $var(profilename) ");
>
> Currently it is giving errors and not allowing to use variable instead
> of static profile name.
>
> Or is there any alternative to pass profile name as variable?
>
> ---
> Thanks,
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] websockets

2021-01-11 Thread Daniel-Constantin Mierla
Hello,


look at websocket module, there are some snippets of config:


  * https://www.kamailio.org/docs/modules/stable/modules/websocket.html


Also, searching on the web about kamailio and websocket/webrtc should
reveal more configs that can be used as starting point.


Once you try and get stuck on some specific part, you can ask here for
further assistance.


Cheers,
Daniel


On 08.01.21 11:06, Daniel Hermann N'don wrote:
> Hello everyone,
> I'm a beginner in kamailio technology, and i want to use websockets
> module in kamailio 5.4 to exchange from the web to kamailio, but i
> don't know how to use it?
> Can someone help me please?
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Different responses for domain.dump

2021-01-11 Thread Daniel-Constantin Mierla
Hello,

do not attach screenshots when you can just copy the output, it
makes the message harder to see and also affects mobile connectivity.

First the 4.4.7 is really old and not maintained. You should upgrade to
5.4.x or at least 5.3.x.

Initially the rpc commands where not jsonrpc complied, the kamcmd was
able to display the response no matter was compliant or not, but other
tools were stricter. Newer versions should have that fixed, in the way
that it is a proper jsonrpc response with an array of domains, in this
particular case.

Cheers,
Daniel

On 08.01.21 11:07, Javier Valencia wrote:
>
> Hi there!
>
> I'm getting different responses from Kamailio 4.4.7 when domain.dump exec;
>
> From *kamcmd*:
>
>
> I'm getting two domains; .es and .net.
>
> Request to jsonrpc-s module:
>
>
> Response from jsonrpc-s module:
>
>
> And now, I'm getting only one domain.
>
> What's I'm doing wrong?
>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Lost MySQL connections - Error 500

2021-01-11 Thread Daniel-Constantin Mierla

On 08.01.21 19:04, Duarte Rocha wrote:
> Thanks for the help.
>
> I'm using db_mode 1 - Write-Through scheme. As far as i understand it
> uses database and cache correct? Is that the difference from mode 3?
Yes, db_mode 1 is different than db_mode 3, the later does no caching.
>
> I'll do some testing with the usrloc's behaviour and i'll let you know.


If there is no external application blocking the database, look at
latency core parameters, it may help to figure out if kamailio does a
query that is slow.

Cheers,
Daniel

>
> Cheers
>
>
> Daniel-Constantin Mierla  > escreveu no dia sexta, 8/01/2021 à(s) 17:47:
>
> Hello,
>
> if there is no external application that accesses the location
> table and you have many records, try to tune the behaviour of
> usrloc module, by setting timer procs and interval to different
> values. Also, if you use database-only mode with a lot of active
> users, you can also consider partitioning users on different
> tables, so you can have rules like users with id starting a-m go
> to location1 and n-z go to location2.
>
> Cheers,
> Daniel
>
> On 08.01.21 18:29, Duarte Rocha wrote:
>> Hello Daniel, 
>>
>> I have Kamailio on an HA setup. One machine has the active
>> Kamailio and if something happens, the IP jumps to the another
>> machine where there is a Kamailio running. Both Kamailio's share
>> the same remote database. Could the reason be both Kamailio's
>> trying to remove expired contacts from the location table at the
>> same time? 
>>
>> Cheers,
>> Duarte
>>
>> Daniel-Constantin Mierla > > escreveu no dia quinta, 7/01/2021
>> à(s) 19:28:
>>
>> Hello,
>>
>> is there any other application that accesses the location table?
>>
>> That error message usually appears when the update of the
>> record cannot be made because it is locked for long time by
>> something else.
>>
>> Cheers,
>> Daniel
>>
>> On 07.01.21 18:23, Duarte Rocha wrote:
>>> Hi all,
>>>
>>> I've made a post last month regarding losing MySQL
>>> connections  -
>>> 
>>> https://lists.kamailio.org/pipermail/sr-users/2020-December/111389.html
>>> 
>>> 
>>>
>>> At the time I thought connections were dying as a
>>> consequence of low activity and traffic on the proxy.
>>> Meanwhile, I've migrated a great number of equipments to the
>>> proxy with Registers being refreshed every 10minutes and the
>>> problem still persists.
>>>
>>> In order to try to fix this i've added timeout_interval and
>>> ping_interval from the db_mysql module. My SQL client on the
>>> Kamailio machine is mysql-community-client  5.6.50-2.el7. It
>>> writes and reads in a remote InnoDB database.
>>>
>>> This are the logs i get from Kamailio when the problem
>>> appears :
>>>
>>> Jan  7 09:43:27 sbc_bbt01_active
>>> /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1
>>> 27880 REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b}
>>> db_mysql [km_dbase.c:123]: db_mysql_submit_query(): driver
>>> error on query: Lock wait timeout exceeded; try restarting
>>> transaction (1205)
>>> Jan  7 09:43:27 sbc_bbt01_active
>>> /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1
>>> 27880 REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} 
>>> [db_query.c:348]: db_do_update(): error while submitting query
>>> Jan  7 09:43:27 sbc_bbt01_active
>>> /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1
>>> 27880 REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} usrloc
>>> [ucontact.c:1147]: db_update_ucontact_ruid(): updating
>>> database failed
>>> Jan  7 09:43:27 sbc_bbt01_active
>>> /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1
>>> 27880 REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} usrloc
>>> [ucontact.c:1663]: update_contact_db(): failed to update
>>> database
>>> Jan  7 09:43:27 sbc_bbt01_active
>>> /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1
>>> 27880 REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b}
>>> registrar [save.c:784]: update_contacts(): failed to update
>>> contact
>>> Jan  7 09:43:27 sbc_bbt01_active
>>> /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1
>>> 27880 REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} sl
>>> [sl_funcs.c:414]: sl_reply_error(): stateless error reply
>>> used: I'm terribly sorry, server error occurred (1/SL)
>>>
>>>
>>> Originally I had usrloc db_mode on mode 3 - DB-Only Scheme.
>>> In order to try to mitigate the issue I changed it to mode 1

Re: [SR-Users] BYE and TCP

2021-01-11 Thread Daniel-Constantin Mierla
The From/To/Call-ID are not used to match the connection. The connection
is matched based on target IP and port. For BYE, these are taken from
Route header, if there is one for next hop, otherwise it is the request
URI. Check these two to see if something is not as expected. Otherwise,
you have to discuss with the provider and see the reason it returns back
the 477 response.

Cheers,
Daniel

On 08.01.21 20:36, Kjeld Flarup wrote:
>
> Happy New Year everyone.
>
>
> I haven't solved this problem yet. Although is it not critical, it is
> a bit annoying.
>
> I have tried to simplify things, and have a reference setup that works.
> My linphone sends a TCP call and my Asterisk answers, plays a speak
> and hangs up.
>
>
> If I instead sends the call to my PBX, which handles the
> authentication via UAC, it fails with this error, which the customer
> site also generated.
>
> Status-Line: SIP/2.0 477 Unfortunately error on sending to next
> hop occurred (477/SL)
>
> Unfortunately the error is not generated by my Kamailio, but by a
> Kamailio at the provider, when it gets a Bye forwarded via their SBC.
>
>
> I have attached a capture which the provider send me. This is the setup
>
> linphone -> My Kamailio PBX (194.255.22.44:36089) -> provider
> Kamailio(194.247.61.26) -> SBC(194.247.61.32) -> provider
> Kamailio(194.247.61.26) -> my Asterisk (194.255.22.44:45075)
>
> A note on the providers Kamailio. It listens on both port 5060 and
> 5070, and both UDP/TCP.
> It is also used as access point for both my PBX and my Asterisk, thus
> the trace may be a little confusing to read.
>
> As far as I can see, the provider Kamailio gets the correct To/From
> and CallID in the bye. Thus it should be able to match the TCP
> connection.
> The flow is also clean, there is no change of ports etc.
>
>
>
> I have this reference setup which works
>
> linphone -> provider Kamailio -> SBC -> provider Kamailio -> my
> Asterisk
>
> The only differences towards the reference I can see these. I do not
> have a capture from the provider on this.
>
>   * There is an extra Via step.
>   * Contact points to the Linphone IP, not the Kamailio IP
>
> Any hint will be appreciated.
>
>
>
>  Med Liberalistiske Hilsner --
>Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
>Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
>Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk
> On 11/9/20 12:06 PM, Daniel-Constantin Mierla wrote:
>>
>> Hello,
>>
>> there is no association between a SIP call and a TCP connection. SIP
>> is not designed on TCP streams, the forwarding is based on the
>> headers. It doesn't matter if there are messages belonging to same
>> call or not, they can share same connection, or can open a new one...
>>
>> The BYE from caller gets to 194.247.61.32:5040, which cannot deliver
>> it further based on Route header. The system at 194.247.61.26:5070
>> must be able to accept connections on advertised port of the Route
>> address. Again, connection interruption can happen from various
>> cases, it cannot rely on ephemeral ports, but on what the SIP system
>> advertises as "listen" address.
>>
>> One can play with tcp port aliases, look at Kamailio core cookbook,
>> in case 194.247.61.32:5040 can do that. But that is not the proper
>> way for server to server communication, there will be cases when the
>> connection will be cut for various reasons (can be also the IP routes
>> in the path that get congested).
>>
>> Otherwise, you can follow the code of tcp_send() function in the
>> tcp_main.c from core to see how tcp connection is matched, there are
>> various cases there, also a matter of the config parameters.
>>
>> Cheers,
>> Daniel
>>
>> On 09.11.20 10:13, Kjeld Flarup wrote:
>>> Hello
>>>
>>> I have attached a pcap received from the provider.
>>>
>>> It is quite informative as it shows bits of how they forward the call.
>>>
>>> We send to 194.247.61.26 which is a Kamailio proxy, that forwards
>>> the call to a SBC  194.247.61.32
>>>
>>> My guess is that the  194.247.61.26 kamailio gets confused, and does
>>> not match the BYE with the ongoing TCP session.
>>> Instead it sees it as a new session, and forwards it according to
>>> the route information.
>>>
>>> Can anybody help explaining what fields Kamailio uses to match an
>>> ongoing TCP session.
>>>
>>>   Regards Kjeld
>>>
>>> Den fre. 6. nov. 2020 kl. 10.50 skrev Daniel-Constantin Mierla
>>> mailto:mico...@gmail.com>>:
>>>
>>> Hello,
>>>
>>> from SIP specs point of view, can be any port -- ACK and BYE do
>>> not have to follow same path as INVITE, so they can even come
>>> from a different IP.
>>>
>>> Then, the call can be closed after 30secs because also the ACK
>>> has the same problems with the header as the BYE. Your pcap
>>> didn't include all the traffic, you have to capture both
>>> directions on your kamailio server to see what 

Re: [SR-Users] Source Port on TLS OPTIONS from Dispatcher

2021-01-11 Thread Daniel-Constantin Mierla
Hello,

the xavp_cfg set in the event_route is not propagated (kept) to the
moment when the message is sent out to tls. The
event_route[tm:local-request] is executed when the local request is
constructed, terminated before sending out, so whatever avp/xavp is set
in the event route are deleted when the block execution is terminated.

It requires another solution here, I am thinking about what can be done
and will be added soon in the master branch.

Meanwhile, a workaround is to look traffic back to kamailio so the
routing happens over request_route block, where you can set the xavp.

Cheers,
Daniel

On 08.01.21 22:23, Charles Phillips wrote:
> Thanks Daniel, I needed some certainty to get unstuck.  It appears
> that the problem is actually related to the TLS config.  I am using
> multiple TLS configs, so it looks like the problem may be that the
> server_name server_id are not being set, so the reply is returning to
> the default TLS config.  Not to mention that when I set the testing
> domains certs under the default config, it works...
>
> This is observed in the logs:
>
> tls_get_connect_server_name(): xavp with outbound server name not found
> tls_get_connect_server_id(): xavp with outbound server id not found
> tls_complete_init(): Using initial TLS domain TLSc 
>
> Is there a way to set this with xavp_cfg in the event_route?  I have
> read that section and tried may combinations, but since the OPTIONs
> packets from the dispatcher module do not seem to traverse the
> standard routes, I am not sure how to handle this.
>
> Any advice would be greatly appreciated!
>
>
> - Charles Phillips
>
>
>
>
>> On Jan 8, 2021, at 12:56 PM, Daniel-Constantin Mierla
>> mailto:mico...@gmail.com>> wrote:
>>
>> Hello,
>>
>> there is an option that you can set to reuse the port for tcp/tls
>> connections, but even so it is a best effort and it is not going to
>> ensured -- all these are practically flags set to the sockets and the
>> kernel (tcp stack) decides after all.
>>
>> Anyhow, the rport is mainly useful for connectionless communication,
>> like UDP. For tcp/tls, the SIP specs demand to reuse the existing
>> connections. As I did several Kamailio-MSTeams interconnectivity
>> deployments, I can tell that the source port was never a problem. The
>> TLS connection is kept open and MSTeams sends back traffic on it.
>>
>> Cheers,
>> Daniel
>>
>> On 08.01.21 14:32, Charles Phillips wrote:
>>> Thanks for the quick response Joel.  Yes, I have read the article
>>> and I have tested and confirmed that I am correctly appending the
>>> contact header (I probably should have left that in the snippet for
>>> clarity).  Below is an example of Kamailio setting up the
>>> connection.  It is going out port 46245 this time, but it is random.
>>>
>>> 07:59:23.572319 IP *my.kamailio.server*.46245 >
>>> *ms.teams.server*.sip-tls: Flags [P.], seq 1:518, ack 1, win 502,
>>> length 517
>>> 07:59:23.802458 IP *ms.teams.server*.sip-tls >
>>> *my.kamailio.server*.46245: Flags [P.], seq 1:3767, ack 518, win
>>> 2051, length 3766
>>>
>>> The TLS connection shows as successful in the logs.
>>>
>>>
>>> - Charles 
>>>
>>>
>>> Date: Thu, 7 Jan 2021 19:12:10 -0800
>>> From: Joel Serrano mailto:j...@textplus.com>>
>>> To: "Kamailio (SER) - Users Mailing List"
>>> mailto:sr-users@lists.kamailio.org>>
>>> Subject: Re: [SR-Users] Source Port on TLS OPTIONS from Dispatcher
>>> Message-ID:
>>> >> >
>>> Content-Type: text/plain; charset="utf-8"
>>>
>>> Hi Charles,
>>>
>>> I don't think your issue is rport, make sure you are setting the Contact
>>> header correctly.
>>>
>>> Have you checked this blog post:
>>> https://skalatan.de/en/blog/kamailio-sbc-teams
>>>  ?
>>>
>>> There is a specific section that talks about how to tell Kamailio to
>>> send
>>> the OPTIONS like MS Teams wants them.
>>>
>>> Good luck,
>>> Joel.
>>>
>>>
 On Jan 7, 2021, at 7:31 PM, Charles Phillips >>> > wrote:

 Hello all.  As they say in radio, “long time listener, first time
 caller”

 Anyway, I am having trouble getting past the following road block
 and any help would be greatly appreciated.

 Kamailio version is 5.4.3 

 When attempting to use dispatcher to send OPTIONS packets to
 several TLS destinations, the packets are leaving the Kamailio
 server on random ports.  This is a problem because the servers I am
 sending the OPTIONS to (MS Teams) are enforcing rport so the
 responses are returned to a port that Kamailio is not listening
 on.  I have tried to force the socket in the event route (relevant
 parts of snippet below) but it does not appear to help.  I should
 also mention that I am not behind NAT and the TLS socket is
 specified in the dispatcher attrs. 

 event_route[tm:local-request] {
     sip_trace();


     $fs =