VG1's sip.conf
--------------
[voxclient]
type=friend
canreinvite=no
dtmfmode=rfc2833
context=outbound
host=dynamic
username=voxclient
secret=voxclient
qualify=yes
disallow=all
allow=g729
Client's sip.conf
-----------------
[vg1]
type=friend
canreinvite=no
host=vg1.hostname
username=voxclient
secret=voxclient
dtmfmode=rfc2833
context=inbound
qualify=yes
disallow=all
allow=g729
-----
Client has a register line,
register => voxclient:voxclientr@vg1.hostname
This lets VG1 know client's ip for dialout purposes, and not having to statically put the hostname in.
When dialing from Client -> VG1, dial string is:
Dial(SIP/vg1/${EXTEN})
All works great, send username=voxclient, secret=voxclient, and it matches the [voxclient] context in VG1's sip.conf.
However.....
When dialing from VG1 -> Client, dial string is:
Dial(SIP/voxclient/${EXTEN})
This will dial host's ip that was registered by peer 'voxclient' -- fine.
Since we specified username=voxclient and secret=voxclient in peer [voxclient] in VG1's sip.conf, it will look for context [voxclient] on client side. But, we have it defined as [vg1]. This would require to have another context called [voxclient] on the client's side, which is what im trying to avoid.
here is how its dialing, and what it returns.
-- Executing Dial("Zap/1-1", "SIP/voxter/6046383851|||") in new stack
-- Called voxter/6046383851
-- SIP/voxter-02f6 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
Here is a brief debug showing peer vg1 that it matched, so i guess it doesnt match on context name, but username= inside context name.. but, it still doesnt work.
--- (14 headers 11 lines)---
Using INVITE request as basis request - 15ae26d448c0f4df67a625da424fa891@66.199.130.41
Sending to 66.199.130.41 : 5060 (NAT)
Found peer 'vg1'
Reliably Transmitting (NAT) to 66.199.130.41:5060:
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 66.199.130.41:5060;branch=z9hG4bK34a44c45;received=66.199.130.41;rport=5060
From: "9546206002" <sip:9546206002@66.199.130.41>;tag=as363967c6
To: <sip:6046383851@66.199.130.40>;tag=as6d7a2bd7
Call-ID: 15ae26d448c0f4df67a625da424fa891@66.199.130.41
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: <sip:6046383851@66.199.130.40>
Content-Length: 0