[Freeswitch-users] Custom Channel Variables via C#

Diego Toro dftoro at yahoo.com
Sat Dec 4 03:00:08 MSK 2010


Hi, You can use ESL managed, is the easy way.

Diego 

http://voipensando.blogspot.com/

--- On Wed, 12/1/10, Mathieu Rene <mrene_lists at avgs.ca> wrote:

From: Mathieu Rene <mrene_lists at avgs.ca>
Subject: Re: [Freeswitch-users] Custom Channel Variables via C#
To: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
Date: Wednesday, December 1, 2010, 4:53 PM

Hi,
You can't send XML dialplan actions on the socket and expect FreeSWITCH to understand it, you must follow the event socket protocol.
See http://wiki.freeswitch.org/wiki/Event_socket for more information.

Mathieu ReneAvant-Garde Solutions IncOffice: + 1 (514) 664-1044 x100Cell: +1 (514) 664-1044 x200mrene at avgs.ca





On 2010-12-01, at 4:46 PM, Brian Campbell wrote:
 
I can set a custom channel variable in my incomming dial plan like this...
 
<action application='set' data='MyChannelVariable=12345' />
 
And it shows up fine in the CDR
 
I am now attempting to use mod_event_socket to set a custom channel variable and have it appear in the CDR
 
Here is the C# code so far, the code is part of a Microsoft Speech Server application that is answering the call
 
private void injectCdrCode_ExecuteCode(object sender, EventArgs e)
{
  try
  {
    TcpClient newClient = new TcpClient();
 
    newClient.Connect("127.0.0.1", 8021);
 
    NetworkStream tcpStream = newClient.GetStream();
 
    byte[] sendBytes = Encoding.ASCII.GetBytes("<action application='set' data='MyChannelVariable=12345' />");
 
    tcpStream.Write(sendBytes, 0, sendBytes.Length);
 
    tcpStream.Close();
 
    newClient.Close();
  }
  catch(Exception ex)
  {
    throw ex;
  }
}
 
After the call is answered, the C# code seems to run fine, but I dont see the custom channel variable in the resulting CDR
 
I figure I am not setting it correctly
 
Can anyone advise on what I am doing wrong ?
 
Thanks
 
 
Brian
 
 
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


-----Inline Attachment Follows-----

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20101203/83f0ca5e/attachment-0001.html 


More information about the FreeSWITCH-users mailing list