Hi,
I have the most stupid problem in my dialplan.
I need to do something as trivial as splitting a string, with a semicolon as
separator.
I was thinking the 'CUT' function would be perfect for this.
But the problem is the semicolon. In the dialplan it is always understood as
a separator for parameters.
What I have tried so far:
[macro-eva-on-sip]
exten => s,1,NoOp(${CALLERID(name)})
exten => s,n,NoOp(${CALLERID(num)})
exten => s,n,Set(v=${CALLERID(num)})
exten => s,n,Set(sep=";")
exten => s,n,NoOp(${CUT(v,sep,1)})
exten => s,n,Dial(SIP/evavox/${MACRO_EXTEN})
exten => s,n,Hangup()
I'm convinced there's a very simple solution to this, but I don't
see it.
Anybody?!
Grtz,
Koen
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20061130/b7bc28ad/attachment.htm
Peter Lindquist
2006-Nov-30 01:59 UTC
[asterisk-users] Cut function on semicolon separator
Hi Koen,
Try:
exten => s,n,NoOp(CUT(${v},${sep},1))
Cheers
Koen Van Impe wrote:> Hi,
>
> I have the most stupid problem in my dialplan.
> I need to do something as trivial as splitting a string, with a
> semicolon as separator.
> I was thinking the 'CUT' function would be perfect for this.
> But the problem is the semicolon. In the dialplan it is always
> understood as a separator for parameters.
>
> What I have tried so far:
>
> [macro-eva-on-sip]
> exten => s,1,NoOp(${CALLERID(name)})
> exten => s,n,NoOp(${CALLERID(num)})
> exten => s,n,Set(v=${CALLERID(num)})
> exten => s,n,Set(sep=";")
> exten => s,n,NoOp(${CUT(v,sep,1)})
> exten => s,n,Dial(SIP/evavox/${MACRO_EXTEN})
> exten => s,n,Hangup()
>
> I'm convinced there's a very simple solution to this, but I
don't see it.
> Anybody?!
>
> Grtz,
>
> Koen
> ------------------------------------------------------------------------
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20061130/fe8370a2/attachment.htm