Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 1:34 am
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Help Setting Up Callback
PostPosted: Wed Mar 12, 2008 1:01 am 
Offline

Joined: Tue Mar 11, 2008 11:51 pm
Posts: 4
Hi
I have reviewed most of the post and am still unable to resolve my problem.
I would like to get callback feature of a2billing to work
asterisk 1.4
a2billing 1.3.1
freepbx 2.4

the callback daemon is running
I created a custom context in extensions_custom.conf
[custom-a2billing-cid-callback]
exten => s,1,AGI(a2billing.php|1|cid-callback) ;last parameter is the callback area code
exten => s,n,Hangup

I created a SIP extension 1000 with context 'custom-a2billing-cid-callback'

in a2billing.conf if copy contect [callback] , and paste to bottom of file then change to [custom-a2billing-cid-callback]

call plans are setup ... able to use calling card feature

Problem ... call comes in to DID , information registers and disconnects however no callback is placed.


Additional Info:
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php|1|cid-callback: A2Billing AGI internal configuration:
a2billing.php|1|cid-callback: Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [debug] => 1
a2billing.php|1|cid-callback: [asterisk_version] => 1_4
a2billing.php|1|cid-callback: [answer_call] => 1
a2billing.php|1|cid-callback: [play_audio] => 1
a2billing.php|1|cid-callback: [say_goodbye] =>
a2billing.php|1|cid-callback: [play_menulanguage] =>
a2billing.php|1|cid-callback: [force_language] =>
a2billing.php|1|cid-callback: [intro_prompt] =>
a2billing.php|1|cid-callback: [min_credit_2call] => 0
a2billing.php|1|cid-callback: [min_duration_2bill] => 0
a2billing.php|1|cid-callback: [notenoughcredit_cardnumber] => 1
a2billing.php|1|cid-callback: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php|1|cid-callback: [use_dnid] =>
a2billing.php|1|cid-callback: [no_auth_dnid] => Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [0] => 2400
a2billing.php|1|cid-callback: [1] => 2300
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: [number_try] => 3
a2billing.php|1|cid-callback: [force_callplan_id] =>
a2billing.php|1|cid-callback: [say_balance_after_auth] => 1
a2billing.php|1|cid-callback: [say_balance_after_call] =>
a2billing.php|1|cid-callback: [say_rateinitial] =>
a2billing.php|1|cid-callback: [say_timetocall] => 1
a2billing.php|1|cid-callback: [auto_setcallerid] => 1
a2billing.php|1|cid-callback: [force_callerid] =>
a2billing.php|1|cid-callback: [cid_sanitize] =>
a2billing.php|1|cid-callback: [cid_enable] => 1
a2billing.php|1|cid-callback: [cid_askpincode_ifnot_callerid] => 1
a2billing.php|1|cid-callback: [cid_auto_assign_card_to_cid] => 1
a2billing.php|1|cid-callback: [cid_auto_create_card] =>
a2billing.php|1|cid-callback: [cid_auto_create_card_len] => 10
a2billing.php|1|cid-callback: [cid_auto_create_card_typepaid] => POSTPAY
a2billing.php|1|cid-callback: [cid_auto_create_card_credit] => 0
a2billing.php|1|cid-callback: [cid_auto_create_card_credit_limit] => 1000
a2billing.php|1|cid-callback: [cid_auto_create_card_tariffgroup] => 6
a2billing.php|1|cid-callback: [callerid_authentication_over_cardnumber] =>
a2billing.php|1|cid-callback: [sip_iax_friends] =>
a2billing.php|1|cid-callback: [sip_iax_pstn_direct_call_prefix] => 555
a2billing.php|1|cid-callback: [sip_iax_pstn_direct_call] =>
a2billing.php|1|cid-callback: [ivr_voucher] =>
a2billing.php|1|cid-callback: [ivr_voucher_prefix] => 8
a2billing.php|1|cid-callback: [jump_voucher_if_min_credit] =>
a2billing.php|1|cid-callback: [extracharge_did] => Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [0] =>
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: [extracharge_fee] => Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [0] =>
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: [international_prefixes] => Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [0] => 011
a2billing.php|1|cid-callback: [1] => 00
a2billing.php|1|cid-callback: [2] => 09
a2billing.php|1|cid-callback: [3] => 1
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: [dialcommand_param] => |60|HRgrL(%timeout%:61000:30000)
a2billing.php|1|cid-callback: [dialcommand_param_sipiax_friend] => |60|HRgrL(3600000:61000:30000)
a2billing.php|1|cid-callback: [switchdialcommand] =>
a2billing.php|1|cid-callback: [failover_recursive_limit] => 2
a2billing.php|1|cid-callback: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php|1|cid-callback: [send_reminder] =>
a2billing.php|1|cid-callback: [record_call] =>
a2billing.php|1|cid-callback: [monitor_formatfile] => gsm
a2billing.php|1|cid-callback: [agi_force_currency] =>
a2billing.php|1|cid-callback: [currency_association] => Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [0] => usd:dollars
a2billing.php|1|cid-callback: [1] => mxn:pesos
a2billing.php|1|cid-callback: [2] => eur:euros
a2billing.php|1|cid-callback: [3] => all:credit
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php|1|cid-callback: [file_conf_enter_menulang] => prepaid-menulang2
a2billing.php|1|cid-callback: [callback_bill_1stleg_ifcall_notconnected] => 1
a2billing.php|1|cid-callback: [logger_enable] => 1
a2billing.php|1|cid-callback: [log_file] => /tmp/a2billing.log
a2billing.php|1|cid-callback: [currency_association_internal] => Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [usd] => dollars
a2billing.php|1|cid-callback: [mxn] => pesos
a2billing.php|1|cid-callback: [eur] => euros
a2billing.php|1|cid-callback: [all] => credit
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: [ivr_voucher_prefixe] => 8
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: file:a2billing.php - line:76 - IDCONFIG : 1
a2billing.php|1|cid-callback: file:a2billing.php - line:77 - MODE : cid-callback
a2billing.php|1|cid-callback: file:a2billing.php - line:89 - AGI Request:
a2billing.php|1|cid-callback: file:a2billing.php - line:90 - Array
a2billing.php|1|cid-callback: (
a2billing.php|1|cid-callback: [agi_request] => a2billing.php
a2billing.php|1|cid-callback: [agi_channel] => IAX2/1176575871-6
a2billing.php|1|cid-callback: [agi_language] => en
a2billing.php|1|cid-callback: [agi_type] => IAX2
a2billing.php|1|cid-callback: [agi_uniqueid] => 1205283522.199
a2billing.php|1|cid-callback: [agi_callerid] => 4167478391
a2billing.php|1|cid-callback: [agi_calleridname] => MCKENZIE O
a2billing.php|1|cid-callback: [agi_callingpres] => 0
a2billing.php|1|cid-callback: [agi_callingani2] => 0
a2billing.php|1|cid-callback: [agi_callington] => 0
a2billing.php|1|cid-callback: [agi_callingtns] => 0
a2billing.php|1|cid-callback: [agi_dnid] => unknown
a2billing.php|1|cid-callback: [agi_rdnis] => unknown
a2billing.php|1|cid-callback: [agi_context] => custom-a2billing-cid-callback
a2billing.php|1|cid-callback: [agi_extension] => s
a2billing.php|1|cid-callback: [agi_priority] => 1
a2billing.php|1|cid-callback: [agi_enhanced] => 0.0
a2billing.php|1|cid-callback: [agi_accountcode] =>
a2billing.php|1|cid-callback: )
a2billing.php|1|cid-callback:
a2billing.php|1|cid-callback: file:Class.A2Billing.php - line:616 - get_agi_request_parameter = 4167478391 ; IAX2/1176575871-6 ; 1205283522.199 ; ; s
a2billing.php|1|cid-callback: file:a2billing.php - line:407 - [MODE : CALLERID-CALLBACK - 4167478391]
a2billing.php|1|cid-callback: file:a2billing.php - line:410 - [HANGUP CLI CALLBACK TRIGGER]
== Spawn extension (custom-a2billing-cid-callback, s, 1) exited non-zero on 'IAX2/1176575871-6'
-- Hungup 'IAX2/1176575871-6'
*******************
a2billing log

........
[11/03/2008 20:58:46]:[file:Class.RateEngine.php - line:182]:[CallerID:4167478391]:[CN:10768553218]:[[RATE ENGINE QUERY]
SELECT tariffgroupname, lcrtype, idtariffgroup, cc_tariffgroup_plan.idtariffplan, tariffname, destination,

cc_ratecard.id, dialprefix, destination, buyrate, buyrateinitblock, buyrateincrement, rateinitial, initblock, billingblock,
connectcharge, disconnectcharge, stepchargea, chargea, timechargea, billingblocka, stepchargeb, chargeb,
timechargeb, billingblockb, stepchargec, chargec, timechargec, billingblockc,
cc_tariffplan.id_trunk AS tp_id_trunk, tp_trunk.trunkprefix AS tp_trunk, tp_trunk.providertech AS tp_providertech,
tp_trunk.providerip AS tp_providerip, tp_trunk.removeprefix AS tp_removeprefix,
cc_ratecard.id_trunk AS rc_id_trunk, rt_trunk.trunkprefix AS rc_trunkprefix, rt_trunk.providertech AS rc_providertech,
rt_trunk.providerip AS rc_providerip, rt_trunk.removeprefix AS rc_removeprefix,
musiconhold,
tp_trunk.failover_trunk AS tp_failover_trunk,
rt_trunk.failover_trunk AS rt_failover_trunk,
tp_trunk.addparameter AS tp_addparameter_trunk,
rt_trunk.addparameter AS rt_addparameter_trunk,
id_outbound_cidgroup,
freetimetocall_package_offer, freetimetocall, packagetype, billingtype, startday, id_cc_package_offer


FROM cc_tariffgroup
RIGHT JOIN cc_tariffgroup_plan ON cc_tariffgroup.id=1

INNER JOIN cc_tariffplan ON (cc_tariffplan.id=cc_tariffgroup_plan.idtariffplan )

LEFT JOIN cc_ratecard ON cc_ratecard.idtariffplan=cc_tariffplan.id
LEFT JOIN cc_trunk AS rt_trunk ON cc_ratecard.id_trunk=rt_trunk.id_trunk
LEFT JOIN cc_trunk AS tp_trunk ON cc_tariffplan.id_trunk=tp_trunk.id_trunk
LEFT JOIN cc_package_offer ON cc_package_offer.id=cc_tariffgroup.id_cc_package_offer

WHERE (dialprefix=SUBSTRING('4167478391',1,length(dialprefix)) OR dialprefix='defaultprefix')
AND startingdate<= CURRENT_TIMESTAMP AND (expirationdate > CURRENT_TIMESTAMP OR expirationdate IS NULL OR LENGTH(expirationdate)<5)
AND startdate<= CURRENT_TIMESTAMP AND (stopdate > CURRENT_TIMESTAMP OR stopdate IS NULL OR LENGTH(stopdate)<5)
AND (starttime <= 2698 AND endtime >=2698)
AND idtariffgroup='1'
AND ( dnidprefix=SUBSTRING('4167478391',1,length(dnidprefix)) OR (dnidprefix='all' AND 0 = 0))
AND ( calleridprefix=SUBSTRING('4167478391',1,length(calleridprefix)) OR (calleridprefix='all' AND 0 = 0))
ORDER BY LENGTH(dialprefix) DESC
]
[11/03/2008 20:58:46]:[file:Class.RateEngine.php - line:192]:[CallerID:4167478391]:[CN:10768553218]:[[rate-engine: Count Total result 2]]
[11/03/2008 20:58:46]:[file:Class.RateEngine.php - line:281]:[CallerID:4167478391]:[CN:10768553218]:[[CC_asterisk_rate-engine: Count Total result 1]]
[11/03/2008 20:58:46]:[file:Class.RateEngine.php - line:282]:[CallerID:4167478391]:[CN:10768553218]:[[CC_asterisk_rate-engine: number_trunk 1]]
[11/03/2008 20:58:46]:[file:a2billing.php - line:439]:[CallerID:4167478391]:[CN:10768553218]:[[resfindrate: - 1]]
[11/03/2008 20:58:46]:[file:Class.RateEngine.php - line:295]:[CallerID:4167478391]:[CN:10768553218]:[[CC_RATE_ENGINE_ALL_CALCULTIMEOUT (20.00000)]]
[11/03/2008 20:58:46]:[file:Class.RateEngine.php - line:301]:[CallerID:4167478391]:[CN:10768553218]:[[CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=0 - res_calcultimeout:60000]]
[11/03/2008 20:58:46]:[file:a2billing.php - line:528]:[CallerID:4167478391]:[CN:10768553218]:[[CALLBACK-ALL : INSERT CALLBACK REQUEST IN SPOOL : QUERY= INSERT INTO cc_callback_spool (uniqueid, status, server_ip, num_attempt, channel, exten, context, priority, variable, id_server_group, callback_time, account, callerid, timeout ) VALUES ('87825-nxibc5i', 'PENDING', 'localhost', '0', 'IAX2/6477235190/4167478391', '1000', 'a2billing-callback', '1', 'CALLED=4167478391|MODE=CID|CBID=87825-nxibc5i|LEG=10768553218|RATEINITIAL=0.02|INITBLOCK=60|BILLINGBLOCK=60|
CONNECTCHARGE=0|DISCONNECTCHARGE=0|STEPCHARGEA=0|TIMECHARGEA=0|STEPCHARGEB=0|TIMECHARGEB=0|STEPCHARGEC=0|
TIMECHARGEC=0', '1', ADDDATE( CURRENT_TIMESTAMP, INTERVAL 10 SECOND ), '10768553218', '4167478391', '30000')]]
[11/03/2008 20:58:46]:[file:Class.A2Billing.php - line:649]:[CallerID:4167478391]:[CN:10768553218]:[[CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='10768553218']]
[11/03/2008 20:58:46]:[CallerID:4167478391]:[CN:10768553218]:[[exit]]


Any help would be appreciated.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 7:38 am 
Offline

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

Once you have confirmed that the daemon is working, otherthings to check are.

1. do you have an account with the right caller ID set in it exactly as it is received. In your case - 4167478391

2. Can your trunk dial out using the same digits as the callerID - e.g. 4167478391

3. Do you have a context that looks like this: -

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php|1|callback)
exten => _X.,n,Hangup

The context to use is set in a2billing.conf under callback, and it is set to use "a2billing-callback" for the return dial.

4. Check callbacks in the gui to get an idea of what went wrong.

5. Check the callback section in the gui to confirm that the asterisk manager username and password is identical to that in manager-custom.conf and the same as the manager parameters in a2billing.conf

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 8:28 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Excellent advice once again from Joe.
jroper wrote:
2. Can your trunk dial out using the same digits as the callerID - e.g. 4167478391
This point in particular seems to be the problem. Your debug log shows that the callback will try to dial 'IAX2/6477235190/4167478391'. I'm not sure where the '6477235190' is coming from. Perhaps it's being added by a trunk definition.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 8:31 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
As some one so nicely put it to me on another forum, I was trying to teach him to fish, rather than giving him a fish ;-)

joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 11:54 am 
Offline

Joined: Tue Mar 11, 2008 11:51 pm
Posts: 4
The IAX2/6477235190 is the trunk I use for outbound calls,

GUI shows PENDING with CHANNEL IAX2/6477235190/4167478391

I added [a2billing-callback] to my extensions_custom , and point DID to this,
still no change

number format is correct, if I use the regular a2billing calling card feature it associates the number with the card and don't ask for pin.


Thanks again for both your assistance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 12:01 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I still don't think that's a valid dialstring. Before confronting that problem you need to ensure the callback daemon is running. If it shows PENDING the callback daemon either isn't running, or has some other problem.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 12:17 pm 
Offline

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

Quote:
I added [a2billing-callback] to my extensions_custom , and point DID to this,


No, don't point the DID to it, just ensure that it is present. A2Billing uses this context for the return leg of the call.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 12:25 pm 
Offline

Joined: Tue Mar 11, 2008 11:51 pm
Posts: 4
I run service a2billing-callback-daemon restart ... shows OK for both stopping and starting

a2billing-callback-daemon.log

[2008-03-12 6:09:05]]ERR: Couldn't open connection: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.0"?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 12:32 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
This shows the daemon can't connect to Postgres through the UNIX socket. This is odd as the daemon uses the same database config as the AGI. Does the user you're running the daemon as have access to Postgres?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 1:11 pm 
Offline

Joined: Tue Mar 11, 2008 11:51 pm
Posts: 4
I am actaully running mysql


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 
Auto Dialer Software


All times are UTC


Who is online

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