Basic(?) question about extension

Hello all,

I’m running a very basic configuration with 10 phones for quite some time.

I’ve added a light menu to redirect the caller directly to the right phone (a simple 1/2/3 option).
I would like to add the possibility to dial #+number to reach any phone while the menu is playing.

My current configuration looks like this:

[menu]
exten => accueil,1,Answer()
  same => n,Background(accueil)
  same => n,Wait(1)
  same => n,Goto(menu,numerotation,1)

exten => numerotation,1,Background(numerotation)
  same => n,WaitExten(5)
  same => n,Goto(menu,numerotation,1)

exten => 1,1,Playback(patientez)
  same => n,Dial(SIP/1000,18,tT)
  same => n,Dial(SIP/1001,15,tT)
  same => n,Dial(SIP/1006,15,tT)
  same => n,VoiceMail(1000,sb)

exten => 2,1,Playback(patientez)
  same => n,Dial(SIP/1001,18,tT)
  same => n,Dial(SIP/1006,15,tT)
  same => n,Dial(SIP/1000,15,tT)
  same => n,VoiceMail(1001,sb)

exten => 3,1,Playback(patientez)
  same => n,Dial(SIP/1000,18,tT)
  same => n,Dial(SIP/1001,15,tT)
  same => n,Dial(SIP/1006,15,tT)
  same => n,VoiceMail(1000,sb)

exten => i,1,Goto(menu,numerotation,1)

And right before the last exten, I added this:

exten => _#[1001-9],1,Playback(patientez)
  same => n,Dial(SIP/${EXTEN:1},18,tT)
  same => n,VoiceMail(${EXTEN:1},sb)

But it doesn’t work at all. What am I missing ?

Thank you for your help!

lamazze

You wrote #+number, but you have coded only “number.” What happens if you simply press 1, 2, or 3, i.e. without the hash symbol?

This isn’t a well formed character class. It is probably equivalent to [0-9] which in turn is a long form of X.

Did you mean 100Z (or long form, 100[1-9] )?

You should always say exactly how it doesn’t work, e.g. dialplan traces and error messages.

My pattern was garbage.

I’ve added this instead:

exten => _#10[0-9][0-9],1,Playback(patientez)
  same => n,Dial(SIP/${EXTEN:1},18,tT)
  same => n,Goto(menu,numerotation,1)

And it works, you can dial 1, 2 or 3 as proposed by the menu, or ignore it and dial #1000#1099 to reach internal phone.

Thank you for your input for the pattern.

As noted above, ‘[0-9]’ can be replaced with ‘x’ – like:

exten = _#10xx,1,playback(patientez)

You can read more about pattern matching here.