Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 25, 2024 3:50 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Adding a language to the IVR
PostPosted: Sun Dec 09, 2007 4:21 am 
Offline

Joined: Thu Jun 14, 2007 2:20 am
Posts: 23
Location: Brasil
It has been a while since I wanted to add Portuguese language to the A2Billing application.
Some time ago, I saw that nice Brazilian prompts were made available in the distribution, but there was no code in the system to actually use them.

This is an attempt to share the modifications I implemented in the system to make these prompts available. I have tested it on my lab and production systems with no problems so far.
Though is being done for Portuguese, it can be used to add any other language, provided that you put the right sound files in the right directory as shown later on.

Any comments/improvements are welcomed.

These modifications were done on an Astersk2Billing version 1.3.0.
I am using the following web server path to the asterisk2billing application in my system: /var/www/a2b/
You may have a different setup and thus will need to use the right path for your system.

1. Modifications in file /var/www/a2b/A2Billing_UI/Public/form_data/FG_var_card.inc:

a) Look for "$language_list = array();" (without the quotes) in the file and add the following line at the end of the list:
Code:
$language_list["3"] = array( gettext("PORTUGUESE"),  "br");   //NEW NEW NEW

b) right after that, you will find another list. Add the following line at the end of that list:
Code:
$language_list_r["3"] = array("br", gettext("PORTUGUESE"));   //NEW NEW NEW

The whole thing should look like this:
Code:
$language_list = array();
$language_list["0"] = array( gettext("ENGLISH"), "en");
$language_list["1"] = array( gettext("SPANISH"), "es");
$language_list["2"] = array( gettext("FRENCH"),  "fr");
$language_list["3"] = array( gettext("PORTUGUESE"),  "br");   //NEW NEW NEW

$language_list_r = array();
$language_list_r["0"] = array("en", gettext("ENGLISH"));
$language_list_r["1"] = array("es", gettext("SPANISH"));
$language_list_r["2"] = array("fr", gettext("FRENCH"));
$language_list_r["3"] = array("br", gettext("PORTUGUESE"));   //NEW NEW NEW

2. Modifications in file /var/www/a2b/A2Billing_UI/Public/form_data/FG_var_ecommerce.inc

Look for "$language_list = array();" (without the qoutes) in the file and add the following line at the end of the list:
Code:
$language_list["3"] = array( gettext("PORTUGUESE"),  "br");   //NEW NEW NEW

The whole thing should look like this:
Code:
$language_list = array();
$language_list["0"] = array( gettext("ENGLISH"), "en");
$language_list["1"] = array( gettext("SPANISH"), "es");
$language_list["2"] = array( gettext("FRENCH"),  "fr");
$language_list["3"] = array( gettext("PORTUGUESE"),  "br");   //NEW NEW NEW

3. Modifications in file /var/www/a2b/A2Billing_UI/signup/form_data/FG_var_index.inc

a) Look for "$language_list = array();" (without the quotes) in the file and add the following line at the end of the list:
Code:
$language_list["3"] = array( gettext("PORTUGUESE"),  "br");   //NEW NEW NEW

b) right after that, you will find another list. Add the following line at the end of that list:
Code:
$language_list_r["3"] = array("br", gettext("PORTUGUESE"));   //NEW NEW NEW

The whole thing should look like this:
Code:
$language_list = array();
$language_list["0"] = array( "ENGLISH", "en");
$language_list["1"] = array( "SPANISH", "es");
$language_list["2"] = array( "FRENCH",  "fr");
$language_list["3"] = array( "PORTUGUESE",  "br");   //NEW NEW NEW

$language_list_r = array();
$language_list_r["0"] = array("en", "ENGLISH");
$language_list_r["1"] = array("es", "SPANISH");
$language_list_r["2"] = array("fr", "FRENCH");
$language_list_r["3"] = array("br", "PORTUGUESE");   //NEW NEW NEW

That finishes the needed modifications in the asterisk2billing files.

Be sure to place the Brazilian sound files in the /var/lib/asterisk/sounds/br directory so that asterisk can find them. Note that the "br" directory matches the "br" assignments in the lists of parameters modified before.
If you add another language you must use a different letters combination in both places: the lists and the directory name so they match all the time.

After this modifications, when you go into Customers--> List Customers --> Edit and you click on the LANGUAGE selection, you should be able to see and select the PORTUGUESE option.
Once selected, the A2Billing will use the Brazilian sounds for that card users.

Enjoy,

Eduardo


Top
 Profile  
 
 Post subject: Re: Adding a language to the IVR
PostPosted: Fri Aug 07, 2009 7:02 am 
Offline

Joined: Sun Jan 20, 2008 1:58 am
Posts: 72
just for the record ... as of a2b Version 1.4.1 this is the file you have to modify
/usr/local/src/a2billing/admin/lib/interface/constants.php
at the top you find the function
function getLanguagesList()

the rest should be pretty simple


Top
 Profile  
 
 Post subject: Re: Adding a language to the IVR
PostPosted: Mon Aug 31, 2009 11:09 am 
Offline

Joined: Sat Aug 29, 2009 7:53 pm
Posts: 4
very good
but i think this method does not work for the all languages because a2billing uses say_number for playing digits and this application can 't play numbers in a right format.

for adding Persian language i use (playback num:123|say) and say.conf instead of say_number in Class.A2billing.php file.


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


All times are UTC


Who is online

Users browsing this forum: No registered users and 40 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group