Multiple independent DID setup - Need Help! should be easy!


#1

Hi guys,

I’ve been stuggling with this for 2 weeks and it should be so easy to do. I’m totally stumped.

I have 2 DIDs for 2 different users. I want them to be seperate so that each has its own voicemail and I can track each users usage. I want to expand later with a voice menu for each number.

If I comment out 1 of the DID contexts the other works perfectly … same the other way around. Both register with the provider no problem.

If I have both DID contexts uncommented in the config then only 1 works… there must be some conflict, but I don’t see it.

Here is my config… really simple, 2 DIDs, 2 extensions, 2 inbound contexts… what am I doing wrong???

sip.conf

register =>5555556978:password@sip.voipservice.ca/5555556978
register =>5555556979:password@sip.voipservice.ca/5555556979

[5555556978]
type=peer
auth=md5
username=5555556978
fromuser=5555556978
fromdomain=voipservice.ca
port=5060
secret=password
host=sip.voipservice.ca
nat=yes
canreinvite=no
qualify=no
disallow=all
allow=ulaw
dtmfmode=rfc2833
insecure=very
context=inbound2

[5555556979]
type=peer
auth=md5
username=5555556979
fromuser=5555556979
fromdomain=voipservice.ca
port=5061
secret=password
host=sip.voipservice.ca
nat=yes
canreinvite=no
qualify=no
disallow=all
allow=ulaw
dtmfmode=rfc2833
insecure=very
context=inbound

[200_company1]
username=200_company1
type=friend
secret=asd
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5061
nat=yes
mailbox=200@company1
host=dynamic
dtmfmode=rfc2833
context=sipoutbound
canreinvite=no
callerid=“Rob” <200>

[200_company2]
username=200_company2
type=friend
secret=asd
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=yes
mailbox=200@company2
host=dynamic
dtmfmode=rfc2833
context=sipoutbound2
canreinvite=no
callerid=“Bowie” <200>

extensions.conf

[inbound]
exten =>5555556979,1,SetAccount(5555556979)
exten =>5555556979,2,Ringing()
exten =>5555556979,3,Answer()
exten =>5555556979,4,Dial(SIP/200_company1,10,r)
exten =>5555556979,6,Hangup()

[inbound2]
exten =>5555556978,1,SetAccount(5555556978)
exten =>5555556978,2,Ringing()
exten =>5555556978,3,Answer()
exten =>5555556978,4,Dial(SIP/200_company2,50)
exten =>5555556978,6,Hangup()

Any help would be very appreciated … thanks!!

rob


#2

post some sip logging from the asterisk CLI of the behavior…


#3

Well if I have both DID contexts active I only get any output from the one that works:

localhost*CLI>
– Executing SetAccount(“SIP/5555556979-00b6”, “5555556979”) in new stack
– Executing Ringing(“SIP/5555556979-00b6”, “”) in new stack
– Executing Answer(“SIP/5555556979-00b6”, “”) in new stack
– Executing Dial(“SIP/5555556979-00b6”, “SIP/200_company1|10|r”) in new stack
– Called 200_company1
– SIP/200_company1-ad74 is ringing
== Spawn extension (inbound, 5555556979, 4) exited non-zero on ‘SIP/5555556979-00b6’

If I dial 5555556978 the connection just goes dead… no asterisk output!!! it never even got that far… could it be my provider or is the config wrong?


#4

Alright, I got closer to diagnosing the problem … but it’s not good.

I have 2 inbound contexts (inbound1, inbound2) … no matter which DID I call I can see asterisk picking inbound1 as the context !!!

14 headers, 9 lines
Using latest request as basis request
Sending to 63.16.257.251 : 5060 (non-NAT)
Found peer ‘5555556979’ <= SUSPICIOUS, why is it associating with the other DID
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 101
Peer audio RTP is at port 64.21.157.126:6972
Found description format G729
Found description format PCMU
Found description format telephone-event
Capabilities: us - 0x4 (ulaw), peer - audio=0x104 (ulaw|g729)/video=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities: us - 0x1 (g723), peer - 0x1 (g723), combined - 0x1 (g723)
Looking for 5555556978 in inbound1 <== WRONG CONTEXT!!

Why is it ignoring my other inbound context ?! Is this a known bug? and is there a work around?

Thanks very much for your help.

rob