fluidicslave

asterisk patterns

6 posts in this topic

so I am trying to find a pattern that would match a number containing "2920" keep in mind that asterisk will only be able to see the 2920 on some calls but the full number on other calls. so I would like a single pattern that can match both 17776542920 as well as just 2920 is this possible seems like it should be

thanks

0

Share this post


Link to post
Share on other sites

if you can't figure it by yourself contact Black Ratchet or ntheory instead of just waiting and doing nothing, you should be reading about dialplan like in here :

<a href="http://www.voip-info.org/wiki/view/Asteris...alplan+Patterns" target="_blank">http://www.voip-info.org/wiki/view/Asteris...alplan+Patterns</a>

it all depends on where 2920 will be (always at the end or also in the middle of the number and how long numbers do you expect users to dial ?)

here is an example :

_2920! - number itself

_2920. - starting with 2920

_1NXXNXX2920 - ending with 2920

I worry that _.2920 could not work but have no way to confirm or deny

Edited by Havoc
0

Share this post


Link to post
Share on other sites

the problem is a tad more unusual than that it needs to match if the user dials N numbers if that is even possible for 1 pattern but I don't think it is

0

Share this post


Link to post
Share on other sites
the problem is a tad more unusual than that it needs to match if the user dials N numbers if that is even possible for 1 pattern but I don't think it is

writing a dialplan is almost always about more than one pattern and remember that asterisk and ATAs analyze line from top to the bottom so it is important to place them in the correct order

0

Share this post


Link to post
Share on other sites

for your extension just match

.2920.
2920!

that'll return everything containing 2920 and 2920 itself

for matching in the caller id num you could do match 2920 occuring anywhere with:

exten => s,1,GotoIf(${REGEX("(2920)" ${CALLERIDNUM})}?2:3)
exten => s,2,NoOp(do something)

should work. checks ${calleridnum} for the pattern "2920", and jumps to extension 2, otherwise jumps to extension 3.

i dunno if this gives you an idea of what you might need to do. try being more specific with the problem. you haven't explained your situation very well.

Edited by unity
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now