local_clobber true|false (default false)<br><br>whether or not to allow (per-leg) local variables inside [] to take precedence over originate global variables in {}<br><br><br>{foo=value1,local_clobber=false}sofia/internal/<a href="mailto:100@test.com">100@test.com</a>,[foo=value2]sofia/internal/<a href="mailto:101@test.com">101@test.com</a><br>
<br>foo will be value1 on both legs<br><br>{foo=value1,local_clobber=true}sofia/internal/<a href="mailto:100@test.com">100@test.com</a>,[foo=value2]sofia/internal/<a href="mailto:101@test.com">101@test.com</a><br>
<br><br>foo will be value1 on all legs except the 101 who set it to value2<br><br><br><br><br><div class="gmail_quote">On Tue, Jan 26, 2010 at 5:53 AM, Alex To <span dir="ltr">&lt;<a href="mailto:tonhudung@gmail.com">tonhudung@gmail.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;">








<div link="blue" vlink="purple" lang="EN-US">

<div>

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hi,</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Would somebody enlighten me on this trunk of code in the mentioned
file at line 2273:</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal" style="margin-left: 1.5in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">if</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> (local_clobber) {</span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              <span style="color: blue;">if</span> (var_event) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_t
*<span style="color: blue;">event</span>;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_header_t
*header;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    <span style="color: green;">/* install the vars from the {} params */</span></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    <span style="color: blue;">for</span> (header = var_event-&gt;headers; header; header =
header-&gt;next) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                          switch_channel_set_variable(originate_status[i].peer_channel,
header-&gt;name, header-&gt;value);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_create(&amp;<span style="color: blue;">event</span>, SWITCH_EVENT_CHANNEL_ORIGINATE);</span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_assert(<span style="color: blue;">event</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_channel_event_set_data(originate_status[i].peer_channel,
<span style="color: blue;">event</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_fire(&amp;<span style="color: blue;">event</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                        }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                        <span style="color: blue;">if</span> (vdata) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              <span style="color: blue;">char</span> *var_array[1024] = { 0 };</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              <span style="color: blue;">int</span> var_count = 0;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              <span style="color: blue;">if</span> ((var_count = switch_separate_string(vdata, <span style="color: rgb(163, 21, 21);">&#39;|&#39;</span>, var_array, (<span style="color: blue;">sizeof</span>(var_array)
/ <span style="color: blue;">sizeof</span>(var_array[0]))))) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    <span style="color: blue;">int</span> x = 0;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    <span style="color: blue;">for</span> (x = 0; x &lt; var_count; x++) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                          <span style="color: blue;">char</span> *inner_var_array[2] = { 0 };</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                          <span style="color: blue;">int</span> inner_var_count;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                          <span style="color: blue;">if</span> ((inner_var_count =</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                                 switch_separate_string(var_array[x],
<span style="color: rgb(163, 21, 21);">&#39;=&#39;</span>,</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                                                                    inner_var_array,
(<span style="color: blue;">sizeof</span>(inner_var_array) / <span style="color: blue;">sizeof</span>(inner_var_array[0])))) == 2) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                                switch_channel_set_variable(originate_status[i].peer_channel,
inner_var_array[0], inner_var_array[1]);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                          }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                        }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                        <span style="color: blue;">if</span> (!local_clobber) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              <span style="color: blue;">if</span> (var_event) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_t
*<span style="color: blue;">event</span>;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_header_t
*header;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    <span style="color: green;">/* install the vars from the {} params */</span></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    <span style="color: blue;">for</span> (header = var_event-&gt;headers; header; header =
header-&gt;next) {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                          switch_channel_set_variable(originate_status[i].peer_channel,
header-&gt;name, header-&gt;value);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_create(&amp;<span style="color: blue;">event</span>, SWITCH_EVENT_CHANNEL_ORIGINATE);</span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_assert(<span style="color: blue;">event</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_channel_event_set_data(originate_status[i].peer_channel,
<span style="color: blue;">event</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                                    switch_event_fire(&amp;<span style="color: blue;">event</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                              }</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">                        }</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">The
code block inside <span style="color: blue;">if</span> (local_clobber) and <span style="color: blue;">if</span> (!local_clobber) does exactly the same thing. May
I know is it by design and how does it actually work ? I am not sure what does
it mean by localClobber so if someone can spare sometime explaining, I would
really appreciate it.</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Thank
you</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Best
Regards</span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></p><font color="#888888">

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Alex
To</span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>

</font></div>

</div>

</div>


<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>
<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="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:+19193869900<br>