TCP Transport question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

Yes, it should be error in UAS. Thanks Klaus!

Now I have another case:
While testing pjSIP's behavior using TCP transport with pjsua, I've
encountered another strange situation. If I use STUN server and UDP
transport, pjsua sends (as I expected) message SIP REGISTER with correct,
STUN resolved addresses in fields "via" and "contact".
On the other hand, if I switch to TCP transport (and use the same STUN
server) than pjsua sends message SIP REGISTER with "wrong - IMO" IP
addresses (my local-private) in "via" and "contact" fields and not like I
would expect with STUN resolved addresses. See log below...

Thanks again,
Sasa


 14:54:52.332 os_core_win32. pjlib 0.8.0-trunk for win32 initialized
 14:54:52.348 sip_endpoint.c Creating endpoint instance...
 14:54:52.348          pjlib select() I/O Queue created (00D20858)
 14:54:52.348 sip_endpoint.c Module "mod-msg-print" registered
 14:54:52.348 sip_transport. Transport manager created.
 14:54:52.348 sip_endpoint.c Module "mod-pjsua-log" registered
 14:54:52.348   pjsua_core.c Nameserver 192.168.133.254 added
 14:54:52.348 sip_endpoint.c Module "mod-tsx-layer" registered
 14:54:52.348 sip_endpoint.c Module "mod-stateful-util" registered
 14:54:52.348 sip_endpoint.c Module "mod-ua" registered
 14:54:52.348 sip_endpoint.c Module "mod-100rel" registered
 14:54:52.348 sip_endpoint.c Module "mod-pjsua" registered
 14:54:52.348 sip_endpoint.c Module "mod-invite" registered
 14:54:52.348   pjsua_core.c STUN server stun.voipbuster.com resolved,
address is 80.239.235.209:3478
 14:54:52.551      pasound.c PortAudio sound library initialized, status=0
 14:54:52.551      pasound.c PortAudio host api count=3
 14:54:52.551      pasound.c Sound device count=8
 14:54:52.551          pjlib select() I/O Queue created (00C4E544)
 14:54:52.551 sip_endpoint.c Module "mod-evsub" registered
 14:54:52.551 sip_endpoint.c Module "mod-presence" registered
 14:54:52.551 sip_endpoint.c Module "mod-refer" registered
 14:54:52.551 sip_endpoint.c Module "mod-pjsua-pres" registered
 14:54:52.551 sip_endpoint.c Module "mod-pjsua-im" registered
 14:54:52.551 sip_endpoint.c Module "mod-pjsua-options" registered
 14:54:52.551   pjsua_core.c 1 SIP worker threads created
 14:54:52.551   pjsua_core.c pjsua version 0.8.0-trunk for win32 initialized
 14:54:52.707   pjsua_core.c SIP UDP socket reachable at 193.77.81.126:5060
 14:54:52.707    udp00D4E000 SIP UDP transport started, published address is
193.77.81.126:5060
 14:54:52.707    pjsua_acc.c Account <sip:193.77.81.126:5060> added with id
0
 14:54:52.707    tcplis:5060 SIP TCP listener ready for incoming connections
at 192.168.133.10:5060
 14:54:52.707    pjsua_acc.c Account <sip:192.168.133.10:5060;transport=TCP>
added with id 1
 14:54:52.707    pjsua_acc.c Account sip:1551 at int-tcp.pingtel.com;transport=tcp
added with id 2
 14:54:52.707     resolver.c Transmitting 47 bytes to NS 0 (
192.168.133.254:53): DNS SRV query for _sip._tcp.int-tcp.pingtel.com
 14:54:52.707    pjsua_acc.c Registration sent
 14:54:52.723     resolver.c Transmitting 37 bytes to NS 0 (
192.168.133.254:53): DNS A query for interop.pingtel.com
 14:54:52.739   tcpc00D56024 TCP client transport created
 14:54:52.739   tcpc00D56024 TCP transport 192.168.133.10:1813 is connecting
to 155.212.198.118:5060...
 14:54:52.739   pjsua_core.c TX 472 bytes Request msg REGISTER/cseq=9189
(tdta00D53760) to tcp 155.212.198.118:5060:
REGISTER sip:int-tcp.pingtel.com;transport=tcp SIP/2.0
Via: SIP/2.0/tcp 192.168.133.10:1813
;rport;branch=z9hG4bKPj363d10babf4c47ed907afe4a1d2ab443
Max-Forwards: 70
From: <sip:1551@xxxxxxxxxxxxxxxxxxx>;tag=86a64bd2d20447c48f55020ba2cc41e8
To: <sip:1551 at int-tcp.pingtel.com>
Call-ID: 8e926480539e4a6cade1065e41dc99bd
CSeq: 9189 REGISTER
User-Agent: PJSUA v0.8.0-trunk/win32
Contact: <sip:1551 at 192.168.133.10:5060;transport=TCP>
Expires: 3600
Content-Length:  0


--end msg--
 14:54:52.754  pjsua_media.c RTP socket reachable at 193.77.81.126:4000
 14:54:52.754  pjsua_media.c RTCP socket reachable at 193.77.81.126:4001
 14:54:52.801  pjsua_media.c RTP socket reachable at 193.77.81.126:4002
 14:54:52.801  pjsua_media.c RTCP socket reachable at 193.77.81.126:4003
 14:54:52.942   tcpc00D56024 TCP transport 192.168.133.10:1813 is connected
to 155.212.198.118:5060
 14:54:53.020  pjsua_media.c RTP socket reachable at 193.77.81.126:4004
 14:54:53.020  pjsua_media.c RTCP socket reachable at 193.77.81.126:4005
 14:54:53.192   pjsua_core.c RX 675 bytes Response msg
401/REGISTER/cseq=9189 (rdata00D561BC) from tcp 155.212.198.118:5060:
SIP/2.0 401 Unauthorized
From: <sip:1551@xxxxxxxxxxxxxxxxxxx>;tag=86a64bd2d20447c48f55020ba2cc41e8
To: <sip:1551 at int-tcp.pingtel.com>
Call-Id: 8e926480539e4a6cade1065e41dc99bd
Cseq: 9189 REGISTER
Via: SIP/2.0/tcp 192.168.133.10:1813
;rport=1813;branch=z9hG4bKPj363d10babf4c47ed907afe4a1d2ab443;received=
193.77.81.126
Www-Authenticate: Digest realm="interop.pingtel.com",
nonce="9b4f6d370adbbe7888264e0de9b6687c47da83ad"
User-Agent: sipX/3.9.7 sipX/registry (Linux)
Date: Fri, 14 Mar 2008 13:54:53 GMT
Contact: <sip:155.212.198.118:5070>
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, REGISTER, SUBSCRIBE
Accept-Language: en
Supported: gruu
Content-Length: 0


--end msg--
 14:54:53.192   pjsua_core.c TX 680 bytes Request msg REGISTER/cseq=9190
(tdta00D53760) to tcp 155.212.198.118:5060:
REGISTER sip:int-tcp.pingtel.com;transport=tcp SIP/2.0
Via: SIP/2.0/tcp 192.168.133.10:1813
;rport;branch=z9hG4bKPjd25d246b3aba4d47a74d04e339cfbb6f
Max-Forwards: 70
From: <sip:1551@xxxxxxxxxxxxxxxxxxx>;tag=86a64bd2d20447c48f55020ba2cc41e8
To: <sip:1551 at int-tcp.pingtel.com>
Call-ID: 8e926480539e4a6cade1065e41dc99bd
CSeq: 9190 REGISTER
User-Agent: PJSUA v0.8.0-trunk/win32
Contact: <sip:1551 at 192.168.133.10:5060;transport=TCP>
Expires: 3600
Authorization: Digest username="1551", realm="interop.pingtel.com",
nonce="9b4f6d370adbbe7888264e0de9b6687c47da83ad", uri="sip:
int-tcp.pingtel.com;transport=tcp", response="456ff714455d37295
087c37dd05f7fc6"
Content-Length:  0


--end msg--
 14:54:53.239  pjsua_media.c RTP socket reachable at 193.77.81.126:4006
 14:54:53.239  pjsua_media.c RTCP socket reachable at 193.77.81.126:4007
 14:54:53.426  pjsua_media.c RTP socket reachable at 193.77.81.126:4008
 14:54:53.426  pjsua_media.c RTCP socket reachable at 193.77.81.126:4009
 14:54:53.442   pjsua_core.c RX 606 bytes Response msg
200/REGISTER/cseq=9190 (rdata00D561BC) from tcp 155.212.198.118:5060:
SIP/2.0 200 OK
From: <sip:1551@xxxxxxxxxxxxxxxxxxx>;tag=86a64bd2d20447c48f55020ba2cc41e8
To: <sip:1551 at int-tcp.pingtel.com>;tag=404665879
Call-Id: 8e926480539e4a6cade1065e41dc99bd
Cseq: 9190 REGISTER
Via: SIP/2.0/tcp 192.168.133.10:1813
;rport=1813;branch=z9hG4bKPjd25d246b3aba4d47a74d04e339cfbb6f;received=
193.77.81.126
Contact: <sip:1551 at 192.168.133.10:5060;transport=TCP>;EXPIRES=1210
User-Agent: sipX/3.9.7 sipX/registry (Linux)
Date: Fri, 14 Mar 2008 13:54:53 GMT
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, REGISTER, SUBSCRIBE
Accept-Language: en
Supported: gruu
Content-Length: 0


--end msg--
 14:54:53.489  pjsua_media.c RTP socket reachable at 193.77.81.126:4010
 14:54:53.489  pjsua_media.c RTCP socket reachable at 193.77.81.126:4011
 14:54:53.723  pjsua_media.c RTP socket reachable at 193.77.81.126:4012
 14:54:53.723  pjsua_media.c RTCP socket reachable at 193.77.81.126:4013
 14:54:54.020  pjsua_media.c RTP socket reachable at 193.77.81.126:4014
 14:54:54.020  pjsua_media.c RTCP socket reachable at 193.77.81.126:4015
 14:54:54.192  pjsua_media.c RTP socket reachable at 193.77.81.126:4016
 14:54:54.192  pjsua_media.c RTCP socket reachable at 193.77.81.126:4017
 14:54:54.348  pjsua_media.c RTP socket reachable at 193.77.81.126:4018
 14:54:54.348  pjsua_media.c RTCP socket reachable at 193.77.81.126:4019
 14:54:54.348  pjsua_media.c pjsua_set_snd_dev(): attempting to open devices
@16000 Hz
 14:54:54.348    pjsua_acc.c sip:1551 at int-tcp.pingtel.com;transport=tcp:
registration success, status=200 (OK), will re-register in 1210 seconds
>>>>
Account list:
  [ 0] <sip:193.77.81.126:5060>: does not register
       Online status: Online
  [ 1] <sip:192.168.133.10:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:1551 at int-tcp.pingtel.com;transport=tcp: 200/OK (expires=1204)
       Online status: Online
Buddy list:
 [ 1] <?>  sip:1552 at int-tcp.pingtel.com;transport=tcp
 [ 2] <?>  sip:1553 at int-tcp.pingtel.com

+=============================================================================+
|       Call Commands:         |   Buddy, IM & Presence:  |
Account:      |
|                              |
|                   |
|  m  Make new call            | +b  Add new buddy       .| +a  Add new
accnt |
|  M  Make multiple calls      | -b  Delete buddy         | -a  Delete
accnt. |
|  a  Answer call              |  i  Send IM              | !a  Modify
accnt. |
|  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr
(Re-)register |
|  H  Hold call                |  u  Unsubscribe presence | ru
Unregister    |
|  v  re-inVite (release hold) |  t  ToGgle Online status |  >  Cycle next
ac.|
|  U  send UPDATE              |  T  Set online status    |  <  Cycle prev
ac.|
| ],[ Select next/prev call
+--------------------------+-------------------+
|  x  Xfer call                |      Media Commands:     |  Status &
Config: |
|  X  Xfer with Replaces       |
|                   |
|  #  Send RFC 2833 DTMF       | cl  List ports           |  d  Dump
status   |
|  *  Send DTMF with INFO      | cc  Connect port         | dd  Dump
detailed |
| dq  Dump curr. call quality  | cd  Disconnect port      | dc  Dump
config   |
|                              |  V  Adjust audio Volume  |  f  Save
config   |
|  S  Send arbitrary REQUEST   | Cp  Codec priorities     |  f  Save
config   |
+------------------------------+--------------------------+-------------------+
|  q  QUIT       sleep N: console sleep for N ms    n: detect NAT
type        |
+=============================================================================+
You have 0 active call
>>>  14:54:59.379   sound_port.c EC suspended because of inactivity
 14:55:00.770 stuntsx00D4F66 STUN timeout waiting for response
 14:55:00.770 stuntsx00D4EE0 STUN timeout waiting for response
 14:55:00.801    pjsua_app.c NAT detected as Port Restricted



On Fri, Mar 14, 2008 at 2:31 PM, Klaus Darilion <
klaus.mailinglists at pernau.at> wrote:

> SIP/2.0 200 OK
> Via:SIP/2.0/tcp
> 192.168.60.130:2378;branch=z9hG4bKPjbaf223aecad0451ab6f5b80e26e5143f;rport
> From:<sip:22222239 at 192.168.104.2>;tag=1e68f3259c4242d6ba74c69ace4f5f44
> To:<sip:2230 at 192.168.104.2>;tag=1482606729-1205334993760
> Call-ID:5dbde9f0111241c0b3e109cce578f6a7
> CSeq:28477 INVITE
> Allow:ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,UPDATE,NOTIFY
> Supported:timer
> Accept:multipart/mixed,application/media_control+xml,application/sdp
> Contact:<sip:192.168.104.2:5060>
>
> Take a look at the contact header - there is no transport parameter,
> thus the UAS announces UDP as transport for indialog requests.
>
> Either a bug or config error in the UAS.
> Or if there is a proxy in the middle which does protocol change then it
> should do record routing.
>
> regards
> klaus
>
> Sasa Coh schrieb:
> > Hello!
> >
> > See attachment with the pjsua log output. Btw. it works on openser but
> > not on broadworks.
> >
> > Thanks,
> > Sasa
> >
> >
> > On Wed, Mar 12, 2008 at 9:29 PM, Klaus Darilion
> > <klaus.mailinglists at pernau.at <mailto:klaus.mailinglists at pernau.at>>
> wrote:
> >
> >
> >
> >     Sasa Coh wrote:
> >      > Hello Benny,
> >      >
> >      > I'm testing pjSIP's behavior using pjsua (latest version) and
> >     found out,
> >      > that (by my opinion) pjsua has an error when using TCP transport.
> >      > I was following instructions from documentation (as below):
> >      >
> >
> ------------------------------------------------------------------------
> >      > Using TCP Transport
> >      >
> >      > By default, TCP transport will be created and initialized.
> >     However, TCP
> >      > will not be used automatically unless the destination URL has
> >      > ";transport=tcp" parameter in it. (Note: this behavior may change
> >     once
> >      > we support resolving NAPTR records).
> >      >
> >      > TCP can be specified when registering to server and when sending
> >      > outgoing requests. To use TCP when registering, add
> >     ";transport=tcp" in
> >      > the registrar's URL, for example with "--registrar
> >     sip:example.com <http://example.com>
> >      > <http://example.com>;transport=tcp" option.
> >      >
> >      > Similarly ";transport=tcp" parameter needs to be added in the
> >      > destination URL when making outgoing calls, subscribing presence,
> or
> >      > sending outgoing MESSAGE request.
> >      >
> >
> ------------------------------------------------------------------------
> >      >
> >      > And now, back to the problem:
> >      > - First, register via TCP - that went OK.
> >      > - Then, in case of an outgoing call, everything is OK too.
> >      > - The error occurs at the time when I put this call on hold. The
> >      > re-INVITE (sent by pjSIP) that goes out (signaling HOLD
> condition) is
> >      > sent via UDP and not TCP as I would expect!
> >      >
> >      > Am I doing something wrong or is this an error in pjSIP? How can
> I
> >      > overcome this?
> >
> >     Show the SIP packets (e.g. using "ngrep -W byline port 5060"). I
> guess
> >     there is the transport parameter missing in the contact header or in
> the
> >     record-route header.
> >
> >     regards
> >     klaus
> >
> >      >
> >      > Kind regards,
> >      > Sasa
> >      >
> >      >
> >      >
> >
> ------------------------------------------------------------------------
> >      >
> >      > _______________________________________________
> >      > Visit our blog: http://blog.pjsip.org
> >      >
> >      > pjsip mailing list
> >      > pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
> >      > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> >
> >     _______________________________________________
> >     Visit our blog: http://blog.pjsip.org
> >
> >     pjsip mailing list
> >     pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
> >     http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Visit our blog: http://blog.pjsip.org
> >
> > pjsip mailing list
> > pjsip at lists.pjsip.org
> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080319/8e5a4a46/attachment-0001.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux