Using the first 11 digits in extensions.conf

Hello

Can you help me with a dialplan which allows the users to dial n number of digits, but only sends first 11 digits out.
Please have a look at what I tried

exten => _1877.,n,GotoIf($[${LEN(${EXTEN})} > 11]? flag1)
exten => _1877.,n(flag1), Set(${EXTEN}= ${EXTEN:0:11})

I am stuck up with what to set. How can I set the first 11 digits

Thanks for any reply

I don’t think you can set EXTEN. Set another variable, or use the expression directly.

You could, of course, use the Goto application.

You mean
exten => _1877.,n,Goto(${EXTEN:0:11})

If you need to ask that question, you haven’t done enough background reading yet. Please study the examples in the configs/extensions.conf.sample file and in Asterisk: The Future of Telephony asteriskdocs.org/

You mean
exten => _1877.,n,Goto(${EXTEN:0:11})


Although it would normally be over-engineering, unless you wanted to achieve a particular CDR result.

GotoIf might kill two birds with one stone.

Although it would normally be over-engineering, unless you wanted to achieve a particular CDR result.

GotoIf might kill two birds with one stone.