Auto-dial unanswered calls marked as Completed in CDR

We have added a “missed call/call me back” function, whereby any call that gets entered into the CDR that does not have a status of Completed, will be added to the CallBack table, where another service will monitor. When the Callback time is reached, a auto-dial file is created, first connecting to an agent, then contacting the client.

The problem is that, if the client does not answer, the CDR gets updated that the call was Completed (and the Callback gets auto-removed from the Callback table).

Why does Asterisk see an answered call as completed?

Thanks!

Example of .call file:

Channel: Local/TEST@CALLBACK
CallerID: "TEST_CALLBACK" <0123456789>
MaxRetries: 0
RetryTime: 300
WaitTime: 45
Application: Dial
Data: PJSIP/0123456789@TEST
AlwaysDelete: False
Archive: True

Callback Extension

[CALLBACK]
exten=>TEST,1,NoOp(Auto callback)
same=>n,GoSub(PerformCallBack,s,1(TEST,Test Line,TESTOverflow))

[PerformCallBack]
include=>from-internal
exten=>s,1,NoOp(Caller ID: ${CALLERID}) ;print the caller Id to console.
same=>n,MixMonitor(${UNIQUEID}.wav,ab)
same=>n,Set(CALLERID(name)=${CALLERID(name)} ${ARG2})
same=>n(queue),Queue(${ARG1},T,,,20)
same=>n,Queue(${ARG3},T,,,20)
same=>n,StopMixMonitor()
same=>n,HangUp()

at your call file, you use a “Local” channel.

how about using a “PJSIP” or “SIP” channel?

We use Local channel (because it works and I don’t know any better).

I will test with PJSIP and see what happens.

Thanks