<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3640" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>Also after</FONT></SPAN><SPAN
class=070324715-13012010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>api = freeswitch.API();</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>what is the difference between</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>api:execute()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>and</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>api:executeString() ?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>I've found example of both uses in <A
href="http://wiki.freeswitch.org/wiki/Mod_lua">http://wiki.freeswitch.org/wiki/Mod_lua</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=070324715-13012010>and in </SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=070324715-13012010><A
href="http://wiki.freeswitch.org/wiki/Make_API_calls_directly_from_Lua_code">http://wiki.freeswitch.org/wiki/Make_API_calls_directly_from_Lua_code</A></SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=070324715-13012010></SPAN><SPAN
class=070324715-13012010></SPAN></FONT></FONT></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2>Claudio</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=070324715-13012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] <B>On Behalf Of
</B>Cavalera Claudio Luigi<BR><B>Sent:</B> Wednesday, January 13, 2010 11:22
AM<BR><B>To:</B> freeswitch-users@lists.freeswitch.org<BR><B>Subject:</B> Re:
[Freeswitch-users] playing with sessions in lua<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2>Thanks a lot Anthony,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2>some comments inline (and please forgive me for my broken
email client).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010>>> </SPAN>example1: Consider this simple
lua script in which i create two<SPAN class=650574509-13012010><FONT
color=#0000ff> </FONT></SPAN>sessions:<BR><BR><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>>> </FONT> </FONT></SPAN>api =
freeswitch.API();<BR><SPAN class=650574509-13012010><FONT
color=#0000ff> <FONT color=#000000>>>
</FONT> </FONT></SPAN>api:execute("originate",
"sofia/internal/1001%192.168.1.1 &park");<BR><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>>> </FONT> </FONT></SPAN>api:execute("originate",
"sofia/internal/1002%192.168.1.1 &park");<BR><BR><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT color=#000000>>
</FONT> </FONT></SPAN>capture the output from api:execute the uuid is in
there<BR><BR><SPAN class=650574509-13012010><FONT color=#0000ff>Thx a
lot,</FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2>this was one piece i was missing although it's
already on the wiki here:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2><A
href="http://wiki.freeswitch.org/wiki/Mod_lua#For_making_API_calls">http://wiki.freeswitch.org/wiki/Mod_lua#For_making_API_calls</A></FONT></SPAN><SPAN
class=650574509-13012010><FONT face=Arial
size=2> </FONT></SPAN></DIV><FONT color=#0000ff></FONT><FONT
color=#0000ff></FONT>
<DIV dir=ltr align=left><BR><BR><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff><FONT
color=#000000> ></FONT> </FONT></SPAN>because lua calls it
freeswitch.bridge<BR><BR><SPAN class=650574509-13012010><FONT
color=#0000ff> <FONT
color=#000000>></FONT> </FONT></SPAN>session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");<BR><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>></FONT> </FONT></SPAN>session2 =
freeswitch.Session("sofia/internal/1002%192.168.1.1", session1);<BR><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>></FONT> </FONT></SPAN>freeswitch.bridge(session1,
session2);<SPAN class=650574509-13012010><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010></SPAN></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff>good to now, there isn't
any example of freeswitch.bridge in the wiki and i would like to add
one.</FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff>Where I could find the full api
of</FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff>freeswitch.Session( )
?</FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff>because I've seen this
working also without "session1" in the second
line:</FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff>session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");<BR>session2 =
freeswitch.Session("sofia/internal/1002%192.168.1.1");<BR>freeswitch.bridge(session1,
session2);<SPAN
class=650574509-13012010> </SPAN></FONT></SPAN><BR><BR><SPAN
class=650574509-13012010><FONT color=#0000ff> also is there any
difference between freeswitch.bridge
and freeswitch.execute(uuid_bridge ...)
?</FONT></SPAN><BR></FONT></FONT><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010> >> </SPAN>example3: yet another
possibility<BR><SPAN class=650574509-13012010> >> </SPAN>local
session1 = freeswitch.Session("sofia/internal/1001%192.168.1.1");<BR><SPAN
class=650574509-13012010> >> </SPAN>session1:originate(session2,
"sofia/internal/1002%192.168.1.1", 1000);<BR><SPAN
class=650574509-13012010> >> </SPAN>but it does not work
either.<BR><BR></FONT></FONT><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>></FONT> </FONT></SPAN>The above is gibberish
try:<BR><SPAN class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>></FONT> </FONT></SPAN>local session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");<BR><SPAN
class=650574509-13012010><FONT color=#0000ff> <FONT
color=#000000>></FONT> </FONT></SPAN>session1:execute("bridge",
"sofia/internal/1002%192.168.1.1");<SPAN class=650574509-13012010><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=650574509-13012010></SPAN></FONT></FONT><FONT face=Arial><FONT
size=2><SPAN class=650574509-13012010></SPAN></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff size=2><SPAN
class=650574509-13012010>Okay i will report also this bridge example on the
wiki which was missing.</SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff size=2><SPAN
class=650574509-13012010>But does session:originate make sense in some cases
or not? Otherwise i'm going to remove this line on the
wiki</SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff size=2><SPAN
class=650574509-13012010> </SPAN></FONT><A
href="http://wiki.freeswitch.org/wiki/Mod_lua#session:originate"><FONT
size=2>http://wiki.freeswitch.org/wiki/Mod_lua#session:originate</FONT></A></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=650574509-13012010><FONT face=Arial
color=#0000ff size=2>Claudio</FONT></SPAN></DIV>
<P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </P>
<P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><FONT style="FONT-SIZE: 8pt"
face="Courier New"><SPAN lang=EN-GB>Internet Email Confidentiality
Footer</SPAN></FONT></P>
<P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><FONT style="FONT-SIZE: 8pt"
face="Courier New">********************************************************************************************************************************************</FONT></P>
<P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><FONT style="FONT-SIZE: 8pt"
face="Courier New">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. <BR><BR>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.
<BR>********************************************************************************************************************************************</FONT></P></BLOCKQUOTE></BODY></HTML>