[Freeswitch-users] playing with sessions in lua

Cavalera Claudio Luigi Claudio.Cavalera at italtel.it
Thu Jan 14 03:23:05 PST 2010


Hi Mike,
in fact i've completed that page with the list of available  session
functions.
 
I've not removed "session:originate" yet, but it would be better if
someone could provide an example in order to write an example in the
wiki.
I've added this valuable example also with the help of rupa
http://wiki.freeswitch.org/wiki/Mod_lua#freeswitch.Session
 
I would like to write something also about api_on_answer to use an api
instead of a dialplan application.
 
BRs,
Claudio


________________________________

	From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Mike
van Lammeren
	Sent: Wednesday, January 13, 2010 8:30 PM
	To: freeswitch-users at lists.freeswitch.org
	Subject: Re: [Freeswitch-users] playing with sessions in lua
	
	
	Hello! 

	Before you remove "session:originate" from the wiki, you should
take a look at this:
	
http://wiki.freeswitch.org/wiki/Mod_lua#How_can_I_find_useful_undocument
ed_Session_Functions.3F

	
<http://wiki.freeswitch.org/wiki/Mod_lua#How_can_I_find_useful_undocumen
ted_Session_Functions.3F> There is, in fact, a function called
"originate".

	Mike van Lammeren


	On Wed, Jan 13, 2010 at 5:22 AM, Cavalera Claudio Luigi
<Claudio.Cavalera at italtel.it> wrote:
	

		Thanks a lot Anthony,
		some comments inline (and please forgive me for my
broken email client).
		 
		
		>>  example1: Consider this simple lua script in which i
create two sessions:
		
		 >>  api = freeswitch.API();
		 >>  api:execute("originate",
"sofia/internal/1001%192.168.1.1 &park");
		 >>  api:execute("originate",
"sofia/internal/1002%192.168.1.1 &park");
		
		 >  capture the output from api:execute the uuid is in
there
		
		
		Thx a lot,
		this was one piece i was missing although it's already
on the wiki here:
	
http://wiki.freeswitch.org/wiki/Mod_lua#For_making_API_calls 
		


		 > because lua calls it freeswitch.bridge
		
		 > session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");
		 > session2 =
freeswitch.Session("sofia/internal/1002%192.168.1.1", session1);
		 > freeswitch.bridge(session1, session2); 
		 
		good to now, there isn't any example of
freeswitch.bridge in the wiki and i would like to add one.
		Where I could find the full api of
		freeswitch.Session( ) ?
		because I've seen this working also without "session1"
in the second line:
		
		session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");
		
		session2 =
freeswitch.Session("sofia/internal/1002%192.168.1.1");
		freeswitch.bridge(session1, session2); 
		
		 also is there any difference between  freeswitch.bridge
and freeswitch.execute(uuid_bridge ...) ?
		 
		 >> example3: yet another possibility
		 >> local session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");
		 >> session1:originate(session2,
"sofia/internal/1002%192.168.1.1", 1000);
		 >> but it does not work either.
		
		 > The above is gibberish try:
		 > local session1 =
freeswitch.Session("sofia/internal/1001%192.168.1.1");
		 > session1:execute("bridge",
"sofia/internal/1002%192.168.1.1"); 
		 
		Okay i will report also this bridge example on the wiki
which was missing.
		But does session:originate make sense in some cases or
not? Otherwise i'm going to remove this line on the wiki
	
http://wiki.freeswitch.org/wiki/Mod_lua#session:originate
<http://wiki.freeswitch.org/wiki/Mod_lua#session:originate> 
		 
		Thanks,
		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
		
		


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100114/4f422f70/attachment-0002.html 


More information about the FreeSWITCH-users mailing list