asterisk2billing.org
http://forum.asterisk2billing.org/

number manipulation for the number entered by a user
http://forum.asterisk2billing.org/viewtopic.php?f=18&t=6592
Page 1 of 1

Author:  seer_tenedos [ Mon Nov 16, 2009 1:08 am ]
Post subject:  number manipulation for the number entered by a user

Hi guys,
I really need to check the number an user enters and manipulate that number in some cases or change it before it gets passed to to the rate engine and the call is made. In my case i am doing callbacks so this would happen after the first leg is connected right after the user dials the number they want to call.

What i need to do is sub in part of the number dialed into the number the user enters in some cases and in other cases a complete number replacement.

While i would love to be able to do this without a code change i don't like my chances. I was hoping someone could point me in the right direction. Ideally it would be great if it passed through something similar to the a2billign extension in asterisk as then you could change it as much as you need to but i think that would be too hard. it would be ideal if i could do this in a way that it would not be blown away next time i get the latest source but i don't think that is possible.

Regards

Chris

Author:  areski [ Mon Nov 16, 2009 9:42 am ]
Post subject:  Re: number manipulation for the number entered by a user

Hi,

Doing manipulation on the dialed number is not the goal of a2billing.
You could achieve this from the Dialplan before reaching A2Billing.

Yours,
/Areski

Author:  seer_tenedos [ Mon Nov 16, 2009 12:17 pm ]
Post subject:  Re: number manipulation for the number entered by a user

areski wrote:
Hi,

Doing manipulation on the dialed number is not the goal of a2billing.
You could achieve this from the Dialplan before reaching A2Billing.

Yours,
/Areski


Great areski so you are saying it is possible then. The dialplan is exactly where i would prefer to do the modification but for the life of me i was unable to work out what dial plan is called on a callback once the user has picked up and is asked to enter the number they wish to call. I was sure a2billing had to trow it back into a dialplan somehow but i could never work out how it did that and where the dial plan it used was. I have worked out how to manipulate the callback number but the number the user enters once they pick up the phone has had me stumped!

Any pointers on locating the dialplan would be great then i should be fine.

Regards,

Chris

Author:  jroper [ Tue Nov 17, 2009 1:38 am ]
Post subject:  Re: number manipulation for the number entered by a user

It's set in the callback section of the A2Billing Global config, usually a2billing-callback context.

Joe

Author:  seer_tenedos [ Tue Nov 17, 2009 2:01 am ]
Post subject:  Re: number manipulation for the number entered by a user

jroper wrote:
It's set in the callback section of the A2Billing Global config, usually a2billing-callback context.

Joe



ok i looked in the source and found this

[a2billing-callback]
exten => _.,1,DeadAgi(a2billing.php|1|callback)
exten => _.,n,Hangup


if that is still current then if for example i want to replace 619 with 03 how would i do so? I can't see the dial command or is that what the DeadAgi call does? I know this could be done on the trunk but the 03 is just an example. it will really be the third digit of the outgoing caller ID. I know how you normally get the caller ID just not how to get the number that will be called.

UPDATE
I have gone through the a2billing.php for mode callback and i swear it looks like the call is either already been made to the second leg or it just answers the 1st leg and in which case i can not spot the part the calls the second leg and how to change the number. I am sure this is as simple as reading and updating a variable in the dial plan above but i am not sure which one it is that i need to update.

Chris

Author:  seer_tenedos [ Wed Nov 18, 2009 11:23 pm ]
Post subject:  Re: number manipulation for the number entered by a user

Ok i have read the AGI and the the other code that it calls and i swear that the code that gets the digits and calls the number happens in the DeadAGI call and the there is no way using that a2billing-callback context to modify the number entered by the user when a2billing prompts for the destination.

I can't be the only one that wants to be able to modify/change the number their callback users enter surely?

Can anyone please help me get this working or provide some more hints in the right direction?

Regards

Chris

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/