Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 19, 2018 9:58 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Wed Mar 19, 2008 2:36 pm 
Offline

Joined: Fri Feb 08, 2008 4:54 pm
Posts: 6
i didn't implement it yet, but this is the basic outline

I’m providing a replacement to payphones in a number of boarding schools, where every student gets a card, which can then be refilled with vouchers……

I need a setup where I can do an installation, and then let the rest be run by a non tech person.

1. I’m using realtime for voicemail,
2. I want a directory of voice mail boxes, at each school
3. I want students to be able to turn on or off their voicemail using a IVR
4. disable voicemail when account falls below a certain balance


i'll be using siftachs code to turn on or off the voicemail

Update data base;

mysql -u a2billinguser -pa2billing mya2billing

alter table cc_subscription_fee add column vmplaces int(11);
alter table cc_card add column vmplaces int(11);

create voicemail_users as oulined by siftach

create table

CREATE TABLE `vm_places` (
`id` int(11) NOT NULL auto_increment,
`placename` varchar(50) NOT NULL default '',
`context` varchar(50) NOT NULL default '',
`stamp` timestamp(14) NOT NULL,
PRIMARY KEY (`id`),
) TYPE=MyISAM;

2. change UI

Vi var/www/html/A2Billing_UI/Public/form_data/ FG_var_card.inc

In the first statement, add, 'voicemail', ‘vmplaces’ before 'sip_buddy'. It should similar to this:

getpost_ifset(array('id', 'username', 'useralias', 'uipass', 'credit', 'language', 'tariff', 'id_didgroup', 'id_campaign', 'callback', 'activated','simultaccess', 'currency','typepaid', 'creditlimit', 'lastname', 'firstname', 'email', 'address','city', 'state', 'country', 'zipcode', 'phone', 'fax', 'inuse', 'cid', 'runservice', 'firstusedate','expirationdate', 'enableexpire', 'expiredays', 'voicemail', ‘vmplaces, 'sip_buddy', 'iax_buddy','popup_select', 'vat', 'autorefill', 'initialbalance'));


Locate this line:

$HD_Form -> AddEditElement (gettext("SIP ACCOUNT"),

Add this before it:

$HD_Form -> AddEditElement (gettext("VOICEMAIL"),
"voicemail",
'1',
"RADIOBUTTON",
"",
"",
gettext("Choose if you want to enable voicemail"),
"" , "", "" , "Yes :1, - No:0", "", "" , "", gettext("Enable voicemail"));


$HD_Form -> AddEditElement (gettext("vm_places"),
"vmplaces",
"",
"SELECT",
"", "", "",
"sql",
"vm_places",
"placename, id",
"", "", "%1", "", "", "", '<OPTION value="-1" selected>'.gettext("NOT DEFINED").'</OPTION>' );


After the last AddEditElement command you should find the FieldEditElement command, add 'voicemail', ‘vmplaces’ to it, again before sip_buddy. It should look similar to this:

$HD_Form -> FieldEditElement ('username, useralias, uipass, credit, language, tariff, id_didgroup, id_campaign,'.
'callback, activated, activatedbyuser, simultaccess, currency, runservice, autorefill, initialbalance, typepaid, creditlimit, firstusedate, enableexpire,'
'expirationdate, expiredays, vat, lastname, firstname, email, address, city, state, country, zipcode, phone,'.
'fax, voicemail, vmplaces, sip_buddy, iax_buddy, inuse');


Do the same thing to:

A2Billing_UI/Public/form_data/ FG_var_subscription.inc

The thing I didn’t get into the UI is adding each place

So im using:

insert into vm_places (placename, context) values ('placename', 'context');

You need to remember to associate 2 subscriptions to each place – one that has voicemail, and one that doesn’t.

Cront Jobs

5 * * * * /etc/asterisk/crona2b.sh

create crona2b.sh that contains the following job

mysql -u a2billinguser -pa2billing mya2billing < /etc/asterisk/voicemail_users.sql

voicemail_users.sql contains

this updates the realtime database every five min

truncate table voicemail_users;
insert into voicemail_users(customer_id,context,mailbox,password,fullname,pager)
select cc_card.id,vm_places.context,cc_card.id,cc_card.username,concat(cc_card.lastname,' ',cc_card.firstname),cc_card.email from cc_card, vm_places, where cc_card.voicemail=1 AND cc_card.credit >=1 AND cc_card.vmplaces=vm_places.id;

this checks if voicemail was enabled/disabled and adjusts billing accordingly

replace into cc_card(id, subscription)
select cc_card.id, cc_subscription_fee.id from cc_card, cc_subscription_fee, vm_places where cc_card.voicemail=1 and cc_card.voicemail=cc_subscription_fee.voicemail and cc_subscription_fee.vmplaces=vm_places.id;

replace into cc_card(id, subscription)
select cc_card.id, cc_subscription_fee.id from cc_card, cc_subscription_fee, vm_places where cc_card.voicemail=0 and cc_card.voicemail=cc_subscription_fee.voicemail and cc_subscription_fee.vmplaces=vm_places.id;



i think this is basically it - i'm implementing it over the next few weeks, and will keep you posted.

i'm wondering where i edit the "generate cards", (i didn't find it under form_data) to be able to generate cards that are associated with a specific school

--- edit ----
i'm thinking of writing an AGI, which will be passed a variable(which will be different at each location---the vmplaces id), and associate a card with a school (after confimation), but i need help with this - my PHP skills are at best mediocre.

also i think the cron to disable voicemail should be run once a month, that way voicemail is sold on a monthly basis (the subscription cron should charge daily - at a fraction) ... i will need to modify the query to look something like this:

truncate table voicemail_users;
insert into voicemail_users(customer_id,context,mailbox,password,fullname,pager)
select cc_card.id,vm_places.context,cc_card.id,cc_card.username,concat(cc_card.lastname,' ',cc_card.firstname),cc_card.email from cc_card, vm_places,cc_subscription_fee where cc_subscription_fee.voicemail=1 AND cc_card.credit >=1 AND cc_card.vmplaces=vm_places.id and cc_subsription_fee.vmplaces=vm_places.id;


i didn't debug this last query yet -

i'd love any feedback or ideas

thanks

yosef (yossel) m.







Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 9:47 am 
Offline

Joined: Mon Oct 15, 2007 9:39 am
Posts: 12
Location: Israel
You can save allot of work if you don't use the voicemail_users table. For directory purposes you have vmplaces in cc_card, just add an index to it. You can enable and disable voicemail by setting the voicemail field in cc_card.

As for the billing - I personally think it is a bad idea to bill for voicemail every day, because it will give the users something to argue with you about, and you don't want to start calculating usage by days.

It will be a good idea to add an expiration date for the voicemail feature in cc_card and bill once every period, which can be a week, a month, 3 months, a year - whatever you think is suitable. Make a table, let's call it cc_voicemail_subscriptions, and in it define all the possible subscriptions. Now the tricky part is to create a web page (or an IVR script) that will allow every user to select what kind of subscription he wants to purchase (or let the admin do it) and charge him for it according to what's defined in the table.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 11:20 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
If this is for a campus style environment, rather than a public service, then you could consider the following architecture.

1. Set up a standard FreePBX system, probably using the device and users setup, so that a user can log into and log out of a phone anywhere in the building. This needs a little thought, but should work.

2. If you need more capacity than one FreePBX system can deliver, then add more PBX systems, using trunking or Dundi to route the calls between PBX's

3. Set up a standard A2Billing server on the same network with trunks to the outside world, put this on a separate box.

4. Set FreePBX to route out via A2Billing using something like IP authentication from FreePBX.

5. Where phones are assigned to one particular person in a secure area, such as staff, then enter the card number into the account code of the extension in FreePBX and send the call straight into A2Billing. The call will authenticate on the basis of account code.

6. In respect of transient users, you have a few options: -

a. Put Admin and transient users in different contexts (or even different FreePBX systems) with different trunks that go into different A2Billling AGI-Confs

a. Get them to dial 9 for an outside line, which goes into A2Billing, prompts for card number, then the number to dial.

b. Get them to log into a phone to make calls, and get them to log out after. (if they forget to log out and someone else uses all their credit, they will know better next time - it's good life training)

c. Create a custom context in the call path that prompts them for an account code, and sets it before passing the call into A2Billing. This will make it easier to incorporate web based dialing etc.


The advantages of this system are as follows: -

1. You have free calls internally.
2. Voicemail and voicemail to email comes naturally.
3. Extra features such as DND are included.
4. Conference calling, even remote classes can easily be done, even with video.
5. It's pretty simple to build, with no major modifications required.
6. All sorts of extras can be built into the system - see some posts in PiaF on the teacher Morning register application for the Aastra 57i phone using an XML application.
7 Completely scalable.

Other Apps coming out of FreePBX and PiaF which could be used internally: -

Tellyapper - Voice Blasting - ring everyone at once.
Intercom system and overhead paging.
Voicemail blasting - send a voicemail to everyone.


Yours

Joe Roper


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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