<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi, You can use ESL managed, is the easy way.<br><br>Diego <br>
http://voipensando.blogspot.com/<br><br>--- On <b>Wed, 12/1/10, Mathieu Rene <i>&lt;mrene_lists@avgs.ca&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Mathieu Rene &lt;mrene_lists@avgs.ca&gt;<br>Subject: Re: [Freeswitch-users] Custom Channel Variables via C#<br>To: "FreeSWITCH Users Help" &lt;freeswitch-users@lists.freeswitch.org&gt;<br>Date: Wednesday, December 1, 2010, 4:53 PM<br><br><div id="yiv965508001"><base><div>Hi,</div><div><br></div><div>You can't send XML dialplan actions on the socket and expect FreeSWITCH to understand it, you must follow the event socket protocol.<div><br></div><div>See&nbsp;<a rel="nofollow" target="_blank" href="http://wiki.freeswitch.org/wiki/Event_socket">http://wiki.freeswitch.org/wiki/Event_socket</a>&nbsp;for more information.</div><div><br><div>
<div><span class="yiv965508001Apple-style-span" style="font-size: 12px;"><div>Mathieu Rene</div><div>Avant-Garde Solutions Inc</div><div>Office: + 1 (514) 664-1044 x100</div><div>Cell: +1 (514) 664-1044 x200</div><div><a rel="nofollow" ymailto="mailto:mrene@avgs.ca" target="_blank" href="/mc/compose?to=mrene@avgs.ca">mrene@avgs.ca</a></div><div><br></div><div><br></div></span></div><br class="yiv965508001Apple-interchange-newline">
</div>
<br><div><div>On 2010-12-01, at 4:46 PM, Brian Campbell wrote:</div><br class="yiv965508001Apple-interchange-newline"><blockquote type="cite"><span class="yiv965508001Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><div class="yiv965508001hmmessage" style="font-size: 10pt; font-family: Tahoma;">&nbsp;<br>I can set a custom channel variable in my incomming dial plan like this...<br>&nbsp;<br>&lt;action application='set' data='MyChannelVariable=12345' /&gt;<br>&nbsp;<br>And it shows up fine in the CDR<br>&nbsp;<br>I am now attempting to use mod_event_socket to set a custom channel variable and have it&nbsp;appear in the CDR<br>&nbsp;<br>Here is the C# code so far, the code is part of a Microsoft Speech
 Server application that is answering the call<br>&nbsp;<br>private void injectCdrCode_ExecuteCode(object sender, EventArgs e)<br>{<br>&nbsp; try<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; TcpClient newClient = new TcpClient();<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; newClient.Connect("127.0.0.1", 8021);<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; NetworkStream tcpStream = newClient.GetStream();<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; byte[] sendBytes = Encoding.ASCII.GetBytes("&lt;action application='set' data='MyChannelVariable=12345' /&gt;");<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; tcpStream.Write(sendBytes, 0, sendBytes.Length);<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; tcpStream.Close();<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; newClient.Close();<br>&nbsp; }<br>&nbsp; catch(Exception ex)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; throw ex;<br>&nbsp; }<br>}<br>&nbsp;<br>After the call is answered, the C# code seems to run fine, but I dont see the custom channel variable in the resulting CDR<br>&nbsp;<br>I figure I am not
 setting it correctly<br>&nbsp;<br>Can anyone advise on what I am doing wrong ?<br>&nbsp;<br>Thanks<br>&nbsp;<br>&nbsp;<br>Brian<br>&nbsp;<br>&nbsp;<br>_______________________________________________<br>FreeSWITCH-users mailing list<br><a rel="nofollow" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" href="/mc/compose?to=FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br><a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br><a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></span></blockquote></div><br></div></div></div><br>-----Inline Attachment Follows-----<br><br><div
 class="plainMail">_______________________________________________<br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="/mc/compose?to=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></div></blockquote></td></tr></table><br>