Обновите код, чтобы избежать проблем с CDR и не меняйте EXTEN. Попробуйте использовать следующий вариант кода:
```exten => _X.,1,NoOp(-------MAIN-DIALPLAN---------)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "UNKNOWN"]?unknown)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INVALID"]?invalid)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "UNAVAILABLE"]?unavailable)
same => n,ExecIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INUSE"]?SET(ANONSE_FILE=busy))
same => n,ExecIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "BUSY"]?SET(ANONSE_FILE=busy))
same => n,Dial(PJSIP/${EXTEN},60,A(${ANONSE_FILE}))
;; Unavailable
same => n(unavailable),Noop(---Unavailable---)
same => n,PlayBack(unavailable)
same => n,HangUp()
;; Unknown
same => n(unknown),Noop(----Unknown----)
same => n,PlayBack(unknown)
same => n,HangUp()
;; Invalid
same => n(invalid),Noop(----Invalid----)
same => n,PlayBack(invalid)
same => n,HangUp()```
или так
```exten => _X.,1,NoOp(-------MAIN-DIALPLAN---------)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "UNKNOWN"]?unknown)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INVALID"]?invalid)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "UNAVAILABLE"]?unavailable)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INUSE"]?busy)
same => n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "BUSY"]?busy)
same => n,Dial(PJSIP/${EXTEN},60)
same => n,HangUp()
;; Unavailable
same => n(unavailable),Noop(---Unavailable---)
same => n,PlayBack(unavailable)
same => n,HangUp()
;; Unknown
same => n(unknown),Noop(----Unknown----)
same => n,PlayBack(unknown)
same => n,HangUp()
;; Invalid
same => n(invalid),Noop(----Invalid----)
same => n,PlayBack(invalid)
same => n,HangUp()```