Create Custom destination to change inbound route sip registration details

My issue is that several times my VOIP provider has had an issue with the server that our incoming calls are routed through. We lose incoming calls but outgoing calls were routed through a different server so were unaffected.
The short term fix was (using the GUI) to go into the trunk associated with the inbound calls and change the SIP Server from sip4.xxxxx.com.au to sip5.xxxxx.com.au (this is a PJSIP trunk). The rest of the registration details were unchanged.
Easy enough if I am there, but I want a solution where dialling a custom destination can do that job.

If I create a Custom Destination, and create an extension that dials that destination, can anyone suggest the kind of thing that might go into extensions_custom.conf to make this work?

thanks in advance

Well well, this approach is very wrong. While it may be a good workaround, your focus should be on a why the connection is dropped.

Sooo… Please post your trunk configuration so we can help you fix the real issue.

My question would be why isn’t the ITSP using a common registrar for all their outbound (your inbound) proxies?

What happens if you try to register against all their outbound proxies?

The connection only drops out when there is a problem at the VOIP provider end. Once they get that fixed, it all works fine. Its just that when it goes down, we are stuck.
I can register against all the outbound proxies individually, but my inbound calls only come through the one that is associated with the trunk assigned to that account. For outbound calls, I could set up a failover outbound route (and have done that, so outbound is not a problem), but inbound calls depend on the provider forwarding them to me and only come in on that trunk. Make sense?

I can ask the provider, but meanwhile, was curious if this workaround might work.

If the provider is having a problem, this half of the process is going to be hard to do. Your inbound route processing (especially if you are using PJ-SIP) should accept connections from literally anywhere that matches the “match” field on the PJ-SIP setup, so inbound from a hundred possible hosts is as simple as one.

Honestly. the multiple outbounds is a lot harder nut to crack.

So if I set up 2 trunks with the identical details of the voip account associated with the incoming (forwarded) calls, except have one using sip4.xxxx.com.au and one using sip5.xxxx.com.au, then the calls could come on either of those? It won’t cause confusion either at the provider end, or at the PBX end?

OK - this is the important part - with SIP, the inbound “trunk” and the outbound “trunk” should be thought of a distinct, largely unrelated entities. Your “inbound” trunks allow a remote host to connect to your server. Your “outbound” trunks allow you to connect to a remote host. As tempting as it is to think of them like you would a Frame Relay or T1, it doesn’t pay.

With Chan-SIP, Yes, you can set up two trunks with identical INBOUND settings for the system to listen on. Any traffic that show us will be dropped into the local context you specify to be processed. This means that your phone system wouldn’t care in the slightest which server the traffic came from.

With PJ-SIP, you can set up “primary” trunk, preferably the one related to your outbound connections, and specify a “match” pattern in the “match” field that lays out all of the remote end servers that will be sending you traffic. Since this trunk allows all sorts of hosts to connect, it acts kind of like the two Chan-SIP trunks (above) in that it routes all of your incoming traffic to the one context you are using for inbound.

Now, for outbound traffic, you may need to set up an alternate server to send your traffic out to. Remember, inbound and outbound are only related by the coincidence that they are using SIP, but each trunk can only send traffic to one host. To use the alternate host, you specify the trunk out in your outbound routes and, in the primary fails, you fail over to the alternate.

Note that I discuss these separately. Once again, in my experience, it behooves you to think of these a separate channels and not a “bidirectional” single channel. That kind of thinking just leads you into a jungle of tangled routes where you spend all of your time trying to sort out which is which and what is what.

I hope that helps.

Thanks. As it happens my incoming calls and outgoing calls are mostly through different providers, so it makes it easy to keep the trunks separate.
Just to let you know, I did exactly as described: set up 2 PJSIP trunks with the details of the same VOIP account (that calls to our old landline number are forwarded to/through), just using SIP4 for one and SIP5 for the other (very easy using the duplicate button at the bottom of the page showing the trunk I am copying).

I can see calls coming in through both of those. Allocation to either trunk looks to be pretty random. But I’m sure if one goes down, the other will just carry on. I’ll probably never know!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.