No I mean that what I'm doing is that one:
On a2billing machine:
1) Setup a new one call plan and rates for my client according as
http://sysadminman.net/blog/2011/using-a2billing-for-wholesale-or-residential-services-19202) Create customer assigned to that Call plan.
3) Edit customer to use ip authentication
4) Add Inbound DID and Destination to that customer ( destination is a like that SIP/customer-id/customer-server-ip-address
5) Give a minimal peer setting context to the client in sip.conf:
[30407]
type=peer
accountcode=30407
regexten=30407
amaflags=billing
nat=yes
dtmfmode=RFC2833
qualify=yes
canreinvite=yes
disallow=all
allow=alaw
allow=ulaw
allow=gsm
allow=g729
host=xxx.xxx.xxx.xxx
insecure=port,invite
context=a2billing
regseconds=0
cancallforward=yes
On client Asterisk machine:
1) sip.conf
[MAXLAN]
deny = 0.0.0.0/0.0.0.0
disallow = all
allow = alaw
type = peer
trustrpid = yes
sendrpid = yes
permit = my a2billing machine host ip
host = my a2billing machine host ip
insecure = invite,port
context = from-maxlan
; ### LOCAL ###
[056940776]
type = friend
host = dynamic
nat = yes
defaultuser = 056940776
secret = boyan123
disallow = all
allow = alaw
canreinvite = no
context = to-maxlan
2) extension.conf
[to-maxlan]
exten => _[+0-9]X.,1,Set(CALLFILENAME=${EXTEN}-${STRFTIME(,,%H:%M)})
exten => _[+0-9]X.,2,Monitor(wav,${CALLERID(num)}-${CALLFILENAME},m)
exten => _[+0-9]X.,3,Dial(SIP/MAXLAN/${EXTEN})
[from-maxlan]
exten => 30407,1,Progress()
exten => 30407,2,Set(CALLFILENAME=${EXTEN}-${STRFTIME(,,%H:%M)})
exten => 30407,3,Monitor(wav,${CALLERID(num)}-${CALLFILENAME},m)
exten => 30407,4,Dial(SIP/056940776)
exten => 30407,5,Hangup
Now with one account added with IP auth to client server and DID to him everything is working ok, but when I add second account to a2billing wit ip auth to client IP and give him peer setting context to in sip.conf (point 5 above). When second account is trying to dial outside is exit with first account CID number 30407 (point 5 above) because I have two same IP auth host with same IP addresses in sip.conf on my machine. I want the second, third .....etc account that I was create on a2billing and assign them to client IP based on auth to exit outbound with their CID or even more I want to assign multiple CID on 1 account and use IP auth to my client based only on 1 account in a2billing.
Thanks !