mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
Merge branch 'master' into v1.4.beta
This commit is contained in:
@@ -634,7 +634,70 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_esl_eslJNI_ESLevent_1nextHeader(J
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jstring jarg4) {
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2, jstring jarg3, jstring jarg4) {
|
||||
jlong jresult = 0 ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = 0;
|
||||
if (jarg1) {
|
||||
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
|
||||
if (!arg1) return 0;
|
||||
}
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = 0;
|
||||
if (jarg3) {
|
||||
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
|
||||
if (!arg3) return 0;
|
||||
}
|
||||
arg4 = 0;
|
||||
if (jarg4) {
|
||||
arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
|
||||
if (!arg4) return 0;
|
||||
}
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
*(ESLconnection **)&jresult = result;
|
||||
if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
|
||||
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
|
||||
if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2, jstring jarg3) {
|
||||
jlong jresult = 0 ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = 0;
|
||||
if (jarg1) {
|
||||
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
|
||||
if (!arg1) return 0;
|
||||
}
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = 0;
|
||||
if (jarg3) {
|
||||
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
|
||||
if (!arg3) return 0;
|
||||
}
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
*(ESLconnection **)&jresult = result;
|
||||
if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
|
||||
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jstring jarg4) {
|
||||
jlong jresult = 0 ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -674,7 +737,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SW
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3) {
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3) {
|
||||
jlong jresult = 0 ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -707,7 +770,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SW
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1) {
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_new_1ESLconnection_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jint jarg1) {
|
||||
jlong jresult = 0 ;
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
@@ -33,16 +33,24 @@ public class ESLconnection {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
public ESLconnection(String host, String port, String user, String password) {
|
||||
public ESLconnection(String host, int port, String user, String password) {
|
||||
this(eslJNI.new_ESLconnection__SWIG_0(host, port, user, password), true);
|
||||
}
|
||||
|
||||
public ESLconnection(String host, String port, String password) {
|
||||
public ESLconnection(String host, int port, String password) {
|
||||
this(eslJNI.new_ESLconnection__SWIG_1(host, port, password), true);
|
||||
}
|
||||
|
||||
public ESLconnection(String host, String port, String user, String password) {
|
||||
this(eslJNI.new_ESLconnection__SWIG_2(host, port, user, password), true);
|
||||
}
|
||||
|
||||
public ESLconnection(String host, String port, String password) {
|
||||
this(eslJNI.new_ESLconnection__SWIG_3(host, port, password), true);
|
||||
}
|
||||
|
||||
public ESLconnection(int socket) {
|
||||
this(eslJNI.new_ESLconnection__SWIG_2(socket), true);
|
||||
this(eslJNI.new_ESLconnection__SWIG_4(socket), true);
|
||||
}
|
||||
|
||||
public int socketDescriptor() {
|
||||
|
||||
@@ -31,9 +31,11 @@ class eslJNI {
|
||||
public final static native boolean ESLevent_delHeader(long jarg1, ESLevent jarg1_, String jarg2);
|
||||
public final static native String ESLevent_firstHeader(long jarg1, ESLevent jarg1_);
|
||||
public final static native String ESLevent_nextHeader(long jarg1, ESLevent jarg1_);
|
||||
public final static native long new_ESLconnection__SWIG_0(String jarg1, String jarg2, String jarg3, String jarg4);
|
||||
public final static native long new_ESLconnection__SWIG_1(String jarg1, String jarg2, String jarg3);
|
||||
public final static native long new_ESLconnection__SWIG_2(int jarg1);
|
||||
public final static native long new_ESLconnection__SWIG_0(String jarg1, int jarg2, String jarg3, String jarg4);
|
||||
public final static native long new_ESLconnection__SWIG_1(String jarg1, int jarg2, String jarg3);
|
||||
public final static native long new_ESLconnection__SWIG_2(String jarg1, String jarg2, String jarg3, String jarg4);
|
||||
public final static native long new_ESLconnection__SWIG_3(String jarg1, String jarg2, String jarg3);
|
||||
public final static native long new_ESLconnection__SWIG_4(int jarg1);
|
||||
public final static native void delete_ESLconnection(long jarg1);
|
||||
public final static native int ESLconnection_socketDescriptor(long jarg1, ESLconnection jarg1_);
|
||||
public final static native int ESLconnection_connected(long jarg1, ESLconnection jarg1_);
|
||||
|
||||
+105
-5
@@ -2231,6 +2231,63 @@ static const char *swig_ESLevent_base_names[] = {0};
|
||||
static swig_lua_class _wrap_class_ESLevent = { "ESLevent", &SWIGTYPE_p_ESLevent,_wrap_new_ESLevent, swig_delete_ESLevent, swig_ESLevent_methods, swig_ESLevent_attributes, swig_ESLevent_bases, swig_ESLevent_base_names };
|
||||
|
||||
static int _wrap_new_ESLconnection__SWIG_0(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("ESLconnection",4,4)
|
||||
if(!lua_isstring(L,1)) SWIG_fail_arg("ESLconnection",1,"char const *");
|
||||
if(!lua_isnumber(L,2)) SWIG_fail_arg("ESLconnection",2,"int const");
|
||||
if(!lua_isstring(L,3)) SWIG_fail_arg("ESLconnection",3,"char const *");
|
||||
if(!lua_isstring(L,4)) SWIG_fail_arg("ESLconnection",4,"char const *");
|
||||
arg1 = (char *)lua_tostring(L, 1);
|
||||
arg2 = (int const)lua_tonumber(L, 2);
|
||||
arg3 = (char *)lua_tostring(L, 3);
|
||||
arg4 = (char *)lua_tostring(L, 4);
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
SWIG_arg=0;
|
||||
SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
|
||||
fail:
|
||||
lua_error(L);
|
||||
return SWIG_arg;
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_new_ESLconnection__SWIG_1(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("ESLconnection",3,3)
|
||||
if(!lua_isstring(L,1)) SWIG_fail_arg("ESLconnection",1,"char const *");
|
||||
if(!lua_isnumber(L,2)) SWIG_fail_arg("ESLconnection",2,"int const");
|
||||
if(!lua_isstring(L,3)) SWIG_fail_arg("ESLconnection",3,"char const *");
|
||||
arg1 = (char *)lua_tostring(L, 1);
|
||||
arg2 = (int const)lua_tonumber(L, 2);
|
||||
arg3 = (char *)lua_tostring(L, 3);
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
SWIG_arg=0;
|
||||
SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
|
||||
fail:
|
||||
lua_error(L);
|
||||
return SWIG_arg;
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_new_ESLconnection__SWIG_2(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -2260,7 +2317,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_new_ESLconnection__SWIG_1(lua_State* L) {
|
||||
static int _wrap_new_ESLconnection__SWIG_3(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -2287,7 +2344,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_new_ESLconnection__SWIG_2(lua_State* L) {
|
||||
static int _wrap_new_ESLconnection__SWIG_4(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
@@ -2321,7 +2378,26 @@ static int _wrap_new_ESLconnection(lua_State* L) {
|
||||
_v = lua_isnumber(L,argv[0]);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_2(L);
|
||||
return _wrap_new_ESLconnection__SWIG_4(L);
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
int _v;
|
||||
{
|
||||
_v = lua_isstring(L,argv[0]);
|
||||
}
|
||||
if (_v) {
|
||||
{
|
||||
_v = lua_isnumber(L,argv[1]);
|
||||
}
|
||||
if (_v) {
|
||||
{
|
||||
_v = lua_isstring(L,argv[2]);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_1(L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
@@ -2338,7 +2414,31 @@ static int _wrap_new_ESLconnection(lua_State* L) {
|
||||
_v = lua_isstring(L,argv[2]);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_1(L);
|
||||
return _wrap_new_ESLconnection__SWIG_3(L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 4) {
|
||||
int _v;
|
||||
{
|
||||
_v = lua_isstring(L,argv[0]);
|
||||
}
|
||||
if (_v) {
|
||||
{
|
||||
_v = lua_isnumber(L,argv[1]);
|
||||
}
|
||||
if (_v) {
|
||||
{
|
||||
_v = lua_isstring(L,argv[2]);
|
||||
}
|
||||
if (_v) {
|
||||
{
|
||||
_v = lua_isstring(L,argv[3]);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_0(L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2361,7 +2461,7 @@ static int _wrap_new_ESLconnection(lua_State* L) {
|
||||
_v = lua_isstring(L,argv[3]);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_0(L);
|
||||
return _wrap_new_ESLconnection__SWIG_2(L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,13 +251,19 @@ class ESLPINVOKE {
|
||||
public static extern string ESLevent_NextHeader(HandleRef jarg1);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_0")]
|
||||
public static extern IntPtr new_ESLconnection__SWIG_0(string jarg1, string jarg2, string jarg3, string jarg4);
|
||||
public static extern IntPtr new_ESLconnection__SWIG_0(string jarg1, int jarg2, string jarg3, string jarg4);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_1")]
|
||||
public static extern IntPtr new_ESLconnection__SWIG_1(string jarg1, string jarg2, string jarg3);
|
||||
public static extern IntPtr new_ESLconnection__SWIG_1(string jarg1, int jarg2, string jarg3);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_2")]
|
||||
public static extern IntPtr new_ESLconnection__SWIG_2(int jarg1);
|
||||
public static extern IntPtr new_ESLconnection__SWIG_2(string jarg1, string jarg2, string jarg3, string jarg4);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_3")]
|
||||
public static extern IntPtr new_ESLconnection__SWIG_3(string jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_4")]
|
||||
public static extern IntPtr new_ESLconnection__SWIG_4(int jarg1);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_delete_ESLconnection")]
|
||||
public static extern void delete_ESLconnection(HandleRef jarg1);
|
||||
|
||||
@@ -38,13 +38,19 @@ public class ESLconnection : IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
public ESLconnection(string host, string port, string user, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_0(host, port, user, password), true) {
|
||||
public ESLconnection(string host, int port, string user, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_0(host, port, user, password), true) {
|
||||
}
|
||||
|
||||
public ESLconnection(string host, string port, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_1(host, port, password), true) {
|
||||
public ESLconnection(string host, int port, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_1(host, port, password), true) {
|
||||
}
|
||||
|
||||
public ESLconnection(int socket) : this(ESLPINVOKE.new_ESLconnection__SWIG_2(socket), true) {
|
||||
public ESLconnection(string host, string port, string user, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_2(host, port, user, password), true) {
|
||||
}
|
||||
|
||||
public ESLconnection(string host, string port, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_3(host, port, password), true) {
|
||||
}
|
||||
|
||||
public ESLconnection(int socket) : this(ESLPINVOKE.new_ESLconnection__SWIG_4(socket), true) {
|
||||
}
|
||||
|
||||
public int SocketDescriptor() {
|
||||
|
||||
@@ -576,7 +576,41 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_NextHeader(void * jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_0(char * jarg1, char * jarg2, char * jarg3, char * jarg4) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_0(char * jarg1, int jarg2, char * jarg3, char * jarg4) {
|
||||
void * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_1(char * jarg1, int jarg2, char * jarg3) {
|
||||
void * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_2(char * jarg1, char * jarg2, char * jarg3, char * jarg4) {
|
||||
void * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -594,7 +628,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_0(char * jarg1, cha
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_1(char * jarg1, char * jarg2, char * jarg3) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_3(char * jarg1, char * jarg2, char * jarg3) {
|
||||
void * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -610,7 +644,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_1(char * jarg1, cha
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_2(int jarg1) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_4(int jarg1) {
|
||||
void * jresult ;
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
+213
-14
@@ -2673,6 +2673,117 @@ XS(_wrap_ESLevent_nextHeader) {
|
||||
|
||||
|
||||
XS(_wrap_new_ESLconnection__SWIG_0) {
|
||||
{
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 4) || (items > 4)) {
|
||||
SWIG_croak("Usage: new_ESLconnection(host,port,user,password);");
|
||||
}
|
||||
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "int""'");
|
||||
}
|
||||
arg2 = static_cast< int >(val2);
|
||||
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_ESLconnection" "', argument " "4"" of type '" "char const *""'");
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_new_ESLconnection__SWIG_1) {
|
||||
{
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 3) || (items > 3)) {
|
||||
SWIG_croak("Usage: new_ESLconnection(host,port,password);");
|
||||
}
|
||||
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "int""'");
|
||||
}
|
||||
arg2 = static_cast< int >(val2);
|
||||
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_new_ESLconnection__SWIG_2) {
|
||||
{
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -2734,7 +2845,7 @@ XS(_wrap_new_ESLconnection__SWIG_0) {
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_new_ESLconnection__SWIG_1) {
|
||||
XS(_wrap_new_ESLconnection__SWIG_3) {
|
||||
{
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -2785,7 +2896,7 @@ XS(_wrap_new_ESLconnection__SWIG_1) {
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_new_ESLconnection__SWIG_2) {
|
||||
XS(_wrap_new_ESLconnection__SWIG_4) {
|
||||
{
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
@@ -2855,8 +2966,10 @@ XS(_wrap_new_ESLconnection) {
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
{
|
||||
int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
}
|
||||
if (!_v) goto check_2;
|
||||
_ranki += _v*_pi;
|
||||
@@ -2877,7 +2990,7 @@ XS(_wrap_new_ESLconnection) {
|
||||
}
|
||||
check_2:
|
||||
|
||||
if (items == 4) {
|
||||
if (items == 3) {
|
||||
SWIG_TypeRank _ranki = 0;
|
||||
SWIG_TypeRank _rankm = 0;
|
||||
SWIG_TypeRank _pi = 1;
|
||||
@@ -2906,14 +3019,6 @@ XS(_wrap_new_ESLconnection) {
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(3), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_3;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
if (!_index || (_ranki < _rank)) {
|
||||
_rank = _ranki; _index = 3;
|
||||
if (_rank == _rankm) goto dispatch;
|
||||
@@ -2921,14 +3026,108 @@ XS(_wrap_new_ESLconnection) {
|
||||
}
|
||||
check_3:
|
||||
|
||||
if (items == 4) {
|
||||
SWIG_TypeRank _ranki = 0;
|
||||
SWIG_TypeRank _rankm = 0;
|
||||
SWIG_TypeRank _pi = 1;
|
||||
int _v = 0;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_4;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
{
|
||||
int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
}
|
||||
if (!_v) goto check_4;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_4;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(3), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_4;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
if (!_index || (_ranki < _rank)) {
|
||||
_rank = _ranki; _index = 4;
|
||||
if (_rank == _rankm) goto dispatch;
|
||||
}
|
||||
}
|
||||
check_4:
|
||||
|
||||
if (items == 4) {
|
||||
SWIG_TypeRank _ranki = 0;
|
||||
SWIG_TypeRank _rankm = 0;
|
||||
SWIG_TypeRank _pi = 1;
|
||||
int _v = 0;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_5;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_5;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_5;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
{
|
||||
int res = SWIG_AsCharPtrAndSize(ST(3), 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_5;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
if (!_index || (_ranki < _rank)) {
|
||||
_rank = _ranki; _index = 5;
|
||||
if (_rank == _rankm) goto dispatch;
|
||||
}
|
||||
}
|
||||
check_5:
|
||||
|
||||
dispatch:
|
||||
switch(_index) {
|
||||
case 1:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_2); return;
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_4); return;
|
||||
case 2:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_1); return;
|
||||
case 3:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_3); return;
|
||||
case 4:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_0); return;
|
||||
case 5:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_2); return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+121
-5
@@ -1796,6 +1796,93 @@ fail:
|
||||
|
||||
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
zval **args[4];
|
||||
|
||||
SWIG_ResetError();
|
||||
if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[0]);
|
||||
arg1 = (char *) Z_STRVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[1]);
|
||||
arg2 = (int) Z_LVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[3]);
|
||||
arg4 = (char *) Z_STRVAL_PP(args[3]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
{
|
||||
SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1);
|
||||
}
|
||||
return;
|
||||
fail:
|
||||
zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
|
||||
}
|
||||
|
||||
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
zval **args[3];
|
||||
|
||||
SWIG_ResetError();
|
||||
if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[0]);
|
||||
arg1 = (char *) Z_STRVAL_PP(args[0]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
convert_to_long_ex(args[1]);
|
||||
arg2 = (int) Z_LVAL_PP(args[1]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[2]);
|
||||
arg3 = (char *) Z_STRVAL_PP(args[2]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
{
|
||||
SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1);
|
||||
}
|
||||
return;
|
||||
fail:
|
||||
zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
|
||||
}
|
||||
|
||||
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
@@ -1842,7 +1929,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) {
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_3) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
@@ -1882,7 +1969,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) {
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_4) {
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
zval **args[1];
|
||||
@@ -1918,7 +2005,20 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) {
|
||||
int _v;
|
||||
_v = (Z_TYPE_PP(argv[0]) == IS_LONG);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
return _wrap_new_ESLconnection__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
int _v;
|
||||
_v = (Z_TYPE_PP(argv[0]) == IS_STRING);
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[1]) == IS_LONG);
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[2]) == IS_STRING);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
@@ -1929,7 +2029,23 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) {
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[2]) == IS_STRING);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
return _wrap_new_ESLconnection__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 4) {
|
||||
int _v;
|
||||
_v = (Z_TYPE_PP(argv[0]) == IS_STRING);
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[1]) == IS_LONG);
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[2]) == IS_STRING);
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[3]) == IS_STRING);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1944,7 +2060,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) {
|
||||
if (_v) {
|
||||
_v = (Z_TYPE_PP(argv[3]) == IS_STRING);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
return _wrap_new_ESLconnection__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3786,6 +3786,124 @@ SWIGINTERN PyObject *ESLevent_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObj
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
PyObject * obj3 = 0 ;
|
||||
|
||||
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
||||
if (!PyArg_ParseTuple(args,(char *)"OOOO:new_ESLconnection",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
|
||||
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "int""'");
|
||||
}
|
||||
arg2 = static_cast< int >(val2);
|
||||
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_ESLconnection" "', argument " "4"" of type '" "char const *""'");
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
{
|
||||
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
SWIG_PYTHON_THREAD_END_ALLOW;
|
||||
}
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_POINTER_NEW | 0 );
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return resultobj;
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
|
||||
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
||||
if (!PyArg_ParseTuple(args,(char *)"OOO:new_ESLconnection",&obj0,&obj1,&obj2)) SWIG_fail;
|
||||
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "int""'");
|
||||
}
|
||||
arg2 = static_cast< int >(val2);
|
||||
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
{
|
||||
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
SWIG_PYTHON_THREAD_END_ALLOW;
|
||||
}
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_POINTER_NEW | 0 );
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return resultobj;
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -3853,7 +3971,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -3909,7 +4027,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_new_ESLconnection__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
@@ -3957,7 +4075,26 @@ SWIGINTERN PyObject *_wrap_new_ESLconnection(PyObject *self, PyObject *args) {
|
||||
}
|
||||
if (_v) {
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return _wrap_new_ESLconnection__SWIG_2(self, args);
|
||||
return _wrap_new_ESLconnection__SWIG_4(self, args);
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
int _v;
|
||||
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
{
|
||||
int res = SWIG_AsVal_int(argv[1], NULL);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (_v) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return _wrap_new_ESLconnection__SWIG_1(self, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
@@ -3972,7 +4109,30 @@ SWIGINTERN PyObject *_wrap_new_ESLconnection(PyObject *self, PyObject *args) {
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return _wrap_new_ESLconnection__SWIG_1(self, args);
|
||||
return _wrap_new_ESLconnection__SWIG_3(self, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 4) {
|
||||
int _v;
|
||||
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
{
|
||||
int res = SWIG_AsVal_int(argv[1], NULL);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (_v) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return _wrap_new_ESLconnection__SWIG_0(self, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3992,7 +4152,7 @@ SWIGINTERN PyObject *_wrap_new_ESLconnection(PyObject *self, PyObject *args) {
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return _wrap_new_ESLconnection__SWIG_0(self, args);
|
||||
return _wrap_new_ESLconnection__SWIG_2(self, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4003,6 +4163,8 @@ SWIGINTERN PyObject *_wrap_new_ESLconnection(PyObject *self, PyObject *args) {
|
||||
fail:
|
||||
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_ESLconnection'.\n"
|
||||
" Possible C/C++ prototypes are:\n"
|
||||
" ESLconnection(char const *,int const,char const *,char const *)\n"
|
||||
" ESLconnection(char const *,int const,char const *)\n"
|
||||
" ESLconnection(char const *,char const *,char const *,char const *)\n"
|
||||
" ESLconnection(char const *,char const *,char const *)\n"
|
||||
" ESLconnection(int)\n");
|
||||
|
||||
+148
-5
@@ -2745,6 +2745,107 @@ swig_class cESLconnection;
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_new_ESLconnection__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
|
||||
if ((argc < 4) || (argc > 4)) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
|
||||
}
|
||||
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLconnection", 1, argv[0] ));
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
ecode2 = SWIG_AsVal_int(argv[1], &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ESLconnection", 2, argv[1] ));
|
||||
}
|
||||
arg2 = static_cast< int >(val2);
|
||||
res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","ESLconnection", 3, argv[2] ));
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","ESLconnection", 4, argv[3] ));
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);DATA_PTR(self) = result;
|
||||
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
return self;
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_new_ESLconnection__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
|
||||
if ((argc < 3) || (argc > 3)) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
|
||||
}
|
||||
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLconnection", 1, argv[0] ));
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
ecode2 = SWIG_AsVal_int(argv[1], &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ESLconnection", 2, argv[1] ));
|
||||
}
|
||||
arg2 = static_cast< int >(val2);
|
||||
res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","ESLconnection", 3, argv[2] ));
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);DATA_PTR(self) = result;
|
||||
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
return self;
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_new_ESLconnection__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
@@ -2803,7 +2904,7 @@ fail:
|
||||
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_new_ESLconnection__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
||||
_wrap_new_ESLconnection__SWIG_3(int argc, VALUE *argv, VALUE self) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
@@ -2868,7 +2969,7 @@ _wrap_ESLconnection_allocate(VALUE self) {
|
||||
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_new_ESLconnection__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
||||
_wrap_new_ESLconnection__SWIG_4(int argc, VALUE *argv, VALUE self) {
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
int val1 ;
|
||||
@@ -2907,7 +3008,25 @@ SWIGINTERN VALUE _wrap_new_ESLconnection(int nargs, VALUE *args, VALUE self) {
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_2(nargs, args, self);
|
||||
return _wrap_new_ESLconnection__SWIG_4(nargs, args, self);
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
int _v;
|
||||
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
{
|
||||
int res = SWIG_AsVal_int(argv[1], NULL);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (_v) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_1(nargs, args, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 3) {
|
||||
@@ -2921,7 +3040,29 @@ SWIGINTERN VALUE _wrap_new_ESLconnection(int nargs, VALUE *args, VALUE self) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_1(nargs, args, self);
|
||||
return _wrap_new_ESLconnection__SWIG_3(nargs, args, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (argc == 4) {
|
||||
int _v;
|
||||
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
{
|
||||
int res = SWIG_AsVal_int(argv[1], NULL);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (_v) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_0(nargs, args, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2940,7 +3081,7 @@ SWIGINTERN VALUE _wrap_new_ESLconnection(int nargs, VALUE *args, VALUE self) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_ESLconnection__SWIG_0(nargs, args, self);
|
||||
return _wrap_new_ESLconnection__SWIG_2(nargs, args, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2949,6 +3090,8 @@ SWIGINTERN VALUE _wrap_new_ESLconnection(int nargs, VALUE *args, VALUE self) {
|
||||
|
||||
fail:
|
||||
Ruby_Format_OverloadedError( argc, 4, "ESLconnection.new",
|
||||
" ESLconnection.new(char const *host, int const port, char const *user, char const *password)\n"
|
||||
" ESLconnection.new(char const *host, int const port, char const *password)\n"
|
||||
" ESLconnection.new(char const *host, char const *port, char const *user, char const *password)\n"
|
||||
" ESLconnection.new(char const *host, char const *port, char const *password)\n"
|
||||
" ESLconnection.new(int socket)\n");
|
||||
|
||||
@@ -9,6 +9,20 @@ void eslSetLogLevel(int level)
|
||||
esl_global_set_default_logger(level);
|
||||
}
|
||||
|
||||
ESLconnection::ESLconnection(const char *host, const int port, const char *password)
|
||||
{
|
||||
connection_construct_common();
|
||||
|
||||
esl_connect(&handle, host, port, NULL, password);
|
||||
}
|
||||
|
||||
ESLconnection::ESLconnection(const char *host, const int port, const char *user, const char *password)
|
||||
{
|
||||
connection_construct_common();
|
||||
|
||||
esl_connect(&handle, host, port, user, password);
|
||||
}
|
||||
|
||||
ESLconnection::ESLconnection(const char *host, const char *port, const char *password)
|
||||
{
|
||||
connection_construct_common();
|
||||
|
||||
@@ -74,6 +74,8 @@ class ESLconnection {
|
||||
private:
|
||||
esl_handle_t handle;
|
||||
public:
|
||||
ESLconnection(const char *host, const int port, const char *user, const char *password);
|
||||
ESLconnection(const char *host, const int port, const char *password);
|
||||
ESLconnection(const char *host, const char *port, const char *user, const char *password);
|
||||
ESLconnection(const char *host, const char *port, const char *password);
|
||||
ESLconnection(int socket);
|
||||
|
||||
@@ -1 +1 @@
|
||||
Tue May 14 07:44:21 CDT 2013
|
||||
Mon Jul 15 16:57:11 CDT 2013
|
||||
|
||||
@@ -226,6 +226,7 @@ void iks_disconnect (iksparser *prs);
|
||||
int iks_has_tls (void);
|
||||
int iks_is_secure (iksparser *prs);
|
||||
int iks_start_tls (iksparser *prs);
|
||||
int iks_proceed_tls (iksparser *prs, const char *cert_file, const char *key_file, int use_ssl);
|
||||
int iks_start_sasl (iksparser *prs, enum ikssasltype type, char *username, char *pass);
|
||||
|
||||
/***** jabber *****/
|
||||
|
||||
@@ -35,6 +35,8 @@ typedef unsigned __int32 uint32_t;
|
||||
#define SF_FOREIGN 1
|
||||
#define SF_TRY_SECURE 2
|
||||
#define SF_SECURE 4
|
||||
#define SF_SERVER 8
|
||||
#define SF_SSLv23 16
|
||||
|
||||
struct stream_data {
|
||||
iksparser *prs;
|
||||
@@ -51,6 +53,8 @@ struct stream_data {
|
||||
unsigned int flags;
|
||||
char *auth_username;
|
||||
char *auth_pass;
|
||||
char *cert_file;
|
||||
char *key_file;
|
||||
#ifdef HAVE_GNUTLS
|
||||
gnutls_session sess;
|
||||
gnutls_certificate_credentials cred;
|
||||
@@ -201,6 +205,7 @@ handshake (struct stream_data *data)
|
||||
gnutls_certificate_free_credentials (data->cred);
|
||||
return IKS_NOMEM;
|
||||
}
|
||||
|
||||
gnutls_protocol_set_priority (data->sess, protocol_priority);
|
||||
gnutls_cipher_set_priority(data->sess, cipher_priority);
|
||||
gnutls_compression_set_priority(data->sess, comp_priority);
|
||||
@@ -224,7 +229,9 @@ handshake (struct stream_data *data)
|
||||
data->flags &= (~SF_TRY_SECURE);
|
||||
data->flags |= SF_SECURE;
|
||||
|
||||
iks_send_header (data->prs, data->server);
|
||||
if (!(data->flags & SF_SERVER)) {
|
||||
iks_send_header (data->prs, data->server);
|
||||
}
|
||||
|
||||
return IKS_OK;
|
||||
} // HAVE_GNUTLS
|
||||
@@ -311,8 +318,25 @@ handshake (struct stream_data *data)
|
||||
SSL_library_init();
|
||||
SSL_load_error_strings();
|
||||
|
||||
data->ssl_ctx = SSL_CTX_new(TLSv1_method());
|
||||
if(!data->ssl_ctx) return IKS_NOMEM;
|
||||
if (data->flags & SF_SERVER) {
|
||||
if (data->flags & SF_SSLv23) {
|
||||
data->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
|
||||
} else {
|
||||
data->ssl_ctx = SSL_CTX_new(TLSv1_server_method());
|
||||
}
|
||||
if(!data->ssl_ctx) return IKS_NOMEM;
|
||||
|
||||
if (SSL_CTX_use_certificate_file(data->ssl_ctx, data->cert_file, SSL_FILETYPE_PEM) <= 0) {
|
||||
return IKS_NET_TLSFAIL;
|
||||
}
|
||||
if (SSL_CTX_use_PrivateKey_file(data->ssl_ctx, data->key_file, SSL_FILETYPE_PEM) <= 0) {
|
||||
return IKS_NET_TLSFAIL;
|
||||
}
|
||||
SSL_CTX_set_verify(data->ssl_ctx, SSL_VERIFY_NONE, NULL);
|
||||
} else {
|
||||
data->ssl_ctx = SSL_CTX_new(TLSv1_method());
|
||||
if(!data->ssl_ctx) return IKS_NOMEM;
|
||||
}
|
||||
|
||||
data->ssl = SSL_new(data->ssl_ctx);
|
||||
if(!data->ssl) return IKS_NOMEM;
|
||||
@@ -329,7 +353,11 @@ handshake (struct stream_data *data)
|
||||
|
||||
do
|
||||
{
|
||||
ret = SSL_connect(data->ssl);
|
||||
if (data->flags & SF_SERVER) {
|
||||
ret = SSL_accept(data->ssl);
|
||||
} else {
|
||||
ret = SSL_connect(data->ssl);
|
||||
}
|
||||
|
||||
if( ret != 1 )
|
||||
{
|
||||
@@ -346,7 +374,9 @@ handshake (struct stream_data *data)
|
||||
data->flags &= (~SF_TRY_SECURE);
|
||||
data->flags |= SF_SECURE;
|
||||
|
||||
iks_send_header (data->prs, data->server);
|
||||
if (!(data->flags & SF_SERVER)) {
|
||||
iks_send_header (data->prs, data->server);
|
||||
}
|
||||
}
|
||||
|
||||
return ret == 1 ? IKS_OK : IKS_NET_TLSFAIL;
|
||||
@@ -954,6 +984,40 @@ iks_start_tls (iksparser *prs)
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
iks_proceed_tls (iksparser *prs, const char *cert_file, const char *key_file, int use_ssl)
|
||||
{
|
||||
#ifdef HAVE_GNUTLS
|
||||
int ret;
|
||||
struct stream_data *data = iks_user_data (prs);
|
||||
|
||||
ret = iks_send_raw (prs, "<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
|
||||
if (ret) return ret;
|
||||
data->cert_file = iks_stack_strdup(data->s, cert_file, 0);
|
||||
data->key_file = iks_stack_strdup(data->s, key_file, 0);
|
||||
data->flags |= SF_TRY_SECURE | SF_SERVER;
|
||||
if (use_ssl) {
|
||||
data->flags |= SF_SSLv23;
|
||||
}
|
||||
return handshake (data);
|
||||
#elif HAVE_SSL
|
||||
int ret;
|
||||
struct stream_data *data = iks_user_data (prs);
|
||||
|
||||
ret = iks_send_raw (prs, "<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
|
||||
if (ret) return ret;
|
||||
data->cert_file = iks_stack_strdup(data->s, cert_file, 0);
|
||||
data->key_file = iks_stack_strdup(data->s, key_file, 0);
|
||||
data->flags |= SF_TRY_SECURE | SF_SERVER;
|
||||
if (use_ssl) {
|
||||
data->flags |= SF_SSLv23;
|
||||
}
|
||||
return handshake (data);
|
||||
#else
|
||||
return IKS_NET_NOTSUPP;
|
||||
#endif
|
||||
}
|
||||
|
||||
/***** sasl *****/
|
||||
|
||||
int
|
||||
|
||||
@@ -112,7 +112,7 @@ xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /
|
||||
<AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -181,7 +181,7 @@ xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
||||
@@ -116,7 +116,7 @@ xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /
|
||||
<AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -185,7 +185,7 @@ xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
||||
@@ -598,39 +598,28 @@ switch_mutex_unlock(obj->flag_mutex);
|
||||
|
||||
#define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
|
||||
|
||||
SWITCH_DECLARE(char *) switch_url_encode(const char *url, char *buf, size_t len);
|
||||
SWITCH_DECLARE(char *) switch_url_decode(char *s);
|
||||
|
||||
static inline char *switch_sanitize_number(char *number)
|
||||
{
|
||||
char *p, *q;
|
||||
char *p = number, *q;
|
||||
char warp[] = "/:";
|
||||
int i;
|
||||
char *val;
|
||||
|
||||
switch_assert(number);
|
||||
|
||||
p = strdup(number);
|
||||
val = p;
|
||||
switch_url_decode(val);
|
||||
|
||||
if (!(strchr(val, '/') || strchr(val, ':') || strchr(val, '@') || strchr(val, '%'))) {
|
||||
if (!(strchr(p, '/') || strchr(p, ':') || strchr(p, '@'))) {
|
||||
return number;
|
||||
}
|
||||
|
||||
while ((q = strrchr(val, '@')))
|
||||
while ((q = strrchr(p, '@')))
|
||||
*q = '\0';
|
||||
|
||||
while ((q = strrchr(val, '%')))
|
||||
*q = '\0';
|
||||
|
||||
for (i = 0; i < (int) strlen(warp); i++) {
|
||||
while (val && (q = strchr(val, warp[i])))
|
||||
val = q + 1;
|
||||
while (p && (q = strchr(p, warp[i])))
|
||||
p = q + 1;
|
||||
}
|
||||
free(p);
|
||||
|
||||
return val;
|
||||
return p;
|
||||
}
|
||||
|
||||
static inline switch_bool_t switch_string_var_check(char *s, switch_bool_t disable)
|
||||
@@ -938,6 +927,8 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit
|
||||
|
||||
|
||||
#define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK)
|
||||
SWITCH_DECLARE(char *) switch_url_encode(const char *url, char *buf, size_t len);
|
||||
SWITCH_DECLARE(char *) switch_url_decode(char *s);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
|
||||
const char *from,
|
||||
const char *headers,
|
||||
|
||||
@@ -334,6 +334,7 @@ typedef struct conference_obj {
|
||||
switch_mutex_t *mutex;
|
||||
conference_member_t *members;
|
||||
conference_member_t *floor_holder;
|
||||
conference_member_t *video_floor_holder;
|
||||
switch_mutex_t *member_mutex;
|
||||
conference_file_node_t *fnode;
|
||||
conference_file_node_t *async_fnode;
|
||||
@@ -527,7 +528,6 @@ static switch_status_t chat_send(switch_event_t *message_event);
|
||||
|
||||
static void launch_conference_record_thread(conference_obj_t *conference, char *path);
|
||||
static int launch_conference_video_bridge_thread(conference_member_t *member_a, conference_member_t *member_b);
|
||||
static void launch_conference_video_mirror_thread(conference_member_t *member_a);
|
||||
|
||||
typedef switch_status_t (*conf_api_args_cmd_t) (conference_obj_t *, switch_stream_handle_t *, int, char **);
|
||||
typedef switch_status_t (*conf_api_member_cmd_t) (conference_member_t *, switch_stream_handle_t *, void *);
|
||||
@@ -542,6 +542,8 @@ static switch_status_t conf_api_sub_undeaf(conference_member_t *member, switch_s
|
||||
static switch_status_t conference_add_event_data(conference_obj_t *conference, switch_event_t *event);
|
||||
static switch_status_t conference_add_event_member_data(conference_member_t *member, switch_event_t *event);
|
||||
static switch_status_t conf_api_sub_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data);
|
||||
static switch_status_t conf_api_sub_vid_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data);
|
||||
static switch_status_t conf_api_sub_clear_vid_floor(conference_obj_t *conference, switch_stream_handle_t *stream, void *data);
|
||||
static switch_status_t conf_api_sub_enforce_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data);
|
||||
|
||||
|
||||
@@ -1455,7 +1457,9 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
|
||||
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_VIDEO)) {
|
||||
switch_channel_clear_flag(channel, CF_VIDEO_ECHO);
|
||||
if (!switch_test_flag(conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
switch_channel_clear_flag(channel, CF_VIDEO_ECHO);
|
||||
}
|
||||
/* Tell the channel to request a fresh vid frame */
|
||||
switch_core_session_refresh_video(member->session);
|
||||
}
|
||||
@@ -1572,18 +1576,94 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
|
||||
return status;
|
||||
}
|
||||
|
||||
static void conference_set_video_floor_holder(conference_obj_t *conference, conference_member_t *member)
|
||||
{
|
||||
switch_event_t *event;
|
||||
int old_id = 0;
|
||||
|
||||
if (switch_test_flag(conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (conference->video_floor_holder) {
|
||||
if (conference->video_floor_holder == member) {
|
||||
return;
|
||||
} else {
|
||||
old_id = conference->video_floor_holder->id;
|
||||
switch_channel_clear_flag(conference->video_floor_holder->channel, CF_VIDEO_PASSIVE);
|
||||
switch_core_session_refresh_video(conference->video_floor_holder->session);
|
||||
}
|
||||
}
|
||||
|
||||
if ((conference->video_floor_holder = member)) {
|
||||
switch_channel_set_flag(member->channel, CF_VIDEO_PASSIVE);
|
||||
switch_core_session_refresh_video(conference->video_floor_holder->session);
|
||||
switch_set_flag(conference, CFLAG_FLOOR_CHANGE);
|
||||
}
|
||||
|
||||
if (old_id > -1 && test_eflag(conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "video-floor-change");
|
||||
if (old_id) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", old_id);
|
||||
} else {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-ID", "none");
|
||||
}
|
||||
if (conference->video_floor_holder) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", conference->video_floor_holder->id);
|
||||
} else {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-ID", "none");
|
||||
}
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void conference_set_floor_holder(conference_obj_t *conference, conference_member_t *member)
|
||||
{
|
||||
switch_event_t *event;
|
||||
int old_id = 0;
|
||||
|
||||
if (conference->floor_holder && conference->floor_holder != member) {
|
||||
switch_channel_clear_flag(conference->floor_holder->channel, CF_VIDEO_PASSIVE);
|
||||
if (conference->floor_holder) {
|
||||
if (conference->floor_holder == member) {
|
||||
return;
|
||||
} else {
|
||||
old_id = conference->floor_holder->id;
|
||||
if (!conference->video_floor_holder && !switch_test_flag(conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
switch_channel_clear_flag(conference->floor_holder->channel, CF_VIDEO_PASSIVE);
|
||||
switch_core_session_refresh_video(conference->floor_holder->session);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((conference->floor_holder = member)) {
|
||||
switch_channel_set_flag(member->channel, CF_VIDEO_PASSIVE);
|
||||
switch_core_session_refresh_video(conference->floor_holder->session);
|
||||
if (!conference->video_floor_holder && !switch_test_flag(conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
switch_channel_set_flag(member->channel, CF_VIDEO_PASSIVE);
|
||||
switch_core_session_refresh_video(conference->floor_holder->session);
|
||||
}
|
||||
switch_set_flag(conference, CFLAG_FLOOR_CHANGE);
|
||||
}
|
||||
|
||||
if (old_id > -1 && test_eflag(conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
if (old_id) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", old_id);
|
||||
} else {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-ID", "none");
|
||||
}
|
||||
|
||||
if (conference->floor_holder) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", conference->floor_holder->id);
|
||||
} else {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-ID", "none");
|
||||
}
|
||||
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Gain exclusive access and remove the member from the list */
|
||||
@@ -1669,18 +1749,12 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe
|
||||
}
|
||||
|
||||
if (member == member->conference->floor_holder) {
|
||||
//member->conference->floor_holder = NULL;
|
||||
conference_set_floor_holder(member->conference, NULL);
|
||||
}
|
||||
|
||||
|
||||
if (test_eflag(conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", member->id);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "none");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
if (member == member->conference->video_floor_holder) {
|
||||
conference_set_video_floor_holder(member->conference, NULL);
|
||||
}
|
||||
|
||||
member->conference = NULL;
|
||||
@@ -1758,6 +1832,8 @@ static void *SWITCH_THREAD_FUNC conference_video_bridge_thread_run(switch_thread
|
||||
switch_thread_rwlock_rdlock(vh->member_b->rwlock);
|
||||
|
||||
|
||||
switch_channel_set_flag(channel_a, CF_VIDEO_PASSIVE);
|
||||
|
||||
/* Acquire locks for both sessions so the helper object and member structures don't get destroyed before we exit */
|
||||
switch_core_session_read_lock(session_a);
|
||||
switch_core_session_read_lock(session_b);
|
||||
@@ -1786,6 +1862,7 @@ static void *SWITCH_THREAD_FUNC conference_video_bridge_thread_run(switch_thread
|
||||
}
|
||||
}
|
||||
}
|
||||
switch_channel_clear_flag(channel_a, CF_VIDEO_PASSIVE);
|
||||
|
||||
switch_thread_rwlock_unlock(vh->member_b->rwlock);
|
||||
switch_thread_rwlock_unlock(vh->member_a->rwlock);
|
||||
@@ -1802,62 +1879,6 @@ static void *SWITCH_THREAD_FUNC conference_video_bridge_thread_run(switch_thread
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void *SWITCH_THREAD_FUNC conference_video_mirror_thread_run(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
struct vid_helper *vh = obj;
|
||||
switch_core_session_t *session_a = vh->member_a->session;
|
||||
switch_channel_t *channel_a = switch_core_session_get_channel(session_a);
|
||||
switch_status_t status;
|
||||
switch_frame_t *read_frame;
|
||||
conference_obj_t *conference = vh->member_a->conference;
|
||||
switch_core_session_message_t msg = { 0 };
|
||||
|
||||
switch_thread_rwlock_rdlock(conference->rwlock);
|
||||
switch_thread_rwlock_rdlock(vh->member_a->rwlock);
|
||||
|
||||
/* Acquire locks for both sessions so the helper object and member structures don't get destroyed before we exit */
|
||||
switch_core_session_read_lock(session_a);
|
||||
|
||||
/* Tell the channel to request a fresh vid frame */
|
||||
msg.from = __FILE__;
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
|
||||
switch_core_session_receive_message(session_a, &msg);
|
||||
|
||||
vh->up = 1;
|
||||
while (vh->up > 0 && switch_test_flag(vh->member_a, MFLAG_RUNNING) &&
|
||||
switch_channel_ready(channel_a)) {
|
||||
|
||||
if (vh->up == 1) {
|
||||
status = switch_core_session_read_video_frame(session_a, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!switch_test_flag(read_frame, SFF_CNG)) {
|
||||
if (switch_core_session_write_video_frame(session_a, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch_yield(100000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch_thread_rwlock_unlock(vh->member_a->rwlock);
|
||||
|
||||
switch_core_session_rwunlock(session_a);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s video mirror thread ended.\n", switch_channel_get_name(channel_a));
|
||||
|
||||
switch_thread_rwlock_unlock(conference->rwlock);
|
||||
|
||||
vh->up = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Main video monitor thread (1 per distinct conference room) */
|
||||
static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
@@ -1869,6 +1890,7 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
||||
int yield = 0;
|
||||
switch_core_session_t *session;
|
||||
char buf[65536];
|
||||
conference_member_t *floor_holder = NULL;
|
||||
|
||||
conference->video_running = 1;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Video thread started for conference %s\n", conference->name);
|
||||
@@ -1881,17 +1903,24 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
||||
|
||||
switch_mutex_lock(conference->mutex);
|
||||
|
||||
if (!conference->floor_holder) {
|
||||
if (conference->video_floor_holder) {
|
||||
floor_holder = conference->video_floor_holder;
|
||||
} else {
|
||||
floor_holder = conference->floor_holder;
|
||||
}
|
||||
|
||||
|
||||
if (!floor_holder) {
|
||||
yield = 100000;
|
||||
goto do_continue;
|
||||
}
|
||||
|
||||
if (!switch_channel_test_flag(switch_core_session_get_channel(conference->floor_holder->session), CF_VIDEO)) {
|
||||
if (!switch_channel_test_flag(switch_core_session_get_channel(floor_holder->session), CF_VIDEO)) {
|
||||
yield = 100000;
|
||||
goto do_continue;
|
||||
}
|
||||
|
||||
session = conference->floor_holder->session;
|
||||
session = floor_holder->session;
|
||||
|
||||
if ((status = switch_core_session_read_lock(session)) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
@@ -2070,48 +2099,9 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
||||
switch_mutex_unlock(imember->audio_in_mutex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (floor_holder != conference->floor_holder) {
|
||||
switch_event_t *event = NULL;
|
||||
|
||||
if (test_eflag(conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
|
||||
if (floor_holder) {
|
||||
conference_add_event_member_data(floor_holder, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", floor_holder->id);
|
||||
} else {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "none");
|
||||
}
|
||||
|
||||
if (conference->floor_holder) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", conference->floor_holder->id);
|
||||
} else {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-ID", "none");
|
||||
}
|
||||
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
if (floor_holder) {
|
||||
switch_channel_t *floor_channel = switch_core_session_get_channel(floor_holder->session);
|
||||
if (switch_channel_test_flag(floor_channel, CF_VIDEO)) {
|
||||
switch_core_session_message_t msg = { 0 };
|
||||
|
||||
msg.from = __FILE__;
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
|
||||
|
||||
switch_core_session_receive_message(floor_holder->session, &msg);
|
||||
}
|
||||
}
|
||||
|
||||
//conference->floor_holder = floor_holder;
|
||||
conference_set_floor_holder(conference, floor_holder);
|
||||
}
|
||||
|
||||
|
||||
if (conference->perpetual_sound && !conference->async_fnode) {
|
||||
conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1);
|
||||
@@ -2187,16 +2177,6 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
||||
} else {
|
||||
conference->mh.up = -1;
|
||||
}
|
||||
} else if (conference->vh[0].up == 0 &&
|
||||
conference->vh[1].up == 0 &&
|
||||
conference->mh.up == 0 &&
|
||||
video_bridge_members[0] &&
|
||||
!video_bridge_members[1] &&
|
||||
switch_test_flag(video_bridge_members[0], MFLAG_RUNNING) &&
|
||||
switch_channel_ready(switch_core_session_get_channel(video_bridge_members[0]->session))
|
||||
) {
|
||||
|
||||
launch_conference_video_mirror_thread(video_bridge_members[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2573,6 +2553,20 @@ static void conference_loop_fn_floor_toggle(conference_member_t *member, caller_
|
||||
conf_api_sub_floor(member, NULL, NULL);
|
||||
}
|
||||
|
||||
static void conference_loop_fn_vid_floor_toggle(conference_member_t *member, caller_control_action_t *action)
|
||||
{
|
||||
if (member == NULL) return;
|
||||
|
||||
conf_api_sub_vid_floor(member, NULL, NULL);
|
||||
}
|
||||
|
||||
static void conference_loop_fn_vid_floor_force(conference_member_t *member, caller_control_action_t *action)
|
||||
{
|
||||
if (member == NULL) return;
|
||||
|
||||
conf_api_sub_vid_floor(member, NULL, "force");
|
||||
}
|
||||
|
||||
static void conference_loop_fn_enforce_floor(conference_member_t *member, caller_control_action_t *action)
|
||||
{
|
||||
if (member == NULL) return;
|
||||
@@ -5242,7 +5236,6 @@ static switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_st
|
||||
|
||||
static switch_status_t conf_api_sub_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data)
|
||||
{
|
||||
switch_event_t *event;
|
||||
|
||||
if (member == NULL)
|
||||
return SWITCH_STATUS_GENERR;
|
||||
@@ -5250,38 +5243,14 @@ static switch_status_t conf_api_sub_floor(conference_member_t *member, switch_st
|
||||
switch_mutex_lock(member->conference->mutex);
|
||||
|
||||
if (member->conference->floor_holder == member) {
|
||||
//member->conference->floor_holder = NULL;
|
||||
conference_set_floor_holder(member->conference, NULL);
|
||||
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(member->conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", member->id);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "none");
|
||||
switch_event_fire(&event);
|
||||
if (stream != NULL) {
|
||||
stream->write_function(stream, "OK floor none\n");
|
||||
}
|
||||
if (stream != NULL) {
|
||||
stream->write_function(stream, "OK floor none\n");
|
||||
}
|
||||
} else if (member->conference->floor_holder == NULL) {
|
||||
//member->conference->floor_holder = member;
|
||||
conference_set_floor_holder(member->conference, member);
|
||||
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(member->conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "none");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", member->id);
|
||||
switch_event_fire(&event);
|
||||
if (stream != NULL) {
|
||||
stream->write_function(stream, "OK floor %u\n", member->id);
|
||||
}
|
||||
|
||||
if (switch_core_session_read_lock(member->session) == SWITCH_STATUS_SUCCESS) {
|
||||
/* Tell the channel to request a fresh vid frame */
|
||||
switch_channel_set_flag(switch_core_session_get_channel(member->session), CF_VIDEO_REFRESH_REQ);
|
||||
switch_core_session_rwunlock(member->session);
|
||||
}
|
||||
if (stream != NULL) {
|
||||
stream->write_function(stream, "OK floor %u\n", member->id);
|
||||
}
|
||||
} else {
|
||||
if (stream != NULL) {
|
||||
@@ -5294,39 +5263,85 @@ static switch_status_t conf_api_sub_floor(conference_member_t *member, switch_st
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t conf_api_sub_clear_vid_floor(conference_obj_t *conference, switch_stream_handle_t *stream, void *data)
|
||||
{
|
||||
|
||||
if (switch_test_flag(conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||
"conference %s is in video bridge mode, this functionality is not compatible\n", conference->name);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_mutex_lock(conference->mutex);
|
||||
conference_set_video_floor_holder(conference, NULL);
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t conf_api_sub_vid_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data)
|
||||
{
|
||||
int force = 0;
|
||||
|
||||
if (member == NULL)
|
||||
return SWITCH_STATUS_GENERR;
|
||||
|
||||
if (switch_test_flag(member->conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||
"conference %s is in video bridge mode, this functionality is not compatible\n", member->conference->name);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_mutex_lock(member->conference->mutex);
|
||||
|
||||
if (data && switch_stristr("force", (char *) data)) {
|
||||
force = 1;
|
||||
}
|
||||
|
||||
if (!force && member->conference->video_floor_holder == member) {
|
||||
conference_set_video_floor_holder(member->conference, NULL);
|
||||
if (stream == NULL) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s OK floor none\n", member->conference->name);
|
||||
} else {
|
||||
stream->write_function(stream, "OK floor none\n");
|
||||
}
|
||||
|
||||
} else if (force || member->conference->video_floor_holder == NULL) {
|
||||
conference_set_video_floor_holder(member->conference, member);
|
||||
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE)) {
|
||||
if (stream == NULL) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s OK floor %d %s\n",
|
||||
member->conference->name, member->id, switch_channel_get_name(member->channel));
|
||||
} else {
|
||||
stream->write_function(stream, "OK floor %u\n", member->id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (stream == NULL) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s floor already held by %d %s\n",
|
||||
member->conference->name, member->id, switch_channel_get_name(member->channel));
|
||||
} else {
|
||||
stream->write_function(stream, "ERR floor is held by %u\n", member->conference->video_floor_holder->id);
|
||||
}
|
||||
}
|
||||
|
||||
switch_mutex_unlock(member->conference->mutex);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t conf_api_sub_enforce_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data)
|
||||
{
|
||||
switch_event_t *event;
|
||||
|
||||
if (member == NULL)
|
||||
return SWITCH_STATUS_GENERR;
|
||||
|
||||
switch_mutex_lock(member->conference->mutex);
|
||||
|
||||
if (member->conference->floor_holder != member) {
|
||||
conference_member_t *old_member = member->conference->floor_holder;
|
||||
//member->conference->floor_holder = member;
|
||||
conference_set_floor_holder(member->conference, member);
|
||||
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE)) {
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(member->conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
if (old_member == NULL) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "none");
|
||||
} else {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", old_member->id);
|
||||
}
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", member->id);
|
||||
switch_event_fire(&event);
|
||||
if (stream != NULL) {
|
||||
stream->write_function(stream, "OK floor %u\n", member->id);
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_core_session_read_lock(member->session) == SWITCH_STATUS_SUCCESS) {
|
||||
/* Tell the channel to request a fresh vid frame */
|
||||
switch_channel_set_flag(switch_core_session_get_channel(member->session), CF_VIDEO_REFRESH_REQ);
|
||||
switch_core_session_rwunlock(member->session);
|
||||
if (stream != NULL) {
|
||||
stream->write_function(stream, "OK floor %u\n", member->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6528,6 +6543,8 @@ static api_command_t conf_api_sub_commands[] = {
|
||||
{"get", (void_fn_t) & conf_api_sub_get, CONF_API_SUB_ARGS_SPLIT, "get", "<parameter-name>"},
|
||||
{"set", (void_fn_t) & conf_api_sub_set, CONF_API_SUB_ARGS_SPLIT, "set", "<max_members|sound_prefix|caller_id_name|caller_id_number|endconf_grace_time> <value>"},
|
||||
{"floor", (void_fn_t) & conf_api_sub_floor, CONF_API_SUB_MEMBER_TARGET, "floor", "<member_id|last>"},
|
||||
{"vid-floor", (void_fn_t) & conf_api_sub_vid_floor, CONF_API_SUB_MEMBER_TARGET, "vid-floor", "<member_id|last> [force]"},
|
||||
{"clear-vid-floor", (void_fn_t) & conf_api_sub_clear_vid_floor, CONF_API_SUB_ARGS_AS_ONE, "clear-vid-floor", ""},
|
||||
{"enforce_floor", (void_fn_t) & conf_api_sub_enforce_floor, CONF_API_SUB_MEMBER_TARGET, "enforce_floor", "<member_id|last>"},
|
||||
};
|
||||
|
||||
@@ -8035,19 +8052,6 @@ static int launch_conference_video_bridge_thread(conference_member_t *member_a,
|
||||
|
||||
|
||||
|
||||
/* Create a video thread for the conference and launch it */
|
||||
static void launch_conference_video_mirror_thread(conference_member_t *member_a)
|
||||
{
|
||||
conference_obj_t *conference = member_a->conference;
|
||||
switch_memory_pool_t *pool = conference->pool;
|
||||
|
||||
memset(&conference->mh, 0, sizeof(conference->mh));
|
||||
|
||||
conference->mh.member_a = member_a;
|
||||
|
||||
launch_thread_detached(conference_video_mirror_thread_run, pool, &conference->mh);
|
||||
}
|
||||
|
||||
static void launch_conference_record_thread(conference_obj_t *conference, char *path)
|
||||
{
|
||||
switch_thread_t *thread;
|
||||
@@ -9116,6 +9120,8 @@ static struct _mapping control_mappings[] = {
|
||||
{"transfer", conference_loop_fn_transfer},
|
||||
{"execute_application", conference_loop_fn_exec_app},
|
||||
{"floor", conference_loop_fn_floor_toggle},
|
||||
{"vid-floor", conference_loop_fn_vid_floor_toggle},
|
||||
{"vid-floor-force", conference_loop_fn_vid_floor_force},
|
||||
{"enforce_floor", conference_loop_fn_enforce_floor},
|
||||
};
|
||||
#define MAPPING_LEN (sizeof(control_mappings)/sizeof(control_mappings[0]))
|
||||
|
||||
@@ -848,11 +848,22 @@ int channel_on_hangup_callback(void *pArg, int argc, char **argv, char **columnN
|
||||
skinny_line_set_state(listener, line_instance, call_id, SKINNY_ON_HOOK);
|
||||
send_select_soft_keys(listener, line_instance, call_id, SKINNY_KEY_SET_ON_HOOK, 0xffff);
|
||||
send_define_current_time_date(listener);
|
||||
if((call_state == SKINNY_PROCEED) || (call_state == SKINNY_RING_OUT) || (call_state == SKINNY_CONNECTED)) { /* calling parties */
|
||||
|
||||
skinny_log_ls(listener, helper->tech_pvt->session, SWITCH_LOG_DEBUG,
|
||||
"channel_on_hangup_callback - cause=%s [%d], call_state = %s [%d]\n",
|
||||
switch_channel_cause2str(helper->cause), helper->cause,
|
||||
skinny_call_state2str(call_state), call_state);
|
||||
|
||||
if ( call_state == SKINNY_RING_OUT && helper->cause == SWITCH_CAUSE_USER_BUSY )
|
||||
{
|
||||
// don't hang up speaker here
|
||||
}
|
||||
else if((call_state == SKINNY_PROCEED) || (call_state == SKINNY_RING_OUT) || (call_state == SKINNY_CONNECTED)) { /* calling parties */
|
||||
// This is NOT correct, but results in slightly better behavior than before
|
||||
// leaving note here to revisit.
|
||||
|
||||
//send_set_speaker_mode(listener, SKINNY_SPEAKER_OFF);
|
||||
/* re-enabling for testing to bring back bad behavior */
|
||||
send_set_speaker_mode(listener, SKINNY_SPEAKER_OFF);
|
||||
}
|
||||
send_set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, call_id);
|
||||
}
|
||||
@@ -869,7 +880,7 @@ switch_status_t channel_on_hangup(switch_core_session_t *session)
|
||||
|
||||
switch_clear_flag_locked(tech_pvt, TFLAG_IO);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP [%s]\n",
|
||||
skinny_log_s(session, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP [%s]\n",
|
||||
switch_channel_get_name(channel), switch_channel_cause2str(cause));
|
||||
|
||||
helper.tech_pvt= tech_pvt;
|
||||
|
||||
@@ -61,6 +61,10 @@
|
||||
"[%s:%d @ %s:%d] " _fmt, skinny_undef_str(listener->device_name), listener->device_instance, skinny_undef_str(listener->remote_ip), \
|
||||
listener->remote_port)
|
||||
|
||||
#define skinny_log_s(session, level, _fmt, ...) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), level, \
|
||||
_fmt, __VA_ARGS__)
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* MODULE TYPES */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -4275,6 +4275,24 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
||||
}
|
||||
} else {
|
||||
host++;
|
||||
|
||||
if (!strchr(host, '.') || switch_true(switch_event_get_header(var_event, "sip_gethostbyname"))) {
|
||||
struct sockaddr_in sa;
|
||||
struct hostent *he = gethostbyname(host);
|
||||
char *ip, *tmp;
|
||||
|
||||
if (he) {
|
||||
memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
|
||||
ip = inet_ntoa(sa.sin_addr);
|
||||
|
||||
tmp = switch_string_replace(dest, host, ip);
|
||||
//host = switch_core_session_strdup(nsession, ip);
|
||||
//dest = switch_core_session_strdup(nsession, tmp);
|
||||
switch_channel_set_variable_printf(nchannel, "sip_route_uri", "sip:%s", tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
tech_pvt->dest = switch_core_session_alloc(nsession, strlen(dest) + 5);
|
||||
tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
|
||||
switch_snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
* Anthony Minessale II <anthm@freeswitch.org>
|
||||
* PeteDao <petekay@gmail.com>
|
||||
* Steve Underwood 0.0.1 <steveu@coppice.org>
|
||||
*
|
||||
* Seven Du <dujinfang@gmail.com>
|
||||
*
|
||||
* mod_say_zh.c -- Say for Mandarin, Cantonese, and probably any other Chinese
|
||||
* dialect.
|
||||
@@ -430,6 +430,58 @@ static switch_status_t zh_say_money(switch_core_session_t *session, char *tosay,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t zh_CN_say_money(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
|
||||
{
|
||||
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
||||
char dbuf[16] = ""; /* enough for digits/x.wav */
|
||||
char *yuan = NULL;
|
||||
char *rest = NULL;
|
||||
int i;
|
||||
|
||||
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
yuan = sbuf;
|
||||
|
||||
if ((rest = strchr(sbuf, '.'))) {
|
||||
*rest++ = '\0';
|
||||
}
|
||||
|
||||
/* If positive sign - skip over" */
|
||||
if (sbuf[0] == '+') {
|
||||
yuan++;
|
||||
}
|
||||
|
||||
/* If negative say "negative" */
|
||||
if (sbuf[0] == '-') {
|
||||
say_file("currency/negative.wav");
|
||||
yuan++;
|
||||
}
|
||||
|
||||
/* Say dollar amount */
|
||||
zh_say_general_count(session, yuan, say_args, args);
|
||||
say_file("currency/yuan.wav");
|
||||
|
||||
if (!rest) return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
/* Say cents */
|
||||
for (i=0; *rest; i++, rest++) {
|
||||
sprintf(dbuf, "digits/%c.wav", *rest);
|
||||
say_file(dbuf);
|
||||
if (i == 0) {
|
||||
say_file("currency/jiao.wav");
|
||||
} else if (i == 1) {
|
||||
say_file("currency/fen.wav");
|
||||
} else if (i == 2) {
|
||||
say_file("currency/li.wav");
|
||||
} /* else just say the rest of digits */
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t zh_say(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
|
||||
{
|
||||
switch_say_callback_t say_cb = NULL;
|
||||
@@ -469,15 +521,59 @@ static switch_status_t zh_say(switch_core_session_t *session, char *tosay, switc
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
static switch_status_t zh_CN_say(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
|
||||
{
|
||||
switch_say_callback_t say_cb = NULL;
|
||||
|
||||
switch (say_args->type) {
|
||||
case SST_NUMBER:
|
||||
case SST_ITEMS:
|
||||
case SST_PERSONS:
|
||||
case SST_MESSAGES:
|
||||
say_cb = zh_say_general_count;
|
||||
break;
|
||||
case SST_TIME_MEASUREMENT:
|
||||
case SST_CURRENT_DATE:
|
||||
case SST_CURRENT_TIME:
|
||||
case SST_CURRENT_DATE_TIME:
|
||||
say_cb = zh_say_time;
|
||||
break;
|
||||
case SST_IP_ADDRESS:
|
||||
return switch_ivr_say_ip(session, tosay, zh_say_general_count, say_args, args);
|
||||
break;
|
||||
case SST_NAME_SPELLED:
|
||||
case SST_NAME_PHONETIC:
|
||||
return switch_ivr_say_spell(session, tosay, say_args, args);
|
||||
break;
|
||||
case SST_CURRENCY:
|
||||
say_cb = zh_CN_say_money;
|
||||
break;
|
||||
default:
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown Say type=[%d]\n", say_args->type);
|
||||
break;
|
||||
}
|
||||
|
||||
if (say_cb) {
|
||||
return say_cb(session, tosay, say_args, args);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_say_zh_load)
|
||||
{
|
||||
switch_say_interface_t *say_interface;
|
||||
switch_say_interface_t *say_zh_CN_interface;
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
say_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SAY_INTERFACE);
|
||||
say_interface->interface_name = "zh";
|
||||
say_interface->say_function = zh_say;
|
||||
|
||||
say_zh_CN_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SAY_INTERFACE);
|
||||
say_zh_CN_interface->interface_name = "zh_CN";
|
||||
say_zh_CN_interface->say_function = zh_CN_say;
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2464,9 +2464,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||
|
||||
if (m->m_proto_name && !strcasecmp(m->m_proto_name, "UDP/TLS/RTP/SAVPF")) {
|
||||
switch_channel_set_flag(session->channel, CF_WEBRTC_MOZ);
|
||||
printf("PRICK FACE 1\n");
|
||||
} else {
|
||||
printf("PRICK FACE 2 [%s]\n", m->m_proto_name);
|
||||
}
|
||||
|
||||
if (m->m_proto == sdp_proto_srtp || m->m_proto == sdp_proto_extended_srtp) {
|
||||
|
||||
+2
-11
@@ -34,8 +34,6 @@
|
||||
//#define RTP_DEBUG_WRITE_DELTA
|
||||
//#define DEBUG_MISSED_SEQ
|
||||
|
||||
#define FIR_COUNTDOWN 100
|
||||
|
||||
#include <switch.h>
|
||||
#ifndef _MSC_VER
|
||||
#include <switch_private.h>
|
||||
@@ -56,6 +54,8 @@
|
||||
#include <switch_version.h>
|
||||
#include <switch_ssl.h>
|
||||
|
||||
#define FIR_COUNTDOWN 100
|
||||
|
||||
#define READ_INC(rtp_session) switch_mutex_lock(rtp_session->read_mutex); rtp_session->reading++
|
||||
#define READ_DEC(rtp_session) switch_mutex_unlock(rtp_session->read_mutex); rtp_session->reading--
|
||||
#define WRITE_INC(rtp_session) switch_mutex_lock(rtp_session->write_mutex); rtp_session->writing++
|
||||
@@ -270,7 +270,6 @@ typedef struct ts_normalize_s {
|
||||
uint32_t last_frame;
|
||||
uint32_t ts;
|
||||
uint32_t delta;
|
||||
uint8_t m;
|
||||
} ts_normalize_t;
|
||||
|
||||
struct switch_rtp {
|
||||
@@ -5484,7 +5483,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||
|
||||
if (!rtp_session->ts_norm.last_ssrc || send_msg->header.ssrc != rtp_session->ts_norm.last_ssrc) {
|
||||
if (rtp_session->ts_norm.last_ssrc) {
|
||||
rtp_session->ts_norm.m = 1;
|
||||
if (rtp_session->ts_norm.delta) {
|
||||
rtp_session->ts_norm.ts += rtp_session->ts_norm.delta;
|
||||
}
|
||||
@@ -5502,13 +5500,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||
rtp_session->ts_norm.last_frame = ntohl(send_msg->header.ts);
|
||||
send_msg->header.ts = htonl(rtp_session->ts_norm.ts);
|
||||
|
||||
if (rtp_session->ts_norm.m) {
|
||||
if (send_msg->header.m) {
|
||||
rtp_session->ts_norm.m = 0;
|
||||
} else {
|
||||
send_msg->header.m = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
send_msg->header.ssrc = htonl(rtp_session->ssrc);
|
||||
|
||||
Reference in New Issue
Block a user