How to add multiple DID's of same provider with same IP's in different context

Hi,

I am trying to add multiple inbound DID’s from the same provider in different context, but the problem I’m facing is that, as the provider is same so it has given me same IP’s. If I add those IPs to my SIP-in.conf file and then configure it in extensions.conf, I’m only able to receive call from one of the DID.

sip-in.conf

[192.99.19.213]
host=192.99.19.213
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=AAA
insecure=very
nat=never
allow=all

[192.99.19.213]
host=192.99.19.213
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=BBB
insecure=very
nat=never
allow=all

Extensions.conf

[AAA]
exten => _1xxxxxxxxxx,1,Answer()
exten => _1xxxxxxxxxx,n,Wait(2)
exten => _1xxxxxxxxxx,n,Background(welcome)
exten => _1xxxxxxxxxx,n,WaitExten(3)
exten => _1xxxxxxxxxx,n,Dial(SIP/1022,30,Tt)
exten => _1xxxxxxxxxx,n,Hangup()

[BBB]
exten => _1yyyyyyyyyy,1,Answer()
exten => _1yyyyyyyyyy,n,Wait(2)
exten => _1yyyyyyyyyy,n,Background(welcome)
exten => _1yyyyyyyyyy,n,WaitExten(3)
exten => _1yyyyyyyyyy,n,Dial(SIP/1023,30,Tt)
exten => _1yyyyyyyyyy,n,Hangup()

In general you will have to route them based on the dialed number, so they will have to start in the same context.

In theory you could route to context based on the source port, but, in reality, a mass market connectivity provider wouldn’t do that.

1 Like

Currently I’m routing them based on numbers within same context, but sometimes when someone calls there is one way voice (no inbound audio) . I did raise the issue with my provider but they told me issue is at my end

I tried with dividing the IP’s between two DID’s but for some reason it always look for one IP (its the first one, will try by changing the order of IP’s in sip-in.conf) for inbound, and if found in context call is passed otherwise CLI shows no context for the IP.

One way audio is not the result of mis-identifying accounts.

I agree, but issue started after adding another DID so i thought…anyway what could be possible reason as issue is not with all calls, only some

Also can you please guide me or direct me to guide by which I’ll be able to configure the accounts properly?

The proper way is to have just one account with any ITSP and then use extensions.conf to split out calls to different handling based on the forwarded dialled digits. In other words, a real direct in dialling configuration.

Unfortunately, I think you may have multiple degenerate (only one number each), direct in dialling accounts, as, in the VoIP DID tends to be used for any incoming, third party, interconnect with the PSTN.