@david551, thanks for listening.
But it does seem to be a problem with Asterisk, according to other unanswered topics:
What I tried to explain were two scenarios in which I had a problem, one using Answer() and the other without using it.
Using Answer() in a simple dial plan, like the one below, makes the “duration” and “billsec” fields of the CDR file stay the same time. I need the “billsec” time to be counted after answering the call, after the Dial() is able to connect the caller with the called number.
extensions.conf
[test]
exten => _ZXXX, 1, Answer
same => n, Dial (PJSIP / $ {EXTEN})
same => n, Hangup
The second scenario is when I stop using Answer () for a dial plan that uses “Queue”, where the caller has the possibility to dial a single digit to get out of the queue and go to another context. What does not work, because by not using Answer () the caller is unable to issue DTMF, in the example below, by dialing 1 before being answered by a member of the queue, the caller would withdraw from the queue and the call would be handled by the “queue-out” context.
extensions.conf
[test]
exten => 8000, Queue (support)
same => n, Hangup
[queue-out]
exten => 1, 1, NoOp (You left the queue to do something else)
...
queues.conf
[support]
musicclass = default
context = queue-out
strategy = rrmemory
joinempty = yes
leavewhenempty = no
ringinuse = no