How to receive calls with "_x." on asterisk 16 with PJSIP?

Hello,
I installed asterisk 16 recently, I’m using res_pjsip but in my from-pstn I received calls with “_x.” and in this version of asterisk I can’t receive that way. I can only receive with “s”.
**THERE IS A POSSIBILITY OF RECEIVING CALLS WITH SOME TYPE OF “_x.” ?**strong text

As long as they are sending something that matches it. Make sure the contact_user is set or they will send to s extension.

1 Like

What exactly would I put in contact_user= ?

from-pstn is an arbitrary name for Asterisk, even, if it means something in some of the GUIs that use Asterisk, it doesn’t mean anything here.

Do you mean in the user part of the request URI? Whilst legal, about the only way it is likely to happen is with an Asterisk dialplan written by someone who doesn’t understand Asterisk dialplans.

It will cause a problem in Asterisk, but shouldn’t do so in the channel driver. If simply placed in the exten field in the dialplan, the _ will be interpreted as starting a pattern, the lower case x will be interpreted literally (upper case X would be different), and the . will be treated as a trailing wild card. That will basically match any user part beginning in x, but you say it actually begins with _.

I think you should be able to match by using a pattern, but with character classes:

_[_]x[.]

However it is such a strange thing to do that I’d have to try it, or look at the code, to be sure. (If the x is really X, you will need a character class for that, as well.)

To add on to this, _X. is very rarely what people want when they use that.

More likely than not, you probably want _X! instead.

The main use of this construct is as a catchall. _X! is unlikely a good idea if there is any possibility of overlap dialling, as it will match single digit number even if longer numbers are present as well. I’d say that . is the wildcard most people should be using. The reason for the X isn’t to match single digit numbers, but rather to not match h, i, e, t, etc…

My context is when explicitly trying to do (for any extension), for example as the destination of a Goto or in a subroutine. 99% of the time when I see _X. it should be _X!. People use it incorrectly all the time, and then wonder when they dial a single-digit extension, why the call crashes… sigh…

Personally, I rarely or never use _X. in my own dialplan.

Technically, _X! won’t catch *, #, or A-D, so a true catch all is still more elusive yet, something like _[A-D0-9*#]!

The only time I use dot “.” and not exclamation mark “!” is with IVR and TRANSFER_CONTEXT (Feature code Assisted/Blind Transfer)
as that those are overlap dialling

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