<div dir="ltr">var event is switch_event_t, there are many iteration examples in the code.<br><br>It&#39;s just a linked list.<br><br>for (h = var_event-&gt;headers; h; h = h-&gt;next) {<br>&nbsp;&nbsp; printf(&quot;%s=%s\n&quot;, h-&gt;name, h-&gt;value);<br>
}<br><br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 1:00 AM, Simon Capper <span dir="ltr">&lt;<a href="mailto:scapper@ooma.com">scapper@ooma.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a way to iterate var_event or do I need to add one?<br>
<br>
<br>
Simon<br>
<br>
<br>
On 10/2/08 11:52 AM, &quot;Anthony Minessale&quot; &lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;<br>
<div><div></div><div class="Wj3C7c">wrote:<br>
<br>
&gt; use a hash to store the vars.<br>
&gt; we have a hashtable you can see being used in zap_io.c<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Oct 2, 2008 at 1:21 PM, Simon Capper &lt;<a href="mailto:scapper@ooma.com">scapper@ooma.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; I see how the var_event mechanism works.<br>
&gt;&gt;<br>
&gt;&gt; Are you ok with new openzap functions to set/get the vars on the channel,<br>
&gt;&gt; called from outgoing_channel().<br>
&gt;&gt;<br>
&gt;&gt; zap_channel_add_var(zap_channel_t *zchan, char *var_name, const char<br>
&gt;&gt; *value)<br>
&gt;&gt;<br>
&gt;&gt; const char * zap_channel_get_var(zap_channel_t *zchan, char *var_name)<br>
&gt;&gt;<br>
&gt;&gt; And new fields in zap_channel struct to hold the data<br>
&gt;&gt; char * user_vars[];<br>
&gt;&gt; int num_user_vars<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Simon<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 10/2/08 10:18 AM, &quot;Anthony Minessale&quot; &lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; The difference openzp is itself also an abstraction layer so you need to<br>
&gt;&gt;&gt; pass it down.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I *will not* violate scope like that.....<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; so the only thing I am ok with is adding channel variables to the openzap<br>
&gt;&gt;&gt; channels.<br>
&gt;&gt;&gt; Then you can either set them all from the vars_event in the mod_openzap<br>
&gt;&gt;&gt; outgoing_channel routine<br>
&gt;&gt;&gt; or with a callback via the core set_variable mechanism.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Then your signaling mod could get the variables by name when it was<br>
&gt;&gt; needed.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; you will learn to understand that due to the years of torture from<br>
&gt;&gt; asterisk<br>
&gt;&gt;&gt; and it&#39;s knotted up api that is somehow called an abstraction layer, I<br>
&gt;&gt; will<br>
&gt;&gt;&gt; not bend on scope issues. Things like this are exactly what went wrong<br>
&gt;&gt;&gt; there.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Oct 2, 2008 at 11:04 AM, Simon Capper &lt;<a href="mailto:scapper@ooma.com">scapper@ooma.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The variables would be set before the call by another app, its analogous<br>
&gt;&gt; to<br>
&gt;&gt;&gt;&gt; setting a sip_x variable and having it appear in the sip signaling,<br>
&gt;&gt; don&#39;t<br>
&gt;&gt;&gt;&gt; need a callback.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The parameters are (so far):<br>
&gt;&gt;&gt;&gt; Ring type: (cadences index to ring the phone with)<br>
&gt;&gt;&gt;&gt; Phones to ring list: (proprietary for my ozmod module, don&#39;t think it<br>
&gt;&gt;&gt;&gt; should<br>
&gt;&gt;&gt;&gt; be in the library)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Maybe have a variable &nbsp;&quot;opanzap_&lt;variable_name&gt;&quot; that mod_openzap looks<br>
&gt;&gt; for<br>
&gt;&gt;&gt;&gt; and adds to the zchan structure by passing a custom variable array to<br>
&gt;&gt;&gt;&gt; zap_channel_open() then the ozmod can read it.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Simon<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 10/2/08 6:11 AM, &quot;Anthony Minessale&quot; &lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; That would pretty much violate the whole scope of the library. &nbsp;It&#39;s<br>
&gt;&gt; not<br>
&gt;&gt;&gt;&gt;&gt; supposed to even know there is a such thing as FreeSWITCH to get<br>
&gt;&gt;&gt;&gt; variables<br>
&gt;&gt;&gt;&gt;&gt; from. &nbsp;There could just as easily be a chan_openzap for asterisk<br>
&gt;&gt; (*WINK*<br>
&gt;&gt;&gt;&gt;&gt; *WINK* anyone? buelleur?)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; What exactly do you need them for?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; The most elegant way would be for the FS core to allow endpoints<br>
&gt;&gt;&gt;&gt;&gt; (mod_openzap) to register a callback to be called<br>
&gt;&gt;&gt;&gt;&gt; when a variable is set on that channel, then add the concept of channel<br>
&gt;&gt;&gt;&gt;&gt; variables to openzap zchans<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; so then when FS had a channel variable set it mod_openzap would in turn<br>
&gt;&gt;&gt;&gt; set<br>
&gt;&gt;&gt;&gt;&gt; it on openzap zchan and the blind abstraction would be preserved.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Thu, Oct 2, 2008 at 2:42 AM, Simon Capper &lt;<a href="mailto:scapper@ooma.com">scapper@ooma.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I want to access channel variables from an ozmod module in openzap.<br>
&gt;&gt;&gt;&gt;&gt;&gt; I can&#39;t see a way to do it in the current code.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I&#39;d like to add the feature and provide a patch for openzap when I&#39;m<br>
&gt;&gt;&gt;&gt; done.<br>
&gt;&gt;&gt;&gt;&gt;&gt; I&#39;m thinking of adding a void pointer that could be passed down via<br>
&gt;&gt;&gt;&gt;&gt;&gt; zap_channel_open that could be then be used from the ozmod modules?<br>
&gt;&gt;&gt;&gt;&gt;&gt; Mod_openzap would set the pointer to a function that would give access<br>
&gt;&gt;&gt;&gt; to<br>
&gt;&gt;&gt;&gt;&gt;&gt; channel variables. Thoughts?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Simon<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; Freeswitch-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; UNSUBSCRIBE:<br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; Freeswitch-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
&gt;&gt;&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;&gt;&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt;&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Freeswitch-dev mailing list<br>
&gt;&gt; <a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
<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>
</div></div></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>
<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="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>
</div>