static void InboundMode2(Object stateInfo)
{
//Initializes a new instance of ESLconnection, and connects to the host $host on the port $port, and supplies $password to freeswitch
ESLconnection eslConnection = new ESLconnection(myinfo);
if (eslConnection.Connected() != ESL_SUCCESS)
{
Console.WriteLine("Error connecting to FreeSwitch");
return;
}
//Set log level
//ESL.eslSetLogLevel((int)enLogLevel.DEBUG);
eslConnection.Api("reloadxml", string.Empty);
// Subscribe to all events
ESLevent eslEvent2 = eslConnection.SendRecv("event plain ALL");
if (eslEvent2 == null)
{
Console.WriteLine("Error subscribing to all events");
return;
}
ESLevent eslEvent = new ESLevent("MESSAGE_WAITING", null);
eslEvent.AddHeader("MWI-Messages-Waiting", "yes");
eslEvent.AddHeader("MWI-Message-Account", "103@20064.domain.com");
eslEvent.AddHeader("MWI-Voice-Message", "1/1 (1/1)");
eslEvent = eslConnection.SendEvent(eslEvent);
if (eslEvent == null)
{
Console.WriteLine("event error");
return;
}
//Turns an event into colon-separated 'name: value' pairs. The format parameter isn't used
Console.WriteLine(eslEvent.Serialize(String.Empty));
// Grab Events until process is killed
while (eslConnection.Connected() == ESL_SUCCESS)
{
eslEvent = eslConnection.RecvEvent();
Console.WriteLine(eslEvent.Serialize(String.Empty));
}
}
When I send the event, I am getting a debug message from FS as follows:
2011-06-27 10:46:25.443081 [ERR] sofia_presence.c:405 Cannot find profile 20064.domain.com]
Thanks!
-Avi