Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 23, 2024 3:25 pm
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Hanging Up before authentication= Call Goes Through *FIXED*
PostPosted: Mon Aug 18, 2008 4:48 pm 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
Hey Guys... this is my first Post, and I have been reading and learning so much from this forum for the past 3 weeks.

I have to say you guys did an AMAZING job with this wonderfull tool. I have changed it most of it is code to act as a Voip Service Provider. which is working great so far, but I got a couple of Issues.

Ill start with biggest issue i Have.

as of right now, I have it on DeadAGI, and when a customer makes an outbound call using a trunk, if he hangs up Before the authentication, A2Billing Makes the call and the destination rings, eventhough the Customer has already hungup.

this problem gets fixed if i used AGI in the extensions.conf insted of the DeadAGI, but the problem with this setup is that if the customer makes a call and HANG's UP FIRST, the call does not get charged and the Database does not get updated.

i can post some logs if need it.

Thanks for your help

za3toor


Last edited by za3toor on Thu Aug 28, 2008 11:48 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Hanging Up before authentication= Call Goes Through
PostPosted: Mon Aug 18, 2008 5:17 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
za3toor wrote:
I have changed it most of it is code to act as a Voip Service Provider.
What did you need to change exactly? Would you care to share your improvements back to the project? Obviously we can't support code we've never seen.
Quote:
as of right now, I have it on DeadAGI, and when a customer makes an outbound call using a trunk, if he hangs up Before the authentication, A2Billing Makes the call and the destination rings, eventhough the Customer has already hungup.
I recall having seen this situation once before, but it was a long time ago and the details escape me. Are you running A2B v1.3.3? This may be an issue we've already fixed. Are you sure A2B is placing the outbound leg? After all if no-one has authenticated A2B won't even know which callplan/trunk to use for the call. Are you sure it's not some Asterisk dialplan which is being executed after A2B has exited?
Quote:
this problem gets fixed if i used AGI in the extensions.conf insted of the DeadAGI, ... if the customer makes a call and HANG's UP FIRST, the call does not get charged and the Database does not get updated.
Yes this is expected behaviour. You must use DeadAGI() for A2B to have any chance of billing correctly.
Quote:
i can post some logs if need it.
Make sure you 'set verbose 15' in Asterisk first. 'debug = 3' in a2billing.conf might yield additional clues.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 18, 2008 6:28 pm 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
Quote:
What did you need to change exactly? Would you care to share your improvements back to the project? Obviously we can't support code we've never seen.


Sure, when it is 100% working with no bugs,

Quote:
recall having seen this situation once before, but it was a long time ago and the details escape me. Are you running A2B v1.3.3?


Yes i am using the latest Version.

Quote:
Are you sure A2B is placing the outbound leg?

Yes because it is the only code in the Context, and all of the sip peers are pointed to that context

Code:
[a2billing]
;exten => _X.,1,Answer
exten => _X.,1,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|1)
;exten => _X.,n,AGI(a2billing.php|1)
exten => _X.,n,Wait(1)
exten => _X.,n,Hangup


here are the LOG for the scneario where I called an outbound number and hangup right away, did not even hear how log i can talk for, and the call went through.



Code:
    -- Executing [19057878135@numberplan-custom-3:1] Wait("SIP/14166239005-006baba0", "1") in new stack
    -- Executing [19057878135@numberplan-custom-3:2] DeadAGI("SIP/14166239005-006baba0", "a2billing.php|1") in new stack
[Aug 18 14:24:51] WARNING[9179]: res_agi.c:2116 deadagi_exec: Running DeadAGI on a live channel will cause problems, please use AGI
    -- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
  a2billing.php|1: A2Billing AGI internal configuration:
  a2billing.php|1: Array
  a2billing.php|1: (
  a2billing.php|1:     [debug] => 3
  a2billing.php|1:     [asterisk_version] => 1_4
  a2billing.php|1:     [answer_call] =>
  a2billing.php|1:     [play_audio] => 1
  a2billing.php|1:     [say_goodbye] =>
  a2billing.php|1:     [play_menulanguage] =>
  a2billing.php|1:     [force_language] =>
  a2billing.php|1:     [intro_prompt] =>
  a2billing.php|1:     [min_credit_2call] => 0
  a2billing.php|1:     [min_duration_2bill] => 0
  a2billing.php|1:     [notenoughcredit_cardnumber] =>
  a2billing.php|1:     [notenoughcredit_assign_newcardnumber_cid] =>
  a2billing.php|1:     [use_dnid] => 1
  a2billing.php|1:     [no_auth_dnid] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] => 2400
  a2billing.php|1:             [1] => 2300
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [number_try] => 1
  a2billing.php|1:     [force_callplan_id] =>
  a2billing.php|1:     [say_balance_after_auth] =>
  a2billing.php|1:     [say_balance_before_call] =>
  a2billing.php|1:     [say_balance_after_call] => 1
  a2billing.php|1:     [say_rateinitial] =>
  a2billing.php|1:     [say_timetocall] => 1
  a2billing.php|1:     [auto_setcallerid] => 1
  a2billing.php|1:     [force_callerid] =>
  a2billing.php|1:     [cid_sanitize] => CID
  a2billing.php|1:     [cid_enable] => 1
  a2billing.php|1:     [cid_askpincode_ifnot_callerid] =>
  a2billing.php|1:     [cid_auto_assign_card_to_cid] =>
  a2billing.php|1:     [cid_auto_create_card] => 1
  a2billing.php|1:     [cid_auto_create_card_len] => 10
  a2billing.php|1:     [cid_auto_create_card_typepaid] => PREPAY
  a2billing.php|1:     [cid_auto_create_card_credit] => 0
  a2billing.php|1:     [cid_auto_create_card_credit_limit] => 1000
  a2billing.php|1:     [cid_auto_create_card_tariffgroup] => 4
  a2billing.php|1:     [callerid_authentication_over_cardnumber] => 1
  a2billing.php|1:     [sip_iax_friends] => 1
  a2billing.php|1:     [sip_iax_pstn_direct_call_prefix] => 1416623
  a2billing.php|1:     [sip_iax_pstn_direct_call] => 1
  a2billing.php|1:     [ivr_voucher] =>
  a2billing.php|1:     [ivr_voucher_prefix] => 8
  a2billing.php|1:     [jump_voucher_if_min_credit] => 1
  a2billing.php|1:     [voucher_phone_number] => 110
  a2billing.php|1:     [min_credit] => 2.50
  a2billing.php|1:     [extracharge_did] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] =>
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [extracharge_fee] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] =>
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [extracharge_buyfee] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] =>
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [international_prefixes] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] => 011
  a2billing.php|1:             [1] => 00
  a2billing.php|1:             [2] => 09
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [dialcommand_param] => |60|HgiRL(%timeout%:61000:30000)
  a2billing.php|1:     [dialcommand_param_sipiax_friend] => |60|HRgirL(3600000:61000:30000)
  a2billing.php|1:     [switchdialcommand] =>
  a2billing.php|1:     [failover_recursive_limit] => 2
  a2billing.php|1:     [maxtime_tocall_negatif_free_route] => 5400
  a2billing.php|1:     [send_reminder] =>
  a2billing.php|1:     [record_call] =>
  a2billing.php|1:     [monitor_formatfile] => gsm
  a2billing.php|1:     [agi_force_currency] =>
  a2billing.php|1:     [currency_association] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] => usd:dollars
  a2billing.php|1:             [1] => mxn:pesos
  a2billing.php|1:             [2] => eur:euros
  a2billing.php|1:             [3] => all:credit
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [file_conf_enter_destination] => prepaid-enter-dest
  a2billing.php|1:     [file_conf_enter_menulang] => prepaid-menulang2
  a2billing.php|1:     [callback_bill_1stleg_ifcall_notconnected] => 1
  a2billing.php|1:     [logger_enable] => 1
  a2billing.php|1:     [log_file] => /tmp/a2billing.log
  a2billing.php|1:     [currency_association_internal] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [usd] => dollars
  a2billing.php|1:             [mxn] => pesos
  a2billing.php|1:             [eur] => euros
  a2billing.php|1:             [all] => credit
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1:     [ivr_voucher_prefixe] => 8
  a2billing.php|1: )
  a2billing.php|1: >
  a2billing.php|1: file:a2billing.php - line:78 - IDCONFIG : 1
  a2billing.php|1: file:a2billing.php - line:79 - MODE : standard
  a2billing.php|1: file:a2billing.php - line:91 - AGI Request:
  a2billing.php|1: file:a2billing.php - line:92 - Array
  a2billing.php|1: (
  a2billing.php|1:     [agi_request] => a2billing.php
  a2billing.php|1:     [agi_channel] => SIP/14166239005-006baba0
  a2billing.php|1:     [agi_language] => en
  a2billing.php|1:     [agi_type] => SIP
  a2billing.php|1:     [agi_uniqueid] => 1219083890.465
  a2billing.php|1:     [agi_callerid] => 14166239005
  a2billing.php|1:     [agi_calleridname] => user 1
  a2billing.php|1:     [agi_callingpres] => 0
  a2billing.php|1:     [agi_callingani2] => 0
  a2billing.php|1:     [agi_callington] => 0
  a2billing.php|1:     [agi_callingtns] => 0
  a2billing.php|1:     [agi_dnid] => 19057878135
  a2billing.php|1:     [agi_rdnis] => unknown
  a2billing.php|1:     [agi_context] => numberplan-custom-3
  a2billing.php|1:     [agi_extension] => 19057878135
  a2billing.php|1:     [agi_priority] => 2
  a2billing.php|1:     [agi_enhanced] => 0.0
  a2billing.php|1:     [agi_accountcode] =>
  a2billing.php|1: )
  a2billing.php|1: >
  a2billing.php|1: file:Class.A2Billing.php - line:623 -  get_agi_request_parameter = 14166239005 ; SIP/14166239005-006baba0 ; 1219083890.465 ;  ; 19057878135
  a2billing.php|1: file:a2billing.php - line:145 - [NO ANSWER CALL]
  a2billing.php|1: file:Class.A2Billing.php - line:1476 - [CID_ENABLE - CID_CONTROL - CID:14166239005]
  a2billing.php|1: file:Class.A2Billing.php - line:1493 - QUERY = SELECT cc_callerid.cid, cc_callerid.id_cc_card, cc_callerid.activated, cc_card.credit,  cc_card.tariff, cc_card.activated, cc_card.inuse, cc_card.simultaccess,   cc_card.typepaid, cc_card.creditlimit, cc_card.language, cc_card.username, removeinterprefix, cc_card.redial,  enableexpire, UNIX_TIMESTAMP(expirationdate), expiredays, nbused, UNIX_TIMESTAMP(firstusedate), UNIX_TIMESTAMP(cc_card.creationdate),  cc_card.currency, cc_card.lastname, cc_card.firstname, cc_card.email, cc_card.uipass, cc_card.id_campaign, cc_card.id, useralias  FROM cc_callerid  LEFT JOIN cc_card ON cc_callerid.id_cc_card=cc_card.id  LEFT JOIN cc_tariffgroup ON cc_card.tariff=cc_tariffgroup.id  WHERE cc_callerid.cid='14166239005'
  a2billing.php|1:  RESULT : Array
  a2billing.php|1: (
  a2billing.php|1:     [0] => Array
  a2billing.php|1:         (
  a2billing.php|1:             [0] => 14166239005
  a2billing.php|1:             [cid] => 14166239005
  a2billing.php|1:             [1] => 84
  a2billing.php|1:             [id_cc_card] => 84
  a2billing.php|1:             [2] => t
  a2billing.php|1:             [activated] => t
  a2billing.php|1:             [3] => 315.00000
  a2billing.php|1:             [credit] => 315.00000
  a2billing.php|1:             [4] => 4
  a2billing.php|1:             [tariff] => 4
  a2billing.php|1:             [5] => t
  a2billing.php|1:             [6] => 0
  a2billing.php|1:             [inuse] => 0
  a2billing.php|1:             [7] => 0
  a2billing.php|1:             [simultaccess] => 0
  a2billing.php|1:             [8] => 0
  a2billing.php|1:             [typepaid] => 0
  a2billing.php|1:             [9] => 1000
  a2billing.php|1:             [creditlimit] => 1000
  a2billing.php|1:             [10] => en
  a2billing.php|1:             [language] => en
  a2billing.php|1:             [11] => 14166239005
  a2billing.php|1:             [username] => 14166239005
  a2billing.php|1:             [12] => 0
  a2billing.php|1:             [removeinterprefix] => 0
  a2billing.php|1:             [13] =>
  a2billing.php|1:             [redial] =>
  a2billing.php|1:             [14] => 0
  a2billing.php|1:             [enableexpire] => 0
  a2billing.php|1:             [15] => 0
  a2billing.php|1:             [UNIX_TIMESTAMP(expirationdate)] => 0
  a2billing.php|1:             [16] => 0
  a2billing.php|1:             [expiredays] => 0
  a2billing.php|1:             [17] => 2
  a2billing.php|1:             [nbused] => 2
  a2billing.php|1:             [18] => 1218760077
  a2billing.php|1:             [UNIX_TIMESTAMP(firstusedate)] => 1218760077
  a2billing.php|1:             [19] => 1218751021
  a2billing.php|1:             [UNIX_TIMESTAMP(cc_card.creationdate)] => 1218751021
  a2billing.php|1:             [20] => USD
  a2billing.php|1:             [currency] => USD
  a2billing.php|1:             [21] => yahoo
  a2billing.php|1:             [lastname] => yahoo
  a2billing.php|1:             [22] => yahoo 2
  a2billing.php|1:             [firstname] => yahoo 2
  a2billing.php|1:             [23] =>
  a2billing.php|1:             [email] =>
  a2billing.php|1:             [24] => 6661102714
  a2billing.php|1:             [uipass] => 6661102714
  a2billing.php|1:             [25] => -1
  a2billing.php|1:             [id_campaign] => -1
  a2billing.php|1:             [26] => 84
  a2billing.php|1:             [id] => 84
  a2billing.php|1:             [27] => 14166239005
  a2billing.php|1:             [useralias] => 14166239005
  a2billing.php|1:         )
  a2billing.php|1: >
  a2billing.php|1: )
  a2billing.php|1: >
  a2billing.php|1: file:Class.A2Billing.php - line:1755 - [SET CHANNEL(language) en]
  a2billing.php|1: file:Class.A2Billing.php - line:648 - your inuse is 1
  a2billing.php|1: file:Class.A2Billing.php - line:658 - your second inuse is 1
  a2billing.php|1: file:Class.A2Billing.php - line:659 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username='14166239005']
  a2billing.php|1: file:Class.A2Billing.php - line:1437 - [AUTO SetCallerID]
  a2billing.php|1: file:Class.A2Billing.php - line:1443 - [REQUESTED SetCallerID : 14166239005]
  a2billing.php|1: file:Class.A2Billing.php - line:1454 - [EXEC SetCallerID : 14166239005]
  a2billing.php|1: file:a2billing.php - line:172 - [CHANNEL STATUS : 4 = Line is ringing]
  a2billing.php|1: file:a2billing.php - line:173 - [CREDIT : 315.00000][CREDIT MIN_CREDIT_2CALL : 0]
  a2billing.php|1: file:a2billing.php - line:286 - TRUNK - dnid : 19057878135 (1)
  a2billing.php|1: file:Class.A2Billing.php - line:681 - 1 &&  && 11&& 0
  a2billing.php|1: file:Class.A2Billing.php - line:706 - DESTINATION ::> 19057878135
  a2billing.php|1: file:Class.A2Billing.php - line:708 - RULES APPLY ON DESTINATION ::> 19057878135
  a2billing.php|1: file:Class.A2Billing.php - line:746 - OK - RESFINDRATE::> 1
  a2billing.php|1: file:Class.A2Billing.php - line:768 - RES_ALL_CALCULTIMEOUT ::> 1
  a2billing.php|1: file:Class.A2Billing.php - line:786 - TIMEOUT::> 378000  : minutes=6300 - seconds=0
    -- Playing 'prepaid-you-have' (escape_digits=#) (sample_offset 0)
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/6' (language 'en')
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/thousand' (language 'en')
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/3' (language 'en')
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/hundred' (language 'en')
    -- Playing 'prepaid-minutes' (escape_digits=#) (sample_offset 0)
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
  a2billing.php|1: file:Class.RateEngine.php - line:1012 - app_callingcard: Dialing 'SIP/4166238759/19057878135|60|HgiRL(378000000:61000:30000)' with timeout of '378000'.
  a2billing.php|1: >
  a2billing.php|1: file:Class.RateEngine.php - line:1037 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
    -- AGI Script Executing Application: (Dial) Options: (SIP/4166238759/19057878135|60|HgiRL(378000000:61000:30000))
    -- Limit Data for this call:
       > timelimit      = 378000000
       > play_warning   = 61000
       > play_to_caller = yes
       > play_to_callee = no
       > warning_freq   = 30000
       > start_sound    = (null)
       > warning_sound  = timeleft
       > end_sound      = (null)
    -- Called 4166238759/19057878135
  a2billing.php|1: file:Class.RateEngine.php - line:1143 - [USEDRATECARD=0]
  a2billing.php|1: file:Class.RateEngine.php - line:888 - [INSERT INTO cc_call   QUERY = INSERT INTO cc_call (uniqueid,sessionid,username,nasipaddress,starttime,sessiontime, calledstation,  terminatecause, stoptime, calledrate, sessionbill, calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buyrate, buycost, id_card_package_offer) VALUES ('1219083890.465', 'SIP/14166239005-006baba0',  '14166239005', '', ]
  a2billing.php|1: file:Class.RateEngine.php - line:893 - [CURRENT_TIMESTAMP - INTERVAL  QUERY = INSERT INTO cc_call (uniqueid,sessionid,username,nasipaddress,starttime,sessiontime, calledstation,  terminatecause, stoptime, calledrate, sessionbill, calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buyrate, buycost, id_card_package_offer) VALUES ('1219083890.465', 'SIP/14166239005-006baba0',  '14166239005', '', CURRENT_TIMESTAMP - INTERVAL 0 SECOND ]
  a2billing.php|1: file:Class.RateEngine.php - line:900 - [CC_asterisk_stop  QUERY = INSERT INTO cc_call (uniqueid,sessionid,username,nasipaddress,starttime,sessiontime, calledstation,  terminatecause, stoptime, calledrate, sessionbill, calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buyrate, buycost, id_card_package_offer) VALUES ('1219083890.465', 'SIP/14166239005-006baba0',  '14166239005', '', CURRENT_TIMESTAMP - INTERVAL 0 SECOND , '0', '19057878135', 'CANCEL', now(), '0.05', '-0',  '', '', 'toronto gta', '4', '1', '6', '5', '14166239005', '0', '0', '0', '0')]
  a2billing.php|1: file:Class.RateEngine.php - line:903 - [CC_asterisk_stop 1.1: SQL: DONE : result=1]
  a2billing.php|1: file:Class.A2Billing.php - line:1185 - [CURRENCY : USD]
    -- Playing 'prepaid-you-have' (escape_digits=#) (sample_offset 0)
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/3' (language 'en')
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/hundred' (language 'en')
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
    -- <SIP/14166239005-006baba0> Playing 'digits/15' (language 'en')
    -- Playing 'dollars' (escape_digits=#) (sample_offset 0)
[Aug 18 14:24:53] WARNING[9179]: file.c:644 ast_readaudio_callback: Failed to write frame
  a2billing.php|1: file:a2billing.php - line:320 - [a2billing account stop]
  a2billing.php|1: file:Class.A2Billing.php - line:648 - your inuse is 0
  a2billing.php|1: file:Class.A2Billing.php - line:658 - your second inuse is 0
  a2billing.php|1: file:Class.A2Billing.php - line:659 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='14166239005']
    -- AGI Script a2billing.php completed, returning -1
Really destroying SIP dialog 'YWM2MGU4OWY2OThiZTE0OWEyMjM4MzA5NTUxOGRjYzA.' Method: ACK
dsl-67-55-9-194*CLI>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 19, 2008 7:00 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

If you let us see the code, we might be able to see any bugs and help you fix them, and incorporate your changes, if they are of value to the wider community.

In respect of the call being delivered, even if you have hungup, are you sure that Asterisk is actually hanging up when you hangup. Test this outside of A2Billing first.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 19, 2008 2:50 pm 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
Hey,

Thanks for your reply,


Quote:
Test this outside of A2Billing first.



I did tested and it works as expected, I have created another Context that dials outbound anything i dial using a trunk.
If i dial and wait it rings on the other end using that trunk, and if I dial and hang up right away while it is authenticating, the call gets terminated.

i found the same issue when calling between 2 extensions/sip users using the A2B context

if i call an extension and wait the call rings, and if i call and hang up while it is authenticating, the call goes through to the other extension even theough the first extension has already hangup.

Thanks


Top
 Profile  
 
 Post subject: an Idea
PostPosted: Tue Aug 19, 2008 10:50 pm 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
Hey guys... I have an Idea....

at approx line 1040 in file Class.A2Billing.php


Code:
$myres = $agi->exec("Dial $dialstr");


so i wanted to add an if statement.... like

Code:
if(Check_Caller_Channel){
$myres = $agi->exec("Dial $dialstr");
}


and i can't seem to find anything that would let me determine the value of the Check_Caller_Channel in AGI.


is there any variable that can be used to determine the status of the Caller Channel in DeadAGI?

thanks...

za3toor


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 19, 2008 11:29 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
You can use PHPAGI to ask Asterisk the status of the channel.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2008 3:57 am 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
Thanks for your reply,

But i can't seem to get it to work,

i tried
Code:
if($agi->channel_status()){
$myres = $agi->exec("Dial $dialstr");
}


am i missing something?

how can i output the value of $agi->channel_status() to the console VERBOSE debug?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2008 12:46 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
za3toor wrote:
how can i output the value of $agi->channel_status() to the console VERBOSE debug?
See the lines of code before and after that line which you are changing. They show how to log something to the two different log destinations. Also see a few lines further down for examples of how to read and store the values of channel variables (DIALSTATUS and ANSWEREDTIME specifically).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2008 2:10 pm 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
Thanks A Lot... FINALLY i got it to work

it was a simple change....


in the a2billing.conf file

i had
Code:
answer_call = no


so when i changed it to
Code:
answer_call = yes


everything worked again...

no i can hang up after authentication and my trunk wont dial the number unless i stay on the line after authentication....


Top
 Profile  
 
 Post subject: finally FIXED
PostPosted: Thu Aug 28, 2008 11:48 pm 
Offline

Joined: Sat Aug 16, 2008 5:15 am
Posts: 10
hey guys... after a good 3 weeks of hard work... i found the complete workaround it. FINALLY....


in Class.Rateengine.PHP

change from

Code:
      $myres = $agi->exec("Dial $dialstr");


To

Code:
         $agi->wait_for_digit(5000);
         $channelcheck = $agi-> stream_file('was-last-seen', '#');
         
         if($channelcheck["result"]==0){
         $myres = $agi->exec("Dial $dialstr");   
         }



It will play an empty sound file. If played successful, the execution of the DIAL app will run, if not.. it wont dial.

Make sure that you have the above file in the sounds directory.

The file above can be changed to anything you want...I.E. Please wait while we connect your call...

Thanks for everyone who helped

and

Enjoy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2008 9:26 am 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
Code:
as of right now, I have it on DeadAGI, and when a customer makes an outbound call using a trunk, if he hangs up Before the authentication, A2Billing Makes the call and the destination rings, eventhough the Customer has already hungup.


You are authenticating on caller-id!! A2B runs off immediately, so it's hard for you to hangup before authentication.

This is an old feature of A2b so i'm sure it works well. The ringing you hear is probably a fake ring due to "R" on the dial command. Besides, Asterisk will terminate the SIP channels if the caller hangs up.

Correct me if I'm wrong, but isnt A2b already setup so you can use it as a service provider? Look for "WHOLESALE" in this forum.

Added after 1 hours 11 minutes:

Just to add ... DeadAGI will attempt to run even though the inbound has hung up, but this is how DeadAGI was designed to work_ to do housekeeping after an inbound channel has hung up. this depends too on "number_try =".

If you want both legs of the call to terminate immediately then use AGI but you will need to upgrade asterisk to the new Asterisk 1.6.0 beta9. AGI in Asterisk 1.2 and 1.4 does not work properly with A2b.

I've tried it and it works well. Arguable the best version of Asterisk out there!!!!! no problems yet. NO freepbx/trixbox just manual config of the default sample config files in plain linux.

Actually one problem I noticed is that the "stun server feature" still needs work. I dont use it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 
Predictive Dialer


All times are UTC


Who is online

Users browsing this forum: No registered users and 12 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