Sipgate UK - Inbound Route DID issue

On inbound the caller ID sent by Sipagte there is a hyphen between the area code and number - for example 01234-567890. FreePBX does not allow a hyphen “-” on the inbound caller ID field, so the inbound caller ID cant be matched. There is no option on the Sipgate control panel to remove the hyphen from the caller ID.
Is there a solution for this?

That’s unusual, historically they have used the standard e.164 standard. Is that happening on all inbound caller ID? You could probably manipulate with some dial plan but would suggest it’s easier to log a ticket with Sipgate and check with them. Admittedly I haven’t used them for a few years but that doesn’t seem correct.

Will FreePBX accept an, underscore prefixed, pattern, in this situation, as I believe Asterisk ignores hyphens on both sides of such matches.

One could certainly do it with a custom trunk, to Goto the DID with the hyphen stripped.

I have opened a ticket just now, so will wait till Sipgate respond

I have tried _01234-56789 and also _0123456789 in the standard Incoming Routes DID field and neither work. I am not completely familiar with Custom Trunk configuration. On the logs it shows the DID as 01234-56789 so it is clearly picking the hyphen up but un-able to match it to any DID.

I am guessing that the number with hyphen is somehow not being displayed accurately. At the Asterisk command prompt, type
pjsip set logger on
or, if you are still using chan_sip for some reason
sip set debug on
make a call in (that is incorrectly routed), paste the Asterisk log for the call at pastebin.freepbx.org and post the link here. We can then see how the incoming INVITE From header is formatted, along with other relevant headers such as P-Asserted-Identity or Remote-Party-ID.

Aside from the Inbound Route issue, it’s a good idea to eliminate the hyphen, as it will prevent returning calls from device history, matching contact lists, affect your CRM system, etc.

1 Like

I have done that.
This is the url:-
https://pastebin.freepbx.org/view/3cb1144b

So in the initial contact header it uses the hyphen but later on it’s using the e.164 format. So to be clear the issue is with the inbound DID not Caller ID of the inbound caller?

If your issue is matching the inbound route with the DID you should be using 004417xxxx etc.

The To: header looks clean. You can set the trunk context to from-pstn-toheader and setup your inbound routes to use the 0044XXX format.

The normal expectation is that the request URI is the whatever you sent in the register. Especially as you are sending a hyphenated one in the OPTIONS’ Contact header, I think you’re the one that is providing the hyphen and Sipgate are just reflecting that back.

Done exactly that, made no difference

In addition to the hyphen issue, note that the SIP URI has
01786-497300
while the To header has
00441786497388

I am guessing that 7300 is your main number and 7388 is the DDI you dialed. If you want a separate Inbound Route for each number on the Sipgate account, change the Context for the trunk to
from-pstn-toheader
and the DID Number for the route to
00441786497388

If you want the same Inbound Route for all numbers on the trunk, change Contact User to
01786497300
and also change DID Number to
01786497300

Hi Stewart
Thanks for pointing the number out, I never even noticed that. I only have 1 number with Sipgate which is 01786497388 but I noticed the log showing 01786497300.
So I have just changed the DID on Incoming Route to “01786497300” and it is now working perfectly.
Thanks to all for helping to resolve this so quickly.

Also I found the 01786497300 was an input error by me on the trunk PJSIP Settings / Advanced / Contact User field, now entered the correct DID and all is perfect now.

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