Hi all i relally need your help on this issue blocking my installation.
I'm trying to enable billing for SIP customers that will call trough a sip trunk (italygw) their wanted destination numbers. The call is well routed and parties can talk each other. I can see the agi script is triggered so , basically the call is well managed .
The sad part is that billing of the call is not working . 2 things are worth of noting during a call : - - session time remains always 0 - the agi script return always value 4
I'm using Ubuntu 16.06 + a2billing 2.2 + php7 + asterisk 13
Thanks a lot for your attention
have a nice day
This i an exerpt of a call from customer to 081XXX (took from asterisk cli) :
a2billing.php: file:Class.RateEngine.php - line:1223 - uniqueid:1477155680.36 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse = inuse + 1 WHERE id_trunk = '3'] -- AGI Script Executing Application: (DIAL) Options: (SIP/italygw/081XXX,60,HRrL(12000000:61000:30000)) > Limit Data for this call: > timelimit = 12000000 ms (12000.000 s) > play_warning = 61000 ms (61.000 s) > play_to_caller = yes > play_to_callee = no > warning_freq = 30000 ms (30.000 s) > start_sound = > warning_sound = timeleft > end_sound = == Using SIP RTP CoS mark 5 -- Called SIP/italygw/081204 -- SIP/italygw-00000019 answered SIP/3980726XXX-00000018 -- Channel SIP/3980726XXX-00000018 joined 'simple_bridge' basic-bridge <4b0b8837-3e1a-40c8-b67b-7805ab97fe44> -- Channel SIP/italygw-00000019 joined 'simple_bridge' basic-bridge <4b0b8837-3e1a-40c8-b67b-7805ab97fe44> > 0x7f546c014100 -- Probation passed - setting RTP source address to XXX.74.XXX.117:5004 > 0x7f5460193ca0 -- Probation passed - setting RTP source address to XXX.74.XXX.117:16490 -- Channel SIP/italygw-00000019 left 'simple_bridge' basic-bridge <4b0b8837-3e1a-40c8-b67b-7805ab97fe44> -- Channel SIP/3980726XXX-00000018 left 'simple_bridge' basic-bridge <4b0b8837-3e1a-40c8-b67b-7805ab97fe44> a2billing.php: file:Class.RateEngine.php - line:1336 - uniqueid:1477155680.36 - DIAL SIP/italygw/081XXX|60|HRrL(12000000:61000:30000) a2billing.php: file:Class.RateEngine.php - line:1223 - uniqueid:1477155680.36 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse = inuse - 1 WHERE id_trunk = '3'] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.RateEngine.php - line:1490 - uniqueid:1477155680.36 - [USEDRATECARD=0] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.RateEngine.php - line:1038 - uniqueid:1477155680.36 - :[sessiontime: - id_cc_package_offer:-1 - package2apply:] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.RateEngine.php - line:1114 - uniqueid:1477155680.36 - [CC_RATE_ENGINE_UPDATESYSTEM: usedratecard K=0 - (sessiontime=0 :: dialstatus= :: buycost=0 :: cost= : signe_cc_call=-: signe=+)] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.RateEngine.php - line:1174 - uniqueid:1477155680.36 - [CC_asterisk_stop : SQL: DONE : result=1] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.RateEngine.php - line:1175 - uniqueid:1477155680.36 - [CC_asterisk_stop : SQL: INSERT INTO cc_call (uniqueid, sessionid, card_id, nasipaddress, starttime, sessiontime, real_sessiontime, calledstation, terminatecauseid, stoptime, sessionbill, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, destination , a2b_custom1, a2b_custom2) VALUES ('1477155680.36', 'SIP/3980726483-00000018', '2', '', SUBDATE(CURRENT_TIMESTAMP, INTERVAL 0 SECOND) , '0', NULL, '081204', 0, now() , '-0', '1', '1', '2', '3', '3980726XXX', '0', '0', NULL, '081XXX', '0' , '', '')] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:a2billing.php - line:578 - uniqueid:1477155680.36 - [a2billing account stop] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.A2Billing.php - line:787 - uniqueid:1477155680.36 - [CARD STATUS UPDATE] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe a2billing.php: file:Class.A2Billing.php - line:796 - uniqueid:1477155680.36 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse = inuse - 1, credit = credit + 0.25 WHERE username = '3980726XXX'] [Oct 22 20:01:34] ERROR[7171][C-000005dc]: utils.c:1402 ast_carefulwrite: write() returned error: Broken pipe -- <SIP/3980726XXX-00000018>AGI Script a2billing.php completed, returning 4 == Spawn extension (a2billing, 081204, 2) exited non-zero on 'SIP/3980726XXX-00000018'
|