I’m working with asterisk 11 and 13 and I don’t have issues, however I’m migrating from these asterisk to pjsip, asterisk 18 and Asterisk Realtime and for some reason I am getting duplicates and triplicate INVITES in the SIP packages
My infrastructure is:
Kamailio SIP → Asterisk 18 → AGI Server
When these asterisk server receive traffic, they working fine but few hours later they show this behavior.
I’ve added the kamailio hostname on asterisk /etc/hosts and I change svr_lookups = no, but I don’t have different results
Maybe I should change other values on Asterisk Realtime tables?
Thank you for you answer but it isn’t clear for me, What could be a solution? I keep investigating and I find in this table ps_aors, can I add value to these options, currently I have these fields with NULL:
An AOR has is not involved in strictly an incoming INVITE handling. Do you have “identify” in realtime? Are you using hostnames? If so then the handling will be blocked until DNS resolution of that completes, if it is slow then the handling of the INVITE will be slow.
That doesn’t avoid DNS resolution. That avoids SRV lookups. If a hostname is provided then DNS resolution will still occur. You should avoid hostnames for identify if at all possible if using realtime for this exact reason. Underneath it uses the system resolution method, so if that respects /etc/hosts and the hostname is in there then it should return quickly.
This is happening for Trying. The only time when DNS should be involved with that is if the Via header contains a domain name. Otherwise, the whole point of Trying is that it can be sent before any significant analysis of the request has been made. It’s a protocol violation to send it late. The UAS has 200ms to send it.
On the other hand, it isn’t clear where the packet capture was taken, and therefore whether Asterisk is causing the delay.
The capture was taken from external server, this server capture the kamailio and asterisk traffic.
I appreciate you help and so based on you explanation the solution is remove hostnames from the /etc/hosts or is there an option for the asterisk doesn’t trying to resolve the names???
We could probably change it though I’m not going to invest time into doing so since in practice the impact isn’t huge and the scope is limited to specific configuration and usage. If someone else put up such a review then it’d be reviewed.