this is typically done by opening a new feature issue under FSCORE at <a href="http://jira.freeswitch.org">http://jira.freeswitch.org</a> with a diff generated from an up-to-date git checkout.<div><br></div><div><br><br><div class="gmail_quote">
On Fri, May 21, 2010 at 10:58 AM, David Swardstrom <span dir="ltr">&lt;<a href="mailto:dswardstrom@remotelink.com">dswardstrom@remotelink.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am developing FreeSwitch Javascript capability to emulate some functionality that is currently provided by a Dialogic based proprietary system running on Microsoft Windows, originally using ISDN interfaces and then ported to Sip based VoIP capability.<br>

This system uses external post-processing code that processes &quot;event&quot; type data for billing and other purposes and I need to provide equivalent event data.<br>
As part of this effort, I need a counter that is guarantied unique when there is a possibility that multiple calls may access the counter. The proprietary code, this unique counter is provided by using InterlockedIncrement().<br>

<br>
Looking at the available JavaScript code, it appears that using getGlobalVariable() and setGlobalVariable() as described in the SetGlobalVar Wiki page would allow me to do this as long as I was willing to allow holes in the count.<br>

<br>
However, I decided to look at the code to see exactly what was being done to implement this. I found was that there was no code at all to implement the 3rd optional parameter.<br>
<br>
I would like to implement this capability but extend the capability to truly provide a unique counter. To accomplish this, support must be provided by the switch core.<br>
<br>
I would like to provide a new routine into switch_core.c:<br>
&lt;Following is the text for switch_core.h&gt;<br>
/*!<br>
  \brief Conditionally add a global variable to the core<br>
  \param varname the name of the variable<br>
  \param value the value of the variable<br>
  \param val2 the value of the variable to verify against<br>
  \     If the global did not exist and val2==&quot;&quot;, add global with value, return true<br>
  \     If the global exists with the value of val2, replace it, return true<br>
  \     If the global exists with a value other than val2, return false<br>
*/<br>
SWITCH_DECLARE(switch_bool_t) switch_core_set_var_conditional(_In_z_ const char *varname, _In_opt_z_ const char *value, _In_opt_z_ const char *val2);<br>
<br>
Then the code in mod_spidermonkey.c can be modified to use this new switch core capability.<br>
<br>
Note: I have implemented this in my local version and have tested it.<br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div>