[asterisk-users] authentication number at the end of the number before calls go through.

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Mar 12 01:34:02 CDT 2008


On Wednesday 12 March 2008 01:22:56 Mark Quitoriano wrote:
> Hi,
>
> I need to create a simple number checking for authorizing the calls. if a
> person dial 91800555121212345 where 12345 is the authorization code. If the
> authorization code is correct the call will go through if not it will play
> something saying wrong authorization code or just hangup.
>
> This my dialplan to get the authorization code
>
> AUTH=12345
>
> exten => _9.,1,Answer()
> exten => _9.,n,Set(CHECKER=${EXTEN:-5})
> exten => _9.,n,GotoIF("$[{CHECKER}" != "${AUTH}"]?die)
>
> exten => _9.,n,Dial(SIP/${EXTEN}/${TRUNK}) <------------- This is my
> problem how can i delete the last 5 digit so the number will be sent to the
> carrier is valid

Dial(SIP/${EXTEN:0:$[${LEN(${EXTEN})} - 5]}/${TRUNK})

-- 
Tilghman



More information about the asterisk-users mailing list