[Asterisk-Users] T100P E&M Wink Trunk
Adam Goryachev
mailinglists at websitemanagers.com.au
Tue Apr 13 17:57:01 MST 2004
On Wed, 2004-04-14 at 10:32, Mike Machado wrote:
> I found ways to do substrings. So this is what I did. I changed the zap
> channels to come into a context called 'fixup' and then jump into
> default after doing the parsing and setting of CID.
>
> [fixup]
> exten => _*NXXNXXXXXX*NXXNXXXXXX,1,SetCIDNum(${EXTEN:1:10})
> exten => _*NXXNXXXXXX*NXXNXXXXXX,2,Goto(default|${EXTEN:-10:10}|1)
>
>
> So far things seem to be working well. Does this sound like a good way
> to deal with this problem?
This assumes that the strings are fixed lengths. If you can be sure that
you will always get the same length strings, then it will be 'good
enough'. Personally, I feel the since you are given special characters
to use as a seperator, you might consider using them. Using cut would do
this.
The other option is to use a regular expression, I'm not too sure how
that would work out in asterisk, but the variables and tiki have some
info on this.
Regards,
Adam
More information about the asterisk-users
mailing list