<div dir="ltr"><div>try changing the dofile line to the full path to the file, which is probably /usr/local/freeswitch/scripts/presence.lua<br><br></div>so the line would look like this<br><br>dofile "/usr/local/freeswitch/scripts/presence.lua"<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 30, 2015 at 1:20 PM, Raphael Lechner <span dir="ltr"><<a href="mailto:raphael.lechner@gmail.com" target="_blank">raphael.lechner@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 style="word-wrap:break-word">Thank you Chris for sharing your lua files with us.<div><br></div><div>I tried but probably I missed something, because I got that error:</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(175,173,36)">EXECUTE <a href="mailto:sofia/internal/91@192.168.130.12" target="_blank">sofia/internal/91@192.168.130.12</a> lua(set_presence.lua vm_blf_extension confirmed)</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(195,55,32)">2015-03-30 21:13:31.775263 [ERR] mod_lua.cpp:203 scripts/presence.lua:2: attempt to index global 'Presence' (a nil value)</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(195,55,32)">stack traceback:</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(195,55,32)"><span style="white-space:pre-wrap">        </span>scripts/presence.lua:2: in main chunk</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(195,55,32)"><span style="white-space:pre-wrap">        </span>[C]: in function 'dofile'</div><div><span style="color:rgb(195,55,32);font-family:Menlo;font-size:11px;white-space:pre-wrap">        </span><span style="color:rgb(195,55,32);font-family:Menlo;font-size:11px">/usr/local/freeswitch/scripts/set_presence.lua:1: in main chunk</span></div><div><br></div><div>Any idea?</div><div><br></div><div>I have named the files <span style="font-family:Menlo;font-size:11px">set_presence.lua and presence.lua(for the functions) and both are located under scripts.</span></div><div><span style="font-family:Menlo;font-size:11px"><br></span></div><div><span style="font-family:Menlo;font-size:11px">Thanks!</span></div><div><div class="h5"><div> <div><br><div><blockquote type="cite"><div>On 30 Mar 2015, at 20:43, Chris Tunbridge <<a href="mailto:blasterjr@gmail.com" target="_blank">blasterjr@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div><div><div><div><div>This can be done with lua, what i've done is created a small lua set of functions that make presence easy to handle.<br><br></div>here's the presence function file: <a href="http://pastie.org/private/8qfyjbwzsmwm2a4uz7owq" target="_blank">http://pastie.org/private/8qfyjbwzsmwm2a4uz7owq</a><br><br></div>then you setup a lua file (call it scripts/set_presence.lua) that is similar to the following<br><br>dofile "presence.lua"<br><br></div><div>state = argv[2]<br></div>user = argv[1]<br></div>domain = session:getVariable('domain')<br></div><div><div><div><br>local p = Presence:new()<br>p:init{user = user, domain = domain, uuid = 'custom_blf_key'};<br><br></div><div>p:set(state,false);<br><br></div><div>you can execute this by adding the following line into your extension that controls it.<br><br></div><div><action application="lua" data="set_presence.lua vm_blf_extension confirmed"/><br><br></div><div>you can swap out the "vm_blf_extension" with anything you want, and as long as the phone "Subscribes" to this, it will work.<br><br></div><div>You can use early, confirmed, terminated for the statuses.<br></div><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 30, 2015 at 9:37 AM, Andrew Cassidy <span dir="ltr"><<a href="mailto:andrew@cassidywebservices.co.uk" target="_blank">andrew@cassidywebservices.co.uk</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">There's always the SEND_PRESENCE esl event...</div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On 30 March 2015 at 16:25, Raphael Lechner <span dir="ltr"><<a href="mailto:raphael.lechner@gmail.com" target="_blank">raphael.lechner@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 style="word-wrap:break-word">We migrated a customer from asterisk to FreeSWITCH 2 weeks ago and they had also a lamp for indicating if the “today closed” playback or call forward to voicemail is enabled or not.<span><font color="#888888"><div><br></div></font></span><div><span><font color="#888888">Raphael</font></span><div><div><br><div><br><div><blockquote type="cite"><div>On 30 Mar 2015, at 17:17, Sean Devoy <<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>> wrote:</div><br><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I have a customer who had this same request as well as one for a lamp indicating a call parked using “valet parking”. They are worried a parked call could get forgotten. I would love to hear a solution to either/both.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Sean<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"><span> </span><a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" style="color:purple;text-decoration:underline" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a><span> </span>[<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" style="color:purple;text-decoration:underline" target="_blank">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>]<span> </span><b>On Behalf Of<span> </span></b>Paul Atreides<br><b>Sent:</b><span> </span>Monday, March 30, 2015 10:32 AM<br><b>To:</b><span> </span>FreeSWITCH Users Help<br><b>Subject:</b><span> </span>Re: [Freeswitch-users] Changing BLF lamp persistently<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">I want to have an indicator if the company voice mail is active or not.<br><br>At the moment I am calling a number and setting a global variable to activate the central company voice mail.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">But I would like to use the BLF from a dummy account so that the user can see at the phone whether the voice mail is<u></u><u></u></div></div><div><p class="MsoNormal" style="margin:0in 0in 12pt;font-size:12pt;font-family:'Times New Roman',serif">active or not.<u></u><u></u></p></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">On Mon, Mar 30, 2015 at 4:08 PM, Michael Jerris <<a href="mailto:mike@jerris.com" style="color:purple;text-decoration:underline" target="_blank">mike@jerris.com</a>> wrote:<u></u><u></u></div><blockquote style="border-style:none none none solid;border-left-color:rgb(204,204,204);border-left-width:1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Can you describe a bit more exactly what you are trying to accomplish? Presence changes in reaction to events that happen in calls.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">On Mon, Mar 30, 2015 at 9:46 AM, Paul Atreides <<a href="mailto:paul.atreides83@googlemail.com" style="color:purple;text-decoration:underline" target="_blank">paul.atreides83@googlemail.com</a>> wrote:<u></u><u></u></div></div></div><blockquote style="border-style:none none none solid;border-left-color:rgb(204,204,204);border-left-width:1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Hi,<br><br>does someone know how to change the BLF lamp persistently? I found the channel variable<br>presence id but this one will only last as long as the channel is active. Is there a way to change<br>it permerently?<br><br>Thanks for helping.<u></u><u></u></div><div><p class="MsoNormal" style="margin:0in 0in 12pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u></p></div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></blockquote></div><br></div></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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.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></blockquote></div><br></div>