Trying to ring my mobile phone via my softphone app does not work as FreePBX thinks my mobile number is an extension

Anyone have any idea what to do here.

When I try to ring my mobile number on my softphone app, i get an error in Asterisk Log files on FreePBX GUI saying “res_pjsip_session.c: 201: Call (UDP:192.168.X.1:5060) to extension ‘+3538948XXXXX’ rejected because extension not found in context ‘from-internal’.”

Given that it says ‘extension not found’ it appears that FreePBX thinks my mobile number +3538948XXXXX is an extension, similar to my extension 201.

When I try to ring another extension connected to FreePBX, it works.

When I ring the DID associated with one of the extensions, it works, so inbound calling is working.

Asterisk uses “extension” in a different way from that in which FreePBX uses the term. Asterisk considers PSTN numbers to be extensions, and you can also use extensions.conf in ways in which the “extension” doesn’t actually represent a phone number, e.g. it can be a dial status code.

What this actually means, for FreePBX, is that there is no outgoing route, associated with the digit string +3538948XXXXX, or at least its prefix.

Thanks for the help.

One thing I will say is, when I dialed 08948XXXXX (instead of +3538948XXXXX) I get a ping on Twilio saying "
|Msg| “The called number is not correctly formatted.”|
|ErrorCode| “32101,The called number is not correctly formatted.”|
|LogLevel| “ERROR”|"

So I get that is a separate issue I need to raise with Twilio (as we would preferably not have to dial our country’s international dialling code in order to ring numbers within our country)

+353 is the prefix for my country (Ireland). So we can either ring +3538948XXXXX, or 08948XXXXX. Both will work in Ireland. However, when I dial 089, it manages to hit the Twilio server. But when I ring +35389, it doesn’t hit the Twilio server, it gives an error. I wonder why?

In order for a number to be treated as an external call, there must be a matching dial pattern in an outbound route. You can add dial patterns in the trunk config to fix outgoing dial strings by prepending the country code.

Only on mobile phones, and some VoIP systems. The PSTN won’t understand + (I’m not actually sure that the mobile network does either; the phone may actually change it into type of number = international, and only send the the digits starting at 35.)

You’ll need to show the match patterns for the outgoing route to see why numbers starting in + are not being sent to Twilio.

This may be helpful, although you may or may not agree with some of the policies proposed:

The Twilio guide and a few others I saw told me to put + in the dial patterns. Perhaps that is meant to go into the prepend or prefix box though, not sure.

Inbound calls are working with the caller ID listed as +353196XXXXX so I believe + symbol is used in some places.

I have now assigned dials patterns for both 0113538948XXXXX and 003538948XXXXX. When I dial these numbers, I get a returned message saying ‘all circuits are busy now. please try your call again later’ instead of nothing as previously. So adding in the dial patterns has helped somewhat. To clarify, the dial patterns I add for both numbers mentioned above, are 15 X’s, and 14 X’s respectively.

X only matches 0-9. If you want to match +, you need to include it explicitly (or as part of an explicit character class).

But +353 XXX XXX XXX does not work as you can see its in the first prefix?

Only the second and third columns are matched against the provided number. The first column is added in front of any match, and the second is removed from any match.

The thread I referenced showed you how to match + and replace it with 00, You can match and keep the + if it is in the third column.

and your 3rd and 4th will be preempted by your 2nd.

Ireland does not have a ‘closed’ dial pattern, you need to work from the Most Significant Digits (MSD) In your case remove any need for dialing Country code for your users and allow XXXXXXXX. note the full-stop at the end , but add E164 prefix as needed by your Trunk provider to the trunk itself add 1800XXXXXX for toll free, If you call NI, either call through UK 0044 or add the short form.

Thanks guys, i now have outbound and inbound calling working.

For now, I won’t try configure the + symbol, it is working with just typing ‘3538948XXXXX’ into Linphone, no plus needed. The problem was the dial patterns, ‘XXXXXXXXXXXX’ works as this is E.164 formatted. Twilio was giving errors saying the number dialed was not E.164 formatted (when I dialled 003538948XXXXX or 0113538948XXXXX)

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