<div dir="ltr">Hello Joli,<div><br></div><div><br></div><div>you can define an "startup-script" in autoload_configs/lua.conf.xml that loops forever and consums the conference Events.</div><div><br></div><div>Here an example that listen to an "CUSTOM" Event to "kill" loop.lua scripts</div>
<div>on fs_cli -x "luarun loop.lua stop". In the "--your magic code here loop" you can add your stuff.</div><div><br></div><div><br></div><div><div>-- logging</div><div>LOGLEVEL = "info"</div>
<div>-- progname</div><div>PROGNAME = "loop.lua"</div><div>-- functions </div><div>function logger(message)</div><div> freeswitch.consoleLog(LOGLEVEL,"["..PROGNAME.."] "..message.."\n")</div>
<div>end</div><div>-- main loop</div><div>logger("Starting script and loop forever")</div><div>con = freeswitch.EventConsumer("CUSTOM");</div><div>run = true</div><div>while run do</div><div> for e in (function() return con:pop(1,1000) end) do</div>
<div> -- logger("event\n" .. e:serialize("xml"))</div><div> element = e:getHeader("Event-Subclass") or ""</div><div><br></div><div> if (element == "lua::stop_event") then</div>
<div> action = e:getHeader("Action") or ""</div><div> if (action == "stop") then</div><div> logger("Got stop message, exiting")</div><div> run = false</div>
<div> break</div><div> end</div><div> end</div><div>-- your magic code here in loop </div><div> end</div><div>end</div></div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014/1/24 Joli Martinez <span dir="ltr"><<a href="mailto:mrjoli021@gmail.com" target="_blank">mrjoli021@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">OK I can setup a separate event hook for that, but the problem I am having is that how can I trigger it at the same time I transfer the call. This will be a busy box, so I can I make sure I get the right memberID and not a new memberID or the previous memberID? <div>
<br></div><div>Thanks,</div><div><div class="h5"><div><br></div><div><br><div><div>On Jan 24, 2014, at 11:32 AM, Duvid Rottenberg <<a href="mailto:adrottenberg@gmail.com" target="_blank">adrottenberg@gmail.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">I haven't used LUA but from what I can see, session::execute is a blocking method and there is no non-blocking version. You would probably have to setup a separate event-hook script to capture the conference::maintenance event.<div>
<a href="https://wiki.freeswitch.org/wiki/Mod_lua#Event_Hooks" target="_blank">https://wiki.freeswitch.org/wiki/Mod_lua#Event_Hooks</a><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jan 24, 2014 at 10:35 AM, Joli Martinez <span dir="ltr"><<a href="mailto:mrjoli021@gmail.com" target="_blank">mrjoli021@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello,<div><br></div><div>I was able to figure that out last night. The problem I am having now is that I cant get the memberId until I transfer call to conference. Once I transfer call to conference, my script stops execution until user hangs up. How can I get the memberId right after I transfer to conference?</div>
<div><br></div><div><p>session:execute(<span>"conference"</span>,3001)</p><p>userId = session:getVariable(<span>"conference_member_id"</span>)</p><p>freeswitch.consoleLog(<span>"INFO"</span>, userId.. <span>"</span><span>\n</span><span>"</span>);</p>
</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 24, 2014 at 9:33 AM, Duvid Rottenberg <span dir="ltr"><<a href="mailto:adrottenberg@gmail.com" target="_blank">adrottenberg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can get it from the add-member event. There will be a Member-ID header.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 9:15 PM, Joli Martinez <span dir="ltr"><<a href="mailto:mrjoli021@gmail.com" target="_blank">mrjoli021@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I need to know the userid number of a person joining a conference. Is there a way to get that userid number when a person joins the conference and save it as a variable in Lua?<br>
<br>
Thanks<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><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>
</blockquote></div><br></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><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></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><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>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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></blockquote></div><br></div></div></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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><br clear="all"><div><br></div>-- <br>Mit freundlichen Grüßen<br>*Karsten Horsmann*<br>
</div>