[pjsip] Size of SIP message

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

 



Alexander Agranovsky wrote:
> Couple of things that I've noticed:
> 
> 1) sip_transport.c, mod_on_tx_msg: it seems that the code makes an  
> assumption, that the size of the message will always be less than  
> PJSIP_MAX_PKT_LEN. While a reasonable assumption for UDP, it's not  
> all that valid for TCP. We can send messages of *any* size over TCP,  
> and this limitation shouldn't be in the way.

While that may be true, it will be difficult to handle if we don't 
have some sort of maximum limit for a message size. Anyway, I don't 
think people are sending gigabytes of content with SIP message, CMIIW.

Particularly in pjsip, we like to pre-allocate resources (memory) in 
advance, to make the library behavior more deterministic. So 
removing this "limitation" will be difficult, I'm afraid.

> 2) mod_msg_print is called after the application callback. What's the  
> best approach for the application, if it wants to log the message?  
> Reproducing the entire mod_on_tx_msg seems redundant (though, it may  
> be useful to overcome the problem mentioned in (1) ;-) ). Seems like  
> either I've missed a method, or the functionality offered by  
> mod_on_tx_msg should be exposed in the API.

Module callbacks are called based on their priority. If you want to 
log a message, register a module with priority value lower than 
PJSIP_MOD_PRIORITY_TRANSPORT_LAYER. Please see pjsua_msg_logger 
module in pjsua_core.c for a sample logging module.

cheers,
  -benny


> Cheers,
> Alex





[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