Using the same TCP port for both Tx and Rx in PJ

JK
Jeremy King
Thu, Jan 10, 2008 7:54 AM

Hi,

I'll get straight to the query! :D

How do I get PJ to use the same TCP port for both SIP Tx and Rx?

The PJ I am working is pre 0.8.0 and uses an ephemeral port to send out
SIP requests.

Can I configure PJ to do this in 0.8.0?

  • J
Hi, I'll get straight to the query! :D How do I get PJ to use the same TCP port for both SIP Tx and Rx? The PJ I am working is pre 0.8.0 and uses an ephemeral port to send out SIP requests. Can I configure PJ to do this in 0.8.0? - J
KD
Klaus Darilion
Thu, Jan 10, 2008 11:24 AM

This is default network behavior. outgoing TCP requests use an ephemeral
port. What's the problem with it?

regards
klaus

Jeremy King schrieb:

Hi,

I'll get straight to the query! :D

How do I get PJ to use the same TCP port for both SIP Tx and Rx?

The PJ I am working is pre 0.8.0 and uses an ephemeral port to send
out SIP requests.

Can I configure PJ to do this in 0.8.0?

  • J


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

This is default network behavior. outgoing TCP requests use an ephemeral port. What's the problem with it? regards klaus Jeremy King schrieb: > Hi, > > I'll get straight to the query! :D > > How do I get PJ to use the same TCP port for both SIP Tx and Rx? > > The PJ I am working is pre 0.8.0 and uses an ephemeral port to send > out SIP requests. > > Can I configure PJ to do this in 0.8.0? > > - J > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
BP
Benny Prijono
Thu, Jan 10, 2008 11:48 AM

On 1/10/08, Jeremy King jerry.ipe.thomas@gmail.com wrote:

Hi,

I'll get straight to the query! :D

How do I get PJ to use the same TCP port for both SIP Tx and Rx?

The PJ I am working is pre 0.8.0 and uses an ephemeral port to send out
SIP requests.

For this we will need SIP outbound, which is there as part of our version
1.0 roadmap ( http://www.pjsip.org/trac/roadmap)

cheers,
-benny

Can I configure PJ to do this in 0.8.0?

  • J
On 1/10/08, Jeremy King <jerry.ipe.thomas@gmail.com> wrote: > > Hi, > > I'll get straight to the query! :D > > How do I get PJ to use the same TCP port for both SIP Tx and Rx? > > The PJ I am working is pre 0.8.0 and uses an ephemeral port to send out > SIP requests. > For this we will need SIP outbound, which is there as part of our version 1.0 roadmap ( http://www.pjsip.org/trac/roadmap) cheers, -benny Can I configure PJ to do this in 0.8.0? > > - J > >
KD
Klaus Darilion
Thu, Jan 10, 2008 12:31 PM

Benny Prijono schrieb:

On 1/10/08, Jeremy King <jerry.ipe.thomas@gmail.com
mailto:jerry.ipe.thomas@gmail.com> wrote:

 Hi,
  
   I'll get straight to the query! :D
  
   How do I get PJ to use the same TCP port for both SIP Tx and Rx?
  
   The PJ I am working is pre 0.8.0 and uses an ephemeral port to
 send out SIP requests.

For this we will need SIP outbound, which is there as part of our
version 1.0 roadmap ( http://www.pjsip.org/trac/roadmap)

I have not tried TCP yet. But If pjsip opens a TCP connection - does it
already allow to receive SIP on this TCP connection?

Further, how does SIP outbound help here? I thought Jeremy wants to open
a TCP connection from port 5060 instead of an ephemeral port and
outbound wont help here.

regards
klaus

Benny Prijono schrieb: > On 1/10/08, *Jeremy King* <jerry.ipe.thomas@gmail.com > <mailto:jerry.ipe.thomas@gmail.com>> wrote: > > Hi, > > I'll get straight to the query! :D > > How do I get PJ to use the same TCP port for both SIP Tx and Rx? > > The PJ I am working is pre 0.8.0 and uses an ephemeral port to > send out SIP requests. > > > For this we will need SIP outbound, which is there as part of our > version 1.0 roadmap ( http://www.pjsip.org/trac/roadmap) I have not tried TCP yet. But If pjsip opens a TCP connection - does it already allow to receive SIP on this TCP connection? Further, how does SIP outbound help here? I thought Jeremy wants to open a TCP connection from port 5060 instead of an ephemeral port and outbound wont help here. regards klaus
BP
Benny Prijono
Thu, Jan 10, 2008 1:39 PM

On 1/10/08, Klaus Darilion klaus.mailinglists@pernau.at wrote:

I have not tried TCP yet. But If pjsip opens a TCP connection - does it
already allow to receive SIP on this TCP connection?

Yes. Basically pjsip does not care where the request comes from.

Further, how does SIP outbound help here? I thought Jeremy wants to open

a TCP connection from port 5060 instead of an ephemeral port and
outbound wont help here.

If I understand correctly, he wanted to send and receive requests with the
same connection (and it doesn't have to be from 5060). So outbound should
help, as it allows server to send request back to client using the same
TCP/TLS connection that the client connect to.

cheers,
-benny

regards

On 1/10/08, Klaus Darilion <klaus.mailinglists@pernau.at> wrote: > > I have not tried TCP yet. But If pjsip opens a TCP connection - does it > already allow to receive SIP on this TCP connection? Yes. Basically pjsip does not care where the request comes from. Further, how does SIP outbound help here? I thought Jeremy wants to open > a TCP connection from port 5060 instead of an ephemeral port and > outbound wont help here. If I understand correctly, he wanted to send and receive requests with the same connection (and it doesn't have to be from 5060). So outbound should help, as it allows server to send request back to client using the same TCP/TLS connection that the client connect to. cheers, -benny regards > klaus > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >
KD
Klaus Darilion
Thu, Jan 10, 2008 3:19 PM

Benny Prijono schrieb:

On 1/10/08, Klaus Darilion <klaus.mailinglists@pernau.at
mailto:klaus.mailinglists@pernau.at> wrote:

 I have not tried TCP yet. But If pjsip opens a TCP connection - does it
 already allow to receive SIP on this TCP connection?

Yes. Basically pjsip does not care where the request comes from.

 Further, how does SIP outbound help here? I thought Jeremy wants to open
 a TCP connection from port 5060 instead of an ephemeral port and
 outbound wont help here.

If I understand correctly, he wanted to send and receive requests with
the same connection (and it doesn't have to be from 5060). So outbound
should help, as it allows server to send request back to client using
the same TCP/TLS connection that the client connect to.

This is also possible without explicit outbound support. Just make a TCP
connection and announce as contact the public TCP address (learned from
first response in received&rport of via)

regards
klaus

Benny Prijono schrieb: > On 1/10/08, *Klaus Darilion* <klaus.mailinglists@pernau.at > <mailto:klaus.mailinglists@pernau.at>> wrote: > > I have not tried TCP yet. But If pjsip opens a TCP connection - does it > already allow to receive SIP on this TCP connection? > > > Yes. Basically pjsip does not care where the request comes from. > > Further, how does SIP outbound help here? I thought Jeremy wants to open > a TCP connection from port 5060 instead of an ephemeral port and > outbound wont help here. > > > If I understand correctly, he wanted to send and receive requests with > the same connection (and it doesn't have to be from 5060). So outbound > should help, as it allows server to send request back to client using > the same TCP/TLS connection that the client connect to. This is also possible without explicit outbound support. Just make a TCP connection and announce as contact the public TCP address (learned from first response in received&rport of via) regards klaus
JK
Jeremy King
Fri, Jan 11, 2008 3:02 AM

On Jan 10, 2008 7:09 PM, Benny Prijono bennylp@pjsip.org wrote:

On 1/10/08, Klaus Darilion klaus.mailinglists@pernau.at wrote:

I have not tried TCP yet. But If pjsip opens a TCP connection - does it
already allow to receive SIP on this TCP connection?

Yes. Basically pjsip does not care where the request comes from.

Further, how does SIP outbound help here? I thought Jeremy wants to open

a TCP connection from port 5060 instead of an ephemeral port and
outbound wont help here.

If I understand correctly, he wanted to send and receive requests with the
same connection (and it doesn't have to be from 5060). So outbound should
help, as it allows server to send request back to client using the same
TCP/TLS connection that the client connect to.

The link between the UA and the edge proxy (SER) is
[UA_Int_IP:UA_Int_Port]<-->[NAT_Ext_IP:NAT_Ext_Port]<-->[Edge_Proxy_Ext_IP:Edge_Proxy_Ext_Port]---{Provider_Network}

The NAT is symmetric.

The problem is that

  • The UA, i.e. PJ, sends the REGISTER from port X (ephemeral) but is
    listening on Port Y,
  • The Edge Proxy records NAT_Ext_IP:NAT_Ext_Port to proxy future requests
    to the UA
  • Edge proxy sends new INVITE to UA through NAT_Ext_IP:NAT_Ext_Port
  • INVITE arrives on port X at the UA
  • PJ sends 500 "Server Internal Error"

--

  • Jerry
On Jan 10, 2008 7:09 PM, Benny Prijono <bennylp@pjsip.org> wrote: > On 1/10/08, Klaus Darilion <klaus.mailinglists@pernau.at> wrote: > > > I have not tried TCP yet. But If pjsip opens a TCP connection - does it > > already allow to receive SIP on this TCP connection? > > > Yes. Basically pjsip does not care where the request comes from. > > Further, how does SIP outbound help here? I thought Jeremy wants to open > > a TCP connection from port 5060 instead of an ephemeral port and > > outbound wont help here. > > > If I understand correctly, he wanted to send and receive requests with the > same connection (and it doesn't have to be from 5060). So outbound should > help, as it allows server to send request back to client using the same > TCP/TLS connection that the client connect to. > The link between the UA and the edge proxy (SER) is [UA_Int_IP:UA_Int_Port]<-->[NAT_Ext_IP:NAT_Ext_Port]<-->[Edge_Proxy_Ext_IP:Edge_Proxy_Ext_Port]---{Provider_Network} The NAT is symmetric. The problem is that - The UA, i.e. PJ, sends the REGISTER from port X (ephemeral) but is listening on Port Y, - The Edge Proxy records NAT_Ext_IP:NAT_Ext_Port to proxy future requests to the UA - Edge proxy sends new INVITE to UA through NAT_Ext_IP:NAT_Ext_Port - INVITE arrives on port X at the UA - PJ sends 500 "Server Internal Error" > > cheers, > -benny > > > > regards > > klaus > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- - Jerry
BP
Benny Prijono
Fri, Jan 11, 2008 6:40 AM

On 1/11/08, Jeremy King jerry.ipe.thomas@gmail.com wrote:

If I understand correctly, he wanted to send and receive requests with the

same connection (and it doesn't have to be from 5060). So outbound should
help, as it allows server to send request back to client using the same
TCP/TLS connection that the client connect to.

The link between the UA and the edge proxy (SER) is

[UA_Int_IP:UA_Int_Port]<-->[NAT_Ext_IP:NAT_Ext_Port]<-->[Edge_Proxy_Ext_IP:Edge_Proxy_Ext_Port]---{Provider_Network}

The NAT is symmetric.

The problem is that

  • The UA, i.e. PJ, sends the REGISTER from port X (ephemeral) but is
    listening on Port Y,
  • The Edge Proxy records NAT_Ext_IP:NAT_Ext_Port to proxy future
    requests to the UA
  • Edge proxy sends new INVITE to UA through NAT_Ext_IP:NAT_Ext_Port
  • INVITE arrives on port X at the UA
  • PJ sends 500 "Server Internal Error"

The 500/Internal Server Error must have been caused by something else, as
pjsip should allow request to be received from any transports.

pjsip version 0.8 and later should work well with SER's NAT helper. When TCP
is used, pjsip will use one TCP connection for the registration session, and
pjsip will maintain this connection open by sending keep-alive every 90
seconds (configurable). If SER decides to send request via this TCP
connection, it will be received by pjsip just like any other requests.

cheers,
-benny

cheers,

On 1/11/08, Jeremy King <jerry.ipe.thomas@gmail.com> wrote: > If I understand correctly, he wanted to send and receive requests with the > > same connection (and it doesn't have to be from 5060). So outbound should > > help, as it allows server to send request back to client using the same > > TCP/TLS connection that the client connect to. > > > > > The link between the UA and the edge proxy (SER) is > > [UA_Int_IP:UA_Int_Port]<-->[NAT_Ext_IP:NAT_Ext_Port]<-->[Edge_Proxy_Ext_IP:Edge_Proxy_Ext_Port]---{Provider_Network} > > The NAT is symmetric. > > The problem is that > - The UA, i.e. PJ, sends the REGISTER from port X (ephemeral) but is > listening on Port Y, > - The Edge Proxy records NAT_Ext_IP:NAT_Ext_Port to proxy future > requests to the UA > - Edge proxy sends new INVITE to UA through NAT_Ext_IP:NAT_Ext_Port > - INVITE arrives on port X at the UA > - PJ sends 500 "Server Internal Error" > The 500/Internal Server Error must have been caused by something else, as pjsip should allow request to be received from any transports. pjsip version 0.8 and later should work well with SER's NAT helper. When TCP is used, pjsip will use one TCP connection for the registration session, and pjsip will maintain this connection open by sending keep-alive every 90 seconds (configurable). If SER decides to send request via this TCP connection, it will be received by pjsip just like any other requests. cheers, -benny cheers, > > -benny > > > > > > > > regards > > > klaus > > > > > > _______________________________________________ > > > Visit our blog: http://blog.pjsip.org > > > > > > pjsip mailing list > > > pjsip@lists.pjsip.org > > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > On Jan 10, 2008 7:09 PM, Benny Prijono <bennylp@pjsip.org> wrote: > > > > -- > - Jerry > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
AK
Angelos Karageorgiou
Fri, Jan 11, 2008 1:38 PM

I have a question regarding siprtp, how does it exactly work ? By
replaying back to the originator the media stream?
and how could I make it originate a media stream ? Say play a 10 Sec file.

Sorry I am still new with pjsip and the learning curve for my aging
bones is if not steep a bit hilly.

Thank you for the good work all

I have a question regarding siprtp, how does it exactly work ? By replaying back to the originator the media stream? and how could I make it originate a media stream ? Say play a 10 Sec file. Sorry I am still new with pjsip and the learning curve for my aging bones is if not steep a bit hilly. Thank you for the good work all
JK
Jeremy King
Sat, Jan 12, 2008 12:17 PM

Appreciate all the help
Thank you all

  • J

On 1/11/08, Benny Prijono bennylp@pjsip.org wrote:

On 1/11/08, Jeremy King jerry.ipe.thomas@gmail.com wrote:

If I understand correctly, he wanted to send and receive requests with

the same connection (and it doesn't have to be from 5060). So outbound
should help, as it allows server to send request back to client using the
same TCP/TLS connection that the client connect to.

The link between the UA and the edge proxy (SER) is

[UA_Int_IP:UA_Int_Port]<-->[NAT_Ext_IP:NAT_Ext_Port]<-->[Edge_Proxy_Ext_IP:Edge_Proxy_Ext_Port]---{Provider_Network}

The NAT is symmetric.

The problem is that

  • The UA, i.e. PJ, sends the REGISTER from port X (ephemeral) but is
    listening on Port Y,
  • The Edge Proxy records NAT_Ext_IP:NAT_Ext_Port to proxy future
    requests to the UA
  • Edge proxy sends new INVITE to UA through NAT_Ext_IP:NAT_Ext_Port
  • INVITE arrives on port X at the UA
  • PJ sends 500 "Server Internal Error"

The 500/Internal Server Error must have been caused by something else, as
pjsip should allow request to be received from any transports.

pjsip version 0.8 and later should work well with SER's NAT helper. When
TCP is used, pjsip will use one TCP connection for the registration session,
and pjsip will maintain this connection open by sending keep-alive every 90
seconds (configurable). If SER decides to send request via this TCP
connection, it will be received by pjsip just like any other requests.

cheers,
-benny

cheers,

--

  • Jerry
Appreciate all the help Thank you all - J On 1/11/08, Benny Prijono <bennylp@pjsip.org> wrote: > > On 1/11/08, Jeremy King <jerry.ipe.thomas@gmail.com> wrote: > > > If I understand correctly, he wanted to send and receive requests with > > > the same connection (and it doesn't have to be from 5060). So outbound > > > should help, as it allows server to send request back to client using the > > > same TCP/TLS connection that the client connect to. > > > > > > > > > > > > The link between the UA and the edge proxy (SER) is > > > > [UA_Int_IP:UA_Int_Port]<-->[NAT_Ext_IP:NAT_Ext_Port]<-->[Edge_Proxy_Ext_IP:Edge_Proxy_Ext_Port]---{Provider_Network} > > > > The NAT is symmetric. > > > > The problem is that > > - The UA, i.e. PJ, sends the REGISTER from port X (ephemeral) but is > > listening on Port Y, > > - The Edge Proxy records NAT_Ext_IP:NAT_Ext_Port to proxy future > > requests to the UA > > - Edge proxy sends new INVITE to UA through NAT_Ext_IP:NAT_Ext_Port > > - INVITE arrives on port X at the UA > > - PJ sends 500 "Server Internal Error" > > > > The 500/Internal Server Error must have been caused by something else, as > pjsip should allow request to be received from any transports. > > pjsip version 0.8 and later should work well with SER's NAT helper. When > TCP is used, pjsip will use one TCP connection for the registration session, > and pjsip will maintain this connection open by sending keep-alive every 90 > seconds (configurable). If SER decides to send request via this TCP > connection, it will be received by pjsip just like any other requests. > > cheers, > -benny > > > > cheers, > > > -benny > > > > > > > > > > > > regards > > > > klaus > > > > > > > > _______________________________________________ > > > > Visit our blog: http://blog.pjsip.org > > > > > > > > pjsip mailing list > > > > pjsip@lists.pjsip.org > > > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > > > > > > > > _______________________________________________ > > > Visit our blog: http://blog.pjsip.org > > > > > > pjsip mailing list > > > pjsip@lists.pjsip.org > > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > On Jan 10, 2008 7:09 PM, Benny Prijono <bennylp@pjsip.org> wrote: > > > > > > > > -- > > - Jerry > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- - Jerry