<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thanks, the link was very helpful<BR>
<BR>
I have taken a look at the link that you provided<BR>
<BR>
I assume now that I can use uuid_setvar to accomplish what I want<BR>
<BR>
Assuming that the uuid is 53d37581-1f90-44bf-860a-addbc8430e3a, it seems that my code would need to change to<BR>
<BR>
<BR>
private void injectCdrCode_ExecuteCode(object sender, EventArgs e)<BR>{<BR> try<BR> {<BR> TcpClient newClient = new TcpClient();<BR> <BR> newClient.Connect("127.0.0.1", 8021);<BR> <BR> NetworkStream tcpStream = newClient.GetStream();<BR> <BR> byte[] sendBytes = Encoding.ASCII.GetBytes("api uuid_setvar 53d37581-1f90-44bf-860a-addbc8430e3a myChannelVariable 12345");<BR> <BR> tcpStream.Write(sendBytes, 0, sendBytes.Length);<BR> <BR> tcpStream.Close();<BR> <BR> newClient.Close();<BR> }<BR> catch(Exception ex)<BR> {<BR> throw ex;<BR> }<BR>}<BR><BR>My question now becomes, how do I go about finding out the uuid for the session ? Is that obtainable via mod_event_socket or is there another way ?<BR>
<BR>
Thanks<BR>
<BR>
Brian <BR>
<HR id=stopSpelling>
From: mrene_lists@avgs.ca<BR>Date: Wed, 1 Dec 2010 16:53:53 -0500<BR>To: freeswitch-users@lists.freeswitch.org<BR>Subject: Re: [Freeswitch-users] Custom Channel Variables via C#<BR><BR>
<META name=Generator content="Microsoft SafeHTML">
<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 <A href="http://wiki.freeswitch.org/wiki/Event_socket" target=_blank>http://wiki.freeswitch.org/wiki/Event_socket</A> for more information.</DIV>
<DIV><BR>
<DIV>
<DIV><SPAN style="FONT-SIZE: 12px" class=ecxApple-style-span>
<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 href="mailto:mrene@avgs.ca">mrene@avgs.ca</A></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV></SPAN></DIV><BR class=ecxApple-interchange-newline></DIV><BR>
<DIV>
<DIV>On 2010-12-01, at 4:46 PM, Brian Campbell wrote:</DIV><BR class=ecxApple-interchange-newline>
<BLOCKQUOTE><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="FONT-FAMILY: Tahoma; FONT-SIZE: 10pt" class=ecxhmmessage> <BR>I can set a custom channel variable in my incomming dial plan like this...<BR> <BR><action application='set' data='MyChannelVariable=12345' /><BR> <BR>And it shows up fine in the CDR<BR> <BR>I am now attempting to use mod_event_socket to set a custom channel variable and have it appear in the CDR<BR> <BR>Here is the C# code so far, the code is part of a Microsoft Speech Server application that is answering the call<BR> <BR>private void injectCdrCode_ExecuteCode(object sender, EventArgs e)<BR>{<BR> try<BR> {<BR> TcpClient newClient = new TcpClient();<BR> <BR> newClient.Connect("127.0.0.1", 8021);<BR> <BR> NetworkStream tcpStream = newClient.GetStream();<BR> <BR> byte[] sendBytes = Encoding.ASCII.GetBytes("<action application='set' data='MyChannelVariable=12345' />");<BR> <BR> tcpStream.Write(sendBytes, 0, sendBytes.Length);<BR> <BR> tcpStream.Close();<BR> <BR> newClient.Close();<BR> }<BR> catch(Exception ex)<BR> {<BR> throw ex;<BR> }<BR>}<BR> <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> <BR>I figure I am not setting it correctly<BR> <BR>Can anyone advise on what I am doing wrong ?<BR> <BR>Thanks<BR> <BR> <BR>Brian<BR> <BR> <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:http://lists.freeswitch.org/mailman/options/freeswitch-users<BR><A href="http://www.freeswitch.org/" target=_blank>http://www.freeswitch.org</A><BR></DIV></SPAN></BLOCKQUOTE></DIV><BR></DIV></DIV><BR>_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org                                            </body>
</html>