Directing 2nd phone number to specific extension (or phone)

Hi. I am not very familiar with Asterisk, although I am feverishly reading all I can about the system. Anyhow, I inherited a running Asterisk system and just added a second phone number from the same provider, which is now routed to our ip address along with the main phone number. Both numbers are from the same provider (NexVortex). What I need to accomplished is the following:

  1. Direct all calls from the second phone number to a specific extension (or phone).

  2. All calls made on that specific extension (or phone) needs to go through the second phone number.

The problem so far is when you call the second number, the call gets directed to our main greeting instead of the specific extension (or phone). Right now I am using an incoming call rule to route all calls matching the second phone pattern to a specific extension, and it is not working. When I try to add a second DID trunk, the second phone number will route correctly, but knocks out the main number.

I’m assuming that there is a filter feature in Asterisk that I am just not aware of, or maybe I am completely off base and need to configure something. Also, can the problem be due to having the same phone number provider? Should I get a second username password from the phone provider for the second number so I can properly setup a second DID trunk?

I am using the digium asterisk gui web interface, but have the capability to SSH into the Asterisk computer to make any changes to configuration files. Any information that you guys can provide to help point me in the right direction is appreciated. Thanks

Please provide relevant extracts of your configuration and a verbose CLI trace. Although statistically it is likely that you are using SIP, we can’t even tell that from what you have written, except possibly by looking up what services NexVortex provides.

Incidentally, if you are using SIP and trying to use contexts on the trunks, you may find you have a problem in that the trunks are being identified by IP address, so only the context from the first matching entry might be being used.

Thank you for the quick reply. You are right with your assumption that we are using SIP (I’m not sure how I forgot to mention that). I will try to retrieve the necessary information.

Below are snippets from my configuration files. As for trace information, I am still in the process of figuring out how to do it. Please let me know if more information or what files you need in order to assist me. Thanks

Extensions.conf
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[DID_trunk_1]
include=default
exten=_X.,1,Goto(voicemenu-custom-5|s|1)
exten=s,1,ExecIf($[ “${CALLERID(num)}”="" ],SetCallerPres,unavailable)
exten=s,2,ExecIf($[ “${CALLERID(num)}”="" ],Set,CALLERID(all)=unknown <0000000>)
exten=s,3,Goto(voicemenu-custom-5|s|1)
exten=_1XXXXXXX,1,Goto(default|301|1)
exten=_1XXXXXXX,1,Goto(default|301|1)
exten=_1XXXXXXX,1,Goto(default|301|1)

[globals]
trunk_1=SIP/trunk_1
trunk_1_cid=unknown
trunk_2_cid=unknown

[default]
exten=650,1,VoiceMailMain
exten=700,1,Goto(voicemenu-custom-5|s|1)
exten=500,1,MeetMe(${EXTEN}|MsI)
exten=710,1,Goto(voicemenu-custom-1|s|1)
exten=501,1,MeetMe(${EXTEN}|MsI)
exten=502,1,MeetMe(${EXTEN}|MsI)
exten=800,1,Goto(ringroups-custom-1|s|1)
exten=705,1,Goto(voicemenu-custom-3|s|1)
exten=*60,1,Answer
exten=*60,2,Playback(at-tone-time-exactly)
exten=*60,3,SayUnixTime(,IMSp)
exten=*60,4,Playback(beep)
exten=*60,5,Hangup
exten=210,1,Goto(ringgroup-XXX|s|1)
exten=706,1,Goto(voicemenu-custom-13|s|1)
exten=711,1,Goto(voicemenu-custom-14|s|1)
exten=777,1,Goto(voicemenu-custom-15|s|1)
exten=o,1,Goto(default,201,1)
exten=801,1,Goto(ringroups-custom-2|s|1)

Sip.conf
[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
nat=yes
externip=XXX.XXX.XXX.XXX
localnet=10.10.1.0/255.255.255.0
disallow=all
allow=g729,ulaw

Users.conf
[trunk_1]
allow=alaw
context=DID_trunk_1
fromdomain=XXX.XXX.XXX.XXX (our IP Address)
canreinvite=no
hasexten=no
hasiax=no
hassip=yes
host=XXX.XXX.XXX.XXX (Nexvortex IP Address)
provider=nexvortex
registeriax=no
registersip=yes
secret=XXXXXXX
trunkname=NexVortex - XXXXXXX
trunkstyle=voip
username=XXXXXXX
insecure=very
port=5060
disallow=g726,gsm,ulaw

[general]
fullname=New User
userbase=200
hasvoicemail=yes
vmsecret=1234
hassip=yes
hasiax=no
hasmanager=no
callwaiting=yes
threewaycalling=yes
callwaitingcallerid=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
callgroup=1
pickupgroup=1
host=dynamic
localextenlength=3
allow_aliasextns=no
allow_an_extns=no
hasagent=no
hasdirectory=yes
operatorExtension=201
subscribecontext=BLF_GROUP
call-limit=100
notifyringing=yes
limitonpeers=yes

[301]
callwaiting=yes
fullname=XXXXXXX
hasagent=no
hasdirectory=yes
hasiax=no
hasmanager=no
hassip=yes
hasvoicemail=yes
deletevoicemail=no
host=dynamic
mailbox=301
secret=XXXXXXX
threewaycalling=yes
vmsecret=XXXXX
registeriax=no
registersip=yes
autoprov=no
canreinvite=no
nat=yes
dtmfmode=rfc2833
disallow=all
allow=all
signalling=fxo_ks
cid_number=301
context=numberplan-custom-1

iax.conf
[general]
bandwidth=low
disallow=lpc10
jitterbuffer=no
forcejitterbuffer=no
autokill=yes

[guest]
type=user
context=default
callerid=“Guest IAX User”

[iaxtel]
type=user
context=default
auth=rsa
inkeys=iaxtel

[iaxfwd]
type=user
context=default
auth=rsa
inkeys=freeworlddialup

[demo]
type=peer
username=asterisk
secret=XXXXXXXXXX
host=XXX.XXX.XXX.XXX