mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 15:14:17 +00:00
add optional arg to hangup hook in perl/lua
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8323 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
de516ce25f
commit
385528394e
7 files changed
+389
-12
No files matched your search
@@ -6997,7 +6997,56 @@ XS(_wrap_Session_setInputCallback) {
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_setHangupHook) {
|
||||
XS(_wrap_Session_setHangupHook__SWIG_0) {
|
||||
{
|
||||
Session *arg1 = (Session *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int res2 ;
|
||||
char *buf2 = 0 ;
|
||||
int alloc2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 3) || (items > 3)) {
|
||||
SWIG_croak("Usage: Session_setHangupHook(self,func,arg);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setHangupHook" "', argument " "1"" of type '" "Session *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< Session * >(argp1);
|
||||
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_setHangupHook" "', argument " "2"" of type '" "char *""'");
|
||||
}
|
||||
arg2 = reinterpret_cast< char * >(buf2);
|
||||
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Session_setHangupHook" "', argument " "3"" of type '" "char *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
(arg1)->setHangupHook(arg2,arg3);
|
||||
|
||||
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_setHangupHook__SWIG_1) {
|
||||
{
|
||||
Session *arg1 = (Session *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@@ -7035,6 +7084,92 @@ XS(_wrap_Session_setHangupHook) {
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_setHangupHook) {
|
||||
dXSARGS;
|
||||
|
||||
{
|
||||
unsigned long _index = 0;
|
||||
SWIG_TypeRank _rank = 0;
|
||||
if (items == 2) {
|
||||
SWIG_TypeRank _ranki = 0;
|
||||
SWIG_TypeRank _rankm = 0;
|
||||
SWIG_TypeRank _pi = 1;
|
||||
int _v = 0;
|
||||
{
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_Session, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_1;
|
||||
_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_1;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
if (!_index || (_ranki < _rank)) {
|
||||
_rank = _ranki; _index = 1;
|
||||
if (_rank == _rankm) goto dispatch;
|
||||
}
|
||||
}
|
||||
check_1:
|
||||
|
||||
if (items == 3) {
|
||||
SWIG_TypeRank _ranki = 0;
|
||||
SWIG_TypeRank _rankm = 0;
|
||||
SWIG_TypeRank _pi = 1;
|
||||
int _v = 0;
|
||||
{
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_Session, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
}
|
||||
if (!_v) goto check_2;
|
||||
_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_2;
|
||||
_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_2;
|
||||
_ranki += _v*_pi;
|
||||
_rankm += _pi;
|
||||
_pi *= SWIG_MAXCASTRANK;
|
||||
if (!_index || (_ranki < _rank)) {
|
||||
_rank = _ranki; _index = 2;
|
||||
if (_rank == _rankm) goto dispatch;
|
||||
}
|
||||
}
|
||||
check_2:
|
||||
|
||||
dispatch:
|
||||
switch(_index) {
|
||||
case 1:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setHangupHook__SWIG_1); return;
|
||||
case 2:
|
||||
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setHangupHook__SWIG_0); return;
|
||||
}
|
||||
}
|
||||
|
||||
croak("No matching function for overloaded 'Session_setHangupHook'");
|
||||
XSRETURN(0);
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_ready) {
|
||||
{
|
||||
Session *arg1 = (Session *) 0 ;
|
||||
@@ -7279,6 +7414,78 @@ XS(_wrap_Session_hangup_func_str_get) {
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_hangup_func_arg_set) {
|
||||
{
|
||||
Session *arg1 = (Session *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int res2 ;
|
||||
char *buf2 = 0 ;
|
||||
int alloc2 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: Session_hangup_func_arg_set(self,hangup_func_arg);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_arg_set" "', argument " "1"" of type '" "Session *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< Session * >(argp1);
|
||||
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_hangup_func_arg_set" "', argument " "2"" of type '" "char *""'");
|
||||
}
|
||||
arg2 = reinterpret_cast< char * >(buf2);
|
||||
if (arg1->hangup_func_arg) delete[] arg1->hangup_func_arg;
|
||||
if (arg2) {
|
||||
size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1;
|
||||
arg1->hangup_func_arg = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size)));
|
||||
} else {
|
||||
arg1->hangup_func_arg = 0;
|
||||
}
|
||||
|
||||
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_hangup_func_arg_get) {
|
||||
{
|
||||
Session *arg1 = (Session *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: Session_hangup_func_arg_get(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_arg_get" "', argument " "1"" of type '" "Session *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< Session * >(argp1);
|
||||
result = (char *) ((arg1)->hangup_func_arg);
|
||||
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_Session_setPERL) {
|
||||
{
|
||||
Session *arg1 = (Session *) 0 ;
|
||||
@@ -7529,6 +7736,8 @@ static swig_command_info swig_commands[] = {
|
||||
{"freeswitchc::Session_cb_arg_get", _wrap_Session_cb_arg_get},
|
||||
{"freeswitchc::Session_hangup_func_str_set", _wrap_Session_hangup_func_str_set},
|
||||
{"freeswitchc::Session_hangup_func_str_get", _wrap_Session_hangup_func_str_get},
|
||||
{"freeswitchc::Session_hangup_func_arg_set", _wrap_Session_hangup_func_arg_set},
|
||||
{"freeswitchc::Session_hangup_func_arg_get", _wrap_Session_hangup_func_arg_get},
|
||||
{"freeswitchc::Session_setPERL", _wrap_Session_setPERL},
|
||||
{0,0}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user