Different extension dialed passes the call.(SOLVED)

Hello everyone. I have 6 DIDs In iax.conf I have them setup as 6 different registrations and 6 different peers as per my provider but the last peer listed is the one making the call regardles of which number you dial. In extensions.conf I have them listed one after another with a syntax of DID,1,Goto(s,1) to answer the call and run a php script.

Everything works fine except, each DID is a different city and if I dial from city1 the call is being passed by city5. My concern is I do not want to cause a long distance call to whoever dials any of the numbers.

Can I fix this issue where the number dialed is the one that passes the call?


I’m still having the same problem, any Ideas?

Thank you.

i assume this problem is with incoming calls?

if the peer isn’t authenticating itself with you, there could be confusion about which account the call is actually coming in on. Thus they may get into the wrong contexts. One way to get around this is to put them all in the same context and then in that context put lines like:

exten => DIDNUMBERHERE,1,Goto(context,s,1) ; where context,s,1 is where you actually want the call to go

Thank you. That’s how I have them, learned that from you. The registration is the same way all register lines one under another and one peer after another. I’m getting excellent registration and communication it’s just that I dial one number and I can see on the cli that another number is picking up the call.
exten => xxxxxxx,1,Goto(s,1)
exten => xxxxxxx,1,Goto(s,1)
exten => xxxxxxx,1,Goto(s,1)
exten => xxxxxxx,1,Goto(s,1)
exten => xxxxxxx,1,Goto(s,1)
exten => xxxxxxx,1,Goto(s,1)
exten => s,1,Answer
exten => s,2,Wait,2
exten => s,3,DeadAGI,a2billing.php
exten => s,4,Wait,2
exten => s,5,Hangup

I just realized I have another issue to run by you. This is a new one:
file.c:824 ast_streamfile: Unable to open digits/100-and (format gsm): No such file or directory.
I have a dirctory for digits and never had this issue until recently, if it’s a file missing do you know where I can get it? thanks.

The last one is solved.

the other number taking the call… you mean it says the call is coming in on the wrong account yes? If so this is what I was talking about. Unless your provider authenticates itself Asterisk can’t always tell between them, thus the single context thing.

or do you mean that it is going to the wrong number?

I have the 6 numbers setup as peers individualy.

six diff. registrations and one context as described above.

When I dial 1234567 I can see on the cli that 9876543 is the number answering the call.

I also noticed that the last number on the registration will be the number showing on the cli when you dial any other.

well for dialing thats probably because you are using it as the account to dial out on.

but for incoming yes that it what I expected. it’s like this-

asterisk registers number1@provider from its IP.
asterisk registers number2@provider from its IP.
asterisk registers number3@provider from its IP.
so we have 3 registrations with the provider, each using its own username/password.

Now any one of these numbers gets a call. Provider says, I have a call to (number@IP). Because they don’t provide auth info, the only thing it says is what number the call is going to. Thus asterisk doesn’t know which account it’s talking about, so it picks one (as i recall usually the most recent one to register).
Thus the single context thing. Once the call comes in, and is given an account to come in with (even if it’s the wrong one), we still route it correctly because we know the number that was dialed. So it will say its coming in on the wrong number/account but as long as it gets routed correctly everything is fine.

Ironhelix, yes, all the calls are being routed correctly but what happens when a person dials the Miami line and the West Palm picks up and it’s the one routing the call? Will this person be charge for a long distance by their provider? I mean, will it be a long distance call for them?

no because the only problem is that asterisk is getting confused.

as far as your provider is concerned, you dial the miami number, and they feed it to you on the miami number. It’s just that * can’t tell the two apart.

Here’s an exercise-
comment out the register lines and the peer definitions for all the numbers except one. Now call that one. It will be correctly detected. You can do this to any of them.

The call will be routed correctly and the customer will be charge as per whatever number they are dialing, you may safely ignore what accoutn asterisk says its coming in on.

Yes, I have tried that before and is just like you say.

Thank you again for taking the time and the clear explanation.