Extensions.conf : One SIP line, multiple phone numbers

Hello,

I don’t know how to handle this :

  • I get one SIP trunk and multiple numbers (all belong to the same line).
  • The numbers are redirected to the line

My sip.conf

[code][general]
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
register=00333XXXXXXXX:********@sip.ovh.net

[OVH-00333XXXXXXXX]
type = peer
insecure = port,invite
host = sip.ovh.net
username = 00333XXXXXXXX
fromuser = 00333XXXXXXXX
secret = ********
nat = yes
fromdomain = sip.ovh.net
disallow = all
allow = alaw,ulaw
context = OVH-SIP
language=fr
[/code]

My extensions.conf

[OVH-00333XXXXXXXX] ; NUMBER 1
exten=s,1,Answer(500)
same=n(loop),Background(press-1&or&press-2)
same=n,WaitExten()
exten=1,1,Playback(you-entered)
same=n,SayNumber(1)
same=n,Goto(s,loop)
exten=2,1,Playback(you-entered)
same=n,SayNumber(2)
same=n,Goto(s,loop)
exten=i,1,Playback(option-is-invalid)
same=n,Goto(s,loop)
exten=t,1,Playback(are-you-still-there)
same=n,Goto(s,loop)

[OVH-00339XXXXXXXX] ; NUMBER 2
exten=s,1,Playback(hello-world)

[OVH-SIP]
exten => s, 1, Goto(00333XXXXXXXX,s,1)

??? : i need to dispatch the calls,
if people call 00333XXXXXXXX --> goto OVH-00333XXXXXXXX
if people call 00339XXXXXXXX --> goto OVH-00339XXXXXXXX

I don’t know hand to make this, can you help me please ?

You should only have one peer, based on the IP address.

Multiple peers with the same IP address will match all incoming calls to the first one.

Your service provide is strange if you have to authenticate each number seperately, in this case.

Do you know why you put port into your insecure setting? This is not something you should do by copy and paste coding.

I don’t believe you will get “s” in this configuration. If you do, you can’t distinguish between incoming lines.

Almost certainly your supplier has many Asterisk users as customers. Ask them for their standard Asterisk configuration.