Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 4:11 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Calling my own dids
PostPosted: Fri Mar 02, 2012 3:34 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 30
Location: Schaumburg , IL
I am looking for a way to bypass PSTN when calling my own DIDs.
Since a2billing.php|2|did hangups if DID is not found I put together asterisk dial plan.
I have also incorporated a channel limit per server.
The dialplan works for US based DIDs and needs to be tweaked for any other country.

[a2billing]
exten => _X.,1,Set(GROUP()=limit)
exten => _X.,n,GotoIf($[${GROUP_COUNT()}>300]?103)
exten => _X.,n,NoOp,${CALLERID(all)}
exten => _X.,n,MYSQL(Connect connid localhost user password mya2billing)
exten => _X.,n,MYSQL(Query resultid ${connid} select `did` from `cc_did` where `did`='${EXTEN:1}')
exten => _X.,n,MYSQL(Fetch foundRow ${resultid} did)
exten => _X.,n,GotoIf($["${foundRow}" = "1"]?localdid)
exten => _X.,n,NoOp(${did})
exten => _X.,n,Goto(pstn,${EXTEN},1)
exten => _X.,n(localdid),Goto(local-did,${EXTEN:1},1)
;exten => _X.,n,MYSQL(Clear ${resultid})
;exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,103,SetVar(DIALSTATUS=CHANUNAVAIL)
exten => _X.,n,Hangup

[did]
exten => _X.,1,NoOp,${CALLERID(all)}
exten => _X.,2,DeadAGI(a2billing.php|2|did)
exten => _X.,3,Hangup

[local-did]
exten => _X.,1,NoOp,${CALLERID(all)}
exten => _X.,n,MYSQL(Clear ${resultid})
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,DeadAGI(a2billing.php|2|did)
exten => _X.,n,Hangup

[pstn]
exten => _X.,1,NoOp,${CALLERID(all)}
exten => _X.,n,MYSQL(Clear ${resultid})
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,DeadAGI(a2billing.php|1)
exten => _X.,n,Hangup

[default]
include => a2billing
exten => _X,1,Goto(a2billing,_X.,1)

The dialplan is nowhere close to be perfect and if anyone have any ideas how to make it better please let me know.


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Sat Mar 03, 2012 9:35 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Current versions of A2Billing handle this automatically. If a customer calls one of your other customer's DID, the call will be handled internally and not hairpin.

Joe


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Sat Mar 03, 2012 3:23 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 30
Location: Schaumburg , IL
I am using the newest version A2Billing 1.9.4 (Cuprum) and this is not the case, unless I have not configured it correctly. Can you please point me to a relevant setup.

I did enable SIP Call:sip_iax_friends and I get prepaid-sipiax-press9 recording, however pressing 9 disconnects the call.


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Sat Mar 03, 2012 5:48 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
No, That setting is not necessary. Automatically calls are routed internally when one customer calls another's DID. Do note though that with USA numbers, 1-555-123456 is not the same as 555-123456

Joe


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Sat Mar 03, 2012 9:58 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 30
Location: Schaumburg , IL
Thank you, That did helped.


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Mon Mar 05, 2012 4:00 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 30
Location: Schaumburg , IL
I may have responded too early.
It works for routing calls within , but prevents DID cals from outside:

My DID providers are sending calls to dids XXX5551212
If I setup a DID in a2b to be XXX5551212 the a2billing is routing calls to PSTN
and If I setup a DID to 1XXX5551212 a2billing is routing calls to DIDs internally, but
Cals from DID providers are not routing since the DID provider sends calls to XXX5551212

Any advice how to add/trip (country code)


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Mon Mar 05, 2012 4:03 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

The admin intensive way is to add two versions of the DID in A2Billing, the better method would be to sanitise the DID to 11 digits in the Asterisk dialplan before sending them into A2Billing.

Joe


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Mon Mar 05, 2012 7:58 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 30
Location: Schaumburg , IL
I have come up with this:

[did]
exten => _NXXNXXXXXX,1,NoOp,${CALLERID(all)}
exten => _NXXNXXXXXX,n,Goto(did,1${EXTEN},1)
exten => _NXXNXXXXXX,n,Hangup

exten => _X.,1,NoOp,${CALLERID(all)}
exten => _X.,n,DeadAGI(a2billing.php|2|did)
exten => _X.,n,Hangup

please let me know if you see any downside to it?


Top
 Profile  
 
 Post subject: Re: Calling my own dids
PostPosted: Tue Mar 06, 2012 5:40 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

That's pretty much what I would do.

Joe


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group