Error in pjsip_tpmgr_receive_packet with SIP over TCP using keep-alive

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

 



Hi Helmut,

Sorry for the delay in getting back to you (and I still have dozen of
unanswered mails on this list, so please everyone be patient ;-) ).

Do you know what the content of the keep alive packets are? If it is
CRLF, then it should be okay (theoretically!), as when the real SIP
message arrives, these CRLF bytes will be ignored by the parser.

It's not so easy to drop bytes with TCP, as TCP is stream oriented
transport and data may come in small chunks. But maybe we can do
something about it, such as to drop CRLF bytes outside SIP message,
but before I do this I'd like to hear what the other endpoints are
sending in the keep-alive packets.

cheers,
 -benny

On 2/12/08, Helmut Wolf <HelmutWolf1 at gmx.de> wrote:
> Hi Benny,
>
>  I am using stateful proxy which transmits SIP over TCP. When TCP connection is established and for a time of min. 3 min no packets
>  are transmitted then the proxy receives an incoming packet on TCP socket but does not report it to pjsip endpoint.
>
>  The problem is with TCP keep-alive packets (2 Bytes). This is transmitted every 90s. In sip_transport.c ->
>  pjsip_tpmgr_receive_packet() the packet will be reported to pjsip_find_msg() which normally returns a complete SIP msg. When this
>  function returns PJ_SUCCESS the SIP msg is reported to endpoint. But on an keep-alive packet the functions returns 171024 (on Win
>  XP, not sure, if platform dependent pjsip status code). The remaining length of the packet is 2. On next incoming keep-alive
>  pjsip_find_msg() returns 171050. The remaining length of the packet is now 4. And so on. If more than 3 keep-alive packets are
>  included in buffer and then a SIP msg is received, pjsip_find_msg() returns 171050. So a SIP msg exists in buffer but will not be
>  reported to the endpoint.
>
>  This happens until the buffer is PJSIP_MAX_PKT_LEN (In my configuration 3000). Then the buffer will be cleared.
>
>  Could you please solve the problem? Maybe you can delete the keep-alive packet in buffer (in pjsip_tpmgr_receive_packet or
>  pjsip_find_msg).
>
>  Best regards,
>  Helmut
>
>
>
>
>  _______________________________________________
>  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
>



[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