<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<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>                                            </body>
</html>