Now you are talking about ESL? Which scenarios are suitable for ESL? When would be nice to use ESL and when LUA?<div><br></div><div>Regards<br><br><div class="gmail_quote">2011/4/28 João Mesquita <span dir="ltr">&lt;<a href="mailto:jmesquita@freeswitch.org">jmesquita@freeswitch.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hey Ken! Even tho spanish is not my native language, I live in Argentina, so I can pretty much get away with it. Any help on portuguese or spanish that this list may require, I am available to help.<br>
<br>Fernando,<br><br>
La manera mas rapida es algo relativo. Depende mucho de con que te sentis mas comodo. Me gusta mucho ESL y también me gusta mucho xml_curl. odbc_query nunca lo use, pero parece sencillo.<br><br>A mi me encanta Python tambien y suelo usarlo con ESL. Uso bastante también Pylons pero ya trabaje con Django tambien. Sea como for, lo que vos necesitás si vas a usar ESL es un outbound socket. Te recomiendo que empiezes leyendo esta pagina para que te vayas enterando de que se trata: <a href="http://wiki.freeswitch.org/wiki/Event_Socket_Outbound" target="_blank">http://wiki.freeswitch.org/wiki/Event_Socket_Outbound</a><br>

<br>Cuando termines de leer, yo te puedo tirar unos &quot;tips&quot; de como implementar lo que necesitás en Python sin demasiados problemas.<br><br>Saludos,<br clear="all"><font color="#888888">João Mesquita</font><div>
<div></div><div class="h5"><br><br>
<br><br><div class="gmail_quote">2011/4/28 FERNANDO VILLARROEL <span dir="ltr">&lt;<a href="mailto:fvillarroel@yahoo.com" target="_blank">fvillarroel@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Hola João.<br><br>Si programo, mi lenguaje preferido es Python yo vengo de Asterisk donde usaba Python para programar AGI.<br>

<br>En web algo me manejo tambien por lo que creo no tendre problemas, le he metido mano a Django y Web2py.<br><br>Si no fuera mucho pedirte me gustaria aprender un poco de todo asi decido luego como lo voy haciendo, ESL me llama la atención ya que me gustaria comenzar a aprehender a usarlo, ya sabes capturar eventos de FS, enviar eventos a FS, etc.<br>

<br>Pero bueno por ahora si me ayudas a resolver mi problema usando lo mas sencillo te lo agradeceria mucho.<br><br>El problema es que debo crear una tabla con aproximadamente 4500 breackouts de numeros moviles, entonces si me entra una llamada con destination_number = 12345678 debo consultar si los 3 primeros dijitos estan presentes en la tabla si es si entonces reenvio la llamada a un
 Gateway y si no entonces la declino para que mi cliente la enrute por otro proveedor.<br><br>Saludos.<br><br><br><br><br>--- On <b>Wed, 4/27/11, João Mesquita <i>&lt;<a href="mailto:jmesquita@freeswitch.org" target="_blank">jmesquita@freeswitch.org</a>&gt;</i></b> wrote:<br>

<blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px"><br>From: João Mesquita &lt;<a href="mailto:jmesquita@freeswitch.org" target="_blank">jmesquita@freeswitch.org</a>&gt;<br>Subject: Re: [Freeswitch-users] Script para chequear un numero de destino<br>

To: &quot;FreeSWITCH Users Help&quot; &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>Date: Wednesday, April 27, 2011, 11:36 PM<div><div></div><div>

<br><br><div>Hola Fernando,<br><br>Yo mas o menos hablo español así que trato de darte una mano. Tenés muchas opciones. mod_easyroute como lo menciona Ken es una, ESL (event_socket) es otra, xml_curl es otra y uno de los &quot;bindings&quot; como lua, python, perl, etc... es otra.<br>


<br>Lo que tenemos que encontrar es lo que a vos te es mas comodo. Programás? En que lenguaje? Si no programás, mod_easyroute seguramente será lo mejor. ESL es lo más complicadito de todos ya que el dialplan entero lo tenes que programar desde tu socket y tirar los comandos hacia freeswitch en un orden especifico. XML_CURL es muy facil si sabes desarrollar en web.<br>


<br>Enfim, espero noticias tuyas para que te pueda ayudar con un determinado camino.<br><br>Saludos,<br><br clear="all">João Mesquita<br><br>
<br><br><div>2011/4/27 Ken Rice <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=krice@freeswitch.org" target="_blank">krice@freeswitch.org</a>&gt;</span><br><blockquote style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">






<div>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">Routing a call if a number exists in a database...  Hmmm sounds suspiciously a lot like mod_easyroute<br><font color="#888888">
<br>
k</font><div><div></div><div><br>
<br>
<br>
On 4/27/11 8:24 PM, &quot;Roger Castaldo&quot; &lt;<a rel="nofollow" href="http://roger.castaldo@gmail.com" target="_blank">roger.castaldo@gmail.com</a>&gt; wrote:<br>
<br>
</div></div></span></font><blockquote><div><div></div><div><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">I ran your email through google translate and from what I can tell you want freeswitch to route a call if the number exists in database X.  That being said, the event socket is not the way to go, look at doing it via a lua script call from the dial plan, then you can have the lua query the database, if it exists, use the api to route the call, or set a flag for the dial plan, otherwise it can hang up, or play a message and hang up which ends the call and stops processing in your dial plan.<br>



<br>
2011/4/27 FERNANDO VILLARROEL &lt;<a rel="nofollow" href="http://fvillarroel@yahoo.com" target="_blank">fvillarroel@yahoo.com</a>&gt;<br>
</span></font><blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">Hola a todos.<br>
<br>
Voy a recibir trafico desde un Gateway A que mi FS enrutará hacia un Gateway B.<br>
<br>
Hasta ahy todo bien, el asunto es que antes de enrutar la llamada hacia el gateway B de alguna manera debo consultar el numero de destino en una base de datos si es así entonces se enruta la llamada en caso contrario la llamda la debo declinar de mi lado para que el Gateway A pueda enrutar esa llamada por otro proveedor distinto de mi.<br>



<br>
Entonces lo que pienso hacer es un Script usando event_socket para que haga la consulta en la base de datos, entonces si el numero de destino esta la base de datos se enruta la llamada en caso contrario la declino para que la llamada continue por otro proveedor.<br>



<br>
Mi tema es que no se me ocurre como hacer esto, imagino que  en el dialplan para que dependiendo de la existencia del numero de destino en la base de datos haga una llamada o en caso contrario haga otra cosa.<br>
<br>
Agredecere aguna idea o sugerencia sobre como resolver este problema.<br>
<br>
Con Asterisk usaria DeadAgi para pasarle el control a un script que consulte con la base de datos y me retorne true si puedo llamar o false en caso contario. Y digo DeadAgi ya que el control lo toma el script, ya que si usara Agi el control sigue en Asterisk independiente de lo que este haciendo el Script.<br>



<br>
Aprovecho entonces de consultar con event_socket el control pasa al script o el dialplan continua ejecutandose.<br>
<br>
Agradecere cualquier idea o sugerencia.<br>
<br>
Saludos<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow" href="http://FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</span></font></blockquote></div></div><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt"><br>
<br>
<hr align="CENTER" size="3" width="95%"></span></font><div><font size="2"><font face="Consolas, Courier New, Courier"><span style="font-size:10pt">_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow" href="http://FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</span></font></font></div></blockquote>
</div>


<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow" href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div><br></div></div>-----Inline Attachment Follows-----<div><br><br><div>_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>

<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>

<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div></div></blockquote></td></tr></tbody></table><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>