Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 5:34 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: how to use "select country" search in display rate card api
PostPosted: Tue Sep 08, 2009 6:07 pm 
Offline

Joined: Sat Sep 30, 2006 11:22 am
Posts: 167
Location: South East Florida
Hello. I finally set up a script that worked for me and displays the rates. Not knowing the code, I have to guess putting something like this together and work based on trial and error. Every thing in the display is working except for the first search window "select a country" . Can someone help on what I'm missing? Is it a line of code or could it be something else. Here is the script.

<?php include ("http://www.Your site/a2billing/webservice/display_ratecard.php?".
"key=3636dtdtUUOoPTGwtwtey858475".
"&page_url=http://www.displaysite/rates.php&".
"&field_to_display=t1.destination,t1.dialprefix,t1.rateinitial&".
"&column_name=Destination,Prefix,Rate/Min&".
"&currency_select=USD&".
"&field_type=,,money&".
"&".$_SERVER['QUERY_STRING']);?>

Thanks.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Tue Sep 08, 2009 8:22 pm 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
I just made few fixes in last rev 2370

Hope this helps.

Yours,
/Areski


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Tue Sep 08, 2009 9:24 pm 
Offline

Joined: Sat Sep 30, 2006 11:22 am
Posts: 167
Location: South East Florida
Perfect. Thank you so much.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Thu Sep 10, 2009 8:40 pm 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
Is there a sample file that explains the process in details within addons or docs?


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Thu Sep 10, 2009 9:18 pm 
Offline

Joined: Sat Sep 30, 2006 11:22 am
Posts: 167
Location: South East Florida
No, not a detailed document. At least not that I know of. In addons there is a good txt explanation with the different variables and so on. There is also a good thread here
viewtopic.php?f=14&t=2969&hilit=api+display+ratecard and here viewtopic.php?f=21&t=5891&p=23538&hilit=api+display+ratecard#p23538

like everything else in life, it's pretty easy once you know how to do it. In the first thread you can learn how to create your key. Just replace the key in the model I have here. The first url is where the display_ratecard.php resides in your a2billing web UI. The third line is where your web page displaying the rates resides and I think that is it.

Take my sample (the one posted in this thread), plug the results of your key (after the MD5 sum) Plug the string or key you created (before running the MD5 sum) in a2billing system settings, global list as your API security key and add the two address for your site in the sample I offered and save it as "rates.php" Go to your browser and call it. http://www.yoursite.com/rates.php

If I'm not mistaken you'll get a nice display. Otherwise let me know and I'll do my best to try and help you.

Oh, very important. Notice Areski's reply in this thread. If you want the first search window "select country" to work you have to use the display_ratecard.php file in svn 2370 or later.

hope it works for you. Let us know.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 08, 2010 4:15 am 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
All right, I am making a revisit here :)

Thanks for the detailed explaination ladca2003.

Here is what I did and it's no work:
- Set API key in Global List (A2Billing 1.4.4.1) to = sldkfjswe83lsewie
MD5 calculated to = 65e67f545c8c7561617ac83480b07cc3 from a web-tool I used. <= Hopefully that is right.

- Create file: nano /var/www/html/webservice/rates.php and inserted the following:

Code:
<?php include ("http://myIP/webservice/display_ratecard.php?".
"key= 65e67f545c8c7561617ac83480b07cc3".
"&page_url=http://myIP/webservice/rates.php&".
"&field_to_display=t1.destination,t1.dialprefix,t1.rateinitial&".
"&column_name=Destination,Prefix,Rate/Min&".
"&currency_select=USD&".
"&field_type=,,money&".
"&".$_SERVER['QUERY_STRING']);?>


Note: a2billing is at /var/www/html/a2billing. Does that make any difference?

Thanks again for the details.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 08, 2010 9:45 am 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
You definitely don't want to add a space after the =
"key= 65e67f545c8c7561617ac83480b07cc3".

Yours,
/Areski


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 08, 2010 3:54 pm 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
That's a typo by me. The rates.php file doesn't have a space. Still no work though.

What is the requirement in terms of settings and configuration in A2Billing for this to work?


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 08, 2010 4:00 pm 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
no extra requirements than A2Billing UI itself.

You might want to look at the apache logs and see if u see an error somewhere.

Yours,
/Areski


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 15, 2010 12:46 am 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
Thanks for that Areski. It was an wrong IP problem for me.

However, related to the original purpose of this thread, do the variables prefix_select and country_select work in v.1.4.4.1? You said you made a revision. Can you please detail what files should be updated? I tried
Code:
"&prefix_select=32,33,34&".
but it didn't work.

Thanks again.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 15, 2010 1:09 pm 
Offline

Joined: Sat Sep 30, 2006 11:22 am
Posts: 167
Location: South East Florida
Hi bruce. This things can be a real pain in the neck and sometimes is just a little detail we leave out. Anyways I use my rates.php to display the rates on a webpage.

Your rates.php file looks ok. Try showing just one rate card at first and see if it makes a difference. include "&rate_cardid=1&". where 1 is one of your rate cards number and you can choose to display which ever or all but maybe displaying just one for testing and seeing the results.

According to where you placed your rates.php file then call it by pointing your browser to http://yourIP/webservice/rates.php it should come up. Or try placing it at the begining of you web directory just in case you have something in you httpd.conf file that's preventing it from displaying. In my case I test it in /var/www/html to see how it works. If you change it remember to change the page_url address in the file itself . And keep it as clean and simple as possible to test it and then load it up.

Hope this helps.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 15, 2010 3:15 pm 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
Thanks for the input. I have got it to display the rate card all right.

But I want to segregate and only show a few countries from the ratecard. In v1.4 documenation there is reference to using prefix_select and country_select variables for showing only certain rates from the RateCard and that is what I wanted to use and it's not working. For example, one should be able to only display rates for USA, Canada from a Rate Card that includes A-Z by adding this line:

Code:
"&country_select=USA,CANADA&"

OR
Code:
"&prefix_select=1&"


Anyone got this to work?
Areski? :?

Thanks


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 22, 2010 5:05 am 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
Anything guys?


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 22, 2010 6:19 am 
Offline

Joined: Sat Sep 30, 2006 11:22 am
Posts: 167
Location: South East Florida
Sorry bruce, not on my side. I tried a few combination but couldn't get it.


Top
 Profile  
 
 Post subject: Re: how to use "select country" search in display rate card api
PostPosted: Fri Jan 22, 2010 4:06 pm 
Offline

Joined: Wed Mar 15, 2006 11:58 pm
Posts: 325
No prob. Thanks for the tries.

I guess Areski is the only one who can weigh on this now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Auto Dialer Software


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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group