I’m working on trunking with a provider, with the following requirements:
my end is using Asterisk 16 on Debian
the other end is using Oracle SBC
I must load balance calls between two fixed IP (ie I must alternatively dialout to IP1 and IP2)
I must use the same FQDN in SIP URI, for both fixed IP boxes
provider doesn’t provide any DNS resolution (I must map myself this FQDN to these two fixed IP adresses)
no requirement on fail over (if box with IP1 ever fails, calls should still be sent to IP1)
I was thinking of using a single PJSIP endpoint with a round robin DNS.
What would you suggest ?
How would you implement such round robin DNS ?
The Debian host on which Asterisk is installed is not running any DNS server and I would prefer to keep it not offering any name resolution service to any other box over the network
If I’m not mistaken, your solution works if Trunk1 and Trunk2 both use IP addresses.
If you are required to use domain names, you must somehow map those domain names to IP addresses.
In my case, both IP addresses must be mapped to the same domain name and I don’t how to alternatively use each IP.
If PJSIP had some sort of Dialing allowing to define, call by call, this domain to IP mapping, that would be perfect.
Alternatively, if I could set in PJSIP aor settings, something:
then, when Asterisk has to send anything to foo1 or foo2, before querying DNS services, it would just resolve any instance of example.com withe either 18.104.22.168 or 22.214.171.124, depending on which contact is dialed to.
Thinking back to my requirements, I forgot to mention I would appreciate to send OPTIONS to both SBC instances (the one I’m trunking with).
This leads me to configure PJSIP with one single endpoint and two AOR: one per SBC.
This way, Asterisk would continuously send OPTIONS to both instances and I could use PJSIP_CONTACT to select the SBC I would like to send calls to.
With this goal in mind, everything would be OK, if I was not required to use the same foobar.example.com domain name for both AORs as for AOR1, I would like my target foobar.example.com to resolve to IP1 and for AOR2, I would like my target foobar.example.com to resolve to IP2.
If I had a way to tell Asterisk to use a specific resolver for anything related to a specific AOR …
I upgraded to Debian Bookworm’s Asterisk 20 and configured two AORs for the same Endpoint.
How do you dial through a specific AOR then and still use domain name in INVITE Request-URI ?
I used something like but Dial(PJSIP/othertestbed/sip:firstname.lastname@example.org) but domain is lost in the process.
I’m sure using two endpoints, each with a single AOR would work around the issue but for the sake of completeness, I prefer to ask.