[Freeswitch-users] Variable manipulation in the dialplan

Anthony Minessale anthony.minessale at gmail.com
Tue Jun 23 06:49:23 PDT 2009


play with it from the cli

freeswitch>global_setvar foo=12345
API CALL [global_setvar(foo=12345)] output:
+OK
freeswitch> eval ${foo:2:1}
API CALL [eval(${foo:2:1})] output:
3
freeswitch> eval ${foo:2:3}
API CALL [eval(${foo:2:3})] output:
345
freeswitch> eval ${foo:3:2}
API CALL [eval(${foo:3:2})] output:
45
freeswitch> eval ${foo:-4:4}
API CALL [eval(${foo:-4:4})] output:
2345

On Tue, Jun 23, 2009 at 8:33 AM, Cavalera Claudio Luigi <
Claudio.Cavalera at italtel.it> wrote:

> Hello,
> I once found in the wiki a page explaining how to "substring" a channel
> variable,
> something like
> <@[intra]lanman> 12345 would be 345 if you do ${var:2}
>
> I can't find that page on the wiki anymore, any hint on were it could
> be? :-)
>
> Also do you think it could be useful to extend this functionality with a
> sort of Java indexOf() to extract a specific substring from a variable
> (but without knowing its size like in the example above)?
>
> Regards,
> Claudio
>
>
> Internet Email Confidentiality Footer
>
> -----------------------------------------------------------------------------------------------------
> La presente comunicazione, con le informazioni in essa contenute e ogni
> documento o file allegato, e' rivolta unicamente alla/e persona/e cui e'
> indirizzata ed alle altre da questa autorizzata/e a riceverla. Se non siete
> i destinatari/autorizzati siete avvisati che qualsiasi azione, copia,
> comunicazione, divulgazione o simili basate sul contenuto di tali
> informazioni e' vietata e potrebbe essere contro la legge (art. 616 C.P.,
> D.Lgs n. 196/2003 Codice in materia di protezione dei dati personali). Se
> avete ricevuto questa comunicazione per errore, vi preghiamo di darne
> immediata notizia al mittente e di distruggere il messaggio originale e ogni
> file allegato senza farne copia alcuna o riprodurne in alcun modo il
> contenuto.
>
> This e-mail and its attachments are intended for the addressee(s) only and
> are confidential and/or may contain legally privileged information. If you
> have received this message by mistake or are not one of the addressees
> above, you may take no action based on it, and you may not copy or show it
> to anyone; please reply to this e-mail and point out the error which has
> occurred.
>
> -----------------------------------------------------------------------------------------------------
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090623/237e5c1a/attachment-0002.html 


More information about the FreeSWITCH-users mailing list