Hello,

We are working on a project that's using a Twilio SIP trunk that diverts calls from the PSTN to our cluster that is hosting two active-active Kamailio 5.1 instances that redirect traffic to several Asterisk 15.4 instances.

On this setup we are facing 2 issues:
  • Diversion headers access: Currently, Kamailio only supports access to the last diversion header but since we are receiving traffic from Twilio (it sets the last Diversion header) we are unable to see if the caller was diverted to our SIP trunk. Is there a workaround for this? Any external module that would support this use case?

  • Message Too Long Error: Since Twilio uses long URIs to define its resources, the SIP messages being handled by Kamailio are sometimes too big and generate a "Message Too Long error". I have been able to temporarily patch this removing unused headers using remove_hf_re and remove_hf but it still fails from time to time. Is there a way to split the UDP packet to mitigate this issue? or what other options could be considered?

Thanks and regards,