[SOLVED] Call a 4 digits external number

Hi everybody !

In France we have a lot of customer services which have 4 digits numbers as phone number.
My question is simple :
Is there a way to configure my Asterisk in a way of making that possible ?

For now, the phone just print “Unreachable” on the screen…

Thanks in advance for your help and answers.

Thomas JIBAUT

YEs you can do it only in your dial plan define the rule for 4 digitis:

exten => XXXX,1,Dial(yourtrunk/${EXTEN},20)

[quote=“navaismo”]YEs you can do it only in your dial plan define the rule for 4 digitis:

exten => XXXX,1,Dial(yourtrunk/${EXTEN},20)[/quote]

You need an underline before before the 'XXXX’s since it is a pattern matching.

Like this:

I have a couple of questions to anwerers.

Is creating extension the only way possible? I think no.
Is creating extension is enough for solving the issue? In general, I think, no.

First of all (in my mind), calls from customers to service should be some way routed using short number. Or it’s supposed to use this number in internal net? If so - then everything ok.

Then, by default, it’s a task of configuration in which extension incoming calls from specific channel will dive. Or am I still wrong? If not, then just creating an extension like that in general is only timewasting, huh?

Thanks ahead for explanations!

People are answering for Asterisk.

I suspect your problem is that you are using an Asterisk GUI.

Finally (after half an hour looking at it) I’ve understood the issue.
So I’ve understood answers too.

Thanks =).

p.s. Never seen Asterisk GUI. Just hard day.

Oh ! Digium never let me know about that I had an answer.

For the moment, my exten lines are like that :
exten => _X.,1,Dial(…)

By changing it to _XXXX, will it allow me to call both 4 digits and 10 digits ?

I’ll try that.

Thanks for answering, so late for my thanks… Sorry.

_X. will allow you to call four digit numbers. If you are using SIP phones, your problem is probably with the dialplans in the phone.

I’m using SIEMENS GigaSet C47H phones.
I don’t think there is a way to configure the phone itself.

When I try to call a 4 digit number, the phone displays :
“Unreachable”

Is there any way to make this thing work ?

Thanks :smile:

Please copy and paste your dialplan currently as it is into a reply, also please use the asterisk CLI by starting with “asterisk -rvvvvv” then try the phone call again and copy paste the results into the post.

Just by telling me to launch by using “asterisk -rvvvv” makes me realize where the problem was. I’ll try my solution, if it doesn’t work, i’ll copy my dialplan in here :wink:

EDIT : IT WORKS !
Just some misguiding in coding the dialplan.

so now, my problem is : adding a “0” in front of any external number we want to call.
is it : exten => _0X., […] ?

1 Like

To add the 0 to the external number would be something like this if you want to prepend a number:
exten => _XXXX.,1,Dial(SIP/trunk_3/0${EXTEN})

That will automatically take your dialed exten and prepend a 0 at the front. Glad to hear the above worked also :smiley:

1 Like

I suspect he wants doesn’t want to prepend 0 to 4 digit numbers, however I was rather confused by the question.

As was I actually can you give more details on the dialplan needed?

Hi again,

We use 4 digits extensions to make internal calls such as 3250 or 3258.
The problem is that we may have to call company’s number which are also 4 digits number.

I just want to find how to put a “0” before any external number we want to call. Putting this “0” in front of all external numbers will permit us to use our internal 4 digits numbers as usual.

Is there a way to do that ?

Here’s an example of my extensions.conf :

[poste-to-ovh-10] ;internal call include => poste-interne ;external call exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-258)

For the moment, with this dialplan, I can call specific external numbers in 4 digits but I cannot make internal 4 digits call.

Have you got an idea for that ?

Thanks a lot !

EDIT : By addind a “0” in front of an external call we want to make, here’s an example :
To call the following number : 0139586030
I want to type : 00139586030
By typing that “0” before the number will permit me and my coworkers to call ourselves with internal calls (with a number which is not beginning with a “0”.

Asterisk will use the best match for the extension, so exact match either the external or internal 4 digits numbers and use wild cards for the other ones, or, of course, exact match them all.

When I try calling an internal 4 digits number, It says that this number is unreachable.
So my asterisk doesn’t recognize if the 4 digits number I’m trying to call is part of my internal 4 digits number list.

I don’t see why…

If you are using a GUI, you should ask on a forum appropriate to that GUI. If the dialplan is hand coded, you need to provide it here.

Here’s my company Asterisk’s extensions.conf :

[poste-interne]

; allow internal phones to communicate between them
exten => 3250,1,Dial(SIP/3250,,TtHhXx)
exten => 3251,1,Dial(SIP/3251,,TtHhXx)
exten => 3252,1,Dial(SIP/3252,,TtHhXx)
exten => 3253,1,Dial(SIP/3253,,TtHhXx)
exten => 3254,1,Dial(SIP/3254,,TtHhXx)
exten => 3255,1,Dial(SIP/3255,,TtHhXx)
exten => 3256,1,Dial(SIP/3256,,TtHhXx)
exten => 3257,1,Dial(SIP/3257,,TtHhXx)
exten => 3258,1,Dial(SIP/3258,,TtHhXx)

[poste-to-ovh-2]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-250)

[poste-to-ovh-3]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-251)

[poste-to-ovh-4]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-252)

[poste-to-ovh-5]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-253)

[poste-to-ovh-6]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-254)

[poste-to-ovh-7]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-255)

[poste-to-ovh-8]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-256)

[poste-to-ovh-9]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-257)

[poste-to-ovh-10]
; appel interne
include => poste-interne
;appel sortant
exten => _X.,1,Dial(SIP/${EXTEN}@ovh-out-258)


[ovh-in]
exten => _X.,1,GoToIf($[${EXTEN}=3249]?fax-in,3249,1)
exten => _X.,2,GoToIf($[${EXTEN}=3250]?3250,3250,1)
exten => _X.,3,GoToIf($[${EXTEN}=3251]?3251,3251,1)
exten => _X.,4,GoToIf($[${EXTEN}=3252]?3252,3252,1)
exten => _X.,5,GoToIf($[${EXTEN}=3253]?3253,3253,1)
exten => _X.,6,GoToIf($[${EXTEN}=3254]?3254,3254,1)
exten => _X.,7,GoToIf($[${EXTEN}=3255]?3255,3255,1)
exten => _X.,8,GoToIf($[${EXTEN}=3256]?3256,3256,1)
exten => _X.,9,GoToIf($[${EXTEN}=3257]?3257,3257,1)
exten => _X.,10,GoToIf($[${EXTEN}=3258]?3258,3258,1)


[3250]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3250,,TtHhXx)
exten => _X.,3,Hangup

[3251]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3251,,TtHhXx)
exten => _X.,3,Hangup

[3252]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3252,,TtHhXx)
exten => _X.,3,Hangup

[3253]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3253,,TtHhXx)
exten => _X.,3,Hangup

[3254]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3254,,TtHhXx)
exten => _X.,3,Hangup

[3255]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3255,,TtHhXx)0
exten => _X.,3,Hangup

[3256]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3256,,TtHhXx)
exten => _X.,3,Hangup

[3257]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3257,,TtHhXx)
exten => _X.,3,Hangup

[3258]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3258,,TtHhXx)
exten => _X.,3,Hangup

I hope you’ll find something…

Inluded contexts are only used when there is no match in the including context. You need move the _X. rules down into another included context, which is included after the internal numbers.

Also this code is rather strange, although probably works:

exten => _X.,1,GoToIf($[${EXTEN}=3249]?fax-in,3249,1) exten => _X.,2,GoToIf($[${EXTEN}=3250]?3250,3250,1) exten => _X.,3,GoToIf($[${EXTEN}=3251]?3251,3251,1)