Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Daniel Tryba
On Thu, Sep 08, 2016 at 04:50:50PM +0200, Federico Cabiddu wrote: > The issue with dispatcher is that, in case of TCP transport, you cannot set > the sending socket for the same reason. > Basically, each time a client TCP socket is open by Kamailio, the SO select > the port, due to the lack of supp

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Yuriy Gorlichenko
I know about dispatcher but it not always canbe heplfull. Sometimes i need my own logic that not implemented at the dispatcher. For checking kamailio live from asterisk im use qualfy for keepalives, if i use asterisk only as media server but it not always usefull. Sometimes scenarios need to use a

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Yuriy Gorlichenko
I know about dispatcher but it not always canbe heplfull. Sometimes i need my own logic that not implemented at the dispatcher. For checking kamailio live from asterisk im use qualfy for keepalives, if i use asterisk only as media server but it not always usefull. Sometimes scenarios need to use a

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Federico Cabiddu
The issue with dispatcher is that, in case of TCP transport, you cannot set the sending socket for the same reason. Basically, each time a client TCP socket is open by Kamailio, the SO select the port, due to the lack of support for SO_REUSEPORT. Cheers, Federico On Thu, Sep 8, 2016 at 4:33 PM,

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Daniel Tryba
On Thu, Sep 08, 2016 at 03:38:32PM +0300, Yuriy Gorlichenko wrote: > I didnt thought about keepalive. I suppose it can help. Better than using qualify in asterisk is to use the dispatcher module in kamailio. The idea is the same, but more configurable and it is just 1 keepalive mechanisme so the a

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Yuriy Gorlichenko
hm. thanks for information. I will read this) nice to know that. Thx for advices again 2016-09-08 15:43 GMT+03:00 Daniel Tryba : > On Thu, Sep 08, 2016 at 02:43:03PM +0300, Yuriy Gorlichenko wrote: > > Like User sends registration, kamailio just Transcoding this request to > TCP > > and then rese

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Daniel Tryba
On Thu, Sep 08, 2016 at 02:43:03PM +0300, Yuriy Gorlichenko wrote: > Like User sends registration, kamailio just Transcoding this request to TCP > and then resend this registration packet to Asterisk. > With this example asteisk must originate all PACKETS to TCP port of > kamailio but it tries to s

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Yuriy Gorlichenko
When packet arrives at from the WebSocket its length usually more that 1500 bytes THat is the problem. sometimes sdp data lost while sending. If asterisk at the sama machine it uses lo interface and then it is not a problem but for remote servers it can be. I didnt thought about keepalive. I suppo

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Daniel Tryba
On Thu, Sep 08, 2016 at 02:43:03PM +0300, Yuriy Gorlichenko wrote: > yes. Thats will be great because in some system design it must use same > port that listening for sendinf like in UDP for example for transcoding SIP > over WebSocket to SIP over TCP and masking registration behind thanscoder. >

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Yuriy Gorlichenko
yes. Thats will be great because in some system design it must use same port that listening for sendinf like in UDP for example for transcoding SIP over WebSocket to SIP over TCP and masking registration behind thanscoder. Like User sends registration, kamailio just Transcoding this request to TC

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Daniel Tryba
On Thu, Sep 08, 2016 at 11:16:29AM +0200, Federico Cabiddu wrote: > about this subject: linux kernel starting from 3.9 introduced SO_REUSEPORT > which allows reusing TCP sockets. > It could be interesting supporting this in Kamailio. I worked on a patch > for this, I can open a PR and start a discu

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Federico Cabiddu
Hi, about this subject: linux kernel starting from 3.9 introduced SO_REUSEPORT which allows reusing TCP sockets. It could be interesting supporting this in Kamailio. I worked on a patch for this, I can open a PR and start a discussion if you think it's worth. Regards, Federico On Thu, Sep 8, 201

Re: [SR-Users] Kamailio send TCP packets from random ports

2016-09-08 Thread Daniel Tryba
On Wed, Sep 07, 2016 at 08:35:30PM +0300, Yuriy Gorlichenko wrote: > Before to send to asteisk any packet i added > $fs=ip.add.re.ss:port > > Also discribed > listen=tcp:ip.add.re.ss:port > > But kamailio send outgoing packets from random prot throug TCP > Presume i configured 5060 port but it se