And I have the issue on piece “Asterisk - Opensips” of that chain. When signaling to Asterisk with tls transport, Opensips uses dynamic tcp port, but adds Record-Route header with its ip and port 5061, on which expects replies from Asterisk.
When Asterisk sends back 200 OK reply to Opensips, it rewrites Record-Route header from 5061 to dynamic port pointed above.
Then, Opensips relays 200 reply to UA1 with that dynamic port, and UA1’s ACK addressed to this port, Opensips drops because it never got connection to it from UA1. The description of this behaivior is below:
Opensips:48470 Asterisk (5062)
1 leg ------------------INVITE (RR:5061)------------>
<-----------------INVITE--------------------------------- 2 leg
2 leg --------------OK (RR:5061)-------------------->
<--------------------ACK (Route:48470)------------ 2 leg
< -------------------OK (RR: 48470) ----------------- 1 leg
1 leg. ACK From UA1 to Asterisk through Opensips (Route:48470) sent, but dropped.
I asked Opensips developers about this situation and they said that rewriting Record-Route header is illegal from SIP protocol point of view.
How could Asterisk community experts comment that situation?
Endpoint: 505050/505050 Not in use 0 of inf
InAuth: 505050-auth/505050
Aor: 505050 1
Contact: 505050/sip:505050@UA1_IP:8852;transpo d3b38f8e46 NonQual nan
Transport: 0.0.0.0-tls tls 3 96 0.0.0.0:5062
When disabling “Rewrite contact”, endpoint is registered with its own IP instead of proxies one. Thus, Asterisk tries to connect directly to endpoint and unfortunately it’s not what i need.
That’s what Path support is for. You’d need to add it in OpenSIPS. It is for ensuring that requests to the client still go through the proxy after registration. Do note that it does not currently work in conjunction with the PJSIP_DIAL_CONTACTS dialplan function[1]. You could also possibly statically set the proxy on the endpoint for outbound dialing…