Strip a number


Hi all!

Alright, I’ve got this issue with one of my gateway and was wondering if one of you guys could give me a hand with it…

My problem resides in the Digits Map. When I press *98 to access my mailbox, the gateway automatically refer to my *98 programmed feature in asterisk (which is the mailbox), but I don’t know why (I’m still troubleshooting this issue with the gateways tech), the gateway passes the last digit as well… That means I press *98, it goes in my mailbox asking for my password, but without pressing anything, it takes the 8 (which is the last number in *98 ) automatically and says, password is incorrect, please enter your password. (taking the 8 as the password… as I can see in CLI)

This problem is for all the * features I programmed in Asterisk. It look like the gateway is passing the last digit twice…

Now I’m wondering if there’s a work-around that I can do with asterisk to remove that last digit. I’m pretty sure there’s a way to strip the last reveceived digits but don’t remember how…

Does it ring a bell for someone?


you’d want to do something like the inverse of ${EXTEN:1}…

let’s see, if we did SET(STRLENGTH=$[${LEN(${EXTEN})}-1]) would give us the length of the string.

so if we did ${EXTEN:0:${STRLENGTH}} as the variable being passed to the VM app, that should do it.

i may be totally wrong, i don’t do much with * variables…


Check your VOIP phone or adapter.

It may have service codes of it’s own, and dialing them may be confusing the phone about what to send to the Asterisk box.

Sipura phones/ATAs are notorious for having them.