VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
markquitoriano at gmai... Guest
|
Posted: Wed Mar 12, 2008 1:22 am Post subject: [asterisk-users] authentication number at the end of the num |
|
|
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
exten => _9.,n(die),Hangup()
btw the number being dialled is not standard. Sometimes its 10 digits
sometimes it 7 digits and most of the time it's 6 digits.
Thanks!
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080312/8f961392/attachment.htm |
|
Back to top |
|
|
markquitoriano at gmai... Guest
|
Posted: Wed Mar 12, 2008 1:29 am Post subject: [asterisk-users] authentication number at the end of the num |
|
|
ok i got the answer
Substrings ${foo:*offset*:*length*}
returns a substring of the string *foo*, beginning at offset *offset* and
returning the next *length* characters.
- If *offset* is negative, it is taken leftwards from the right hand
end of the string.
- If *length* is omitted or is negative, then all the rest of the
string beginning at *offset* is returned.
Examples:
${123456789:1} - returns the string 23456789
${123456789:-4} - returns the string 6789
${123456789:0:3} - returns the string 123
${123456789:2:3} - returns the string 345
${123456789:-4:3} - returns the string 678
Examples of use:
exten => _NXX.,1,SetVar(areacode=${EXTEN:0:3}) - get the first 3
digits of ${EXTEN}
exten => _516XXXXXXX,1,Dial(${EXTEN:3}) - get all but the
first 3 digits of ${EXTEN}
exten => 100,1,SetVar(whichVowel=4)
exten => 100,2,SetVar(foo=AEIOU:${whichVowel}:1) - sets ${foo} to
the single letter 'U'
On Wed, Mar 12, 2008 at 2:22 PM, Mark Quitoriano <markquitoriano at gmail.com>
wrote:
Quote: | 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
exten => _9.,n(die),Hangup()
btw the number being dialled is not standard. Sometimes its 10 digits
sometimes it 7 digits and most of the time it's 6 digits.
Thanks!
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
|
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080312/12a6d05a/attachment.htm |
|
Back to top |
|
|
tilghman at mail.jeffa... Guest
|
Posted: Wed Mar 12, 2008 1:34 am Post subject: [asterisk-users] authentication number at the end of the num |
|
|
On Wednesday 12 March 2008 01:22:56 Mark Quitoriano wrote:
Quote: | 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 |
|
Back to top |
|
|
tilghman at mail.jeffa... Guest
|
Posted: Wed Mar 12, 2008 1:40 am Post subject: [asterisk-users] authentication number at the end of the num |
|
|
On Wednesday 12 March 2008 01:29:16 Mark Quitoriano wrote:
Quote: | ok i got the answer
Substrings ${foo:*offset*:*length*}
returns a substring of the string *foo*, beginning at offset *offset* and
returning the next *length* characters.
- If *offset* is negative, it is taken leftwards from the right hand
end of the string.
- If *length* is omitted or is negative, then all the rest of the
string beginning at *offset* is returned.
|
In 1.4 and 1.6, a negative length reduces the length of the total string:
${EXTEN:0:-5} gives you everything but the last 5 digits.
--
Tilghman |
|
Back to top |
|
|
markquitoriano at gmai... Guest
|
Posted: Wed Mar 12, 2008 1:51 am Post subject: [asterisk-users] authentication number at the end of the num |
|
|
hmmmm... seems like this command doesn't do what i want.
what i wanted to do is remove the 12345 number at 1800555121212345 and send
the rest to the next cmd or operation.
On Wed, Mar 12, 2008 at 2:29 PM, Mark Quitoriano <markquitoriano at gmail.com>
wrote:
Quote: | ok i got the answer
Substrings ${foo:*offset*:*length*}
returns a substring of the string *foo*, beginning at offset *offset* and
returning the next *length* characters.
- If *offset* is negative, it is taken leftwards from the right hand
end of the string.
- If *length* is omitted or is negative, then all the rest of the
string beginning at *offset* is returned.
Examples:
${123456789:1} - returns the string 23456789
${123456789:-4} - returns the string 6789
${123456789:0:3} - returns the string 123
${123456789:2:3} - returns the string 345
${123456789:-4:3} - returns the string 678
Examples of use:
exten => _NXX.,1,SetVar(areacode=${EXTEN:0:3}) - get the first 3 digits of ${EXTEN}
exten => _516XXXXXXX,1,Dial(${EXTEN:3}) - get all but the first 3 digits of ${EXTEN}
exten => 100,1,SetVar(whichVowel=4)
exten => 100,2,SetVar(foo=AEIOU:${whichVowel}:1) - sets ${foo} to the single letter 'U'
On Wed, Mar 12, 2008 at 2:22 PM, Mark Quitoriano <markquitoriano at gmail.com>
wrote:
Quote: | 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
exten => _9.,n(die),Hangup()
btw the number being dialled is not standard. Sometimes its 10 digits
sometimes it 7 digits and most of the time it's 6 digits.
Thanks!
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
|
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
|
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080312/8c4e99c0/attachment-0001.htm |
|
Back to top |
|
|
markquitoriano at gmai... Guest
|
Posted: Wed Mar 12, 2008 2:00 am Post subject: [asterisk-users] authentication number at the end of the num |
|
|
Hi Paul,
Asterisk CMD Authenticate has a prompt to ask for authentication, my client
doesn't want that they want it to behave like avaya put the auth code at the
end of the number.
On Wed, Mar 12, 2008 at 2:47 PM, Paul Hales <pdhales at optusnet.com.au> wrote:
Quote: |
The Authenticate application is pretty good for this sort of thing...
PaulH
On Wed, 2008-03-12 at 14:22 +0800, Mark Quitoriano wrote:
Quote: | 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
exten => _9.,n(die),Hangup()
btw the number being dialled is not standard. Sometimes its 10 digits
sometimes it 7 digits and most of the time it's 6 digits.
Thanks!
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
|
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
|
--
Regards,
Mark Quitoriano
http://asterisk.org.ph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080312/3bff9a03/attachment.htm |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|