Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Variable manipulation in the dialplan


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
Claudio.Cavalera at it...
Guest





PostPosted: Tue Jun 23, 2009 8:34 am    Post subject: [Freeswitch-users] Variable manipulation in the dialplan Reply with quote

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? Smile

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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
anthony.minessale at g...
Guest





PostPosted: Tue Jun 23, 2009 8:50 am    Post subject: [Freeswitch-users] Variable manipulation in the dialplan Reply with quote

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@italtel.it (Claudio.Cavalera@italtel.it)> wrote:
Quote:
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? Smile

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@lists.freeswitch.org (Freeswitch-users@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@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
Claudio.Cavalera at it...
Guest





PostPosted: Wed Jun 24, 2009 5:44 am    Post subject: [Freeswitch-users] Variable manipulation in the dialplan Reply with quote

Quote:
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Anthony Minessale

Quote:
play with it from the cli

Quote:
freeswitch> eval ${foo:-4:4}
API CALL [eval(${foo:-4:4})] output:
2345


Thanks anthm!
This way to test directly on the cli is really nice, I didn't know of
it.
If I've understood well, a negative number as first parameter will make
the second parameter useless/meaningless.
Besides, the second parameter is useless/meaningless if set equal to 0
or lesser than 0.

I still think that we could benefit from more power here in the
dialplan,
if I have
12346578@domain.org
I'm not able to grab out the number (of which I don't know the length)
even if I know that domain.org is always the same length.
I've looked for something useful in
http://apr.apache.org/docs/apr/1.3/apr__strings_8h.html
and switch_apr.c
but I think I'll end up calling an external script. Smile

Best Regars,
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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
saeedahmad1981 at gmai...
Guest





PostPosted: Wed Jun 24, 2009 5:57 am    Post subject: [Freeswitch-users] Variable manipulation in the dialplan Reply with quote

Can we also test dialplan using CLI, like "dial" in asterisk?






-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Cavalera
Claudio Luigi
Sent: Wednesday, June 24, 2009 12:36 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Variable manipulation in the dialplan

Quote:
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Anthony Minessale

Quote:
play with it from the cli

Quote:
freeswitch> eval ${foo:-4:4}
API CALL [eval(${foo:-4:4})] output:
2345


Thanks anthm!
This way to test directly on the cli is really nice, I didn't know of
it.
If I've understood well, a negative number as first parameter will make
the second parameter useless/meaningless.
Besides, the second parameter is useless/meaningless if set equal to 0
or lesser than 0.

I still think that we could benefit from more power here in the
dialplan,
if I have
12346578@domain.org
I'm not able to grab out the number (of which I don't know the length)
even if I know that domain.org is always the same length.
I've looked for something useful in
http://apr.apache.org/docs/apr/1.3/apr__strings_8h.html
and switch_apr.c
but I think I'll end up calling an external script. Smile

Best Regars,
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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
jason at jasonjgw.net
Guest





PostPosted: Wed Jun 24, 2009 6:07 am    Post subject: [Freeswitch-users] Variable manipulation in the dialplan Reply with quote

Saeed Ahmed <saeedahmad1981@gmail.com> wrote:
Quote:
Can we also test dialplan using CLI, like "dial" in asterisk?

Have a look at the originate command.


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

VoiceMeUp - Corporate & Wholesale VoIP Services