[pjsip] Error sending msg > PJSIP_MAX_PKT_LEN in pjsip_msg_print()

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

 



Helmut Wolf wrote:
> Hi Benny,
> 
> I am using stateful_proxy.c
> 
> Test case: I have received an INVITE msg which has to be forwarded. After attaching some SIP headers it has a length of 2053 Bytes,
> which is bigger than the default PJSIP_MAX_PKT_LEN of 2000. The result is that the msg is forwarded but there is no SDP Body and the
> content-length is 0.
> 
> I suppose the error is sip_transport.c -> mod_on_tx_msg() -> pjsip_msg_print() where the msg is printed to tdata->buf. The function
> returns a value > 0 but I think it must return a value < 0 so mod_on_tx_msg() returns with PJSIP_EMSGTOOLONG...

That is the expected behavior indeed.

It's just that it's rather difficult to pinpoint where the fault 
was. For the most part, pjsip_msg_print() doesn't really print the 
message by itself, but rather calls various xx_print() callbacks 
that are registered with the SIP headers and body. So it could be 
that one of these callbacks failed to check the remaining length of 
the print buffer or it didn't return -1 to signal pjsip_msg_print() 
that the print buffer is not long enough.

What kind of message body it is? And what callback was put in 
pjsip_msg_body structure?

And same question for the SIP headers. Can you list the header names 
used in the message?

regards,
  -benny

> I have setted PJSIP_MAX_PKT_LEN to 3000 and then it works fine.
> 
> Best regards,
> Helmut





[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