<div dir="ltr"><div>When i run lua /usr/local/freeswitch/scripts/presence.lua i get an empty return with no errors, can you do lua -v so i can see what version of lua you&#39;re on?<br><br></div>Also which version of FreeSWITCH are you running?<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 30, 2015 at 2:34 PM, Raphael Lechner <span dir="ltr">&lt;<a href="mailto:raphael.lechner@gmail.com" target="_blank">raphael.lechner@gmail.com</a>&gt;</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">still same error. It’s normal that when I call the presence.lua file directly with lua I got the same error?<div><br></div><div>tested with lua5.1 and lua5.2</div><div><div style="margin:0px;font-size:11px;font-family:Menlo">root@rapbx:/usr/local/freeswitch# lua /usr/local/freeswitch/scripts/presence.lua</div><div style="margin:0px;font-size:11px;font-family:Menlo">lua: /usr/local/freeswitch/scripts/presence.lua:1: attempt to index global &#39;Presence&#39; (a nil value)</div><div style="margin:0px;font-size:11px;font-family:Menlo">stack traceback:</div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="white-space:pre-wrap">        </span>/usr/local/freeswitch/scripts/presence.lua:1: in main chunk</div><div style="margin:0px;font-size:11px;font-family:Menlo"><span style="white-space:pre-wrap">        </span>[C]: in ?</div><div style="margin:0px;font-size:11px;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;font-family:Menlo">calling via diaplan</div><div style="margin:0px;font-size:11px;font-family:Menlo"><span class=""><div style="margin:0px;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></span><div style="margin:0px;color:rgb(195,55,32)">2015-03-30 22:25:57.535504 [ERR] mod_lua.cpp:203 /usr/local/freeswitch/scripts/presence.lua:2: attempt to index global &#39;Presence&#39; (a nil value)</div><div style="margin:0px;color:rgb(195,55,32)">stack traceback:</div><div style="margin:0px;color:rgb(195,55,32)"><span style="white-space:pre-wrap">        </span>/usr/local/freeswitch/scripts/presence.lua:2: in main chunk</div><span class=""><div style="margin:0px;color:rgb(195,55,32)"><span style="white-space:pre-wrap">        </span>[C]: in function &#39;dofile&#39;</div><div style="margin:0px;color:rgb(195,55,32)"><span style="white-space:pre-wrap">        </span>/usr/local/freeswitch/scripts/set_presence.lua:1: in main chunk</div><div style="margin:0px;color:rgb(195,55,32)"><br></div></span><div style="margin:0px;color:rgb(195,55,32)">set_presence.lua -&gt; <a href="https://pastebin.freeswitch.org/24060" target="_blank">https://pastebin.freeswitch.org/24060</a></div><div style="margin:0px;color:rgb(195,55,32)">presence.lua -&gt; <a href="https://pastebin.freeswitch.org/24061" target="_blank">https://pastebin.freeswitch.org/24061</a></div><div style="margin:0px;color:rgb(195,55,32)"><br></div><div style="margin:0px;color:rgb(195,55,32)">Thanks</div></div><div><div class="h5"><div><br><div><blockquote type="cite"><div>On 30 Mar 2015, at 22:19, Chris Tunbridge &lt;<a href="mailto:blasterjr@gmail.com" target="_blank">blasterjr@gmail.com</a>&gt; wrote:</div><br><div><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 &quot;/usr/local/freeswitch/scripts/presence.lua&quot;<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">&lt;<a href="mailto:raphael.lechner@gmail.com" target="_blank">raphael.lechner@gmail.com</a>&gt;</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 &#39;Presence&#39; (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 &#39;dofile&#39;</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><div> <div><br><div><blockquote type="cite"><div>On 30 Mar 2015, at 20:43, Chris Tunbridge &lt;<a href="mailto:blasterjr@gmail.com" target="_blank">blasterjr@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr"><div><div><div><div><div>This can be done with lua, what i&#39;ve done is created a small lua set of functions that make presence easy to handle.<br><br></div>here&#39;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 &quot;presence.lua&quot;<br><br></div><div>state = argv[2]<br></div>user = argv[1]<br></div>domain = session:getVariable(&#39;domain&#39;)<br></div><div><div><div><br>local p = Presence:new()<br>p:init{user = user, domain = domain, uuid = &#39;custom_blf_key&#39;};<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>&lt;action application=&quot;lua&quot; data=&quot;set_presence.lua vm_blf_extension confirmed&quot;/&gt;<br><br></div><div>you can swap out the &quot;vm_blf_extension&quot; with anything you want, and as long as the phone &quot;Subscribes&quot; 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">&lt;<a href="mailto:andrew@cassidywebservices.co.uk" target="_blank">andrew@cassidywebservices.co.uk</a>&gt;</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&#39;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">&lt;<a href="mailto:raphael.lechner@gmail.com" target="_blank">raphael.lechner@gmail.com</a>&gt;</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 &lt;<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>&gt; 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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,serif"><u></u> <u></u></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,serif">active or not.<u></u><u></u></p></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><u></u> <u></u></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">On Mon, Mar 30, 2015 at 4:08 PM, Michael Jerris &lt;<a href="mailto:mike@jerris.com" style="color:purple;text-decoration:underline" target="_blank">mike@jerris.com</a>&gt; 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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,serif"><u></u> <u></u></div><div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">On Mon, Mar 30, 2015 at 9:46 AM, Paul Atreides &lt;<a href="mailto:paul.atreides83@googlemail.com" style="color:purple;text-decoration:underline" target="_blank">paul.atreides83@googlemail.com</a>&gt; 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:&#39;Times New Roman&#39;,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:&#39;Times New Roman&#39;,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" target="_blank">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" 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>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>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" 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></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></div></div></div>