Hi,
Im using Asterisk 1.6.1. I have a problem with the call timer of Xlite or another softphone when there are dialing out. Before the other end answer, the call timer as already start counting. So channel gets in ANSWERED state and call timer starts as soon as line
starts to ring even if no one really pick up ordinary phone and costumer did not talk to anyone.
That leads to problem that costumers will be billed even if they did
not make a real conversation. How can I avoid that behavior and set asterisk to start counting
after someone really pick up the phone on the other side ?
PS. The cdr is ok but just the behaviour that the call timer start counting before someone really pick up the phone.
Thank´s for your Help.
What is your dialplan; some people redudantly force an Answer before starting the outgoing leg?
I infer that you are using a circuit switched service, but what signalling protocol is it using, and if it is FXO, does the service provide provide answer supervision, what sort, and what are the answer supervision settings in your dahdi configuration.
Hi,
May be by adding, answeronpolarityswitch=yes on your DAHDI configuration will correct your issue.
Thx
[quote=“david55”]What is your dialplan; some people redudantly force an Answer before starting the outgoing leg?
I infer that you are using a circuit switched service, but what signalling protocol is it using, and if it is FXO, does the service provide provide answer supervision, what sort, and what are the answer supervision settings in your dahdi configuration.[/quote]
HI,
Here is my dialplan
[callshop]
exten =>_X.,1,DeadAGI(ns_cs.php,2)
exten =>_X.,2,Hangup
How to use a circuit switched service. I have Zaptel. How to be sure that DAHDI is installed instead of Zaptel
[quote=“esampathj”]Hi,
May be by adding, answeronpolarityswitch=yes on your DAHDI configuration will correct your issue.
Thx[/quote]
I have Changed zapat.conf but it does not worked. What to do next?
Thank s
[quote=“lontcad”][quote=“david55”]What is your dialplan; some people redudantly force an Answer before starting the outgoing leg?
I infer that you are using a circuit switched service, but what signalling protocol is it using, and if it is FXO, does the service provide provide answer supervision, what sort, and what are the answer supervision settings in your dahdi configuration.[/quote]
HI,
Here is my dialplan
[callshop]
exten =>_X.,1,DeadAGI(ns_cs.php,2)
exten =>_X.,2,Hangup
How to use a circuit switched service. I have Zaptel. How to be sure that DAHDI is installed instead of Zaptel[/quote]
Here is my CLI
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
== Parsing ‘/etc/asterisk/asterisk.conf’: == Found
== Parsing ‘/etc/asterisk/extconfig.conf’: == Found
== Binding sipusers to mysql/general/cc_sip_buddies
== Binding sippeers to mysql/general/cc_sip_buddies
== Binding iaxusers to mysql/general/cc_iax_buddies
== Binding iaxpeers to mysql/general/cc_iax_buddies
Connected to Asterisk 1.6.1.6 currently running on vs2052214 (pid = 19931)
Verbosity is at least 11
== Using SIP RTP CoS mark 5
== Using SIP VRTP CoS mark 6
– Executing [004917664082204@callshop:1] DeadAGI(“SIP/005467-b50f4628”, “ns_cs.php,2”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/ns_cs.php
ns_cs.php,2: A2Billing AGI internal configuration:
ns_cs.php,2: Array
ns_cs.php,2: (
ns_cs.php,2: [debug] => 3
ns_cs.php,2: [asterisk_version] => 1_2
ns_cs.php,2: [answer_call] =>
ns_cs.php,2: [play_audio] => 1
ns_cs.php,2: [say_goodbye] =>
ns_cs.php,2: [play_menulanguage] =>
ns_cs.php,2: [force_language] =>
ns_cs.php,2: [intro_prompt] =>
ns_cs.php,2: [min_credit_2call] => 0
ns_cs.php,2: [min_duration_2bill] => 0
ns_cs.php,2: [notenoughcredit_cardnumber] => 1
ns_cs.php,2: [notenoughcredit_assign_newcardnumber_cid] => 1
ns_cs.php,2: [use_dnid] => 1
ns_cs.php,2: [no_auth_dnid] => Array
ns_cs.php,2: (
ns_cs.php,2: [0] => 2400
ns_cs.php,2: [1] => 2300
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: [number_try] => 2
ns_cs.php,2: [force_callplan_id] =>
ns_cs.php,2: [say_balance_after_auth] =>
ns_cs.php,2: [say_balance_after_call] =>
ns_cs.php,2: [say_rateinitial] =>
ns_cs.php,2: [say_timetocall] =>
ns_cs.php,2: [auto_setcallerid] => 1
ns_cs.php,2: [force_callerid] =>
ns_cs.php,2: [cid_sanitize] =>
ns_cs.php,2: [cid_enable] =>
ns_cs.php,2: [cid_askpincode_ifnot_callerid] =>
ns_cs.php,2: [cid_auto_assign_card_to_cid] => 1
ns_cs.php,2: [cid_auto_create_card] =>
ns_cs.php,2: [cid_auto_create_card_len] => 10
ns_cs.php,2: [cid_auto_create_card_typepaid] => POSTPAY
ns_cs.php,2: [cid_auto_create_card_credit] => 0
ns_cs.php,2: [cid_auto_create_card_credit_limit] => 1000
ns_cs.php,2: [cid_auto_create_card_tariffgroup] => 6
ns_cs.php,2: [callerid_authentication_over_cardnumber] =>
ns_cs.php,2: [sip_iax_friends] => 1
ns_cs.php,2: [sip_iax_pstn_direct_call_prefix] => 55
ns_cs.php,2: [sip_iax_pstn_direct_call] => 1
ns_cs.php,2: [ivr_voucher] =>
ns_cs.php,2: [ivr_voucher_prefix] => 8
ns_cs.php,2: [jump_voucher_if_min_credit] =>
ns_cs.php,2: [extracharge_did] => Array
ns_cs.php,2: (
ns_cs.php,2: [0] =>
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: [extracharge_fee] => Array
ns_cs.php,2: (
ns_cs.php,2: [0] =>
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: [dialcommand_param] => |60|HRL(%timeout%:61000:30000)
ns_cs.php,2: [dialcommand_param_sipiax_friend] => |60|HRL(3600000:61000:30000)
ns_cs.php,2: [switchdialcommand] =>
ns_cs.php,2: [failover_recursive_limit] => 2
ns_cs.php,2: [maxtime_tocall_negatif_free_route] => 5400
ns_cs.php,2: [send_reminder] =>
ns_cs.php,2: [record_call] =>
ns_cs.php,2: [monitor_formatfile] => gsm
ns_cs.php,2: [agi_force_currency] =>
ns_cs.php,2: [currency_association] => Array
ns_cs.php,2: (
ns_cs.php,2: [0] => usd:dollars
ns_cs.php,2: [1] => mxn:pesos
ns_cs.php,2: [2] => eur:euros
ns_cs.php,2: [3] => all:credit
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: [file_conf_enter_destination] => prepaid-enter-dest
ns_cs.php,2: [file_conf_enter_menulang] => prepaid-menulang2
ns_cs.php,2: [callback_bill_1stleg_ifcall_notconnected] => 1
ns_cs.php,2: [force_GraceTime] => 1
ns_cs.php,2: [logger_enable] => 1
ns_cs.php,2: [log_file] => /tmp/a2billing.log
ns_cs.php,2: [currency_association_internal] => Array
ns_cs.php,2: (
ns_cs.php,2: [usd] => dollars
ns_cs.php,2: [mxn] => pesos
ns_cs.php,2: [eur] => euros
ns_cs.php,2: [all] => credit
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: [ivr_voucher_prefixe] => 8
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: file:ns_cs.php - line:78 - IDCONFIG : 2
ns_cs.php,2: file:ns_cs.php - line:79 - MODE : standard
ns_cs.php,2: file:ns_cs.php - line:91 - AGI Request:
ns_cs.php,2: file:ns_cs.php - line:92 - Array
ns_cs.php,2: (
ns_cs.php,2: [agi_request] => ns_cs.php
ns_cs.php,2: [agi_context] => callshop
ns_cs.php,2: [agi_extension] => 004917664082204
ns_cs.php,2: [agi_priority] => 1
ns_cs.php,2: [agi_enhanced] => 0.0
ns_cs.php,2: [agi_accountcode] => 005467
ns_cs.php,2: [agi_threadid] => -1260282992
ns_cs.php,2: [agi_arg_1] => 2
ns_cs.php,2: )
ns_cs.php,2:
ns_cs.php,2: file:libns_cs.php - line:750 - get_agi_request_parameter = ; ; ; 005467 ; 004917664082204
ns_cs.php,2: file:ns_cs.php - line:147 - [NO ANSWER CALL]
ns_cs.php,2: file:libns_cs.php - line:1831 - SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, 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_card LEFT JOIN cc_tariffgroup ON tariff=cc_tariffgroup.id WHERE username=‘005467’
ns_cs.php,2: file:libns_cs.php - line:1905 - [SET LANGUAGE() en]
ns_cs.php,2: file:libns_cs.php - line:2140 - step–6
ns_cs.php,2: file:libns_cs.php - line:290 - reseller count : 0
ns_cs.php,2: file:libns_cs.php - line:2145 - step–7
ns_cs.php,2: callingcard_ivr_authenticate_reseller: reseller is0
ns_cs.php,2: file:libns_cs.php - line:783 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username=‘005467’]
ns_cs.php,2: file:libns_cs.php - line:1590 - [AUTO SetCallerID]
ns_cs.php,2: file:ns_cs.php - line:174 - [CHANNEL STATUS : 4 = Line is ringing]
ns_cs.php,2: file:ns_cs.php - line:175 - [CREDIT : 10.00000][CREDIT MIN_CREDIT_2CALL : 0]
ns_cs.php,2: file:ns_cs.php - line:281 - TRUNK - dnid : 004917664082204 (1)
ns_cs.php,2: file:libns_cs.php - line:805 - 1 && && 15&& 0
ns_cs.php,2: file:libns_cs.php - line:830 - DESTINATION ::> 004917664082204
ns_cs.php,2: file:libns_cs.php - line:832 - RULES APPLY ON DESTINATION ::> 4917664082204
ns_cs.php,2: file:libns_cs.php - line:870 - OK - RESFINDRATE::> 1
ns_cs.php,2: file:libns_cs.php - line:892 - RES_ALL_CALCULTIMEOUT ::> 1
ns_cs.php,2: this card reseller is0
ns_cs.php,2: file:libns_cs.php - line:921 - TIMEOUT::> 8207 : minutes=136 - seconds=47
ns_cs.php,2: file:libns_engine_cs.php - line:1126 - app_callingcard: Dialing ‘SIP/77.72.174.132/000004917664082204|60|HRL(8207000:61000:30000)M(callstatusanswered^11453)’ with timeout of ‘8207’.
ns_cs.php,2:
ns_cs.php,2: file:libns_engine_cs.php - line:1151 - app_callingcard: CIDGROUPID=’-1’ OUTBOUND CID SELECTED IS ‘0’.
– AGI Script Executing Application: (Dial) Options: (SIP/77.72.174.132/000004917664082204|60|HRL(8207000:61000:30000)M(callstatusanswered^11453))
– Limit Data for this call:
> timelimit = 8207000
> play_warning = 61000
> play_to_caller = yes
> play_to_callee = no
> warning_freq = 30000
> start_sound =
> warning_sound = timeleft
> end_sound =
== Using SIP RTP CoS mark 5
== Using SIP VRTP CoS mark 6
– Called 77.72.174.132/000004917664082204
– SIP/77.72.174.132-088c2800 is making progress passing it to SIP/005467-b50f4628
> Saved useragent “SJphone/1.60.289a (SJ Labs)” for peer 005467
– SIP/77.72.174.132-088c2800 answered SIP/005467-b50f4628
ns_cs.php,2: file:libns_engine_cs.php - line:1254 - -> dialstatus : ANSWER, answered time is 1
ns_cs.php,2:
ns_cs.php,2: file:libns_engine_cs.php - line:1258 - [USEDRATECARD=0]
ns_cs.php,2: file:libns_engine_cs.php - line:831 - ft2c_package_offer : 0 ; ; 0
ns_cs.php,2: file:libns_engine_cs.php - line:905 - [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,cscalledrate,cssessionbill) VALUES (’’, ‘’, ‘005467’, ‘’, CURRENT_TIMESTAMP - INTERVAL 3 SECOND , ‘3’, ‘4917664082204’, ‘ANSWER’, now(), ‘0.0731’, ‘+0.0037’, ‘’, ‘’, ‘germany - mobile o2’, ‘12’, ‘9’, ‘1339249’, ‘2’, ‘’, ‘0’, ‘0.0731’, ‘0.003655’, ‘0’,‘0.00000’,‘0’)]
ns_cs.php,2: file:libns_engine_cs.php - line:908 - [CC_asterisk_stop 1.1: SQL: DONE : result=1]
ns_cs.php,2: file:libns_engine_cs.php - line:928 - [CC_asterisk_stop 1.2: SQL: UPDATE cc_card SET credit= credit-0.0037 , redial=‘4917664082204’ , lastuse=now(), firstusedate=now(), nbused=nbused+1 WHERE username=‘005467’]
ns_cs.php,2: file:libns_engine_cs.php - line:933 - UPDATE cc_trunk SET secondusedreal = secondusedreal + 3 WHERE id_trunk=‘2’
ns_cs.php,2: file:libns_engine_cs.php - line:937 - UPDATE cc_tariffplan SET secondusedreal = secondusedreal + 3 WHERE id=‘9’
ns_cs.php,2: this card reseller is0
ns_cs.php,2: line:948 - INSERT INTO cc_reseller_call(id_call,resellerid,parent_resellerid,sellrate,sellfee ,buyrate,buycost) values(106036,0,0,‘0.0731’,’+0.0037’,‘0.0731’,‘0.003655’)
ns_cs.php,2: file:ns_cs.php - line:315 - [a2billing account stop]
ns_cs.php,2: file:ns_cs.php - line:174 - [CHANNEL STATUS : = Channel is down and available]
ns_cs.php,2: file:ns_cs.php - line:175 - [CREDIT : 9.9963][CREDIT MIN_CREDIT_2CALL : 0]
ns_cs.php,2: file:ns_cs.php - line:267 - RES sip_iax_pstndirect_call DTMF :
ns_cs.php,2: file:libns_cs.php - line:805 - 0 && && 15&& 1
ns_cs.php,2: file:libns_cs.php - line:812 - RES DTMF :
ns_cs.php,2: file:libns_cs.php - line:830 - DESTINATION ::>
ns_cs.php,2: file:libns_cs.php - line:832 - RULES APPLY ON DESTINATION ::>
ns_cs.php,2: file:libns_cs.php - line:783 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username=‘005467’]
– <SIP/005467-b50f4628>AGI Script ns_cs.php completed, returning -1
vs2052214*CLI>