Elastix 1.6.12/A2billing prompt unavailale number

Discussion in 'General' started by chrisxiao, Feb 15, 2010.

  1. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    Elastix 1.6-12 works fine. Then I configure A2billing on extension 225:
    In the beginning of /etc/asterisk/extensions_custom.conf
    I add under [from-internal-custom]
    ; begin a2billing
    exten => 225, 1, Answer
    exten => 225, 2, Wait, 2
    exten => 225, 3, DeadAGI,a2billing.php
    exten => 225, 4, Wait, 2
    exten => 225, Hangup
    ; end of a2billing


    I create calling plan, rate card, rate and trunks.
    I use SoftPhone to dial 225 via IVR. Eventually I would like to use outside
    phone to dial the PBX, provide pin, and dial another international number.
    1) Create pin and use Rate Simulator to test. Got "Card Error!!!". I found that CC_entity_sim_ratecard.php has a bug in its SQL statement when it check the card number(pin): select * from cc_card where id=$id_cc_card
    this should really be
    select * from cc_card where username=$id_cc_card.

    2) I move on to use the pin for dialing, a2billing/elastix prompts my balance and available miminutes and dial the given number, but prompt:
    The number you dialed is unavailable.

    Any one can give me help? I just cannot believe the latest Elsastix installation won't work with a2billing.
     
  2. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    The log is long, I include the part that is after the pin is validated:
    elastix*CLI> ssss




    No such command 'ssss' (type 'help ssss' for other possible commands)
    AGI Tx >> 200 result=17323188334
    AGI Rx << VERBOSE "file:Class.A2Billing.php - line:663 - RES DTMF : 17323188334" 1
    a2billing.php: file:Class.A2Billing.php - line:663 - RES DTMF : 17323188334
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.A2Billing.php - line:681 - DESTINATION ::> 17323188334" 1
    a2billing.php: file:Class.A2Billing.php - line:681 - DESTINATION ::> 17323188334
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.A2Billing.php - line:683 - RULES APPLY ON DESTINATION ::> 17323188334" 1
    a2billing.php: file:Class.A2Billing.php - line:683 - RULES APPLY ON DESTINATION ::> 17323188334
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.A2Billing.php - line:721 - OK - RESFINDRATE::> 1" 1
    a2billing.php: file:Class.A2Billing.php - line:721 - OK - RESFINDRATE::> 1
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.A2Billing.php - line:743 - RES_ALL_CALCULTIMEOUT ::> 1" 1
    a2billing.php: file:Class.A2Billing.php - line:743 - RES_ALL_CALCULTIMEOUT ::> 1
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.A2Billing.php - line:760 - TIMEOUT::> 60000 : minutes=1000 - seconds=0" 1
    a2billing.php: file:Class.A2Billing.php - line:760 - TIMEOUT::> 60000 : minutes=1000 - seconds=0
    AGI Tx >> 200 result=1
    AGI Rx << STREAM FILE prepaid-you-have "#" 0
    -- Playing 'prepaid-you-have' (escape_digits=#) (sample_offset 0)
    AGI Tx >> 200 result=0 endpos=9440
    AGI Rx << SAY NUMBER 1000 ""
    -- <SIP/302-09ca5940> Playing 'digits/1' (language 'en')
    -- <SIP/302-09ca5940> Playing 'digits/thousand' (language 'en')
    AGI Tx >> 200 result=0
    AGI Rx << STREAM FILE prepaid-minutes "#" 0
    -- Playing 'prepaid-minutes' (escape_digits=#) (sample_offset 0)
    AGI Tx >> 200 result=0 endpos=6240
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:960 - app_callingcard: Dialing 'ZAP/1/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'." 1
    a2billing.php: file:Class.RateEngine.php - line:960 - app_callingcard: Dialing 'ZAP/1/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'.
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "" 1
    a2billing.php:
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:985 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'." 1
    a2billing.php: file:Class.RateEngine.php - line:985 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
    AGI Tx >> 200 result=1
    AGI Rx << EXEC Dial ZAP/1/17323188334|60|HRrL(60000000:61000:30000)
    -- AGI Script Executing Application: (Dial) Options: (ZAP/1/17323188334|60|HRrL(60000000:61000:30000))
    -- Limit Data for this call:
    > timelimit = 60000000
    > play_warning = 61000
    > play_to_caller = yes
    > play_to_callee = no
    > warning_freq = 30000
    > start_sound = (null)
    > warning_sound = timeleft
    > end_sound = (null)
    == Everyone is busy/congested at this time (1:0/0/1)AGI Tx >> 200 result=0
    AGI Rx << GET VARIABLE ANSWEREDTIME
    AGI Tx >> 200 result=1 ()
    AGI Rx << GET VARIABLE DIALSTATUS
    AGI Tx >> 200 result=1 (CHANUNAVAIL)
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1013 - [K=0]:[ANSWEREDTIME=0-DIALSTATUS=CHANUNAVAIL]" 1
    a2billing.php: file:Class.RateEngine.php - line:1013 - [K=0]:[ANSWEREDTIME=0-DIALSTATUS=CHANUNAVAIL]
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1053 - FAILOVER app_callingcard: Dialing 'ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'." 1
    a2billing.php: file:Class.RateEngine.php - line:1053 - FAILOVER app_callingcard: Dialing 'ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'.
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "" 1
    a2billing.php:
    AGI Tx >> 200 result=1
    AGI Rx << EXEC DIAL ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000)
    -- AGI Script Executing Application: (DIAL) Options: (ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000))
    -- Limit Data for this call:
    > timelimit = 60000000
    > play_warning = 61000
    > play_to_caller = yes
    > play_to_callee = no
    > warning_freq = 30000
    > start_sound = (null)
    > warning_sound = timeleft
    > end_sound = (null)
    == Everyone is busy/congested at this time (1:0/0/1)
    AGI Tx >> 200 result=0
    AGI Rx << GET VARIABLE ANSWEREDTIME
    AGI Tx >> 200 result=1 ()
    AGI Rx << GET VARIABLE DIALSTATUS
    AGI Tx >> 200 result=1 (CHANUNAVAIL)
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1063 - [FAILOVER K=0]:[ANSTIME=-DIALSTATUS=CHANUNAVAIL]" 1
    a2billing.php: file:Class.RateEngine.php - line:1063 - [FAILOVER K=0]:[ANSTIME=-DIALSTATUS=CHANUNAVAIL]
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1013 - [K=0]:[ANSWEREDTIME=0-DIALSTATUS=CHANUNAVAIL]" 1
    a2billing.php: file:Class.RateEngine.php - line:1013 - [K=0]:[ANSWEREDTIME=0-DIALSTATUS=CHANUNAVAIL]
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1053 - FAILOVER app_callingcard: Dialing 'ZAP/1/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'." 1
    a2billing.php: file:Class.RateEngine.php - line:1053 - FAILOVER app_callingcard: Dialing 'ZAP/1/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'.
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "" 1
    a2billing.php:
    AGI Tx >> 200 result=1
    AGI Rx << EXEC DIAL ZAP/1/17323188334|60|HRrL(60000000:61000:30000)
    -- AGI Script Executing Application: (DIAL) Options: (ZAP/1/17323188334|60|HRrL(60000000:61000:30000))
    -- Limit Data for this call:
    > timelimit = 60000000
    > play_warning = 61000
    > play_to_caller = yes
    > play_to_callee = no
    > warning_freq = 30000
    > start_sound = (null)
    > warning_sound = timeleft
    > end_sound = (null)
    == Everyone is busy/congested at this time (1:0/0/1)
    AGI Tx >> 200 result=0
    AGI Rx << GET VARIABLE ANSWEREDTIME
    AGI Tx >> 200 result=1 ()
    AGI Rx << GET VARIABLE DIALSTATUS
    AGI Tx >> 200 result=1 (CHANUNAVAIL)
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1063 - [FAILOVER K=0]:[ANSTIME=-DIALSTATUS=CHANUNAVAIL]" 1
    a2billing.php: file:Class.RateEngine.php - line:1063 - [FAILOVER K=0]:[ANSTIME=-DIALSTATUS=CHANUNAVAIL]
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1013 - [K=0]:[ANSWEREDTIME=0-DIALSTATUS=CHANUNAVAIL]" 1
    a2billing.php: file:Class.RateEngine.php - line:1013 - [K=0]:[ANSWEREDTIME=0-DIALSTATUS=CHANUNAVAIL]
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1053 - FAILOVER app_callingcard: Dialing 'ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'." 1
    a2billing.php: file:Class.RateEngine.php - line:1053 - FAILOVER app_callingcard: Dialing 'ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000)' with timeout of '60000'.
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "" 1
    a2billing.php:
    AGI Tx >> 200 result=1
    AGI Rx << EXEC DIAL ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000)
    -- AGI Script Executing Application: (DIAL) Options: (ZAP/ZAP/3/17323188334|60|HRrL(60000000:61000:30000))
    -- Limit Data for this call:
    > timelimit = 60000000
    > play_warning = 61000
    > play_to_caller = yes
    > play_to_callee = no
    > warning_freq = 30000
    > start_sound = (null)
    > warning_sound = timeleft
    > end_sound = (null)
    == Everyone is busy/congested at this time (1:0/0/1)
    AGI Tx >> 200 result=0
    AGI Rx << GET VARIABLE ANSWEREDTIME
    AGI Tx >> 200 result=1 ()
    AGI Rx << GET VARIABLE DIALSTATUS
    AGI Tx >> 200 result=1 (CHANUNAVAIL)
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1063 - [FAILOVER K=0]:[ANSTIME=-DIALSTATUS=CHANUNAVAIL]" 1
    a2billing.php: file:Class.RateEngine.php - line:1063 - [FAILOVER K=0]:[ANSTIME=-DIALSTATUS=CHANUNAVAIL]
    AGI Tx >> 200 result=1
    AGI Rx << VERBOSE "file:Class.RateEngine.php - line:1095 - [USEDRATECARD - FAIL =0]" 1
    a2billing.php: file:Class.RateEngine.php - line:1095 - [USEDRATECARD - FAIL =0]
    AGI Tx >> 200 result=1
    AGI Rx << STREAM FILE prepaid-dest-unreachable "#" 0
    -- Playing 'prepaid-dest-unreachable' (escape_digits=#) (sample_offset 0)
    elastix*CLI>
     
  3. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    I don't have much experience with a2billing, but the problem seems to be here:

    a2billing.php: file:Class.A2Billing.php - line:719 - ERROR ::> RateEngine didnt succeed to match the dialed number over the ratecard (Please check : id the ratecard is well create ; if the removeInter_Prefix is set according to your prefix in the ratecard ; if you hooked the ratecard to the Call Plan)
     
  4. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    Ramoncio,
    I put a new log. As you can see, when agi dials, it found that no channel is avaialable. I think some a2billing calling dialing-function in asterisk is not working.
    But I have no ideas how to pursuit from here. May be I should upgrade a2b 1.3.0 to 1.3.3?
     
  5. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    Have you tried manually creating a sip extension and use it with a softphone? Can you dial out? Maybe you have problems with your outbound routes configuration, or your dahdi/sip configuration.
    You'd better check that you have full pbx functionality before struggling with a2billing.
     
  6. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    My system has 2 FXO and 1 FXS. I create several SIP extensions and use soft phones to register with these extensions. I verify that any combination of calling between soft phone, my internal regular phone, outside phone including my cell phone are working fine, including IVR.
    Then, I moved on to A2billing. Soft phone to call the 225 extension, the next step is get a2b working from outside phone. But I get stuck with the first step.
     
  7. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    I'm afraid I can't help you. I haven't used a2billing, though it is in my to-do list.
    I heard the documentation was quite good, that there was a document simulating a whole installation and configuration from scratch. Try asking into their forums as well.
     
  8. fmvillares

    Joined:
    Sep 8, 2007
    Messages:
    1,785
    Likes Received:
    0
    please dont use that version is years old and buggy as hell

    latest and stabler a2billing is http://www.asterisk2billing.org/cgi-bin/trac.cgi

    version 1.5.1...
    follow the instructions here to install latest and voila...working perfect

    http://www.asterisk2billing.org/cgi-bin ... on%20Guide

    and please dont criticize all the good work done by the elastix developers...elastix has many parts and the less used sometimes are left behind as vtiger or a2billing...sugar crm will be removed definitively in a few releases...

    see ya
     
  9. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    I tried installing a2b1.5.1 on trixbox 2.8. following the instruction http://www.asterisk2billing.org/cgi-bin ... on%20Guide
    But it did not work. The instruction is more for Debean, not for Centos. That's why I switch to Latest Elastix, which bundle a2b 1.3 pre-installed.
    Can you provide me some information how to upgrade 1.3 to 1.5.1 or any help link.
     
  10. fmvillares

    Joined:
    Sep 8, 2007
    Messages:
    1,785
    Likes Received:
    0
    i dont know what pages r u looking at but i reviewd all centos install guide in my link and all of that is working (mysql version obviously...
    this is upgrade instructions
    http://www.asterisk2billing.org/cgi-bin ... 2_to_1.3.3

    the same applies to 1.3 to 1.5.1 only different files

    i followed the steps again with a beta install that i have and its working ok

    see ya
     
  11. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    I tried to install a2b 1.5.1 and following your links. I have mysql 5.0.77.
    After I untar the package, under DataBase/mysql5.x,
    I need to add extra line in the a2billing-createdb-user
    mysql -rroot -ppassw0rd < a2billing-createdb-user.sql

    Then, I need to create the schema using sh create-db.sh
    however, there is a bug in create-db.sh where it try to locate a file
    UPDATE-a2billing-v1.4.4.1-to-v1.5.0.sql
    which really should be UPDATE-a2billing-v1.4.5-to-v1.5.0.sql

    However, the db creation failed at creating trigger:
    REATE TRIGGER cc_ratecard_validate_regex_ins BEFORE INSERT ON cc_ratecard
    FOR EACH ROW

    ERROR 1227 (42000) at line 2729: Access denied; you need the SUPER privilege for this operation

    I read from somewhere that an extra GRANT need to be applied to the user, but I don't remember the exact syntax:
    GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'%' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;


    Help!!
     
  12. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    You posted . . .mysql -rroot -ppassw0rd . . . that (passw0rd) is I believe the PIAF sql root password here in elastix it is eLaStIx.2oo7, I hope that helps.

    dicko
     
  13. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    You are right about the password. But the problem is still the same due to the super privilege.
     
  14. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Perhaps the root user with the right password would have those super privileges, you can't get more super than root :)
    maybe you need to drop all the a2billing tables and users and try the script again from a "normalized" environment?
     
  15. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    On top of A2b 1.3, I installed 1.5.1 DB successfully after 5hours of pain.
    following the rest of insturnction which is messy, sometimes refer to debian, sometimes to non-debian distro. I finally type http://192.168.1.6/a2billing
    It redirect to https://192.168.1.6/a2billing/Public/index.php
    shows me this
    Invalid card number lenght defined in configuration.

    if I type http://192.168.1.6/a2billing/admin
    it redirect to https://192.168.1.6/a2billing/Public/index.php
    shows me this:
    Invalid card number lenght defined in configuration.

    Error : A2Billing configuration file is missing!


    I add a large section of [webui] stuff in /etc/asterisk/a2billing.conf
    No difference.

    Very frustrated that they write codes but do not write document well.
     
  16. fmvillares

    Joined:
    Sep 8, 2007
    Messages:
    1,785
    Likes Received:
    0
    the elastix a2billing db is mya2billing not a2billing try this to upgrade...

    see ya
     
  17. fmvillares

    Joined:
    Sep 8, 2007
    Messages:
    1,785
    Likes Received:
    0
    well wait a second...stop the rush..try to have a centos fresh install...and try to hace a fresh a2billing install to understand the process...the upgrade to 1.5 has 4 steps,
    1 upgrade db (its basicllly execute a mysql script)
    2 replace old /web/html/a2billing files with new ones
    3 replace and add agi and sound new files in agi and sounds asterisk files
    4 verify permissions and reload asterisk...

    do you have passed through all this steps?

    best regards
     
  18. chrisxiao

    Joined:
    Feb 14, 2010
    Messages:
    10
    Likes Received:
    0
    1. upgrade db : I write the down each step for the db setup:
    http://www.elastix.org/component/option ... 4/lang,en/
    when I select * from cc_authen, I only see one entry for root, I don'nt see the admin entry
    2. replace old /web/html/a2billing: based on the instruction, I copy admin,customer,agent to /var/www/html/a2billing/
    This may be wrong. The instruction says.
    #cp -rf /usr/local/src/a2billing/admin /var/www/a2billing
    #cp -rf /usr/local/src/a2billing/agent /var/www/a2billing
    #cp -rf /usr/local/src/a2billing/customer /var/www/a2billing
    #cp -rf /usr/local/src/a2billing/common /var/www/a2billing
    I thought that's for debian distro, the centos has /var/www/html as the web root page. I will try following the instruction to see if it makes a difference.

    I will document each step if I got any success.
     
  19. fmvillares

    Joined:
    Sep 8, 2007
    Messages:
    1,785
    Likes Received:
    0
    in elastix simply change the folders to the correct ones, its not simply copy paste but to understand what you r doing...thats the way we learn...for example elastix root password for mysql is eLaStiX.2OO7 for granting all permits as dicko said..
    see yaa
     
  20. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    sed 's/eLaStiX.2OO7/eLaStiX.2oo7/' :)
     

Share This Page