Dial Out CDR dst Column loss Number

Hello all,

I want to achieve a function.

Dial a number(example: 9) before Dial Out.

dialplan like below:
[callout]
exten => 9,1,Answer()
exten => 9,n,Playtones(dial)
exten => 9,n,Read(firstdigit,1,30)
exten => 9,n,GoToIf($[${LEN(${firstdigit})} > 0]?true:false)
exten => 9,n(true),StopPlayTones()
exten => 9,n,WaitExten(30)
exten => 9,n,Hangup()
exten => 9,n(false),Hangup()
exten => _9XXXXXXXX,1,Dial(SIP/${firstdigit}${EXTEN})

If I want Dial Out 0912345678
I would to Dial 9 -> listen dialtone -> Dial 0912345678(When I Dial 1 Number, the dialtone stop)
But the CDR dst was incomplete.
like this: 912345678

can tell me how to solve the problem ?
thanks.

The _9… means that the number that is finally dialled can only start with a 9, so it looks right to me.

You have thrown away the 0 when you don’t use the result of the read, but why would you bother with the read if you didn’t want to do that. Use background for a sound that you want to break on the first digit.

Also, CDRs are not designed to cope well with complex dial plans.

On the other hand, trying to emulate the limitations of legacy systems really isn’t a sensible thing to do.