Re: [SR-Users] BYE and TCP

2020-11-05 Thread Kjeld Flarup

Hello

I got an answer from the VOIP provider.

They claim that we have an error in our port forwarding. Because we 
advertise 5071, but traffic comes from another port.


As I understand, it is however impossible for TCP to send all traffic 
from just one port.


How is TCP SIP actually supposed to handle a BYE, when the client is 
behind NAT.


 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/4/20 10:00 PM, Kjeld Flarup wrote:


Hello again

I have attached a Capture.

My public IP is 194.255.22.44, and I have a port forward of 5071 in my 
router


The Raspberry Pi running the Kamailio is on 192.168.2.9 with an alias 
192.168.2.40


My listening is setup like this

listen=127.0.0.1:5071
listen=eth0:5071  advertise 194.255.22.44:5071
alias=194.255.22.44:5071

Kamailio is forwarding an invite from a door phone thus I also rewrite 
FROM:


uac_replace_from("sip:"+$dbr(ra=>[0,1])+"@194.255.22.44:5071");
And the failure route to
$fu = "sip:"+$dbr(ra=>[0,0])+"@194.255.22.44:5071";

In the route doing the INVITE I also set this:

set_advertised_address("194.255.22.44:5071");


Regarding tcp_reuse_port, if I set this I get this error, which I 
understand is due to the way TCP works.


Nov  4 18:38:41 scantronpbx /usr/sbin/kamailio[15864]: {1 ACK 16191 
ACK C2Az-Xm2b0CEPyV5eQuz7yEf9IJo4PyJ} WARNING:  
[core/tcp_main.c:1061]: tcp_do_connect(): binding to source address 
192.168.2.40:5071 failed: Address already in use [98]


I do have tcp_reuse_port=yes with this capture. But much to my 
surprise, the 200 OK from is send to 37148, but the ACK to it comes 
from 37150



 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/4/20 1:59 PM, Carsten Bock wrote:

Hi,

I think you are searching for this parameter:

http://www.kamailio.org/wiki/cookbooks/devel/core#tcp_reuse_port

It basically tells the kernel not to choose a new port at random for 
a new connection, but it will try to reuse the existing port (in your 
case 5071).


Thanks,
Carsten


--
Carsten Bock I CTO & Founder

ng-voice GmbH

Trostbrücke 1 I 20457 Hamburg I Germany
T +49 40 524 75 93-40 | M +49 179 2021244 I www.ng-voice.com 



Registry Office at Local Court Hamburg, HRB 120189
Managing Directors: Dr. David Bachmann, Carsten Bock



Am Mi., 4. Nov. 2020 um 12:07 Uhr schrieb Kjeld Flarup 
mailto:kjeld.fla...@liberalismen.dk>>:


Hello

I have a Kamailio running behind NAT, which sends calls to a VOIP
service provider.

I have setup the Kamalio to listen on port 5071, and also setup a
port
forward in the router.

Now the problem is that with TCP, 5071 is not used for the
dialog, but a
new port is chosen everytime. This means that when the mobile phone
called hands up, I never sees the BYE, because BYE is a new dialog.


To which port is the server supposed to send the BYE, and what field
tells the server this.


-- 
 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 


___
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] How to Add Customer Table During Installation

2020-11-05 Thread me.proje...@yahoo.com
 Hi, 
I added two scripts 1- to create tables 2- Insert some basic data in address 
table
Statement 1 executed and tables created but second .sql file not executed 
although it showed in logs. What shall I do to insert some basic data?
Thanks.
On Thursday, November 5, 2020, 07:03:04 PM GMT+5, me.proje...@yahoo.com 
 wrote:  
 
  Hi,
Thanks for your reply. Some times we need to provide Initial Data in some 
tables so I think we can use something you suggested. 
On Thursday, November 5, 2020, 06:00:23 PM GMT+5, Daniel-Constantin Mierla 
 wrote:  
 
  Hello, 
  if you put the sql to create the table in 
share/kamailio/mysql/customtable-create.sql 
  then you can run: 
  kamdbctl add-tables customtable 
  This has to be done after the kamdbctl create command. 
  If you plan for long term, also taking in consideration the option to add 
management of customtable records in the cli, I can recommend to look at 
kamcli: 
    * https://github.com/kamailio/kamcli 
  It can also create the customtable using: 
  kamcli db create-tables-group customtable 
  The 'kamcli db' offers what old 'kamdbctl' and 'kamctl db ...' do. 
  But then you can just add your own python file in 
'kamcli/commands/cmd_customtable.py' to manage records in that table (for 
example, you can use cmd_aliasdb.py as a starting point). 
  Cheers,
 Daniel
  
  On 05.11.20 13:40, me.proje...@yahoo.com wrote:
  
 
 Hi, 
  I want add some custom Table Creation during installation of Kamailio.  
  I want to add my Custom Table during the execution of  
  kamdbctl create
  
  command. Currently I am adding my script in  
  share/kamailio/mysql/auth_db-create.sql 
  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] How to Add Customer Table During Installation

2020-11-05 Thread me.proje...@yahoo.com
 Hi,
Thanks for your reply. Some times we need to provide Initial Data in some 
tables so I think we can use something you suggested. 
On Thursday, November 5, 2020, 06:00:23 PM GMT+5, Daniel-Constantin Mierla 
 wrote:  
 
  Hello, 
  if you put the sql to create the table in 
share/kamailio/mysql/customtable-create.sql 
  then you can run: 
  kamdbctl add-tables customtable 
  This has to be done after the kamdbctl create command. 
  If you plan for long term, also taking in consideration the option to add 
management of customtable records in the cli, I can recommend to look at 
kamcli: 
    * https://github.com/kamailio/kamcli 
  It can also create the customtable using: 
  kamcli db create-tables-group customtable 
  The 'kamcli db' offers what old 'kamdbctl' and 'kamctl db ...' do. 
  But then you can just add your own python file in 
'kamcli/commands/cmd_customtable.py' to manage records in that table (for 
example, you can use cmd_aliasdb.py as a starting point). 
  Cheers,
 Daniel
  
  On 05.11.20 13:40, me.proje...@yahoo.com wrote:
  
 
 Hi, 
  I want add some custom Table Creation during installation of Kamailio.  
  I want to add my Custom Table during the execution of  
  kamdbctl create
  
  command. Currently I am adding my script in  
  share/kamailio/mysql/auth_db-create.sql 
  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] sr-users Digest, Vol 186, Issue 5

2020-11-05 Thread Yufei Tao
Hi,

Here's an example kamailio.cfg that uses record_route so in-dialog requests
will go through the Kamailio proxy:
https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg
There are many other example cfg files:
https://github.com/kamailio/kamailio/tree/master/misc/examples

Any server that wants to see the in-dialog messages needs to add itself to
the record route list when receiving the initial INVITE for example. If a
server is not in the list of record routes, then in-dialog requests will
not be sent to the server. Headers that are most important in terms of
routing are R-URI, Route, Record-Route, Contact, Via.

Via header is for routing responses, while Record-Route is for in-dialog
requests.

Cheers,
Yufei


> Message: 7
> Date: Thu, 5 Nov 2020 12:26:16 +0200
> From: "Adrian Tabacioiu" 
> To: sr-users@lists.kamailio.org
> Subject: [SR-Users] Proxy configuration that exit dialog afer INVITE
> -> OK
> Message-ID: <7449102a9f3dbe38b6dba753d1cffcd8.squir...@mail.c-s.ro>
> Content-Type: text/plain;charset=iso-8859-1
>
>
> Hello all,
>
> Am I new in the usage of kamailio, sorry if I ask somehow something simple
> or terribly wrong .
>
> I need to test a configuration of Kamailio which exit the dialog between
> UA after the first OK (that means it will not receive the following ACK,
> BYE).
>
> I understand that in theory this is possible in two configuration types:
> - no Record Route header
> - or stateless proxy
>
> First question:
> Am I correct with the choices above?
> Can I find example configuration for this two modes ?
>
> Question 2:
> two or more proxy should be inter-connected, removing the Record Route
> header would interfere with proxy routing ? (should not the "Via"
> information be sufficient?)
>
> Thank you in advance for help.
>
> Best regards,
> Adrian Tabacioiu
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] How to Add Customer Table During Installation

2020-11-05 Thread me.proje...@yahoo.com
Hi,
I want add some custom Table Creation during installation of Kamailio. 
I want to add my Custom Table during the execution of 
kamdbctl create

command. Currently I am adding my script in 
share/kamailio/mysql/auth_db-create.sql
Thanks,___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] How to Add Customer Table During Installation

2020-11-05 Thread Daniel-Constantin Mierla
Hello,

if you put the sql to create the table in
share/kamailio/mysql/customtable-create.sql

then you can run:

kamdbctl add-tables customtable

This has to be done after the kamdbctl create command.

If you plan for long term, also taking in consideration the option to
add management of customtable records in the cli, I can recommend to
look at kamcli:

  * https://github.com/kamailio/kamcli

It can also create the customtable using:

kamcli db create-tables-group customtable

The 'kamcli db' offers what old 'kamdbctl' and 'kamctl db ...' do.

But then you can just add your own python file in
'kamcli/commands/cmd_customtable.py' to manage records in that table
(for example, you can use cmd_aliasdb.py as a starting point).

Cheers,
Daniel

On 05.11.20 13:40, me.proje...@yahoo.com wrote:
> Hi,
>
> I want add some custom Table Creation during installation of Kamailio. 
>
> I want to add my Custom Table during the execution of 
>
> *kamdbctl create*
>
> command. Currently I am adding my script in 
>
> *share/kamailio/mysql/auth_db-create.sql*
>
> 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] tsilo - failure to add branches (-1)

2020-11-05 Thread Jurijs Ivolga
Hi Federico,

In my Kamailio "append_branches" was set  to 0 long time ago and this was a
legacy that I needed to deal with. After removing "modparam("registrar",
"append_branches", 0)" and fixing config everything worked. Thank you again!

Jurijs


On Thu, Nov 5, 2020 at 12:51 PM Federico Cabiddu 
wrote:

> Good to know that you solved it :)
> Why did you have to set "append_branches" to 0? Which was the behaviour
> when enabling it?
>
> Cheers,
>
> Federico
>
> On Tue, Nov 3, 2020 at 6:51 PM Jurijs Ivolga 
> wrote:
>
>> Hi Federico,
>>
>> First of all, thank you a lot for helping me. This means a lot to me
>> This is true open source spirit!!!
>>
>> So indeed I had messed up config and I was saving transactions
>> incorrectly and that why you saw 2 call IDs.
>>
>> I updated my config and now I do save transactions correctly and it
>> works! I would like to add that I needed to update Registrar settings too:
>>
>> modparam("registrar", "append_branches", 0) -- this was messing with my
>> config too. I needed to disable it to make it work.
>>
>> Thank you again
>>
>> Jurijs
>>
>>
>> On Tue, Nov 3, 2020 at 12:55 PM Federico Cabiddu <
>> federico.cabi...@gmail.com> wrote:
>>
>>> Hi Jurijs,
>>> I had a look at the logs but they are confusing: looks like there are
>>> two calls (transactions) stored by tsilo and the ts_append is called only
>>> for one.
>>> In the logs you sent:
>>> 1) row 19: an INVITE comes with callid
>>> 9741c821-93b2-1239-0599-024233fefdc7
>>> 2) row 60: since there is no contact the transaction is
>>> suspended (transaction hash:id=9467:1575872173)
>>> 3) row 132: a REGISTER is received from the user for which the
>>> transaction was suspended
>>> 4) row 193 onward: the transaction 9467:1575872173 is resumed, the
>>> INVITE is sent out and the transaction stored by tsilo
>>> 5) row 262: another REGISTER from the same instance (same sip.instance
>>> and received) is received
>>> 6) ts_append is called but the transaction hash:id is 16864:783220347
>>> and the callid is 3ed4a6c3051ea46b50487a0d1b5b25ec@10.10.0.0: when has
>>> this transaction been stored? I couldn't find anywhere in the logs
>>> Which version of kamailio are you using?
>>> Are you setting the "use_domain" tsilo parameter?
>>> First I'd suggest trying to call ts_store specifying the r-uri, as you
>>> do for ts_append.
>>> Then could you please retry the scenario being sure that there is only
>>> one transaction stored?
>>> Thank you,
>>>
>>> Federico
>>>
>>>
>>>
>>>
>>> On Sat, Oct 31, 2020 at 5:16 PM Jurijs Ivolga 
>>> wrote:
>>>
 Hi,

 Any ideas regarding "t_append_branches(): failure to add branches (-1)"?

 Is there a way somehow to dump what ts_append handover towards tm? I
 think if I would be able to see this I will be able to understand what is
 wrong. I tried tm:local-request and failure route and branch route, but
 these routes are not executed when this error happens.

 Maybe the issue is that the TLS connection is established between
 Kamailio and UAC what is in front my Register and this Register kamailio
 just tries to connect directly towards UAC and it fails? At least this is
 my idea why this might fail.

 Jurijs


 On Thu, Oct 29, 2020 at 8:38 AM Jurijs Ivolga 
 wrote:

> Hi Federico,
>
> Indeed I had a messed up config at that point. I cleaned it up, but
> still had the same problem.
>
> Full log in attachment.
>
> Here is some part of it:
>
> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tsilo [ts_append.c:72]:
>> ts_append(): transaction 16864:783220347 found for
>> sip:1443452187102-0af7c6035717-0...@voipstaging.myappapp.net, going
>> to append branches
>> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_lookup.c:1612]:
>> t_lookup_ident_filter(): transaction found
>> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} registrar [lookup.c:306]:
>> lookup_helper(): contact for [1443452187102-0af7c6035717-0001] found by
>> address
>> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_append_branches.c:77]:
>> t_append_branches(): transaction 16864:783220347 in status 180
>> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_append_branches.c:99]:
>> t_append_branches(): Call 3ed4a6c3051ea46b50487a0d1b5b25ec@10.10.0.0:
>> 1 (0) outgoing branches
>> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm
>> [t_append_branches.c:163]: t_append_branches(): Call
>> 3ed4a6c3051ea46b50487a0d1b5b25ec@10.10.0.0: 1 (0) outgoing branches
>> after clear_branches()
>> 45(51) ERROR: {1 21 REGISTER 6z~FzexPro} tm
>> [t_append_branches.c:172]: *t_append_branches(): failure to add
>> branches (-1)*
>> 45(51) INFO: {1 21 REGISTER 6z~FzexPro} 

Re: [SR-Users] tsilo - failure to add branches (-1)

2020-11-05 Thread Federico Cabiddu
Good to know that you solved it :)
Why did you have to set "append_branches" to 0? Which was the behaviour
when enabling it?

Cheers,

Federico

On Tue, Nov 3, 2020 at 6:51 PM Jurijs Ivolga 
wrote:

> Hi Federico,
>
> First of all, thank you a lot for helping me. This means a lot to me
> This is true open source spirit!!!
>
> So indeed I had messed up config and I was saving transactions incorrectly
> and that why you saw 2 call IDs.
>
> I updated my config and now I do save transactions correctly and it works!
> I would like to add that I needed to update Registrar settings too:
>
> modparam("registrar", "append_branches", 0) -- this was messing with my
> config too. I needed to disable it to make it work.
>
> Thank you again
>
> Jurijs
>
>
> On Tue, Nov 3, 2020 at 12:55 PM Federico Cabiddu <
> federico.cabi...@gmail.com> wrote:
>
>> Hi Jurijs,
>> I had a look at the logs but they are confusing: looks like there are two
>> calls (transactions) stored by tsilo and the ts_append is called only for
>> one.
>> In the logs you sent:
>> 1) row 19: an INVITE comes with callid
>> 9741c821-93b2-1239-0599-024233fefdc7
>> 2) row 60: since there is no contact the transaction is
>> suspended (transaction hash:id=9467:1575872173)
>> 3) row 132: a REGISTER is received from the user for which the
>> transaction was suspended
>> 4) row 193 onward: the transaction 9467:1575872173 is resumed, the INVITE
>> is sent out and the transaction stored by tsilo
>> 5) row 262: another REGISTER from the same instance (same sip.instance
>> and received) is received
>> 6) ts_append is called but the transaction hash:id is 16864:783220347 and
>> the callid is 3ed4a6c3051ea46b50487a0d1b5b25ec@10.10.0.0: when has this
>> transaction been stored? I couldn't find anywhere in the logs
>> Which version of kamailio are you using?
>> Are you setting the "use_domain" tsilo parameter?
>> First I'd suggest trying to call ts_store specifying the r-uri, as you do
>> for ts_append.
>> Then could you please retry the scenario being sure that there is only
>> one transaction stored?
>> Thank you,
>>
>> Federico
>>
>>
>>
>>
>> On Sat, Oct 31, 2020 at 5:16 PM Jurijs Ivolga 
>> wrote:
>>
>>> Hi,
>>>
>>> Any ideas regarding "t_append_branches(): failure to add branches (-1)"?
>>>
>>> Is there a way somehow to dump what ts_append handover towards tm? I
>>> think if I would be able to see this I will be able to understand what is
>>> wrong. I tried tm:local-request and failure route and branch route, but
>>> these routes are not executed when this error happens.
>>>
>>> Maybe the issue is that the TLS connection is established between
>>> Kamailio and UAC what is in front my Register and this Register kamailio
>>> just tries to connect directly towards UAC and it fails? At least this is
>>> my idea why this might fail.
>>>
>>> Jurijs
>>>
>>>
>>> On Thu, Oct 29, 2020 at 8:38 AM Jurijs Ivolga 
>>> wrote:
>>>
 Hi Federico,

 Indeed I had a messed up config at that point. I cleaned it up, but
 still had the same problem.

 Full log in attachment.

 Here is some part of it:

 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tsilo [ts_append.c:72]:
> ts_append(): transaction 16864:783220347 found for
> sip:1443452187102-0af7c6035717-0...@voipstaging.myappapp.net, going
> to append branches
> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_lookup.c:1612]:
> t_lookup_ident_filter(): transaction found
> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} registrar [lookup.c:306]:
> lookup_helper(): contact for [1443452187102-0af7c6035717-0001] found by
> address
> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_append_branches.c:77]:
> t_append_branches(): transaction 16864:783220347 in status 180
> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_append_branches.c:99]:
> t_append_branches(): Call 3ed4a6c3051ea46b50487a0d1b5b25ec@10.10.0.0:
> 1 (0) outgoing branches
> 45(51) DEBUG: {1 21 REGISTER 6z~FzexPro} tm [t_append_branches.c:163]:
> t_append_branches(): Call 3ed4a6c3051ea46b50487a0d1b5b25ec@10.10.0.0:
> 1 (0) outgoing branches after clear_branches()
> 45(51) ERROR: {1 21 REGISTER 6z~FzexPro} tm [t_append_branches.c:172]: 
> *t_append_branches():
> failure to add branches (-1)*
> 45(51) INFO: {1 21 REGISTER 6z~FzexPro} 

[SR-Users] Proxy configuration that exit dialog afer INVITE -> OK

2020-11-05 Thread Adrian Tabacioiu


Hello all,

Am I new in the usage of kamailio, sorry if I ask somehow something simple
or terribly wrong .

I need to test a configuration of Kamailio which exit the dialog between
UA after the first OK (that means it will not receive the following ACK,
BYE).

I understand that in theory this is possible in two configuration types:
- no Record Route header
- or stateless proxy

First question:
Am I correct with the choices above?
Can I find example configuration for this two modes ?

Question 2:
two or more proxy should be inter-connected, removing the Record Route
header would interfere with proxy routing ? (should not the "Via"
information be sufficient?)

Thank you in advance for help.

Best regards,
Adrian Tabacioiu

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