How can I get the determine the total size of an outgoing INVITE?
The size of the body is $bs, but is there a way to get the size of all headers? Based on the size of the total request I have to chose between UDP and TCP, upstream provider requires IP packets>1300 to be transmitted over TCP.
Is there an easy way (like $bs) or should I just call msg_apply_changes() and loop through all headers and sum the lengths of them?
Hello,
On 07/02/14 16:05, Daniel Tryba wrote:
How can I get the determine the total size of an outgoing INVITE?
The size of the body is $bs, but is there a way to get the size of all headers? Based on the size of the total request I have to chose between UDP and TCP, upstream provider requires IP packets>1300 to be transmitted over TCP.
Is there an easy way (like $bs) or should I just call msg_apply_changes() and loop through all headers and sum the lengths of them?
there is a variable giving the size of the entire sip message:
- http://www.kamailio.org/wiki/cookbooks/4.1.x/pseudovariables#ml_-_sip_messag...
But in this case you should play with mtu related parameters or functions from core:
- http://www.kamailio.org/wiki/cookbooks/4.1.x/core#udp_mtu
Cheers, Daniel
On Saturday 08 February 2014 08:59:26 Daniel-Constantin Mierla wrote:
http://www.kamailio.org/wiki/cookbooks/4.1.x/pseudovariables#ml_-_sip_messa ge_length
Strangely enough I didn't see that one.
But in this case you should play with mtu related parameters or functions from core:
This (and udp_mtu_try_proto) does exactly what I need to do for this specific upstream provider. I'll see if I can get this to do the job. Thanks.
On Monday 10 February 2014 11:25:11 Daniel Tryba wrote:
This (and udp_mtu_try_proto) does exactly what I need to do for this specific upstream provider. I'll see if I can get this to do the job. Thanks.
Might be to risky in my setup, since I only need this for a specific dispatcher, I chose the folowing: - in the dispatcher (if the id matches) I set an AVP - at the end of route[RELAY] (just before t_relay()) if the AVP is set: * msg_apply_changes to commit changes. * if $ml>1299 use t_relay_to_tcp instead of t_relay.
This leaves me the option to set the AVP for any other destination that might need it in the future without any other changes.