提交 67724654 authored 作者: Diego Toro's avatar Diego Toro

Improve C# support. Rename properties like C#-style

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16520 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 83bae735
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35 * Version 1.3.40
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35 * Version 1.3.40
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
...@@ -29,11 +29,13 @@ public class ESLconnection : IDisposable { ...@@ -29,11 +29,13 @@ public class ESLconnection : IDisposable {
public virtual void Dispose() { public virtual void Dispose() {
lock(this) { lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) { if (swigCPtr.Handle != IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false; swigCMemOwn = false;
ESLPINVOKE.delete_ESLconnection(swigCPtr); ESLPINVOKE.delete_ESLconnection(swigCPtr);
} }
swigCPtr = new HandleRef(null, IntPtr.Zero); swigCPtr = new HandleRef(null, IntPtr.Zero);
}
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
} }
...@@ -47,97 +49,97 @@ public class ESLconnection : IDisposable { ...@@ -47,97 +49,97 @@ public class ESLconnection : IDisposable {
public ESLconnection(int socket) : this(ESLPINVOKE.new_ESLconnection__SWIG_2(socket), true) { public ESLconnection(int socket) : this(ESLPINVOKE.new_ESLconnection__SWIG_2(socket), true) {
} }
public int socketDescriptor() { public int SocketDescriptor() {
int ret = ESLPINVOKE.ESLconnection_socketDescriptor(swigCPtr); int ret = ESLPINVOKE.ESLconnection_SocketDescriptor(swigCPtr);
return ret; return ret;
} }
public int connected() { public int Connected() {
int ret = ESLPINVOKE.ESLconnection_connected(swigCPtr); int ret = ESLPINVOKE.ESLconnection_Connected(swigCPtr);
return ret; return ret;
} }
public ESLevent getInfo() { public ESLevent GetInfo() {
IntPtr cPtr = ESLPINVOKE.ESLconnection_getInfo(swigCPtr); IntPtr cPtr = ESLPINVOKE.ESLconnection_GetInfo(swigCPtr);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public int send(string cmd) { public int Send(string cmd) {
int ret = ESLPINVOKE.ESLconnection_send(swigCPtr, cmd); int ret = ESLPINVOKE.ESLconnection_Send(swigCPtr, cmd);
return ret; return ret;
} }
public ESLevent sendRecv(string cmd) { public ESLevent SendRecv(string cmd) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_sendRecv(swigCPtr, cmd); IntPtr cPtr = ESLPINVOKE.ESLconnection_SendRecv(swigCPtr, cmd);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public ESLevent api(string cmd, string arg) { public ESLevent Api(string cmd, string arg) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_api(swigCPtr, cmd, arg); IntPtr cPtr = ESLPINVOKE.ESLconnection_Api(swigCPtr, cmd, arg);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public ESLevent bgapi(string cmd, string arg) { public ESLevent Bgapi(string cmd, string arg) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_bgapi(swigCPtr, cmd, arg); IntPtr cPtr = ESLPINVOKE.ESLconnection_Bgapi(swigCPtr, cmd, arg);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public int sendEvent(ESLevent send_me) { public int SendEvent(ESLevent send_me) {
int ret = ESLPINVOKE.ESLconnection_sendEvent(swigCPtr, ESLevent.getCPtr(send_me)); int ret = ESLPINVOKE.ESLconnection_SendEvent(swigCPtr, ESLevent.getCPtr(send_me));
return ret; return ret;
} }
public ESLevent recvEvent() { public ESLevent RecvEvent() {
IntPtr cPtr = ESLPINVOKE.ESLconnection_recvEvent(swigCPtr); IntPtr cPtr = ESLPINVOKE.ESLconnection_RecvEvent(swigCPtr);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public ESLevent recvEventTimed(int ms) { public ESLevent RecvEventTimed(int ms) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_recvEventTimed(swigCPtr, ms); IntPtr cPtr = ESLPINVOKE.ESLconnection_RecvEventTimed(swigCPtr, ms);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public ESLevent filter(string header, string value) { public ESLevent Filter(string header, string value) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_filter(swigCPtr, header, value); IntPtr cPtr = ESLPINVOKE.ESLconnection_Filter(swigCPtr, header, value);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public int events(string etype, string value) { public int Events(string etype, string value) {
int ret = ESLPINVOKE.ESLconnection_events(swigCPtr, etype, value); int ret = ESLPINVOKE.ESLconnection_Events(swigCPtr, etype, value);
return ret; return ret;
} }
public ESLevent execute(string app, string arg, string uuid) { public ESLevent Execute(string app, string arg, string uuid) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_execute(swigCPtr, app, arg, uuid); IntPtr cPtr = ESLPINVOKE.ESLconnection_Execute(swigCPtr, app, arg, uuid);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public ESLevent executeAsync(string app, string arg, string uuid) { public ESLevent ExecuteAsync(string app, string arg, string uuid) {
IntPtr cPtr = ESLPINVOKE.ESLconnection_executeAsync(swigCPtr, app, arg, uuid); IntPtr cPtr = ESLPINVOKE.ESLconnection_ExecuteAsync(swigCPtr, app, arg, uuid);
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true); ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
return ret; return ret;
} }
public int setAsyncExecute(string val) { public int SetAsyncExecute(string val) {
int ret = ESLPINVOKE.ESLconnection_setAsyncExecute(swigCPtr, val); int ret = ESLPINVOKE.ESLconnection_SetAsyncExecute(swigCPtr, val);
return ret; return ret;
} }
public int setEventLock(string val) { public int SetEventLock(string val) {
int ret = ESLPINVOKE.ESLconnection_setEventLock(swigCPtr, val); int ret = ESLPINVOKE.ESLconnection_SetEventLock(swigCPtr, val);
return ret; return ret;
} }
public int disconnect() { public int Disconnect() {
int ret = ESLPINVOKE.ESLconnection_disconnect(swigCPtr); int ret = ESLPINVOKE.ESLconnection_Disconnect(swigCPtr);
return ret; return ret;
} }
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35 * Version 1.3.40
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
...@@ -29,42 +29,44 @@ public class ESLevent : IDisposable { ...@@ -29,42 +29,44 @@ public class ESLevent : IDisposable {
public virtual void Dispose() { public virtual void Dispose() {
lock(this) { lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) { if (swigCPtr.Handle != IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false; swigCMemOwn = false;
ESLPINVOKE.delete_ESLevent(swigCPtr); ESLPINVOKE.delete_ESLevent(swigCPtr);
} }
swigCPtr = new HandleRef(null, IntPtr.Zero); swigCPtr = new HandleRef(null, IntPtr.Zero);
}
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
} }
public SWIGTYPE_p_esl_event_t event { public SWIGTYPE_p_esl_event_t Event {
set { set {
ESLPINVOKE.ESLevent_event_set(swigCPtr, SWIGTYPE_p_esl_event_t.getCPtr(value)); ESLPINVOKE.ESLevent_Event_set(swigCPtr, SWIGTYPE_p_esl_event_t.getCPtr(value));
} }
get { get {
IntPtr cPtr = ESLPINVOKE.ESLevent_event_get(swigCPtr); IntPtr cPtr = ESLPINVOKE.ESLevent_Event_get(swigCPtr);
SWIGTYPE_p_esl_event_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_esl_event_t(cPtr, false); SWIGTYPE_p_esl_event_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_esl_event_t(cPtr, false);
return ret; return ret;
} }
} }
public string serialized_string { public string SerializedString {
set { set {
ESLPINVOKE.ESLevent_serialized_string_set(swigCPtr, value); ESLPINVOKE.ESLevent_SerializedString_set(swigCPtr, value);
} }
get { get {
string ret = ESLPINVOKE.ESLevent_serialized_string_get(swigCPtr); string ret = ESLPINVOKE.ESLevent_SerializedString_get(swigCPtr);
return ret; return ret;
} }
} }
public int mine { public int Mine {
set { set {
ESLPINVOKE.ESLevent_mine_set(swigCPtr, value); ESLPINVOKE.ESLevent_Mine_set(swigCPtr, value);
} }
get { get {
int ret = ESLPINVOKE.ESLevent_mine_get(swigCPtr); int ret = ESLPINVOKE.ESLevent_Mine_get(swigCPtr);
return ret; return ret;
} }
} }
...@@ -78,24 +80,24 @@ public class ESLevent : IDisposable { ...@@ -78,24 +80,24 @@ public class ESLevent : IDisposable {
public ESLevent(ESLevent me) : this(ESLPINVOKE.new_ESLevent__SWIG_2(ESLevent.getCPtr(me)), true) { public ESLevent(ESLevent me) : this(ESLPINVOKE.new_ESLevent__SWIG_2(ESLevent.getCPtr(me)), true) {
} }
public string serialize(string format) { public string Serialize(string format) {
string ret = ESLPINVOKE.ESLevent_serialize(swigCPtr, format); string ret = ESLPINVOKE.ESLevent_Serialize(swigCPtr, format);
return ret; return ret;
} }
public bool setPriority(SWIGTYPE_p_esl_priority_t priority) { public bool SetPriority(SWIGTYPE_p_esl_priority_t priority) {
bool ret = ESLPINVOKE.ESLevent_setPriority(swigCPtr, SWIGTYPE_p_esl_priority_t.getCPtr(priority)); bool ret = ESLPINVOKE.ESLevent_SetPriority(swigCPtr, SWIGTYPE_p_esl_priority_t.getCPtr(priority));
if (ESLPINVOKE.SWIGPendingException.Pending) throw ESLPINVOKE.SWIGPendingException.Retrieve(); if (ESLPINVOKE.SWIGPendingException.Pending) throw ESLPINVOKE.SWIGPendingException.Retrieve();
return ret; return ret;
} }
public string getHeader(string header_name) { public string GetHeader(string header_name) {
string ret = ESLPINVOKE.ESLevent_getHeader(swigCPtr, header_name); string ret = ESLPINVOKE.ESLevent_GetHeader(swigCPtr, header_name);
return ret; return ret;
} }
public string getBody() { public string GetBody() {
string ret = ESLPINVOKE.ESLevent_getBody(swigCPtr); string ret = ESLPINVOKE.ESLevent_GetBody(swigCPtr);
return ret; return ret;
} }
...@@ -104,28 +106,28 @@ public class ESLevent : IDisposable { ...@@ -104,28 +106,28 @@ public class ESLevent : IDisposable {
return ret; return ret;
} }
public bool addBody(string value) { public bool AddBody(string value) {
bool ret = ESLPINVOKE.ESLevent_addBody(swigCPtr, value); bool ret = ESLPINVOKE.ESLevent_AddBody(swigCPtr, value);
return ret; return ret;
} }
public bool addHeader(string header_name, string value) { public bool AddHeader(string header_name, string value) {
bool ret = ESLPINVOKE.ESLevent_addHeader(swigCPtr, header_name, value); bool ret = ESLPINVOKE.ESLevent_AddHeader(swigCPtr, header_name, value);
return ret; return ret;
} }
public bool delHeader(string header_name) { public bool DelHeader(string header_name) {
bool ret = ESLPINVOKE.ESLevent_delHeader(swigCPtr, header_name); bool ret = ESLPINVOKE.ESLevent_DelHeader(swigCPtr, header_name);
return ret; return ret;
} }
public string firstHeader() { public string FirstHeader() {
string ret = ESLPINVOKE.ESLevent_firstHeader(swigCPtr); string ret = ESLPINVOKE.ESLevent_FirstHeader(swigCPtr);
return ret; return ret;
} }
public string nextHeader() { public string NextHeader() {
string ret = ESLPINVOKE.ESLevent_nextHeader(swigCPtr); string ret = ESLPINVOKE.ESLevent_NextHeader(swigCPtr);
return ret; return ret;
} }
......
...@@ -9,14 +9,14 @@ namespace ManagedEslTest ...@@ -9,14 +9,14 @@ namespace ManagedEslTest
// Connect to FreeSWITCH // Connect to FreeSWITCH
ESLconnection eslConnection = new ESLconnection("localhost", "8021", "ClueCon"); ESLconnection eslConnection = new ESLconnection("localhost", "8021", "ClueCon");
// We want all Events (probably will want to change this depending on your needs) // We want all Events (probably will want to change this depending on your needs)
eslConnection.sendRecv("event plain ALL"); eslConnection.SendRecv("event plain ALL");
// Grab Events until process is killed // Grab Events until process is killed
while (eslConnection.connected() == 1) while (eslConnection.Connected() == 1)
{ {
ESLevent eslEvent = eslConnection.recvEvent(); ESLevent eslEvent = eslConnection.RecvEvent();
Console.WriteLine(eslEvent.serialize(String.Empty)); Console.WriteLine(eslEvent.Serialize(String.Empty));
} }
} }
} }
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35 * Version 1.3.40
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35 * Version 1.3.40
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论