Back as far as Asterisk 1.8 in chan_sip, there was a concept of an outbound proxy.
The sip.conf file has this:
outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the devices
In creating “endpoints” in 1.8, you could specify a “host=xxx” to send traffic bound for any destination through that host and then onto its final destination.
I have been trying to utilize this same method in PJSIP, but can’t find any way to do it.
The goal is Asterisk -> Sip Proxy -> End Destination
Dialing with the string PJSIP/endpoint/sip:9999@xxx.xxx.xxx.xxx permits me to send packets directly to the end destination, but refuses to utilize the AOR record as the proxy and goes directly to the destination instead of through the proxy.
Using the outbound_proxy in the endpoint, causes the INVITE message’s INVITE header to show “INVITE endpoint” as opposed to the expected “INVITE sip:9999@xxx.xxx.xxx.xxx”.
I have run out of things to try and the code is so convoluted these days, its very difficult to trace how parameters affect the output.
Any help is appreciated.