Calls bill during the ringback tone

Hi,
With all suppliers I have the same issue :
All calls are bill during the ring back tone before the connection.
Asterisk version : 1.4.18.1 with MOR 8
Thank you for your help !

Don’t call Answer() (or applications like Playback that implicitly answer).

1.4 is obsolete.

Really ? it is the right reason ?

Answer is what sends the signal that starts PSTN billing. There is a tendency for people to start every dialplan with Answer. That is wrong. It should only be used if you need to have the caller wait longer than the PSTN unasnsered call timeout or you want to send early media on networks that don’t support it (most PSTN operators don’t support it).

However, until you show us your dialplan, we could be completely at cross purposes.

Hi,
On the sip trace we see the line hangup cause : ANSWERED
It is the problem ?
How can I change it ?
Thanks

[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:2301 mor_exec: Res after dialing ‘-1’, hangup cause: ANSWERED
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1259 mor_acct_stop: real duration: 8.965207, duration: 9
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1278 mor_acct_stop: real billsec: 1.640816, latency: 0.000000, real with latency: 1.640816, billsec: 2
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1285 mor_acct_stop: grace time: 0, billsec after grace time: 2
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1297 mor_acct_stop: Seconds to bill: 2
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1561 mor_acct_stop: Provider billsec: 2, price: 0.002200, rate: 0.066000
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1562 mor_acct_stop: User billsec: 2, price: 0.002533, rate: 0.076000
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1752 mor_acct_stop: Prices after convert to default currency: prov_rate: 0.066000, prov_price: 0.002200, user_rate: 0.076000, user_price: 0.002533
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:1826 mor_acct_stop: Users’ balance will be deducted by: 0.002533, and frozen balance by: 2.276200.
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:2423 mor_exec: Hangupcause: ANSWERED, code: 16, mor hangupcause: -1, hangupcause to DB: 16
[Oct 21 17:28:21] NOTICE[2914]: app_mor.c:2441 mor_exec: Application mor started and ended succesfully, with end code: 0!
– Executing [h@mor:1] Set(“SIP/1004-0888cd38”, “MOR_DIALSTATUS=ANSWER”) in new stack
– Executing [h@mor:2] Set(“SIP/1004-0888cd38”, “MOR_RDURATION=”) in new stack
– Executing [h@mor:3] Set(“SIP/1004-0888cd38”, “MOR_RBILLSEC=”) in new stack
– Executing [h@mor:4] Set(“SIP/1004-0888cd38”, “MOR_CLID=“1599” <+33170777981>”) in new stack
– Executing [h@mor:5] Set(“SIP/1004-0888cd38”, “MOR_CHANNEL=SIP/1004-0888cd38”) in new stack
– Executing [h@mor:6] NoOp(“SIP/1004-0888cd38”, “HANGUP CAUSE: 16”) in new stack
[Oct 21 17:28:21] ERROR[2914]: cdr_csv.c:313 csv_log: Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory
[Oct 21 17:28:21] ERROR[2914]: cdr_csv.c:275 writefile: Unable to open file /var/log/asterisk//cdr-csv/10.csv : No such file or directory
[Oct 21 17:28:21] WARNING[2914]: cdr_csv.c:318 csv_log: Unable to write CSV record to account file ‘10’ : No such file or directory
HOME*CLI>

Dialstatus answered means that you actually invoked Dial and the called party answered. You are going to have to provide much more complete details of your dial plan, but, assuming it is simple, my original reply still applies, but needs to be addressed to the downstream system, not to your system.

app_mor.c isn’t part of Asterisk!