Provider channel

Hello,

There is my sip.conf, i have 2 accounts on same provider

[code]
[AsteriskSIPProvider1]
type=friend
username=username1
secret=pass1
host=ip
nat=no
fromuser=username1
fromdomain=ip
insecure=invite
context=external
disallow=all
allow=alaw
allow=gsm
allow=g729

[AsteriskSIPProvider2]
type=friend
username=username2
secret=pass2
host=ip
nat=no
fromuser=username2
fromdomain=ip
insecure=invite
context=external
disallow=all
allow=alaw
allow=gsm
allow=g729[/code]

So i have 2 telephone numbers.
But any of this 2 numbers i was called ${CHANNEL} is AsteriskSIPProvider1. But i need to differentiate my calls. How can i do that?

You need one account with proper direct in dialing (i.e. the provider forwards at least part of the called number to you). You then use extensions.conf to separate the two.

If you had been using register, the provider might have accepted a callback extension, in the register request, to allow you to specify different extensions for the two accounts. Note that the incoming calls would still only match one of them in sip.conf.

As Asterisk matches the calls based on IP address, and, by default, the From header is already taken for caller ID, you cannot really have two accounts on the same provider for incoming calls.

(Although it is likely to be more difficult to get a provider to do this that provide proper DID, you could use an alternative means of delivering incoming caller-ID, which would free up the From header.)

This is a frequenc question, so a Gootle search should have found an answer.