Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 10:19 pm
Voice Broadcast System


All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 7:30 am 
Offline

Joined: Thu Nov 12, 2009 9:36 pm
Posts: 33
Hi friends,
I am trying to set up a test IVR system in asterisk where I would like to dial a number as defined within a context using a2billing. When I dial 123456, it goes to the IVR menu and presents option of pressing 1 to ring my home and 2 to ring my mobile. I would like to make this outbound call automatically from within a2billing using the defined trunks, without asking for PIN or playing any voice prompts so that call details are recorded in the billing system.

So far, I have tried something like this;

[callme]
exten => s,1,Answer()
exten => s,n,Background(PlayMenuOptions)
exten => s,n,WaitExten()
exten => 1,1,DeadAGI(a2billing.php,2,My Phone Number)
exten => 1,n,Hangup()
include => a2billing-outbound

When I press 1, I am expecting the call to be forwarded to "My Phone Number" without the person calling 123456 extension having to enter PIN or hear any announcements[/u]

I have successfully removed voice prompts as follows:
I have created agi-conf2 as use_dnid=yes and relevant voice prompts and anwer_call are set to No.

[a2billing-outbound]
<<<<<<<<<<<<<<< As mentioned in other posts, I have removed Answer() here and in agi-conf2.
exten => _X.,3,DeadAGI(a2billing.php|2)
exten => _X.,4,Wait,2
exten => _X.,5,Hangup

executing [s@callme:1] Answer("IAX2/1234567890-3478", "") in new stack
-- Executing [s@callme:2] BackGround("IAX2/1234567890-3478", "PlayMenuOptions") in new stack
-- <IAX2/1234567890-3478> Playing 'PlayMenuOptions' (language 'en')
-- Executing [1@callme:1] DeadAGI("IAX2/1234567890-3478", "a2billing.php|2|XXXXXXXXXXX") in new stack
[Aug 26 16:28:23] WARNING[4828]: res_agi.c:2212 deadagi_exec: Running DeadAGI on a live channel will cause problems, please use AGI
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
-- AGI Script a2billing.php completed, returning 0

Also, I was able to forward the call using DeadAGI(a2billing.php|1| DID) function, but then I was unable to play the IVR Menu. As soon as I dialled 123456 it will call the extension associated with this DID as set in inbound DID destination in a2billing. I want something like this to happen but after a user presses the menu options, calls should be diverted to PSTN or mobile number as defined in the IVR as a response to the user selection.

If the above set up can be manipulated to work, how do I tell the system to bill the right user in a2billing and how do I set it up?

Is using DeadAGI(a2billing.php|1| DID) function a better option? If yes, how do I set it up?

In Summary:
I want the call to be forwarded/dialled out using a2billing as a response to the user selection in IVR prompt, and the number to be dialled is already defined in the context (Dial Plan) so that a2billing already knows what number to call. Also, need to tell a2billing which user account to use to record the calls.

I have done lots of research on this forum and was unable to find anything relevant.

Thanks in advance for your help.

Regards,
VoipBeginner


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 10:36 am 
Offline

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

Some of the code here is relevant to your application - viewtopic.php?f=33&t=7994 e.g.
Code:
exten => _X.,n,Goto(some-context,${EXTEN},1)

[some-context]
exten => _X.,1,deadAGI(a2billing.php,4)
exten => _X.,n,Hangup


or in your case

exten => _X.,n,Goto(some-context,123456,1)

Joe


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 11:33 am 
Offline

Joined: Thu Nov 12, 2009 9:36 pm
Posts: 33
Hi Joe,
Thanks for the quick reply. Sorry to bother you again but I was not very clear with your explanation. I tried to just use the code you provided but was unable to get the expected result.

Also, read this post >> viewtopic.php?f=33&t=7994.
I did not quite understand how Ferdorna got his result with the below code, and how I could use that in my scenario.

exten => _X.,1,Set(CDR(accountcode)=${EXTEN:0:10}) *** I use 10 digits account codes***
exten => _X.,n,Goto(Wholesale,${EXTEN:10},1)

[Wholesale]
exten => _X.,1,AGI(a2billing.php,4)
exten => _X.,n,Hangup

Is there any way I could simply set the account code to a2billing user and set the number that I needed to dial in the dial plan, and then forward that to a context like [Wholesale] above?

As I am still in the learning phase, a detailed answer will be highly appreciated.

I am sure there is a solution, but will be very kind of you or anyone else to help me learn it the easy way.

Thanks again,
VoipBeginner


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 11:51 am 
Offline

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

The only thing you need to set in this instance is the telephone number to call. One presumes that the caller will be identified by their caller ID.

Quote:
...set the number that I needed to dial in the dial plan...


That's what this code snippet I gave you does:-

Code:
exten => _X.,n,Goto(some-context,123456,1)

It sets the number to call as 123456.

In A2Billing have use_dnid = yes, and allow the caller to authenticate via the their caller ID.

Job done.

So in your original example, it may be modified to look like this

Code:
[callme]
exten => s,1,Answer()
exten => s,n,Background(PlayMenuOptions)
exten => s,n,WaitExten()
exten => 1,n,Goto(call-a2billing,123456,1)
exten => 1,n,Hangup()

[call-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup


Joe


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 12:20 pm 
Offline

Joined: Thu Nov 12, 2009 9:36 pm
Posts: 33
Hi Joe,
Thanks again for the quick, positive and encouraging response. Really appreciate it.

123456 is the sample DID number that will be dialled to get to the the IVR system. Once the call hits the IVR it will PlayMenuOptions, and when the user presses 1 then it will call exten => 1,n,Goto(call-a2billing,123456,1) and instead of 123456 the number to be dialled will be something like
9298902200 so I believe changing it to exten => 1,n,Goto(call-a2billing, 9298902200,1) should still give the same result.

One more question, the callers will be anyone trying to talk to me through my IVR. How do I authenticate them with their CallerID when I don't have their accounts in a2billing to assign the callerID's to? Will having the DID number 123456 as a callerID assigned to one particular account do the trick? How do I authenticate non a2billing users based on their callerIDs?

Looks like I am very close to getting it work, yet very very far without your help and support.

I am waiting eagerly for your response.

Thanks again.
VoipBeginner.


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 4:47 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Quote:
How do I authenticate non a2billing users based on their callerIDs?


You cannot, if a stranger calls your system, what are you going to authenticate them to? You have to know who they are, and got some money off them before you can let them make a call, although you can automatically create an account on first call it the caller ID is delivered.

If you are simply using A2Billing to route a call to your phone, then it would seem a bit pointless passing it through a billing system.

If you want to put all customers calling through to your number against the same account, then simply set the accountcode of a valid A2Billing account, which you know how to do based on the posts we have linked to.

Joe


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Thu Aug 26, 2010 10:30 pm 
Offline

Joined: Thu Nov 12, 2009 9:36 pm
Posts: 33
Hi Joe,
Thank you again for your reply.

Basically, it will be my family and friends calling me through the IVR, just wanted to show them off that I have learnt something.. :lol:

I want to use A2Billing to record the call details just for learning purpose and it can all be recorded to one account. Now, I have another hurdle of figuring out how its done. Even though you have already provided me the link with the tutorial, I am not very clear how Ferdorna >> viewtopic.php?f=33&t=7994 got his result.

[woowoo]
exten => _X.,1,Set(CDR(accountcode)=${EXTEN:0:10}) *** I use 10 digits account codes***
exten => _X.,n,Goto(Wholesale,${EXTEN:10},1)

How do I set the account code and the phone number that needs to be dialled in the above context? I need to hard code the A2billing account number and the destination phone number before it is passed to next context, which will then process the call and record the call details in A2billing against that account.

Thank you in advance.

Regards,
VoipBeginner.


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Fri Aug 27, 2010 1:56 am 
Offline

Joined: Thu Nov 12, 2009 9:36 pm
Posts: 33
Hi Joe,
Looks like I have figured it out. Not sure if it is the right way but I was able to make a outbound call after the IVR option 1 was selected using the A2billing account to record call details.

[callme]
exten => s,1,Answer()
exten => s,n,Background(PlayMenuOptions)
exten => s,n,WaitExten()
exten => 1,1,Set(CDR(accountcode)="XXXXXXXXXX")
exten => 1,n,Goto(call-a2billing,123456789,1)

exten => _X.,n,Hangup()

[call-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

Set(CDR(accountcode)="XXXXXXXXXX") << I replaced XX with a 10 digit A2billing account nmuber
Goto(call-a2billing,123456789,1) << 123456789 is sample telephone number that was forwarded to A2billing to dial out.

It has worked as per my requirement. Please confirm if it is the right way to get this result.

Thank you so much for your help.
Really, really appreciate it.

Regards,
VoipBeginner


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Fri Aug 27, 2010 8:01 am 
Offline

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

That's how I'd do it.

Joe


Top
 Profile  
 
 Post subject: Re: How to dial a number defined within context of a2billing?
PostPosted: Fri Aug 27, 2010 11:32 pm 
Offline

Joined: Thu Nov 12, 2009 9:36 pm
Posts: 33
Hi Joe,
Thank you so much for all your help and guidance.

I could not do it without yourself and lots of other lovely people and massive amount of information available in this forum.

I have had very good learning experience of A2billing so far.

Thnaks agian,

Regards,
VoipBeginner


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


All times are UTC


Who is online

Users browsing this forum: No registered users and 29 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