freeswitch-branches
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
June 2007
- 6 participants
- 67 discussions
[Freeswitch-branches] [commit] r5469 - freeswitch/branches/spditner/trunk
by Freeswitch SVN 26 Jun '07
by Freeswitch SVN 26 Jun '07
26 Jun '07
Author: spditner
Date: Tue Jun 26 12:33:36 2007
New Revision: 5469
Added:
freeswitch/branches/spditner/trunk/
- copied from r5468, /freeswitch/trunk/
Log:
Creating private branch
1
0
[Freeswitch-branches] [commit] r5453 - in freeswitch/branches/greenlizard/src: include mod/languages/mod_python
by Freeswitch SVN 24 Jun '07
by Freeswitch SVN 24 Jun '07
24 Jun '07
Author: greenlizard
Date: Sun Jun 24 13:26:12 2007
New Revision: 5453
Modified:
freeswitch/branches/greenlizard/src/include/switch_cpp.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
Log:
streamFile's 2nd argument is now optional
Modified: freeswitch/branches/greenlizard/src/include/switch_cpp.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_cpp.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_cpp.h Sun Jun 24 13:26:12 2007
@@ -203,7 +203,7 @@
* \return an int status code indicating success or failure
*
*/
- int streamFile(char *file, int starting_sample_count);
+ int streamFile(char *file, int starting_sample_count=0);
/** \brief flush any pending events
*/
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Sun Jun 24 13:26:12 2007
@@ -4363,7 +4363,7 @@
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
- int arg3 ;
+ int arg3 = (int) 0 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -4376,7 +4376,7 @@
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_streamFile",&obj0,&obj1,&obj2)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OO|O:CoreSession_streamFile",&obj0,&obj1,&obj2)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_streamFile" "', argument " "1"" of type '" "CoreSession *""'");
@@ -4387,11 +4387,13 @@
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_streamFile" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_streamFile" "', argument " "3"" of type '" "int""'");
- }
- arg3 = static_cast< int >(val3);
+ if (obj2) {
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_streamFile" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ }
result = (int)(arg1)->streamFile(arg2,arg3);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
1
0
[Freeswitch-branches] [commit] r5452 - in freeswitch/branches/greenlizard/src: . include mod/languages/mod_python
by Freeswitch SVN 24 Jun '07
by Freeswitch SVN 24 Jun '07
24 Jun '07
Author: greenlizard
Date: Sun Jun 24 13:19:32 2007
New Revision: 5452
Modified:
freeswitch/branches/greenlizard/src/include/switch_cpp.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/branches/greenlizard/src/switch_cpp.cpp
Log:
fix segfault that was happening with originate/bridge due to no valid session in b leg. rename streamfile to streamFile. remove playFile since streamFile does the same thing
Modified: freeswitch/branches/greenlizard/src/include/switch_cpp.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_cpp.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_cpp.h Sun Jun 24 13:19:32 2007
@@ -142,29 +142,17 @@
/** \brief Originate a call to a destination
*
- * \param old_session - the session where the call is originating from
- * and also the session in which _this_ session was
- * created
+ * \param a_leg_sessoin - the session where the call is originating from
+ * and also the session in which _this_ session was
+ * created
* \param dest - a string representing destination, eg, sofia/mydomain.com/foo@bar.com
* \return an int status code indicating success or failure
*
*/
- int originate(CoreSession *aleg_session,
+ int originate(CoreSession *a_leg_session,
char *dest,
int timeout=60);
- /** \brief Play a file that resides on disk into the channel
- *
- * \param file - the path to the .wav/.mp3 to be played
- * \param timer_name - ?? does not seem to be used, what is this?
- * \return an int status code indicating success or failure
- *
- * NOTE: if a dtmf callback is installed before calling this
- * function, that callback will be called upon receiving any
- * dtmfs
- */
- int playFile(char *file, char *timer_name);
-
/** \brief set a DTMF callback function
*
@@ -215,7 +203,7 @@
* \return an int status code indicating success or failure
*
*/
- int streamfile(char *file, int starting_sample_count);
+ int streamFile(char *file, int starting_sample_count);
/** \brief flush any pending events
*/
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py Sun Jun 24 13:19:32 2007
@@ -115,14 +115,13 @@
def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args)
def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args)
def originate(*args): return _freeswitch.CoreSession_originate(*args)
- def playFile(*args): return _freeswitch.CoreSession_playFile(*args)
def setDTMFCallback(*args): return _freeswitch.CoreSession_setDTMFCallback(*args)
def speak(*args): return _freeswitch.CoreSession_speak(*args)
def set_tts_parms(*args): return _freeswitch.CoreSession_set_tts_parms(*args)
def getDigits(*args): return _freeswitch.CoreSession_getDigits(*args)
def transfer(*args): return _freeswitch.CoreSession_transfer(*args)
def playAndGetDigits(*args): return _freeswitch.CoreSession_playAndGetDigits(*args)
- def streamfile(*args): return _freeswitch.CoreSession_streamfile(*args)
+ def streamFile(*args): return _freeswitch.CoreSession_streamFile(*args)
def flushEvents(*args): return _freeswitch.CoreSession_flushEvents(*args)
def flushDigits(*args): return _freeswitch.CoreSession_flushDigits(*args)
def setAutoHangup(*args): return _freeswitch.CoreSession_setAutoHangup(*args)
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp Sun Jun 24 13:19:32 2007
@@ -175,6 +175,11 @@
bool PySession::begin_allow_threads(void) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::begin_allow_threads() called\n");
+ if (!session) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No valid session\n");
+ return false;
+ }
+
// swap out threadstate and store in instance variable
switch_channel_t *channel = switch_core_session_get_channel(session);
PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
@@ -196,7 +201,6 @@
}
else {
// currently swapped out
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Threadstate already swapd-out! Skipping\n");
return false;
}
@@ -205,11 +209,15 @@
bool PySession::end_allow_threads(void) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::end_allow_threads() called\n");
// swap in threadstate from instance variable saved earlier
+ if (!session) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No valid session\n");
+ return false;
+ }
+
switch_channel_t *channel = switch_core_session_get_channel(session);
PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
if (swapin_tstate == NULL) {
// currently swapped in
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Threadstate double swap-in! Skipping\n");
return false;
}
else {
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c Sun Jun 24 13:19:32 2007
@@ -177,18 +177,19 @@
// will be null
if (swapin_tstate == NULL) {
// swap it out
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Threadstate mod_python.c swap-out! \n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Threadstate mod_python.c swap-out! \n");
// PyEval_ReleaseThread(cur_tstate);
swapin_tstate = (void *) PyEval_SaveThread();
switch_channel_set_private(channel, "SwapInThreadState", (void *) swapin_tstate);
}
else {
// thread state is already swapped out, so, nothing for us to do
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "according to chan priv data, already swapped out \n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "according to chan priv data, already swapped out \n");
}
}
else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Threadstate mod_python.c swap-out! \n");
+ // they ran python script from cmd line, behave a bit differently (untested)
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Threadstate mod_python.c swap-out! \n");
PyEval_ReleaseThread(tstate);
}
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Sun Jun 24 13:19:32 2007
@@ -3961,52 +3961,6 @@
}
-SWIGINTERN PyObject *_wrap_CoreSession_playFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- int result;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_playFile",&obj0,&obj1,&obj2)) SWIG_fail;
- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playFile" "', argument " "1"" of type '" "CoreSession *""'");
- }
- arg1 = reinterpret_cast< CoreSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_playFile" "', argument " "2"" of type '" "char *""'");
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_playFile" "', argument " "3"" of type '" "char *""'");
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (int)(arg1)->playFile(arg2,arg3);
- resultobj = SWIG_From_int(static_cast< int >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return NULL;
-}
-
-
SWIGINTERN PyObject *_wrap_CoreSession_setDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -4405,7 +4359,7 @@
}
-SWIGINTERN PyObject *_wrap_CoreSession_streamfile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
@@ -4422,23 +4376,23 @@
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_streamfile",&obj0,&obj1,&obj2)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_streamFile",&obj0,&obj1,&obj2)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_streamfile" "', argument " "1"" of type '" "CoreSession *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_streamFile" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_streamfile" "', argument " "2"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_streamFile" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
ecode3 = SWIG_AsVal_int(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_streamfile" "', argument " "3"" of type '" "int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_streamFile" "', argument " "3"" of type '" "int""'");
}
arg3 = static_cast< int >(val3);
- result = (int)(arg1)->streamfile(arg2,arg3);
+ result = (int)(arg1)->streamFile(arg2,arg3);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
@@ -5269,14 +5223,13 @@
{ (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL},
{ (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL},
- { (char *)"CoreSession_playFile", _wrap_CoreSession_playFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback, METH_VARARGS, NULL},
{ (char *)"CoreSession_speak", _wrap_CoreSession_speak, METH_VARARGS, NULL},
{ (char *)"CoreSession_set_tts_parms", _wrap_CoreSession_set_tts_parms, METH_VARARGS, NULL},
{ (char *)"CoreSession_getDigits", _wrap_CoreSession_getDigits, METH_VARARGS, NULL},
{ (char *)"CoreSession_transfer", _wrap_CoreSession_transfer, METH_VARARGS, NULL},
{ (char *)"CoreSession_playAndGetDigits", _wrap_CoreSession_playAndGetDigits, METH_VARARGS, NULL},
- { (char *)"CoreSession_streamfile", _wrap_CoreSession_streamfile, METH_VARARGS, NULL},
+ { (char *)"CoreSession_streamFile", _wrap_CoreSession_streamFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_flushEvents", _wrap_CoreSession_flushEvents, METH_VARARGS, NULL},
{ (char *)"CoreSession_flushDigits", _wrap_CoreSession_flushDigits, METH_VARARGS, NULL},
{ (char *)"CoreSession_setAutoHangup", _wrap_CoreSession_setAutoHangup, METH_VARARGS, NULL},
Modified: freeswitch/branches/greenlizard/src/switch_cpp.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_cpp.cpp (original)
+++ freeswitch/branches/greenlizard/src/switch_cpp.cpp Sun Jun 24 13:19:32 2007
@@ -92,6 +92,7 @@
const switch_application_interface_t *application_interface;
sanity_check_noreturn;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::execute. data:%s\n", data);
if ((application_interface = switch_loadable_module_get_application_interface(app))) {
begin_allow_threads();
switch_core_session_exec(session, application_interface, data);
@@ -99,25 +100,6 @@
}
}
-int CoreSession::playFile(char *file, char *timer_name)
-{
- switch_status_t status;
- switch_file_handle_t fh = { 0 };
- sanity_check(-1);
- if (switch_strlen_zero(timer_name)) {
- timer_name = NULL;
- }
- store_file_handle(&fh);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "playFile begin_allow_threads\n");
- begin_allow_threads();
- status = switch_ivr_play_file(session, &fh, file, ap);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "playFile end_allow_threads\n");
- end_allow_threads();
- return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
-
-}
-
-
void CoreSession::setDTMFCallback(void *cbfunc, char *funcargs) {
cb_state.funcargs = funcargs;
@@ -206,6 +188,7 @@
sanity_check(-1);
begin_allow_threads();
status = switch_ivr_session_transfer(session, extension, dialplan, context);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "transfer result: %d\n", status);
end_allow_threads();
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
@@ -241,7 +224,7 @@
}
-int CoreSession::streamfile(char *file, int starting_sample_count) {
+int CoreSession::streamFile(char *file, int starting_sample_count) {
switch_status_t status;
switch_file_handle_t fh = { 0 };
@@ -283,7 +266,7 @@
}
-int CoreSession::originate(CoreSession *aleg_session,
+int CoreSession::originate(CoreSession *a_leg_session,
char *dest,
int timeout)
{
@@ -294,11 +277,15 @@
cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
- if (aleg_session != NULL) {
- aleg_core_session = aleg_session->session;
+ if (a_leg_session != NULL) {
+ aleg_core_session = a_leg_session->session;
}
- begin_allow_threads();
+ // this session has no valid switch_core_session_t at this point, and therefore
+ // no valid channel. since the threadstate is stored in the channel, and there
+ // is none, if we try to call begin_alllow_threads it will fail miserably.
+ // use the 'a leg session' to do the thread swapping stuff.
+ a_leg_session->begin_allow_threads();
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
@@ -319,11 +306,11 @@
}
- end_allow_threads();
+ a_leg_session->end_allow_threads();
return SWITCH_STATUS_SUCCESS;
failed:
- end_allow_threads();
+ a_leg_session->end_allow_threads();
return SWITCH_STATUS_FALSE;
}
1
0
[Freeswitch-branches] [commit] r5441 - in freeswitch/branches/greenlizard: scripts src/mod/endpoints/mod_portaudio src/mod/languages/mod_python src/mod/languages/mod_spidermonkey_core_db src/mod/languages/mod_spidermonkey_odbc
by Freeswitch SVN 22 Jun '07
by Freeswitch SVN 22 Jun '07
22 Jun '07
Author: greenlizard
Date: Fri Jun 22 14:46:25 2007
New Revision: 5441
Modified:
freeswitch/branches/greenlizard/scripts/api.js
freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c
Log:
merge trunk 5430 to 5439
Modified: freeswitch/branches/greenlizard/scripts/api.js
==============================================================================
--- freeswitch/branches/greenlizard/scripts/api.js (original)
+++ freeswitch/branches/greenlizard/scripts/api.js Fri Jun 22 14:46:25 2007
@@ -53,10 +53,12 @@
request.write("</form><hr noshade size=1><br>");
if ((command = request.getHeader("command"))) {
- cmd_list = command.split(" ", 2);
+ cmd_list = command.split(" ");
+ cmd = cmd_list.shift();
+ args = cmd_list.join(" ");
- if ((reply = apiExecute(cmd_list[0], cmd_list[1]))) {
- request.write("<B>Command Result</b><br><pre>" + reply + "\n</pre>");
+ if ((reply = apiExecute(cmd, args))) {
+ request.write("<br><B>Command Result</b><br><pre>" + reply + "\n</pre>");
}
}
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c Fri Jun 22 14:46:25 2007
@@ -29,7 +29,7 @@
* mod_portaudio.c -- PortAudio Endpoint Module
*
*/
-#include <switch.h>
+#include "switch.h"
#include <stdio.h>
#include <stdlib.h>
@@ -47,8 +47,7 @@
static switch_endpoint_interface_t *channel_endpoint_interface;
#define SAMPLE_TYPE paInt16
-//#define SAMPLE_TYPE paFloat32
-typedef short SAMPLE;
+typedef int16_t SAMPLE;
typedef switch_status_t (*pa_command_t) (char **argv, int argc, switch_stream_handle_t *stream);
@@ -86,7 +85,6 @@
switch_frame_t hold_frame;
unsigned char holdbuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
switch_codec_t write_codec;
- switch_timer_t timer;
struct private_object *next;
};
@@ -268,7 +266,7 @@
if (olen == 0) {
break;
}
- WriteAudioStream(globals.ring_stream, abuf, (long) olen);
+ WriteAudioStream(globals.ring_stream, abuf, (long) olen, &globals.timer);
}
}
}
@@ -282,8 +280,6 @@
if (ring_file) {
deactivate_ring_device();
switch_core_file_close(&fh);
- switch_core_codec_destroy(&tech_pvt->write_codec);
- switch_core_timer_destroy(&tech_pvt->timer);
}
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
@@ -566,30 +562,13 @@
if (!is_master(tech_pvt)) {
if (tech_pvt->hold_file) {
if (!tech_pvt->hfh) {
- int codec_ms = tech_pvt->codec_ms ? tech_pvt->codec_ms : globals.codec_ms;
int sample_rate = tech_pvt->sample_rate ? tech_pvt->sample_rate : globals.sample_rate;
-
- if (switch_core_codec_init(&tech_pvt->write_codec,
- "L16",
- NULL,
- sample_rate,
- codec_ms,
- 1,
- SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
- NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
- switch_core_codec_destroy(&globals.read_codec);
- tech_pvt->hold_file = NULL;
- goto cng;
- }
-
if (switch_core_file_open(&tech_pvt->fh,
tech_pvt->hold_file,
globals.read_codec.implementation->number_of_channels,
globals.read_codec.implementation->samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
tech_pvt->hold_file = NULL;
goto cng;
}
@@ -598,7 +577,7 @@
tech_pvt->hold_frame.data = tech_pvt->holdbuf;
tech_pvt->hold_frame.buflen = sizeof(tech_pvt->holdbuf);
tech_pvt->hold_frame.rate = sample_rate;
- tech_pvt->hold_frame.codec = &tech_pvt->write_codec;
+ tech_pvt->hold_frame.codec = &globals.write_codec;
}
goto hold;
@@ -612,9 +591,8 @@
{
switch_size_t olen = globals.read_codec.implementation->samples_per_frame;
- if (switch_core_timer_next(&tech_pvt->timer) != SWITCH_STATUS_SUCCESS) {
+ if (switch_core_timer_next(&globals.timer) != SWITCH_STATUS_SUCCESS) {
switch_core_file_close(&tech_pvt->fh);
- switch_core_codec_destroy(&tech_pvt->write_codec);
goto cng;
}
switch_core_file_read(tech_pvt->hfh, tech_pvt->hold_frame.data, &olen);
@@ -628,7 +606,7 @@
tech_pvt->hold_frame.datalen = (uint32_t) (olen * sizeof(int16_t));
tech_pvt->hold_frame.samples = (uint32_t) olen;
- tech_pvt->hold_frame.timestamp = tech_pvt->timer.samplecount;
+ tech_pvt->hold_frame.timestamp = globals.timer.samplecount;
*frame = &tech_pvt->hold_frame;
}
@@ -638,7 +616,12 @@
switch_mutex_lock(globals.device_lock);
- if ((samples = ReadAudioStream(globals.audio_stream, globals.read_frame.data, globals.read_codec.implementation->samples_per_frame)) != 0) {
+ if ((samples = ReadAudioStream(globals.audio_stream, globals.read_frame.data,
+ globals.read_codec.implementation->samples_per_frame,
+ &globals.timer)) == 0) {
+
+ goto cng;
+ } else {
globals.read_frame.datalen = samples * 2;
globals.read_frame.samples = samples;
@@ -682,7 +665,8 @@
if (globals.audio_stream) {
if (switch_test_flag((&globals), GFLAG_EAR)) {
- WriteAudioStream(globals.audio_stream, (short *) frame->data, (int) (frame->datalen / sizeof(SAMPLE)));
+ WriteAudioStream(globals.audio_stream, (short *) frame->data, (int) (frame->datalen / sizeof(SAMPLE)),
+ &globals.timer);
}
status = SWITCH_STATUS_SUCCESS;
}
@@ -986,6 +970,7 @@
switch_core_codec_destroy(&globals.write_codec);
}
+ switch_core_timer_destroy(&globals.timer);
Pa_Terminate();
return SWITCH_STATUS_SUCCESS;
@@ -1248,8 +1233,6 @@
-
-
globals.read_frame.rate = sample_rate;
globals.read_frame.codec = &globals.read_codec;
@@ -1268,7 +1251,8 @@
outputParameters.sampleFormat = SAMPLE_TYPE;
outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency;
outputParameters.hostApiSpecificStreamInfo = NULL;
- err = OpenAudioStream(&globals.audio_stream, &inputParameters, &outputParameters, sample_rate, paClipOff);
+ err = OpenAudioStream(&globals.audio_stream, &inputParameters, &outputParameters, sample_rate, paClipOff,
+ globals.read_codec.implementation->samples_per_frame);
/* UNLOCKED ************************************************************************************************* */
switch_mutex_unlock(globals.device_lock);
@@ -1292,7 +1276,6 @@
static switch_status_t engage_ring_device(int sample_rate, int channels)
{
- //int codec_ms = 20;
PaStreamParameters outputParameters;
PaError err;
@@ -1308,7 +1291,8 @@
outputParameters.sampleFormat = SAMPLE_TYPE;
outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency;
outputParameters.hostApiSpecificStreamInfo = NULL;
- err = OpenAudioStream(&globals.ring_stream, NULL, &outputParameters, sample_rate, paClipOff);
+ err = OpenAudioStream(&globals.ring_stream, NULL, &outputParameters, sample_rate, paClipOff,
+ globals.read_codec.implementation->samples_per_frame);
/* UNLOCKED ************************************************************************************************* */
switch_mutex_unlock(globals.device_lock);
@@ -1405,7 +1389,6 @@
if (tech_pvt) {
switch_channel_hangup(switch_core_session_get_channel(tech_pvt->session), SWITCH_CAUSE_NORMAL_CLEARING);
- //switch_set_flag_locked(tech_pvt, TFLAG_HUP);
stream->write_function(stream, "OK\n");
} else {
stream->write_function(stream, "NO SUCH CALL\n");
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.c Fri Jun 22 14:46:25 2007
@@ -40,6 +40,7 @@
* license above.
*/
+#include <switch.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@@ -49,11 +50,6 @@
#include <string.h>
#include <time.h>
-/************************************************************************/
-/******** Constants *****************************************************/
-/************************************************************************/
-
-#define FRAMES_PER_BUFFER (256)
/************************************************************************/
/******** Prototypes ****************************************************/
@@ -69,17 +65,20 @@
/************************************************************************/
/* Called from PortAudio.
- * Read and write data only if there is room in FIFOs.
+ * Read and write data
*/
static int blockingIOCallback(const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
{
PABLIO_Stream *data = (PABLIO_Stream *) userData;
long numBytes = data->bytesPerFrame * framesPerBuffer;
-
+
/* This may get called with NULL inputBuffer during initial setup. */
if (inputBuffer != NULL) {
- PaUtil_WriteRingBuffer(&data->inFIFO, inputBuffer, numBytes);
+ if (PaUtil_WriteRingBuffer(&data->inFIFO, inputBuffer, numBytes) != numBytes) {
+ PaUtil_FlushRingBuffer(&data->inFIFO);
+ PaUtil_WriteRingBuffer(&data->inFIFO, inputBuffer, numBytes);
+ }
}
if (outputBuffer != NULL) {
int i;
@@ -117,17 +116,24 @@
* Write data to ring buffer.
* Will not return until all the data has been written.
*/
-long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames)
+long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer)
{
long bytesWritten;
char *p = (char *) data;
long numBytes = aStream->bytesPerFrame * numFrames;
+
while (numBytes > 0) {
bytesWritten = PaUtil_WriteRingBuffer(&aStream->outFIFO, p, numBytes);
numBytes -= bytesWritten;
p += bytesWritten;
- if (numBytes > 0)
- Pa_Sleep(10);
+ if (numBytes > 0) {
+ if (switch_core_timer_check(timer) == SWITCH_STATUS_SUCCESS) {
+ PaUtil_FlushRingBuffer(&aStream->outFIFO);
+ printf("ASS\n");
+ return 0;
+ }
+ switch_yield(1000);
+ }
}
return numFrames;
}
@@ -136,18 +142,22 @@
* Read data from ring buffer.
* Will not return until all the data has been read.
*/
-long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames)
+long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer)
{
long bytesRead;
char *p = (char *) data;
long numBytes = aStream->bytesPerFrame * numFrames;
-
+
while (numBytes > 0) {
bytesRead = PaUtil_ReadRingBuffer(&aStream->inFIFO, p, numBytes);
numBytes -= bytesRead;
- p += bytesRead;
- if (numBytes > 0)
- Pa_Sleep(10);
+ if (numBytes > 0) {
+ if (switch_core_timer_check(timer) == SWITCH_STATUS_SUCCESS) {
+ PaUtil_FlushRingBuffer(&aStream->inFIFO);
+ return 0;
+ }
+ switch_yield(1000);
+ }
}
return numFrames;
}
@@ -172,12 +182,12 @@
return bytesFull / aStream->bytesPerFrame;
}
-/************************************************************/
+/***********************************************************/
static unsigned long RoundUpToNextPowerOf2(unsigned long n)
{
long numBits = 0;
if (((n - 1) & n) == 0)
- return n; /* Already Power of two. */
+ return n;
while (n > 0) {
n = n >> 1;
numBits++;
@@ -185,20 +195,25 @@
return (1 << numBits);
}
+
+
/************************************************************
* Opens a PortAudio stream with default characteristics.
* Allocates PABLIO_Stream structure.
*
*/
PaError OpenAudioStream(PABLIO_Stream ** rwblPtr,
- const PaStreamParameters * inputParameters, const PaStreamParameters * outputParameters, double sampleRate,
- PaStreamFlags streamFlags)
+ const PaStreamParameters *inputParameters,
+ const PaStreamParameters *outputParameters,
+ double sampleRate,
+ PaStreamFlags streamFlags,
+ long samples_per_frame)
{
- long bytesPerSample;
+ long bytesPerSample = 2;
PaError err;
PABLIO_Stream *aStream;
long numFrames;
- long numBytes;
+ //long numBytes;
int channels = 1;
/* Allocate PABLIO_Stream structure for caller. */
@@ -218,12 +233,8 @@
channels = outputParameters->channelCount;
}
- numFrames = 4 * FRAMES_PER_BUFFER;
- numFrames = RoundUpToNextPowerOf2(numFrames);
-
- bytesPerSample = 2;
- aStream->samplesPerFrame = channels;
- aStream->bytesPerFrame = bytesPerSample * aStream->samplesPerFrame;
+ numFrames = RoundUpToNextPowerOf2(samples_per_frame * 5);
+ aStream->bytesPerFrame = bytesPerSample;
/* Initialize Ring Buffers */
@@ -240,13 +251,14 @@
}
/* Make Write FIFO appear full initially. */
- numBytes = PaUtil_GetRingBufferWriteAvailable(&aStream->outFIFO);
- PaUtil_AdvanceRingBufferWriteIndex(&aStream->outFIFO, numBytes);
+ //numBytes = PaUtil_GetRingBufferWriteAvailable(&aStream->outFIFO);
+ //PaUtil_AdvanceRingBufferWriteIndex(&aStream->outFIFO, numBytes);
/* Open a PortAudio stream that we will use to communicate with the underlying
* audio drivers. */
- err = Pa_OpenStream(&aStream->stream, inputParameters, outputParameters, sampleRate, FRAMES_PER_BUFFER, streamFlags, blockingIOCallback, aStream);
+ err = Pa_OpenStream(&aStream->stream, inputParameters, outputParameters, sampleRate, samples_per_frame, streamFlags, blockingIOCallback, aStream);
+
if (err != paNoError)
goto error;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.h (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/pablio.h Fri Jun 22 14:46:25 2007
@@ -61,7 +61,6 @@
PaUtilRingBuffer outFIFO;
PaStream *stream;
int bytesPerFrame;
- int samplesPerFrame;
} PABLIO_Stream;
/* Values for flags for OpenAudioStream(). */
@@ -75,13 +74,13 @@
* Write data to ring buffer.
* Will not return until all the data has been written.
*/
- long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames);
+ long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer);
/************************************************************
* Read data from ring buffer.
* Will not return until all the data has been read.
*/
- long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames);
+ long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer);
/************************************************************
* Return the number of frames that could be written to the stream without
@@ -105,7 +104,7 @@
*/
PaError OpenAudioStream(PABLIO_Stream ** rwblPtr,
const PaStreamParameters * inputParameters,
- const PaStreamParameters * outputParameters, double sampleRate, PaStreamCallbackFlags statusFlags);
+ const PaStreamParameters * outputParameters, double sampleRate, PaStreamCallbackFlags statusFlags, long samples_per_frame);
PaError CloseAudioStream(PABLIO_Stream * aStream);
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i Fri Jun 22 14:46:25 2007
@@ -9,14 +9,12 @@
%cstring_bounded_mutable(char *dtmf_buf, 128);
%cstring_bounded_mutable(char *terminator, 8);
-
/** insert the following includes into generated code so it compiles */
%{
#include "switch_cpp.h"
#include "freeswitch_python.h"
%}
-
%ignore SwitchToMempool;
/**
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c Fri Jun 22 14:46:25 2007
@@ -242,6 +242,16 @@
};
+static JSBool db_setProperty(JSContext * cx, JSObject * obj, jsval id, jsval *vp)
+{
+ char *name = JS_GetStringBytes(JS_ValueToString(cx, id));
+
+ if (strcmp(name, "_dB_RoW_DaTa_")) {
+ *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
+ }
+ return JS_TRUE;
+}
+
static JSBool db_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
{
JSBool res = JS_TRUE;
@@ -268,7 +278,7 @@
JSClass db_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, db_getProperty, DEFAULT_SET_PROPERTY,
+ JS_PropertyStub, JS_PropertyStub, db_getProperty, db_setProperty,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, db_destroy, NULL, NULL, NULL,
db_construct
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c Fri Jun 22 14:46:25 2007
@@ -424,21 +424,39 @@
static JSPropertySpec odbc_props[] = {
-// {"name", odbc_NAME, JSPROP_READONLY|JSPROP_PERMANENT},
+ {"name", odbc_NAME, JSPROP_READONLY|JSPROP_PERMANENT},
{0}
};
+static JSBool odbc_setProperty(JSContext * cx, JSObject * obj, jsval id, jsval *vp)
+{
+ char *name = JS_GetStringBytes(JS_ValueToString(cx, id));
+
+ if (strcmp(name, "_oDbC_dB_RoW_DaTa_")) {
+ *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
+ }
+ return JS_TRUE;
+}
-static JSBool odbc_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+static JSBool odbc_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval *vp)
{
- JSBool res = JS_TRUE;
+ int param;
+ char *name = JS_GetStringBytes(JS_ValueToString(cx, id));
+
+ /* numbers are our props anything else is a method */
+ if (name[0] >= 48 && name[0] <= 57) {
+ param = atoi(name);
+ } else {
+ return JS_TRUE;
+ }
- return res;
+ *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
+ return JS_TRUE;
}
JSClass odbc_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, odbc_getProperty, DEFAULT_SET_PROPERTY,
+ JS_PropertyStub, JS_PropertyStub, odbc_getProperty, odbc_setProperty,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, odbc_destroy, NULL, NULL, NULL,
odbc_construct
};
1
0
[Freeswitch-branches] [commit] r5440 - in freeswitch/branches/greenlizard/src: . include mod/languages/mod_python
by Freeswitch SVN 22 Jun '07
by Freeswitch SVN 22 Jun '07
22 Jun '07
Author: greenlizard
Date: Fri Jun 22 14:36:36 2007
New Revision: 5440
Modified:
freeswitch/branches/greenlizard/src/include/switch_cpp.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/branches/greenlizard/src/switch_core_file.c
freeswitch/branches/greenlizard/src/switch_cpp.cpp
Log:
implement flushEvents() flushDigits() setAutoHangup() and setHangupHook(). reworked dtmfhandler and some aspects relating to threadstate. folded in memory pool thing from mishehu. added more asserts to switch_core_file (coordinated w/ anthony on this)
Modified: freeswitch/branches/greenlizard/src/include/switch_cpp.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_cpp.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_cpp.h Fri Jun 22 14:36:36 2007
@@ -11,6 +11,50 @@
#include <switch.h>
+//
+// C++ Interface: switch_to_cpp_mempool
+//
+// Description: This class allows for overloading the new operator to allocate from a switch_memory_pool_t
+//
+// Author: Yossi Neiman <freeswitch(a)cartissolutions.com>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+
+
+#ifndef SWITCHTOMEMPOOL
+#define SWITCHTOMEMPOOL
+class SwitchToMempool {
+ public:
+ SwitchToMempool() { }
+ SwitchToMempool(switch_memory_pool_t *mem) { memorypool = mem; }
+ void *operator new(switch_size_t num_bytes, switch_memory_pool_t *mem)
+ {
+ void *ptr = switch_core_alloc(mem, (switch_size_t) num_bytes);
+ return ptr;
+ }
+ protected:
+ switch_memory_pool_t *memorypool;
+};
+#endif
+
+
+/*
+
+Overview: once you create an object that inherits this class, since
+ the memory pool is then a class data member, you can continue to
+ allocate objects from the memory pool.
+ objects from within the class
+
+Notes on usage:
+
+1. The derived class will need to also overload the ctor so that it accepts a memory pool object as a parameter.
+2. Instantiation of a class would then look something like this: Foo *bar = new(memory_pool) Foo(memory_pool);
+
+Note that the first parameter to the new operator is implicitly handled by c++... not sure I like that but it's how it is...
+
+*/
+
void console_log(char *level_str, char *msg);
void console_clean_log(char *msg);
@@ -40,6 +84,12 @@
char *funcargs; // extra string that will be passed to callback function
} input_callback_state_t;
+typedef enum {
+ S_HUP = (1 << 0),
+ S_FREE = (1 << 1),
+ S_RDLOCK = (1 << 2)
+} session_flag_t;
+
class CoreSession {
protected:
@@ -52,6 +102,9 @@
char *tts_name;
char *voice_name;
void store_file_handle(switch_file_handle_t *fh);
+ void *on_hangup; // language specific callback function, cast as void *
+
+
public:
CoreSession();
CoreSession(char *uuid);
@@ -59,12 +112,14 @@
virtual ~CoreSession();
switch_core_session_t *session;
switch_channel_t *channel;
+ unsigned int flags;
input_callback_state cb_state; // callback state, always pointed to by the buf
// field in this->args
+ switch_channel_state_t hook_state; // store hookstate for on_hangup callback
int answer();
int preAnswer();
- void hangup(char *cause);
+ virtual void hangup(char *cause);
void setVariable(char *var, char *val);
char *getVariable(char *var);
@@ -118,19 +173,16 @@
* is pressed by user during playFile(), streamfile(), and
* certain other methods are executing.
*
- * Note that language specific sessions might need to create
- * their own version of this with a slightly different signature
- * (as done in freeswitch_python.h)
- */
- void setDTMFCallback(switch_input_callback_function_t cb,
- void *buf,
- uint32_t buflen);
+ */
+ void setDTMFCallback(void *cbfunc, char *funcargs);
+
int speak(char *text);
void set_tts_parms(char *tts_name, char *voice_name);
int getDigits(char *dtmf_buf,
- int len,
+ int buflen,
+ int maxdigits,
char *terminators,
char *terminator,
int timeout);
@@ -165,11 +217,26 @@
*/
int streamfile(char *file, int starting_sample_count);
+ /** \brief flush any pending events
+ */
+ int flushEvents();
+
+ /** \brief flush any pending digits
+ */
+ int flushDigits();
+
+ int setAutoHangup(bool val);
+
+ /** \brief Set the hangup callback function
+ * \param hangup_func - language specific function ptr cast into void *
+ */
+ void setHangupHook(void *hangup_func);
+
bool ready();
void execute(char *app, char *data);
- virtual void begin_allow_threads();
- virtual void end_allow_threads();
+ virtual bool begin_allow_threads() = 0;
+ virtual bool end_allow_threads() = 0;
/** \brief Get the uuid of this session
* \return the uuid of this session
@@ -181,6 +248,12 @@
*/
const switch_input_args_t& get_cb_args() const { return args; };
+ /** \brief Callback to the language specific hangup callback
+ */
+ virtual void check_hangup_hook() = 0;
+
+ virtual switch_status_t run_dtmf_callback(void *input,
+ switch_input_type_t itype) = 0;
};
@@ -200,6 +273,19 @@
void bridge(CoreSession &session_a, CoreSession &session_b);
+/** \brief the actual hangup hook called back by freeswitch core
+ * which in turn gets the session and calls the appropriate
+ * instance method to complete the callback.
+ */
+switch_status_t hanguphook(switch_core_session_t *session);
+
+switch_status_t dtmf_callback(switch_core_session_t *session,
+ void *input,
+ switch_input_type_t itype,
+ void *buf,
+ unsigned int buflen);
+
+
#ifdef __cplusplus
}
#endif
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py Fri Jun 22 14:36:36 2007
@@ -80,16 +80,16 @@
input_callback_state_t_swigregister = _freeswitch.input_callback_state_t_swigregister
input_callback_state_t_swigregister(input_callback_state_t)
+S_HUP = _freeswitch.S_HUP
+S_FREE = _freeswitch.S_FREE
+S_RDLOCK = _freeswitch.S_RDLOCK
class CoreSession(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CoreSession, name)
+ def __init__(self): raise AttributeError, "No constructor defined"
__repr__ = _swig_repr
- def __init__(self, *args):
- this = _freeswitch.new_CoreSession(*args)
- try: self.this.append(this)
- except: self.this = this
__swig_destroy__ = _freeswitch.delete_CoreSession
__del__ = lambda self : None;
__swig_setmethods__["session"] = _freeswitch.CoreSession_session_set
@@ -98,9 +98,15 @@
__swig_setmethods__["channel"] = _freeswitch.CoreSession_channel_set
__swig_getmethods__["channel"] = _freeswitch.CoreSession_channel_get
if _newclass:channel = _swig_property(_freeswitch.CoreSession_channel_get, _freeswitch.CoreSession_channel_set)
+ __swig_setmethods__["flags"] = _freeswitch.CoreSession_flags_set
+ __swig_getmethods__["flags"] = _freeswitch.CoreSession_flags_get
+ if _newclass:flags = _swig_property(_freeswitch.CoreSession_flags_get, _freeswitch.CoreSession_flags_set)
__swig_setmethods__["cb_state"] = _freeswitch.CoreSession_cb_state_set
__swig_getmethods__["cb_state"] = _freeswitch.CoreSession_cb_state_get
if _newclass:cb_state = _swig_property(_freeswitch.CoreSession_cb_state_get, _freeswitch.CoreSession_cb_state_set)
+ __swig_setmethods__["hook_state"] = _freeswitch.CoreSession_hook_state_set
+ __swig_getmethods__["hook_state"] = _freeswitch.CoreSession_hook_state_get
+ if _newclass:hook_state = _swig_property(_freeswitch.CoreSession_hook_state_get, _freeswitch.CoreSession_hook_state_set)
def answer(*args): return _freeswitch.CoreSession_answer(*args)
def preAnswer(*args): return _freeswitch.CoreSession_preAnswer(*args)
def hangup(*args): return _freeswitch.CoreSession_hangup(*args)
@@ -117,17 +123,26 @@
def transfer(*args): return _freeswitch.CoreSession_transfer(*args)
def playAndGetDigits(*args): return _freeswitch.CoreSession_playAndGetDigits(*args)
def streamfile(*args): return _freeswitch.CoreSession_streamfile(*args)
+ def flushEvents(*args): return _freeswitch.CoreSession_flushEvents(*args)
+ def flushDigits(*args): return _freeswitch.CoreSession_flushDigits(*args)
+ def setAutoHangup(*args): return _freeswitch.CoreSession_setAutoHangup(*args)
+ def setHangupHook(*args): return _freeswitch.CoreSession_setHangupHook(*args)
def ready(*args): return _freeswitch.CoreSession_ready(*args)
def execute(*args): return _freeswitch.CoreSession_execute(*args)
def begin_allow_threads(*args): return _freeswitch.CoreSession_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.CoreSession_end_allow_threads(*args)
def get_uuid(*args): return _freeswitch.CoreSession_get_uuid(*args)
def get_cb_args(*args): return _freeswitch.CoreSession_get_cb_args(*args)
+ def check_hangup_hook(*args): return _freeswitch.CoreSession_check_hangup_hook(*args)
+ def run_dtmf_callback(*args): return _freeswitch.CoreSession_run_dtmf_callback(*args)
CoreSession_swigregister = _freeswitch.CoreSession_swigregister
CoreSession_swigregister(CoreSession)
bridge = _freeswitch.bridge
-PythonDTMFCallback = _freeswitch.PythonDTMFCallback
+hanguphook = _freeswitch.hanguphook
+dtmf_callback = _freeswitch.dtmf_callback
+S_SWAPPED_IN = _freeswitch.S_SWAPPED_IN
+S_SWAPPED_OUT = _freeswitch.S_SWAPPED_OUT
class PySession(CoreSession):
__swig_setmethods__ = {}
for _s in [CoreSession]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
@@ -143,8 +158,12 @@
__swig_destroy__ = _freeswitch.delete_PySession
__del__ = lambda self : None;
def setDTMFCallback(*args): return _freeswitch.PySession_setDTMFCallback(*args)
+ def setHangupHook(*args): return _freeswitch.PySession_setHangupHook(*args)
+ def check_hangup_hook(*args): return _freeswitch.PySession_check_hangup_hook(*args)
+ def hangup(*args): return _freeswitch.PySession_hangup(*args)
def begin_allow_threads(*args): return _freeswitch.PySession_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.PySession_end_allow_threads(*args)
+ def run_dtmf_callback(*args): return _freeswitch.PySession_run_dtmf_callback(*args)
PySession_swigregister = _freeswitch.PySession_swigregister
PySession_swigregister(PySession)
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp Fri Jun 22 14:36:36 2007
@@ -1,7 +1,7 @@
#include "freeswitch_python.h"
#define sanity_check(x) do { if (!session) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0)
-#define init_vars() do { caller_profile.source = "mod_python"; } while(0)
+#define init_vars() do { caller_profile.source = "mod_python"; swapstate = S_SWAPPED_IN; } while(0)
PySession::PySession() : CoreSession()
{
@@ -24,80 +24,107 @@
sanity_check();
if (!PyCallable_Check(pyfunc)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "DTMF function is not a python function.");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "DTMF function is not a python function.\n");
+ return;
}
- else {
- cb_state.funcargs = funcargs;
- cb_state.function = (void *) pyfunc;
+ Py_XINCREF(pyfunc);
+ CoreSession::setDTMFCallback((void *) pyfunc, funcargs);
- args.buf = &cb_state;
- args.buflen = sizeof(cb_state); // not sure what this is used for, copy mod_spidermonkey
-
- // we cannot set the actual callback to a python function, because
- // the callback is a function pointer with a specific signature.
- // so, set it to the following c function which will act as a proxy,
- // finding the python callback in the args callback args structure
- args.input_callback = PythonDTMFCallback; // defined in mod_python.i
- ap = &args;
+}
+
+void PySession::setHangupHook(PyObject *pyfunc) {
+
+ if (!PyCallable_Check(pyfunc)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Hangup hook is not a python function.\n");
+ return;
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "dtmf callback was set, pyfunc: %p. cb_state: %p\n", pyfunc, &cb_state);
+ // without this Py_XINCREF, there will be segfaults. basically the python
+ // interpreter will not know that it should not GC this object.
+ // callback example: http://docs.python.org/ext/callingPython.html
+ Py_XINCREF(pyfunc);
+ CoreSession::setHangupHook((void *) pyfunc);
}
-void PySession::begin_allow_threads(void) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::begin_allow_threads() called\n");
+void PySession::check_hangup_hook() {
+ PyObject *func;
+ PyObject *result;
+ char *resultStr;
+ bool did_swap_in = false;
- // swap out threadstate and store in instance variable
- threadState = (void *) PyEval_SaveThread();
- cb_state.threadState = threadState;
- args.buf = &cb_state;
- ap = &args;
-}
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "check_hangup_hook called\n");
-void PySession::end_allow_threads(void) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::end_allow_threads() called\n");
- // swap in threadstate from instance variable saved earlier
- PyEval_RestoreThread(((PyThreadState *)threadState));
-}
+ if (!session) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No valid session\n");
+ return;
+ }
-PySession::~PySession() {
- // Should we do any cleanup here?
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::~PySession desctructor\n");
-}
+ // The did_swap_in boolean was added to fix the following problem:
+ // Design flaw - we swap in threadstate based on the assumption that thread state
+ // is currently _swapped out_ when this hangup hook is called. However, nothing known to
+ // guarantee that, and if thread state is already swapped in when this is invoked,
+ // bad things will happen.
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "check hangup hook end_allow_threads\n");
+ did_swap_in = end_allow_threads();
+
+ if (on_hangup == NULL) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "on_hangup is null\n");
+ return;
+ }
+ func = (PyObject *) on_hangup;
-/* ----- functions not bound to PySession instance ------ */
+ // TODO: to match js implementation, should pass the _python_ PySession
+ // object instance wrapping this C++ PySession instance. but how do we do that?
+ // for now, pass the uuid since its better than nothing
+ PyObject* func_arg = Py_BuildValue("(s)", uuid);
+ result = PyEval_CallObject(func, func_arg);
+ Py_XDECREF(func_arg);
+
+ if (result) {
+ resultStr = (char *) PyString_AsString(result);
+ // currently just ignore the result
+ }
+ else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to call python hangup callback\n");
+ PyErr_Print();
+ PyErr_Clear();
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "check hangup hook begin_allow_threads\n");
+ if (did_swap_in) {
+ begin_allow_threads();
+ }
+
+ Py_XDECREF(result);
+
+}
+
+switch_status_t PySession::run_dtmf_callback(void *input,
+ switch_input_type_t itype) {
-switch_status_t PythonDTMFCallback(switch_core_session_t *session,
- void *input,
- switch_input_type_t itype,
- void *buf,
- unsigned int buflen)
-{
PyObject *func, *arglist;
- PyObject *result;
+ PyObject *pyresult;
char *resultStr;
char *funcargs;
- input_callback_state_t *cb_state;
switch_file_handle_t *fh = NULL;
- PyThreadState *threadState = NULL;
+ bool did_swap_in = false;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PythonDTMFCallback\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "run_dtmf_callback\n");
- if (!buf) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "buf pointer is null");
+
+ if (!cb_state.function) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "cb_state->function is null\n");
return SWITCH_STATUS_FALSE;
- }
-
- cb_state = (input_callback_state *) buf;
+ }
- func = (PyObject *) cb_state->function;
+ func = (PyObject *) cb_state.function;
if (!func) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "cb_state->function is null\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "cb_state->function is null\n");
return SWITCH_STATUS_FALSE;
}
else {
@@ -108,7 +135,7 @@
return SWITCH_STATUS_FALSE;
}
- funcargs = (char *) cb_state->funcargs;
+ funcargs = (char *) cb_state.funcargs;
arglist = Py_BuildValue("(sis)", input, itype, funcargs);
if (!arglist) {
@@ -116,38 +143,132 @@
return SWITCH_STATUS_FALSE;
}
- threadState = (PyThreadState *) cb_state->threadState;
- if (!threadState) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error, invalid threadstate\n");
- return SWITCH_STATUS_FALSE;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "run_dtmf_callback end_allow_threads\n");
+ did_swap_in = end_allow_threads();
+
+ pyresult = PyEval_CallObject(func, arglist);
+
+
+ Py_XDECREF(arglist); // Trash arglist
+ if (pyresult && pyresult != Py_None) {
+ resultStr = (char *) PyString_AsString(pyresult);
+ switch_status_t cbresult = process_callback_result(resultStr, &cb_state, session);
+ return cbresult;
}
else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "restoring threadstate: %p\n", threadState);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error calling python callback\n");
+ PyErr_Print();
+ PyErr_Clear();
}
- PyEval_RestoreThread(threadState); // nasty stuff happens when py interp has no thread state
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "run_dtmf_callback begin_allow_threads\n");
+ if (did_swap_in) {
+ begin_allow_threads();
+ }
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "restored threadstate, calling python function: %p\n", func);
-
- result = PyEval_CallObject(func, arglist);
-
- threadState = PyEval_SaveThread();
+ Py_XDECREF(pyresult);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "called python function\n");
+ return SWITCH_STATUS_SUCCESS;
- Py_DECREF(arglist); // Trash arglist
- if (result && result != Py_None) {
- resultStr = (char *) PyString_AsString(result);
- Py_XDECREF(result);
- return process_callback_result(resultStr, cb_state, session);
- }
- else {
- return SWITCH_STATUS_FALSE;
- }
+}
+
+bool PySession::begin_allow_threads(void) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::begin_allow_threads() called\n");
+
+ // swap out threadstate and store in instance variable
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
+ // so lets assume the thread state was swapped in when the python script was started,
+ // therefore swapin_tstate will be NULL (because there is nothing to swap in, since its
+ // _already_ swapped in.)
+ if (swapin_tstate == NULL) {
+ // currently swapped in
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Threadstate swap-out!\n");
+ swapin_tstate = PyEval_SaveThread();
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "swapin_tstate: %p\n", swapin_tstate);
+ // give future swapper-inners something to actually swap in
+ switch_channel_set_private(channel, "SwapInThreadState", (void *) swapin_tstate);
+ cb_state.threadState = threadState; // TODO: get rid of this
+ args.buf = &cb_state;
+ ap = &args;
+ return true;
+
+ }
+ else {
+ // currently swapped out
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Threadstate already swapd-out! Skipping\n");
+ return false;
+ }
+
+}
+
+bool PySession::end_allow_threads(void) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::end_allow_threads() called\n");
+ // swap in threadstate from instance variable saved earlier
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
+ if (swapin_tstate == NULL) {
+ // currently swapped in
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Threadstate double swap-in! Skipping\n");
+ return false;
+ }
+ else {
+ // currently swapped out
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Threadstate swap-in!\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "swapin_tstate: %p\n", swapin_tstate);
+ PyEval_RestoreThread(swapin_tstate);
+ // dont give any swapper-inners the opportunity to do a double swap
+ switch_channel_set_private(channel, "SwapInThreadState", NULL);
+ return true;
+ }
}
+void PySession::hangup(char *cause) {
+
+
+ // since we INCREF'd this function pointer earlier (so the py gc didnt reclaim it)
+ // we have to DECREF it, or else the PySession dtor will never get called and
+ // a zombie channel will be left over using up resources
+
+ if (cb_state.function != NULL) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "xdecref on cb_state_function\n");
+ PyObject * func = (PyObject *) cb_state.function;
+ Py_XDECREF(func);
+ }
+ else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "cb_state.function is null\n");
+ }
+
+
+ CoreSession::hangup(cause);
+
+}
+
+
+PySession::~PySession() {
+ // Should we do any cleanup here?
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::~PySession started\n");
+
+ if (on_hangup) {
+ PyObject * func = (PyObject *) on_hangup;
+ Py_XDECREF(func);
+ }
+
+
+ if (cb_state.function != NULL) {
+ PyObject * func = (PyObject *) cb_state.function;
+ Py_XDECREF(func);
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::~PySession finished\n");
+
+}
+
+
+
+
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h Fri Jun 22 14:36:36 2007
@@ -14,12 +14,10 @@
-switch_status_t PythonDTMFCallback(switch_core_session *session,
- void *input,
- switch_input_type_t itype,
- void *buf,
- unsigned int buflen);
-
+typedef enum {
+ S_SWAPPED_IN = (1 << 0),
+ S_SWAPPED_OUT = (1 << 1)
+} swap_state_t;
void console_log(char *level_str, char *msg);
void console_clean_log(char *msg);
@@ -29,14 +27,21 @@
class PySession : public CoreSession {
private:
void *threadState;
+ int swapstate;
public:
PySession();
PySession(char *uuid);
PySession(switch_core_session_t *session);
~PySession();
void setDTMFCallback(PyObject *pyfunc, char *funcargs);
- void begin_allow_threads();
- void end_allow_threads();
+ void setHangupHook(PyObject *pyfunc);
+ void check_hangup_hook();
+ void hangup(char *cause);
+ bool begin_allow_threads();
+ bool end_allow_threads();
+
+ switch_status_t run_dtmf_callback(void *input,
+ switch_input_type_t itype);
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c Fri Jun 22 14:36:36 2007
@@ -49,11 +49,12 @@
void init_freeswitch(void);
static switch_api_interface_t python_run_interface;
+
SWITCH_MODULE_LOAD_FUNCTION(mod_python_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown);
SWITCH_MODULE_DEFINITION(mod_python, mod_python_load, mod_python_shutdown, NULL);
-static void eval_some_python(char *uuid, char *args)
+static void eval_some_python(char *uuid, char *args, switch_core_session_t *session)
{
PyThreadState *tstate = NULL;
char *dupargs = NULL;
@@ -92,6 +93,11 @@
// swap in thread state
PyEval_AcquireThread(tstate);
+ if (session) {
+ // record the fact that thread state is swapped in
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ switch_channel_set_private(channel, "SwapInThreadState", NULL);
+ }
init_freeswitch();
// import the module
@@ -138,7 +144,9 @@
}
// invoke the handler
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call python script \n");
result = PyEval_CallObjectWithKeywords(function, arg, (PyObject *)NULL);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Finished calling python script \n");
// check the result and print out any errors
if (!result) {
@@ -160,7 +168,29 @@
Py_XDECREF(result);
// swap out thread state
- PyEval_ReleaseThread(tstate);
+ if (session) {
+ // record the fact that thread state is swapped in
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ PyThreadState *swapin_tstate = (PyThreadState *) switch_channel_get_private(channel, "SwapInThreadState");
+ // so lets assume nothing in the python script swapped any thread state in
+ // or out .. thread state will currently be swapped in, and the SwapInThreadState
+ // will be null
+ if (swapin_tstate == NULL) {
+ // swap it out
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Threadstate mod_python.c swap-out! \n");
+ // PyEval_ReleaseThread(cur_tstate);
+ swapin_tstate = (void *) PyEval_SaveThread();
+ switch_channel_set_private(channel, "SwapInThreadState", (void *) swapin_tstate);
+ }
+ else {
+ // thread state is already swapped out, so, nothing for us to do
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "according to chan priv data, already swapped out \n");
+ }
+ }
+ else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Threadstate mod_python.c swap-out! \n");
+ PyEval_ReleaseThread(tstate);
+ }
switch_safe_free(dupargs);
@@ -169,7 +199,7 @@
static void python_function(switch_core_session_t *session, char *data)
{
- eval_some_python(switch_core_session_get_uuid(session), (char *)data);
+ eval_some_python(switch_core_session_get_uuid(session), (char *)data, session);
}
@@ -183,7 +213,7 @@
switch_memory_pool_t *pool;
struct switch_py_thread *pt = (struct switch_py_thread *) obj;
- eval_some_python(NULL, strdup(pt->args));
+ eval_some_python(NULL, strdup(pt->args), NULL);
pool = pt->pool;
switch_core_destroy_memory_pool(&pool);
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i Fri Jun 22 14:36:36 2007
@@ -9,12 +9,16 @@
%cstring_bounded_mutable(char *dtmf_buf, 128);
%cstring_bounded_mutable(char *terminator, 8);
+
/** insert the following includes into generated code so it compiles */
%{
#include "switch_cpp.h"
#include "freeswitch_python.h"
%}
+
+%ignore SwitchToMempool;
+
/**
* tell swig to grok everything defined in these header files and
* build all sorts of c wrappers and python shadows of the c wrappers.
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Fri Jun 22 14:36:36 2007
@@ -2469,14 +2469,14 @@
#define SWIGTYPE_p_PySession swig_types[1]
#define SWIGTYPE_p_char swig_types[2]
#define SWIGTYPE_p_input_callback_state swig_types[3]
-#define SWIGTYPE_p_switch_channel_t swig_types[4]
-#define SWIGTYPE_p_switch_core_session swig_types[5]
-#define SWIGTYPE_p_switch_core_session_t swig_types[6]
-#define SWIGTYPE_p_switch_input_args_t swig_types[7]
-#define SWIGTYPE_p_switch_input_callback_function_t swig_types[8]
-#define SWIGTYPE_p_switch_input_type_t swig_types[9]
-#define SWIGTYPE_p_switch_status_t swig_types[10]
-#define SWIGTYPE_p_uint32_t swig_types[11]
+#define SWIGTYPE_p_session_flag_t swig_types[4]
+#define SWIGTYPE_p_swap_state_t swig_types[5]
+#define SWIGTYPE_p_switch_channel_state_t swig_types[6]
+#define SWIGTYPE_p_switch_channel_t swig_types[7]
+#define SWIGTYPE_p_switch_core_session_t swig_types[8]
+#define SWIGTYPE_p_switch_input_args_t swig_types[9]
+#define SWIGTYPE_p_switch_input_type_t swig_types[10]
+#define SWIGTYPE_p_switch_status_t swig_types[11]
#define SWIGTYPE_p_void swig_types[12]
static swig_type_info *swig_types[14];
static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
@@ -2768,13 +2768,18 @@
SWIGINTERN int
-SWIG_AsVal_long (PyObject *obj, long* val)
+SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
{
if (PyInt_Check(obj)) {
- if (val) *val = PyInt_AsLong(obj);
- return SWIG_OK;
+ long v = PyInt_AsLong(obj);
+ if (v >= 0) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ return SWIG_OverflowError;
+ }
} else if (PyLong_Check(obj)) {
- long v = PyLong_AsLong(obj);
+ unsigned long v = PyLong_AsUnsignedLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_OK;
@@ -2785,7 +2790,7 @@
#ifdef SWIG_PYTHON_CAST_MODE
{
int dispatch = 0;
- long v = PyInt_AsLong(obj);
+ unsigned long v = PyLong_AsUnsignedLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_AddCast(SWIG_OK);
@@ -2795,8 +2800,8 @@
if (!dispatch) {
double d;
int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
- if (val) *val = (long)(d);
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+ if (val) *val = (unsigned long)(d);
return res;
}
}
@@ -2807,41 +2812,44 @@
SWIGINTERN int
-SWIG_AsVal_int (PyObject * obj, int *val)
+SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
{
- long v;
- int res = SWIG_AsVal_long (obj, &v);
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
- if ((v < INT_MIN || v > INT_MAX)) {
+ if ((v > UINT_MAX)) {
return SWIG_OverflowError;
} else {
- if (val) *val = static_cast< int >(v);
+ if (val) *val = static_cast< unsigned int >(v);
}
}
return res;
}
-SWIGINTERNINLINE PyObject*
- SWIG_From_bool (bool value)
+SWIGINTERNINLINE PyObject*
+SWIG_From_unsigned_SS_long (unsigned long value)
{
- return PyBool_FromLong(value ? 1 : 0);
+ return (value > LONG_MAX) ?
+ PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_unsigned_SS_int (unsigned int value)
+{
+ return SWIG_From_unsigned_SS_long (value);
}
SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
+SWIG_AsVal_long (PyObject *obj, long* val)
{
if (PyInt_Check(obj)) {
- long v = PyInt_AsLong(obj);
- if (v >= 0) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- return SWIG_OverflowError;
- }
+ if (val) *val = PyInt_AsLong(obj);
+ return SWIG_OK;
} else if (PyLong_Check(obj)) {
- unsigned long v = PyLong_AsUnsignedLong(obj);
+ long v = PyLong_AsLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_OK;
@@ -2852,7 +2860,7 @@
#ifdef SWIG_PYTHON_CAST_MODE
{
int dispatch = 0;
- unsigned long v = PyLong_AsUnsignedLong(obj);
+ long v = PyInt_AsLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
return SWIG_AddCast(SWIG_OK);
@@ -2862,8 +2870,8 @@
if (!dispatch) {
double d;
int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
- if (val) *val = (unsigned long)(d);
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+ if (val) *val = (long)(d);
return res;
}
}
@@ -2874,20 +2882,45 @@
SWIGINTERN int
-SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
+SWIG_AsVal_int (PyObject * obj, int *val)
{
- unsigned long v;
- int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
- if ((v > UINT_MAX)) {
+ if ((v < INT_MIN || v > INT_MAX)) {
return SWIG_OverflowError;
} else {
- if (val) *val = static_cast< unsigned int >(v);
+ if (val) *val = static_cast< int >(v);
}
}
return res;
}
+
+SWIGINTERN int
+SWIG_AsVal_bool (PyObject *obj, bool *val)
+{
+ if (obj == Py_True) {
+ if (val) *val = true;
+ return SWIG_OK;
+ } else if (obj == Py_False) {
+ if (val) *val = false;
+ return SWIG_OK;
+ } else {
+ long v = 0;
+ int res = SWIG_AddCast(SWIG_AsVal_long (obj, val ? &v : 0));
+ if (SWIG_IsOK(res) && val) *val = v ? true : false;
+ return res;
+ }
+}
+
+
+SWIGINTERNINLINE PyObject*
+ SWIG_From_bool (bool value)
+{
+ return PyBool_FromLong(value ? 1 : 0);
+}
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -3311,103 +3344,6 @@
return SWIG_Py_Void();
}
-SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- CoreSession *result = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)":new_CoreSession")) SWIG_fail;
- result = (CoreSession *)new CoreSession();
- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- char *arg1 = (char *) 0 ;
- CoreSession *result = 0 ;
- int res1 ;
- char *buf1 = 0 ;
- int alloc1 = 0 ;
- PyObject * obj0 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"O:new_CoreSession",&obj0)) SWIG_fail;
- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CoreSession" "', argument " "1"" of type '" "char *""'");
- }
- arg1 = reinterpret_cast< char * >(buf1);
- result = (CoreSession *)new CoreSession(arg1);
- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
- if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
- return resultobj;
-fail:
- if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
- CoreSession *result = 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- PyObject * obj0 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"O:new_CoreSession",&obj0)) SWIG_fail;
- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CoreSession" "', argument " "1"" of type '" "switch_core_session_t *""'");
- }
- arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
- result = (CoreSession *)new CoreSession(arg1);
- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CoreSession(PyObject *self, PyObject *args) {
- int argc;
- PyObject *argv[2];
- int ii;
-
- if (!PyTuple_Check(args)) SWIG_fail;
- argc = PyObject_Length(args);
- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
- argv[ii] = PyTuple_GET_ITEM(args,ii);
- }
- if (argc == 0) {
- return _wrap_new_CoreSession__SWIG_0(self, args);
- }
- if (argc == 1) {
- int _v;
- void *vptr = 0;
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_switch_core_session_t, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- return _wrap_new_CoreSession__SWIG_2(self, args);
- }
- }
- if (argc == 1) {
- int _v;
- int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- return _wrap_new_CoreSession__SWIG_1(self, args);
- }
- }
-
-fail:
- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CoreSession'.\n Possible C/C++ prototypes are:\n CoreSession()\n CoreSession(char *)\n CoreSession(switch_core_session_t *)\n");
- return NULL;
-}
-
-
SWIGINTERN PyObject *_wrap_delete_CoreSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -3536,6 +3472,59 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_flags_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_flags_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_flags_set" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_flags_set" "', argument " "2"" of type '" "unsigned int""'");
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ if (arg1) (arg1)->flags = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_flags_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ unsigned int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_flags_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_flags_get" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (unsigned int) ((arg1)->flags);
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_CoreSession_cb_state_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -3589,6 +3578,67 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_hook_state_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_channel_state_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_hook_state_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_hook_state_set" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ {
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_switch_channel_state_t, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hook_state_set" "', argument " "2"" of type '" "switch_channel_state_t""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_hook_state_set" "', argument " "2"" of type '" "switch_channel_state_t""'");
+ } else {
+ switch_channel_state_t * temp = reinterpret_cast< switch_channel_state_t * >(argp2);
+ arg2 = *temp;
+ if (SWIG_IsNewObj(res2)) delete temp;
+ }
+ }
+ if (arg1) (arg1)->hook_state = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_hook_state_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_channel_state_t result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_hook_state_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_hook_state_get" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = ((arg1)->hook_state);
+ resultobj = SWIG_NewPointerObj((new switch_channel_state_t(static_cast< const switch_channel_state_t& >(result))), SWIGTYPE_p_switch_channel_state_t, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_CoreSession_answer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -3960,61 +4010,39 @@
SWIGINTERN PyObject *_wrap_CoreSession_setDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
- switch_input_callback_function_t arg2 ;
- void *arg3 = (void *) 0 ;
- uint32_t arg4 ;
+ void *arg2 = (void *) 0 ;
+ char *arg3 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
- void *argp2 ;
- int res2 = 0 ;
+ int res2 ;
int res3 ;
- void *argp4 ;
- int res4 = 0 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_setDTMFCallback",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_setDTMFCallback",&obj0,&obj1,&obj2)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setDTMFCallback" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
- {
- res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_switch_input_callback_function_t, 0 | 0);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setDTMFCallback" "', argument " "2"" of type '" "switch_input_callback_function_t""'");
- }
- if (!argp2) {
- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_setDTMFCallback" "', argument " "2"" of type '" "switch_input_callback_function_t""'");
- } else {
- switch_input_callback_function_t * temp = reinterpret_cast< switch_input_callback_function_t * >(argp2);
- arg2 = *temp;
- if (SWIG_IsNewObj(res2)) delete temp;
- }
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setDTMFCallback" "', argument " "2"" of type '" "void *""'");
}
- res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setDTMFCallback" "', argument " "3"" of type '" "void *""'");
- }
- {
- res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_uint32_t, 0 | 0);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_setDTMFCallback" "', argument " "4"" of type '" "uint32_t""'");
- }
- if (!argp4) {
- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_setDTMFCallback" "', argument " "4"" of type '" "uint32_t""'");
- } else {
- uint32_t * temp = reinterpret_cast< uint32_t * >(argp4);
- arg4 = *temp;
- if (SWIG_IsNewObj(res4)) delete temp;
- }
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setDTMFCallback" "', argument " "3"" of type '" "char *""'");
}
- (arg1)->setDTMFCallback(arg2,arg3,arg4);
+ arg3 = reinterpret_cast< char * >(buf3);
+ (arg1)->setDTMFCallback(arg2,arg3);
resultobj = SWIG_Py_Void();
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
return resultobj;
fail:
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
return NULL;
}
@@ -4103,9 +4131,10 @@
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
int arg3 ;
- char *arg4 = (char *) 0 ;
+ int arg4 ;
char *arg5 = (char *) 0 ;
- int arg6 ;
+ char *arg6 = (char *) 0 ;
+ int arg7 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -4116,24 +4145,27 @@
int alloc2 = 0 ;
int val3 ;
int ecode3 = 0 ;
- int res4 ;
- char *buf4 = 0 ;
- int alloc4 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
int res5 ;
- char temp5[8+1] ;
- char *t5 = 0 ;
- size_t n5 = 0 ;
+ char *buf5 = 0 ;
int alloc5 = 0 ;
- int val6 ;
- int ecode6 = 0 ;
+ int res6 ;
+ char temp6[8+1] ;
+ char *t6 = 0 ;
+ size_t n6 = 0 ;
+ int alloc6 = 0 ;
+ int val7 ;
+ int ecode7 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
PyObject * obj4 = 0 ;
PyObject * obj5 = 0 ;
+ PyObject * obj6 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getDigits" "', argument " "1"" of type '" "CoreSession *""'");
@@ -4153,35 +4185,40 @@
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_getDigits" "', argument " "3"" of type '" "int""'");
}
arg3 = static_cast< int >(val3);
- res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "char *""'");
- }
- arg4 = reinterpret_cast< char * >(buf4);
- res5 = SWIG_AsCharPtrAndSize(obj4, &t5, &n5, &alloc5);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
if (!SWIG_IsOK(res5)) {
- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *terminator""'");
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *""'");
+ }
+ arg5 = reinterpret_cast< char * >(buf5);
+ res6 = SWIG_AsCharPtrAndSize(obj5, &t6, &n6, &alloc6);
+ if (!SWIG_IsOK(res6)) {
+ SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CoreSession_getDigits" "', argument " "6"" of type '" "char *terminator""'");
}
- if ( n5 > (size_t) 8 ) n5 = (size_t) 8;
- memcpy(temp5, t5, sizeof(char)*n5);
- if (alloc5 == SWIG_NEWOBJ) delete[] t5;
- temp5[n5 - 1] = 0;
- arg5 = (char *) temp5;
- ecode6 = SWIG_AsVal_int(obj5, &val6);
- if (!SWIG_IsOK(ecode6)) {
- SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CoreSession_getDigits" "', argument " "6"" of type '" "int""'");
+ if ( n6 > (size_t) 8 ) n6 = (size_t) 8;
+ memcpy(temp6, t6, sizeof(char)*n6);
+ if (alloc6 == SWIG_NEWOBJ) delete[] t6;
+ temp6[n6 - 1] = 0;
+ arg6 = (char *) temp6;
+ ecode7 = SWIG_AsVal_int(obj6, &val7);
+ if (!SWIG_IsOK(ecode7)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "CoreSession_getDigits" "', argument " "7"" of type '" "int""'");
}
- arg6 = static_cast< int >(val6);
- result = (int)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6);
+ arg7 = static_cast< int >(val7);
+ result = (int)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6,arg7);
resultobj = SWIG_From_int(static_cast< int >(result));
arg2[128] = 0;
resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg2));
- arg5[8] = 0;
- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg5));
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ arg6[8] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg6));
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return resultobj;
fail:
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return NULL;
}
@@ -4411,6 +4448,109 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_flushEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_flushEvents",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_flushEvents" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (int)(arg1)->flushEvents();
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_flushDigits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_flushDigits",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_flushDigits" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (int)(arg1)->flushDigits();
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_setAutoHangup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ bool arg2 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_setAutoHangup",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setAutoHangup" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ ecode2 = SWIG_AsVal_bool(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_setAutoHangup" "', argument " "2"" of type '" "bool""'");
+ }
+ arg2 = static_cast< bool >(val2);
+ result = (int)(arg1)->setAutoHangup(arg2);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_setHangupHook(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ void *arg2 = (void *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_setHangupHook",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setHangupHook" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setHangupHook" "', argument " "2"" of type '" "void *""'");
+ }
+ (arg1)->setHangupHook(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_CoreSession_ready(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -4481,6 +4621,7 @@
SWIGINTERN PyObject *_wrap_CoreSession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
+ bool result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
@@ -4491,8 +4632,8 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_begin_allow_threads" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
- (arg1)->begin_allow_threads();
- resultobj = SWIG_Py_Void();
+ result = (bool)(arg1)->begin_allow_threads();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
@@ -4502,6 +4643,7 @@
SWIGINTERN PyObject *_wrap_CoreSession_end_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
+ bool result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
@@ -4512,8 +4654,8 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_end_allow_threads" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
- (arg1)->end_allow_threads();
- resultobj = SWIG_Py_Void();
+ result = (bool)(arg1)->end_allow_threads();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
@@ -4567,6 +4709,73 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_check_hangup_hook(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_check_hangup_hook",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_check_hangup_hook" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ (arg1)->check_hangup_hook();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_run_dtmf_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ void *arg2 = (void *) 0 ;
+ switch_input_type_t arg3 ;
+ switch_status_t result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ void *argp3 ;
+ int res3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_run_dtmf_callback",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_run_dtmf_callback" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_run_dtmf_callback" "', argument " "2"" of type '" "void *""'");
+ }
+ {
+ res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_switch_input_type_t, 0 | 0);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_run_dtmf_callback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ }
+ if (!argp3) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_run_dtmf_callback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ } else {
+ switch_input_type_t * temp = reinterpret_cast< switch_input_type_t * >(argp3);
+ arg3 = *temp;
+ if (SWIG_IsNewObj(res3)) delete temp;
+ }
+ }
+ result = (arg1)->run_dtmf_callback(arg2,arg3);
+ resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *CoreSession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
@@ -4610,9 +4819,31 @@
}
-SWIGINTERN PyObject *_wrap_PythonDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_hanguphook(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+ switch_status_t result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:hanguphook",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hanguphook" "', argument " "1"" of type '" "switch_core_session_t *""'");
+ }
+ arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
+ result = hanguphook(arg1);
+ resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_dtmf_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- switch_core_session *arg1 = (switch_core_session *) 0 ;
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
void *arg2 = (void *) 0 ;
switch_input_type_t arg3 ;
void *arg4 = (void *) 0 ;
@@ -4632,23 +4863,23 @@
PyObject * obj3 = 0 ;
PyObject * obj4 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOOOO:PythonDTMFCallback",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session, 0 | 0 );
+ if (!PyArg_ParseTuple(args,(char *)"OOOOO:dtmf_callback",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PythonDTMFCallback" "', argument " "1"" of type '" "switch_core_session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dtmf_callback" "', argument " "1"" of type '" "switch_core_session_t *""'");
}
- arg1 = reinterpret_cast< switch_core_session * >(argp1);
+ arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PythonDTMFCallback" "', argument " "2"" of type '" "void *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dtmf_callback" "', argument " "2"" of type '" "void *""'");
}
{
res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_switch_input_type_t, 0 | 0);
if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PythonDTMFCallback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "dtmf_callback" "', argument " "3"" of type '" "switch_input_type_t""'");
}
if (!argp3) {
- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PythonDTMFCallback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "dtmf_callback" "', argument " "3"" of type '" "switch_input_type_t""'");
} else {
switch_input_type_t * temp = reinterpret_cast< switch_input_type_t * >(argp3);
arg3 = *temp;
@@ -4657,14 +4888,14 @@
}
res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0);
if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "PythonDTMFCallback" "', argument " "4"" of type '" "void *""'");
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "dtmf_callback" "', argument " "4"" of type '" "void *""'");
}
ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5);
if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "PythonDTMFCallback" "', argument " "5"" of type '" "unsigned int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "dtmf_callback" "', argument " "5"" of type '" "unsigned int""'");
}
arg5 = static_cast< unsigned int >(val5);
- result = PythonDTMFCallback(arg1,arg2,arg3,arg4,arg5);
+ result = dtmf_callback(arg1,arg2,arg3,arg4,arg5);
resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
@@ -4827,9 +5058,88 @@
}
+SWIGINTERN PyObject *_wrap_PySession_setHangupHook(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ PyObject *arg2 = (PyObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:PySession_setHangupHook",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_setHangupHook" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ arg2 = obj1;
+ (arg1)->setHangupHook(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_PySession_check_hangup_hook(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:PySession_check_hangup_hook",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_check_hangup_hook" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ (arg1)->check_hangup_hook();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_PySession_hangup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:PySession_hangup",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_hangup" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySession_hangup" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ (arg1)->hangup(arg2);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_PySession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
PySession *arg1 = (PySession *) 0 ;
+ bool result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
@@ -4840,8 +5150,8 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_begin_allow_threads" "', argument " "1"" of type '" "PySession *""'");
}
arg1 = reinterpret_cast< PySession * >(argp1);
- (arg1)->begin_allow_threads();
- resultobj = SWIG_Py_Void();
+ result = (bool)(arg1)->begin_allow_threads();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
@@ -4851,6 +5161,7 @@
SWIGINTERN PyObject *_wrap_PySession_end_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
PySession *arg1 = (PySession *) 0 ;
+ bool result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
@@ -4861,8 +5172,54 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_end_allow_threads" "', argument " "1"" of type '" "PySession *""'");
}
arg1 = reinterpret_cast< PySession * >(argp1);
- (arg1)->end_allow_threads();
- resultobj = SWIG_Py_Void();
+ result = (bool)(arg1)->end_allow_threads();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_PySession_run_dtmf_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ void *arg2 = (void *) 0 ;
+ switch_input_type_t arg3 ;
+ switch_status_t result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ void *argp3 ;
+ int res3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:PySession_run_dtmf_callback",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_run_dtmf_callback" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySession_run_dtmf_callback" "', argument " "2"" of type '" "void *""'");
+ }
+ {
+ res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_switch_input_type_t, 0 | 0);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PySession_run_dtmf_callback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ }
+ if (!argp3) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySession_run_dtmf_callback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ } else {
+ switch_input_type_t * temp = reinterpret_cast< switch_input_type_t * >(argp3);
+ arg3 = *temp;
+ if (SWIG_IsNewObj(res3)) delete temp;
+ }
+ }
+ result = (arg1)->run_dtmf_callback(arg2,arg3);
+ resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
@@ -4893,14 +5250,17 @@
{ (char *)"new_input_callback_state_t", _wrap_new_input_callback_state_t, METH_VARARGS, NULL},
{ (char *)"delete_input_callback_state_t", _wrap_delete_input_callback_state_t, METH_VARARGS, NULL},
{ (char *)"input_callback_state_t_swigregister", input_callback_state_t_swigregister, METH_VARARGS, NULL},
- { (char *)"new_CoreSession", _wrap_new_CoreSession, METH_VARARGS, NULL},
{ (char *)"delete_CoreSession", _wrap_delete_CoreSession, METH_VARARGS, NULL},
{ (char *)"CoreSession_session_set", _wrap_CoreSession_session_set, METH_VARARGS, NULL},
{ (char *)"CoreSession_session_get", _wrap_CoreSession_session_get, METH_VARARGS, NULL},
{ (char *)"CoreSession_channel_set", _wrap_CoreSession_channel_set, METH_VARARGS, NULL},
{ (char *)"CoreSession_channel_get", _wrap_CoreSession_channel_get, METH_VARARGS, NULL},
+ { (char *)"CoreSession_flags_set", _wrap_CoreSession_flags_set, METH_VARARGS, NULL},
+ { (char *)"CoreSession_flags_get", _wrap_CoreSession_flags_get, METH_VARARGS, NULL},
{ (char *)"CoreSession_cb_state_set", _wrap_CoreSession_cb_state_set, METH_VARARGS, NULL},
{ (char *)"CoreSession_cb_state_get", _wrap_CoreSession_cb_state_get, METH_VARARGS, NULL},
+ { (char *)"CoreSession_hook_state_set", _wrap_CoreSession_hook_state_set, METH_VARARGS, NULL},
+ { (char *)"CoreSession_hook_state_get", _wrap_CoreSession_hook_state_get, METH_VARARGS, NULL},
{ (char *)"CoreSession_answer", _wrap_CoreSession_answer, METH_VARARGS, NULL},
{ (char *)"CoreSession_preAnswer", _wrap_CoreSession_preAnswer, METH_VARARGS, NULL},
{ (char *)"CoreSession_hangup", _wrap_CoreSession_hangup, METH_VARARGS, NULL},
@@ -4917,20 +5277,31 @@
{ (char *)"CoreSession_transfer", _wrap_CoreSession_transfer, METH_VARARGS, NULL},
{ (char *)"CoreSession_playAndGetDigits", _wrap_CoreSession_playAndGetDigits, METH_VARARGS, NULL},
{ (char *)"CoreSession_streamfile", _wrap_CoreSession_streamfile, METH_VARARGS, NULL},
+ { (char *)"CoreSession_flushEvents", _wrap_CoreSession_flushEvents, METH_VARARGS, NULL},
+ { (char *)"CoreSession_flushDigits", _wrap_CoreSession_flushDigits, METH_VARARGS, NULL},
+ { (char *)"CoreSession_setAutoHangup", _wrap_CoreSession_setAutoHangup, METH_VARARGS, NULL},
+ { (char *)"CoreSession_setHangupHook", _wrap_CoreSession_setHangupHook, METH_VARARGS, NULL},
{ (char *)"CoreSession_ready", _wrap_CoreSession_ready, METH_VARARGS, NULL},
{ (char *)"CoreSession_execute", _wrap_CoreSession_execute, METH_VARARGS, NULL},
{ (char *)"CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads, METH_VARARGS, NULL},
{ (char *)"CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads, METH_VARARGS, NULL},
{ (char *)"CoreSession_get_uuid", _wrap_CoreSession_get_uuid, METH_VARARGS, NULL},
{ (char *)"CoreSession_get_cb_args", _wrap_CoreSession_get_cb_args, METH_VARARGS, NULL},
+ { (char *)"CoreSession_check_hangup_hook", _wrap_CoreSession_check_hangup_hook, METH_VARARGS, NULL},
+ { (char *)"CoreSession_run_dtmf_callback", _wrap_CoreSession_run_dtmf_callback, METH_VARARGS, NULL},
{ (char *)"CoreSession_swigregister", CoreSession_swigregister, METH_VARARGS, NULL},
{ (char *)"bridge", _wrap_bridge, METH_VARARGS, NULL},
- { (char *)"PythonDTMFCallback", _wrap_PythonDTMFCallback, METH_VARARGS, NULL},
+ { (char *)"hanguphook", _wrap_hanguphook, METH_VARARGS, NULL},
+ { (char *)"dtmf_callback", _wrap_dtmf_callback, METH_VARARGS, NULL},
{ (char *)"new_PySession", _wrap_new_PySession, METH_VARARGS, NULL},
{ (char *)"delete_PySession", _wrap_delete_PySession, METH_VARARGS, NULL},
{ (char *)"PySession_setDTMFCallback", _wrap_PySession_setDTMFCallback, METH_VARARGS, NULL},
+ { (char *)"PySession_setHangupHook", _wrap_PySession_setHangupHook, METH_VARARGS, NULL},
+ { (char *)"PySession_check_hangup_hook", _wrap_PySession_check_hangup_hook, METH_VARARGS, NULL},
+ { (char *)"PySession_hangup", _wrap_PySession_hangup, METH_VARARGS, NULL},
{ (char *)"PySession_begin_allow_threads", _wrap_PySession_begin_allow_threads, METH_VARARGS, NULL},
{ (char *)"PySession_end_allow_threads", _wrap_PySession_end_allow_threads, METH_VARARGS, NULL},
+ { (char *)"PySession_run_dtmf_callback", _wrap_PySession_run_dtmf_callback, METH_VARARGS, NULL},
{ (char *)"PySession_swigregister", PySession_swigregister, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
};
@@ -4945,14 +5316,14 @@
static swig_type_info _swigt__p_PySession = {"_p_PySession", "PySession *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swap_state_t = {"_p_swap_state_t", "enum swap_state_t *|swap_state_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_switch_core_session = {"_p_switch_core_session", "switch_core_session *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_input_args_t = {"_p_switch_input_args_t", "switch_input_args_t *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_switch_input_callback_function_t = {"_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_input_type_t = {"_p_switch_input_type_t", "switch_input_type_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_status_t = {"_p_switch_status_t", "switch_status_t *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
@@ -4960,14 +5331,14 @@
&_swigt__p_PySession,
&_swigt__p_char,
&_swigt__p_input_callback_state,
+ &_swigt__p_session_flag_t,
+ &_swigt__p_swap_state_t,
+ &_swigt__p_switch_channel_state_t,
&_swigt__p_switch_channel_t,
- &_swigt__p_switch_core_session,
&_swigt__p_switch_core_session_t,
&_swigt__p_switch_input_args_t,
- &_swigt__p_switch_input_callback_function_t,
&_swigt__p_switch_input_type_t,
&_swigt__p_switch_status_t,
- &_swigt__p_uint32_t,
&_swigt__p_void,
};
@@ -4975,14 +5346,14 @@
static swig_cast_info _swigc__p_PySession[] = { {&_swigt__p_PySession, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swap_state_t[] = { {&_swigt__p_swap_state_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_switch_core_session[] = { {&_swigt__p_switch_core_session, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_input_args_t[] = { {&_swigt__p_switch_input_args_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_switch_input_callback_function_t[] = { {&_swigt__p_switch_input_callback_function_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_input_type_t[] = { {&_swigt__p_switch_input_type_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_status_t[] = { {&_swigt__p_switch_status_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
@@ -4990,14 +5361,14 @@
_swigc__p_PySession,
_swigc__p_char,
_swigc__p_input_callback_state,
+ _swigc__p_session_flag_t,
+ _swigc__p_swap_state_t,
+ _swigc__p_switch_channel_state_t,
_swigc__p_switch_channel_t,
- _swigc__p_switch_core_session,
_swigc__p_switch_core_session_t,
_swigc__p_switch_input_args_t,
- _swigc__p_switch_input_callback_function_t,
_swigc__p_switch_input_type_t,
_swigc__p_switch_status_t,
- _swigc__p_uint32_t,
_swigc__p_void,
};
@@ -5519,5 +5890,10 @@
SWIG_InstallConstants(d,swig_const_table);
+ SWIG_Python_SetConstant(d, "S_HUP",SWIG_From_int(static_cast< int >(S_HUP)));
+ SWIG_Python_SetConstant(d, "S_FREE",SWIG_From_int(static_cast< int >(S_FREE)));
+ SWIG_Python_SetConstant(d, "S_RDLOCK",SWIG_From_int(static_cast< int >(S_RDLOCK)));
+ SWIG_Python_SetConstant(d, "S_SWAPPED_IN",SWIG_From_int(static_cast< int >(S_SWAPPED_IN)));
+ SWIG_Python_SetConstant(d, "S_SWAPPED_OUT",SWIG_From_int(static_cast< int >(S_SWAPPED_OUT)));
}
Modified: freeswitch/branches/greenlizard/src/switch_core_file.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_file.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_file.c Fri Jun 22 14:36:36 2007
@@ -95,6 +95,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, void *data, switch_size_t *len)
{
assert(fh != NULL);
+ assert(fh->file_interface != NULL);
return fh->file_interface->file_read(fh, data, len);
}
@@ -102,6 +103,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_write(switch_file_handle_t *fh, void *data, switch_size_t *len)
{
assert(fh != NULL);
+ assert(fh->file_interface != NULL);
return fh->file_interface->file_write(fh, data, len);
}
@@ -109,6 +111,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_seek(switch_file_handle_t *fh, unsigned int *cur_pos, int64_t samples, int whence)
{
assert(fh != NULL);
+ assert(fh->file_interface != NULL);
switch_set_flag(fh, SWITCH_FILE_SEEK);
return fh->file_interface->file_seek(fh, cur_pos, samples, whence);
@@ -117,6 +120,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_set_string(switch_file_handle_t *fh, switch_audio_col_t col, const char *string)
{
assert(fh != NULL);
+ assert(fh->file_interface != NULL);
return fh->file_interface->file_set_string(fh, col, string);
}
@@ -124,6 +128,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_get_string(switch_file_handle_t *fh, switch_audio_col_t col, const char **string)
{
assert(fh != NULL);
+ assert(fh->file_interface != NULL);
return fh->file_interface->file_get_string(fh, col, string);
@@ -132,6 +137,9 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
{
+ assert(fh != NULL);
+ assert(fh->file_interface != NULL);
+
switch_clear_flag(fh, SWITCH_FILE_OPEN);
return fh->file_interface->file_close(fh);
Modified: freeswitch/branches/greenlizard/src/switch_cpp.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_cpp.cpp (original)
+++ freeswitch/branches/greenlizard/src/switch_cpp.cpp Fri Jun 22 14:36:36 2007
@@ -7,7 +7,7 @@
#define sanity_check(x) do { if (!session) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0)
#define sanity_check_noreturn do { if (!session) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0)
-#define init_vars() do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; } while(0)
+#define init_vars() do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; on_hangup = NULL; cb_state.function = NULL; } while(0)
@@ -36,8 +36,13 @@
CoreSession::~CoreSession()
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::~CoreSession desctructor");
+ switch_channel_t *channel = NULL;
if (session) {
+ channel = switch_core_session_get_channel(session);
+ if (channel && switch_test_flag(this, S_HUP)) {
+ switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+ }
switch_core_session_rwunlock(session);
}
@@ -103,30 +108,35 @@
timer_name = NULL;
}
store_file_handle(&fh);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "playFile begin_allow_threads\n");
begin_allow_threads();
status = switch_ivr_play_file(session, &fh, file, ap);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "playFile end_allow_threads\n");
end_allow_threads();
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
-void CoreSession::setDTMFCallback(switch_input_callback_function_t cb,
- void *buf,
- uint32_t buflen)
-{
- sanity_check_noreturn;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::setDTMFCallback.");
- if (cb) {
- args.buf = buf;
- args.buflen = buflen;
- args.input_callback = cb;
- ap = &args;
- } else {
- memset(&args, 0, sizeof(args));
- ap = NULL;
- }
-}
+void CoreSession::setDTMFCallback(void *cbfunc, char *funcargs) {
+
+ cb_state.funcargs = funcargs;
+ cb_state.function = cbfunc;
+
+ args.buf = &cb_state;
+ args.buflen = sizeof(cb_state); // not sure what this is used for, copy mod_spidermonkey
+
+ switch_channel_set_private(channel, "CoreSession", this);
+
+ // we cannot set the actual callback to a python function, because
+ // the callback is a function pointer with a specific signature.
+ // so, set it to the following c function which will act as a proxy,
+ // finding the python callback in the args callback args structure
+ args.input_callback = dtmf_callback;
+ ap = &args;
+
+
+}
int CoreSession::speak(char *text)
{
@@ -134,6 +144,12 @@
switch_codec_t *codec;
sanity_check(-1);
+
+ // create and store an empty filehandle in callback args
+ // to workaround a bug in the presumptuous process_callback_result()
+ switch_file_handle_t fh = { 0 };
+ store_file_handle(&fh);
+
if (!tts_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No TTS engine specified");
return SWITCH_STATUS_FALSE;
@@ -161,7 +177,8 @@
}
int CoreSession::getDigits(char *dtmf_buf,
- int len,
+ int buflen,
+ int maxdigits,
char *terminators,
char *terminator,
int timeout)
@@ -169,13 +186,16 @@
switch_status_t status;
sanity_check(-1);
begin_allow_threads();
+
status = switch_ivr_collect_digits_count(session,
dtmf_buf,
- (uint32_t) len,
- (uint32_t) len,
+ (uint32_t) buflen,
+ (uint32_t) maxdigits,
terminators,
terminator,
(uint32_t) timeout);
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "getDigits dtmf_buf: %s\n", dtmf_buf);
end_allow_threads();
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
@@ -213,6 +233,9 @@
bad_input_audio_files,
dtmf_buf, 128,
digits_regex);
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "playAndGetDigits dtmf_buf: %s\n", dtmf_buf);
+
end_allow_threads();
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
@@ -319,6 +342,52 @@
}
+int CoreSession::flushEvents()
+{
+ switch_event_t *event;
+ switch_channel_t *channel;
+
+ if (!session) {
+ return SWITCH_STATUS_FALSE;
+ }
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ while (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+ switch_event_destroy(&event);
+ }
+ return SWITCH_STATUS_SUCCESS;
+}
+
+int CoreSession::flushDigits()
+{
+ char buf[256];
+ switch_size_t has;
+ switch_channel_t *channel;
+
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ while ((has = switch_channel_has_dtmf(channel))) {
+ switch_channel_dequeue_dtmf(channel, buf, sizeof(buf));
+ }
+ return SWITCH_STATUS_SUCCESS;
+}
+
+int CoreSession::setAutoHangup(bool val)
+{
+ if (!session) {
+ return SWITCH_STATUS_FALSE;
+ }
+ if (val) {
+ switch_set_flag(this, S_HUP);
+ } else {
+ switch_clear_flag(this, S_HUP);
+ }
+ return SWITCH_STATUS_SUCCESS;
+}
+
void CoreSession::setCallerData(char *var, char *val) {
if (strcmp(var, "dialplan") == 0) {
@@ -351,12 +420,17 @@
}
-void CoreSession::begin_allow_threads() {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::begin_allow_threads() called and does nothing\n");
-}
+void CoreSession::setHangupHook(void *hangup_func) {
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::seHangupHook, hangup_func: %p\n", hangup_func);
+ on_hangup = hangup_func;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ hook_state = switch_channel_get_state(channel);
+ switch_channel_set_private(channel, "CoreSession", this);
+ switch_core_event_hook_add_state_change(session, hanguphook);
-void CoreSession::end_allow_threads() {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::end_allow_threads() called and does nothing\n");
}
/** \brief Store a file handle in the callback args
@@ -425,6 +499,64 @@
}
+switch_status_t hanguphook(switch_core_session_t *session_hungup)
+{
+ switch_channel_t *channel;
+ CoreSession *coresession = NULL;
+ switch_channel_state_t state;
+
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hangup_hook called\n");
+ fflush(stdout);
+
+ channel = switch_core_session_get_channel(session_hungup);
+ assert(channel != NULL);
+
+ state = switch_channel_get_state(channel);
+
+ if ((coresession = (CoreSession *) switch_channel_get_private(channel, "CoreSession"))) {
+ if (coresession->hook_state != state) {
+ coresession->hook_state = state;
+ coresession->check_hangup_hook();
+ }
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+switch_status_t dtmf_callback(switch_core_session_t *session_cb,
+ void *input,
+ switch_input_type_t itype,
+ void *buf,
+ unsigned int buflen) {
+
+ switch_channel_t *channel;
+ CoreSession *coresession = NULL;
+ switch_status_t result;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "dtmf_callback called\n");
+ fflush(stdout);
+
+ channel = switch_core_session_get_channel(session_cb);
+ assert(channel != NULL);
+
+ coresession = (CoreSession *) switch_channel_get_private(channel, "CoreSession");
+ if (!coresession) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid CoreSession\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ result = coresession->run_dtmf_callback(input, itype);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "process_callback_result returned\n");
+ if (result) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "process_callback_result returned: %d\n", result);
+ }
+ return result;
+
+}
+
+
switch_status_t process_callback_result(char *ret,
struct input_callback_state *cb_state,
@@ -432,16 +564,40 @@
{
switch_file_handle_t *fh = NULL;
+
+ if (!cb_state) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Process callback result aborted because cb_state is null\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!cb_state->extra) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Process callback result aborted because cb_state->extra is null\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
fh = (switch_file_handle_t *) cb_state->extra;
if (!fh) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Process callback result aborted because fh is null\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!fh->file_interface) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Process callback result aborted because fh->file_interface is null\n");
return SWITCH_STATUS_FALSE;
}
if (!ret) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Process callback result aborted because ret is null\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!session) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Process callback result aborted because session is null\n");
return SWITCH_STATUS_FALSE;
}
+
if (!strncasecmp(ret, "speed", 4)) {
char *p;
@@ -482,7 +638,7 @@
unsigned int pos = 0;
char *p;
codec = switch_core_session_get_read_codec(session);
-
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "got codec\n");
if ((p = strchr(ret, ':'))) {
p++;
if (*p == '+' || *p == '-') {
@@ -492,14 +648,20 @@
}
if (step > 0) {
samps = step * (codec->implementation->samples_per_second / 1000);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "going to seek\n");
switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "done seek\n");
} else {
samps = step * (codec->implementation->samples_per_second / 1000);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "going to seek\n");
switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "done seek\n");
}
} else {
samps = atoi(p) * (codec->implementation->samples_per_second / 1000);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "going to seek\n");
switch_core_file_seek(fh, &pos, samps, SEEK_SET);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "done seek\n");
}
}
@@ -507,9 +669,11 @@
}
if (!strcmp(ret, "true") || !strcmp(ret, "undefined")) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "return success\n");
return SWITCH_STATUS_SUCCESS;
}
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no match, return false\n");
return SWITCH_STATUS_FALSE;
1
0
[Freeswitch-branches] [commit] r5432 - freeswitch/branches/greenlizard/src/mod/languages/mod_python
by Freeswitch SVN 21 Jun '07
by Freeswitch SVN 21 Jun '07
21 Jun '07
Author: greenlizard
Date: Thu Jun 21 14:16:35 2007
New Revision: 5432
Modified:
freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
Log:
bugfix: return values from playAndGetDigits stopped working
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile Thu Jun 21 14:16:35 2007
@@ -3,8 +3,8 @@
# and define these variables to impact your build
-LOCAL_CFLAGS=-I$(PREFIX)/include/python2.5/
-LOCAL_LDFLAGS=-lpython2.5 -L$(PREFIX)/lib/python2.5/config/ -lutil -lstdc++
+LOCAL_CFLAGS=-I/usr/include/python2.4/
+LOCAL_LDFLAGS=-lpython2.4 -L/usr/lib/python2.4/config/ -lutil -lstdc++
LOCAL_OBJS=freeswitch_python.o mod_python_wrap.o
include ../../../../build/modmake.rules
@@ -26,5 +26,5 @@
$(CC) -w $(CFLAGS) -c $< -o $@
local_install:
- cp -f freeswitch.py $(PREFIX)/lib/python2.5/site-packages/
+ cp -f freeswitch.py /usr/lib/python2.4/site-packages/
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i Thu Jun 21 14:16:35 2007
@@ -1,6 +1,14 @@
%module freeswitch
%include "cstring.i"
+/**
+ * tell swig to treat these variables as mutable so they
+ * can be used to return values.
+ * See http://www.swig.org/Doc1.3/Library.html
+ */
+%cstring_bounded_mutable(char *dtmf_buf, 128);
+%cstring_bounded_mutable(char *terminator, 8);
+
/** insert the following includes into generated code so it compiles */
%{
#include "switch_cpp.h"
@@ -14,8 +22,5 @@
%include switch_cpp.h
%include freeswitch_python.h
-/** hmm .. dunno why this is here */
-%cstring_bounded_mutable(char *dtmf_buf, 128);
-%cstring_bounded_mutable(char *terminator, 8);
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Thu Jun 21 14:16:35 2007
@@ -4110,7 +4110,9 @@
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
- char *buf2 = 0 ;
+ char temp2[128+1] ;
+ char *t2 = 0 ;
+ size_t n2 = 0 ;
int alloc2 = 0 ;
int val3 ;
int ecode3 = 0 ;
@@ -4118,7 +4120,9 @@
char *buf4 = 0 ;
int alloc4 = 0 ;
int res5 ;
- char *buf5 = 0 ;
+ char temp5[8+1] ;
+ char *t5 = 0 ;
+ size_t n5 = 0 ;
int alloc5 = 0 ;
int val6 ;
int ecode6 = 0 ;
@@ -4135,11 +4139,15 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getDigits" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &t2, &n2, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getDigits" "', argument " "2"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getDigits" "', argument " "2"" of type '" "char *dtmf_buf""'");
}
- arg2 = reinterpret_cast< char * >(buf2);
+ if ( n2 > (size_t) 128 ) n2 = (size_t) 128;
+ memcpy(temp2, t2, sizeof(char)*n2);
+ if (alloc2 == SWIG_NEWOBJ) delete[] t2;
+ temp2[n2 - 1] = 0;
+ arg2 = (char *) temp2;
ecode3 = SWIG_AsVal_int(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_getDigits" "', argument " "3"" of type '" "int""'");
@@ -4150,11 +4158,15 @@
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "char *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
- res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
+ res5 = SWIG_AsCharPtrAndSize(obj4, &t5, &n5, &alloc5);
if (!SWIG_IsOK(res5)) {
- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *terminator""'");
}
- arg5 = reinterpret_cast< char * >(buf5);
+ if ( n5 > (size_t) 8 ) n5 = (size_t) 8;
+ memcpy(temp5, t5, sizeof(char)*n5);
+ if (alloc5 == SWIG_NEWOBJ) delete[] t5;
+ temp5[n5 - 1] = 0;
+ arg5 = (char *) temp5;
ecode6 = SWIG_AsVal_int(obj5, &val6);
if (!SWIG_IsOK(ecode6)) {
SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CoreSession_getDigits" "', argument " "6"" of type '" "int""'");
@@ -4162,14 +4174,14 @@
arg6 = static_cast< int >(val6);
result = (int)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6);
resultobj = SWIG_From_int(static_cast< int >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ arg2[128] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg2));
+ arg5[8] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg5));
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return resultobj;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return NULL;
}
@@ -4265,7 +4277,9 @@
char *buf8 = 0 ;
int alloc8 = 0 ;
int res9 ;
- char *buf9 = 0 ;
+ char temp9[128+1] ;
+ char *t9 = 0 ;
+ size_t n9 = 0 ;
int alloc9 = 0 ;
int res10 ;
char *buf10 = 0 ;
@@ -4322,11 +4336,15 @@
SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CoreSession_playAndGetDigits" "', argument " "8"" of type '" "char *""'");
}
arg8 = reinterpret_cast< char * >(buf8);
- res9 = SWIG_AsCharPtrAndSize(obj8, &buf9, NULL, &alloc9);
+ res9 = SWIG_AsCharPtrAndSize(obj8, &t9, &n9, &alloc9);
if (!SWIG_IsOK(res9)) {
- SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *dtmf_buf""'");
}
- arg9 = reinterpret_cast< char * >(buf9);
+ if ( n9 > (size_t) 128 ) n9 = (size_t) 128;
+ memcpy(temp9, t9, sizeof(char)*n9);
+ if (alloc9 == SWIG_NEWOBJ) delete[] t9;
+ temp9[n9 - 1] = 0;
+ arg9 = (char *) temp9;
res10 = SWIG_AsCharPtrAndSize(obj9, &buf10, NULL, &alloc10);
if (!SWIG_IsOK(res10)) {
SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "CoreSession_playAndGetDigits" "', argument " "10"" of type '" "char *""'");
@@ -4334,17 +4352,17 @@
arg10 = reinterpret_cast< char * >(buf10);
result = (int)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
resultobj = SWIG_From_int(static_cast< int >(result));
+ arg9[128] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg9));
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
- if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
return resultobj;
fail:
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
- if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
return NULL;
}
1
0
[Freeswitch-branches] [commit] r5430 - in freeswitch/branches/greenlizard: src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_iax src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_woomera w32/Setup
by Freeswitch SVN 20 Jun '07
by Freeswitch SVN 20 Jun '07
20 Jun '07
Author: greenlizard
Date: Wed Jun 20 14:59:05 2007
New Revision: 5430
Modified:
freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj
Log:
merge trunk 5427 to 5429
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c Wed Jun 20 14:59:05 2007
@@ -1817,7 +1817,7 @@
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- channel_endpoint_interface->interface_name = modname;
+ channel_endpoint_interface->interface_name = "digngaling";
channel_endpoint_interface->io_routines = &channel_io_routines;
channel_endpoint_interface->state_handler = &channel_event_handlers;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c Wed Jun 20 14:59:05 2007
@@ -868,7 +868,7 @@
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- channel_endpoint_interface->interface_name = modname;
+ channel_endpoint_interface->interface_name = "iax";
channel_endpoint_interface->io_routines = &channel_io_routines;
channel_endpoint_interface->state_handler = &channel_state_handlers;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c Wed Jun 20 14:59:05 2007
@@ -852,7 +852,7 @@
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- channel_endpoint_interface->interface_name = modname;
+ channel_endpoint_interface->interface_name = "portaudio";
channel_endpoint_interface->io_routines = &channel_io_routines;
channel_endpoint_interface->state_handler = &channel_event_handlers;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c Wed Jun 20 14:59:05 2007
@@ -1353,7 +1353,7 @@
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
woomera_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- woomera_endpoint_interface->interface_name = modname;
+ woomera_endpoint_interface->interface_name = "woomera";
woomera_endpoint_interface->io_routines = &woomera_io_routines;
woomera_endpoint_interface->state_handler = &woomera_event_handlers;
Modified: freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj
==============================================================================
--- freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj (original)
+++ freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj Wed Jun 20 14:59:05 2007
@@ -15,12 +15,6 @@
{
"Entry"
{
- "MsmKey" = "8:_0A2A2813738E4157B2CC6A4EF2A303BB"
- "OwnerKey" = "8:_UNDEFINED"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
"MsmKey" = "8:_0F091427EEA0245FBA87474748D35ABD"
"OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
"MsmSig" = "8:_UNDEFINED"
@@ -45,199 +39,199 @@
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_FB1B9FBDC3294F1C96DAC4246C013C22"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_F84240319757424DB1C58AD0AD420127"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_E763C699DF0948B6984DDEB96A2DFD06"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_D7EC5795A9C645AC8E129C2EE6D461ED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_D6F0F5845FAD4707975CE012A33CD607"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_D0BB09AFB8D94B76918F0EE85BCCAD0A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_C81AC700C1BC4A55B98DF12C0CBAFD6F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_C105055EE271471A999CE7022E617EB7"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_B20769E090034897B32E3EA4EC1BA8A0"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_B0A2E9B4C45D4098AFD734D0C4E3EAFB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_AD2EB44FE6D548F2A8DA4F9F2CE817AC"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_A0D5F714A0F94250A1C39603B699AB82"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_87768631363249B2B301143C193612F7"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_6E5C001E7A314DCEA0A4BF52BF74BCAD"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_684D96FA2BDD46909367E651099D8C4E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_5A636BB90F7F4B86ACB8839EA2C899AA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_3E37631016BC45B2B672FE23257D542B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"OwnerKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
"MsmSig" = "8:_UNDEFINED"
}
@@ -273,14 +267,14 @@
}
"Entry"
{
- "MsmKey" = "8:_329D8DAE6C01FCF026E9DFB48B932203"
- "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
+ "MsmKey" = "8:_326CFBAF7BA54A989CB1BF8A9CF959D8"
+ "OwnerKey" = "8:_245904E3D36D4A86B2FB963505EB83D2"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_35FACDFFDDB943568B7588D14D0513A7"
- "OwnerKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmKey" = "8:_329D8DAE6C01FCF026E9DFB48B932203"
+ "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@@ -303,18 +297,6 @@
}
"Entry"
{
- "MsmKey" = "8:_525E8ED430D44113995AB8FBF1945569"
- "OwnerKey" = "8:_548996CD77304E3598846F122E79431A"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
- "MsmKey" = "8:_548996CD77304E3598846F122E79431A"
- "OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
"MsmKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -417,12 +399,6 @@
}
"Entry"
{
- "MsmKey" = "8:_A40E3F2045F44C60A8509FDFE47E6C45"
- "OwnerKey" = "8:_UNDEFINED"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
"MsmKey" = "8:_A944ADCEDF884574A23F7BA5420A6BA1"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -742,26 +718,6 @@
}
"File"
{
- "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0A2A2813738E4157B2CC6A4EF2A303BB"
- {
- "SourcePath" = "8:..\\..\\AUTHORS"
- "TargetName" = "8:AUTHORS"
- "Tag" = "8:"
- "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
- "Condition" = "8:"
- "Transitive" = "11:FALSE"
- "Vital" = "11:TRUE"
- "ReadOnly" = "11:FALSE"
- "Hidden" = "11:FALSE"
- "System" = "11:FALSE"
- "Permanent" = "11:FALSE"
- "SharedLegacy" = "11:FALSE"
- "PackageAs" = "3:1"
- "Register" = "3:1"
- "Exclude" = "11:FALSE"
- "IsDependency" = "11:FALSE"
- "IsolateTo" = "8:"
- }
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0F091427EEA0245FBA87474748D35ABD"
{
"SourcePath" = "8:js32.dll"
@@ -962,26 +918,6 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
- "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A40E3F2045F44C60A8509FDFE47E6C45"
- {
- "SourcePath" = "8:..\\..\\COPYING"
- "TargetName" = "8:COPYING"
- "Tag" = "8:"
- "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
- "Condition" = "8:"
- "Transitive" = "11:FALSE"
- "Vital" = "11:TRUE"
- "ReadOnly" = "11:FALSE"
- "Hidden" = "11:FALSE"
- "System" = "11:FALSE"
- "Permanent" = "11:FALSE"
- "SharedLegacy" = "11:FALSE"
- "PackageAs" = "3:1"
- "Register" = "3:1"
- "Exclude" = "11:FALSE"
- "IsDependency" = "11:FALSE"
- "IsolateTo" = "8:"
- }
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_ADA22D44BCDEBA509E09A5D4C155AA41"
{
"SourcePath" = "8:ODBC32.dll"
@@ -1173,7 +1109,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Freeswitch"
"ProductCode" = "8:{317A9CC0-40DC-4803-A13E-5937F05F9D2E}"
- "PackageCode" = "8:{35A30F10-964D-4C59-A882-360D2CAC47EC}"
+ "PackageCode" = "8:{F98461BC-9B50-4BEA-A554-74A6F557BECF}"
"UpgradeCode" = "8:{8080E3A5-7ADD-4173-8913-BDA439D1C8DD}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
@@ -1447,53 +1383,6 @@
}
}
}
- "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_E8A0FD168FA4401FBF582E01DA819A71"
- {
- "Sequence" = "3:210"
- "DisplayName" = "8:License Agreement"
- "UseDynamicProperties" = "11:TRUE"
- "IsDependency" = "11:FALSE"
- "SourcePath" = "8:<VsdDialogDir>\\VsdAdminLicenseDlg.wid"
- "Properties"
- {
- "BannerBitmap"
- {
- "Name" = "8:BannerBitmap"
- "DisplayName" = "8:#1001"
- "Description" = "8:#1101"
- "Type" = "3:8"
- "ContextData" = "8:Bitmap"
- "Attributes" = "3:4"
- "Setting" = "3:1"
- "UsePlugInResources" = "11:TRUE"
- }
- "EulaText"
- {
- "Name" = "8:EulaText"
- "DisplayName" = "8:#1008"
- "Description" = "8:#1108"
- "Type" = "3:6"
- "ContextData" = "8:"
- "Attributes" = "3:0"
- "Setting" = "3:2"
- "Value" = "8:_A40E3F2045F44C60A8509FDFE47E6C45"
- "UsePlugInResources" = "11:TRUE"
- }
- "Sunken"
- {
- "Name" = "8:Sunken"
- "DisplayName" = "8:#1007"
- "Description" = "8:#1107"
- "Type" = "3:5"
- "ContextData" = "8:4;True=4;False=0"
- "Attributes" = "3:0"
- "Setting" = "3:0"
- "Value" = "3:4"
- "DefaultValue" = "3:4"
- "UsePlugInResources" = "11:TRUE"
- }
- }
- }
}
}
"{DF760B10-853B-4699-99F2-AFF7185B4A62}:_9237AC900FC7421096FC1C1F479A57D9"
@@ -1595,53 +1484,6 @@
}
}
}
- "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1229F6668E004795AE90C753D37CA881"
- {
- "Sequence" = "3:300"
- "DisplayName" = "8:License Agreement"
- "UseDynamicProperties" = "11:TRUE"
- "IsDependency" = "11:FALSE"
- "SourcePath" = "8:<VsdDialogDir>\\VsdLicenseDlg.wid"
- "Properties"
- {
- "BannerBitmap"
- {
- "Name" = "8:BannerBitmap"
- "DisplayName" = "8:#1001"
- "Description" = "8:#1101"
- "Type" = "3:8"
- "ContextData" = "8:Bitmap"
- "Attributes" = "3:4"
- "Setting" = "3:1"
- "UsePlugInResources" = "11:TRUE"
- }
- "EulaText"
- {
- "Name" = "8:EulaText"
- "DisplayName" = "8:#1008"
- "Description" = "8:#1108"
- "Type" = "3:6"
- "ContextData" = "8:"
- "Attributes" = "3:0"
- "Setting" = "3:2"
- "Value" = "8:_A40E3F2045F44C60A8509FDFE47E6C45"
- "UsePlugInResources" = "11:TRUE"
- }
- "Sunken"
- {
- "Name" = "8:Sunken"
- "DisplayName" = "8:#1007"
- "Description" = "8:#1107"
- "Type" = "3:5"
- "ContextData" = "8:4;True=4;False=0"
- "Attributes" = "3:0"
- "Setting" = "3:0"
- "Value" = "3:4"
- "DefaultValue" = "3:4"
- "UsePlugInResources" = "11:TRUE"
- }
- }
- }
"{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_E4748A502E1E4F89B72F6B70E40E6954"
{
"Sequence" = "3:400"
@@ -1804,7 +1646,7 @@
}
"MergeModule"
{
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_27200676A75147D0BB7FA5500BB31A6D"
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_245904E3D36D4A86B2FB963505EB83D2"
{
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:TRUE"
@@ -1818,7 +1660,7 @@
"Feature" = "8:"
"IsolateTo" = "8:"
}
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_35FACDFFDDB943568B7588D14D0513A7"
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_326CFBAF7BA54A989CB1BF8A9CF959D8"
{
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:TRUE"
@@ -1832,34 +1674,6 @@
"Feature" = "8:"
"IsolateTo" = "8:"
}
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_525E8ED430D44113995AB8FBF1945569"
- {
- "UseDynamicProperties" = "11:TRUE"
- "IsDependency" = "11:TRUE"
- "SourcePath" = "8:policy_8_0_microsoft_vc80_crt_x86.msm"
- "Properties"
- {
- }
- "LanguageId" = "3:0"
- "Exclude" = "11:FALSE"
- "Folder" = "8:"
- "Feature" = "8:"
- "IsolateTo" = "8:"
- }
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_548996CD77304E3598846F122E79431A"
- {
- "UseDynamicProperties" = "11:TRUE"
- "IsDependency" = "11:TRUE"
- "SourcePath" = "8:Microsoft_VC80_CRT_x86.msm"
- "Properties"
- {
- }
- "LanguageId" = "3:0"
- "Exclude" = "11:FALSE"
- "Folder" = "8:"
- "Feature" = "8:"
- "IsolateTo" = "8:"
- }
}
"ProjectOutput"
{
1
0
[Freeswitch-branches] [commit] r5427 - freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia
by Freeswitch SVN 20 Jun '07
by Freeswitch SVN 20 Jun '07
20 Jun '07
Author: greenlizard
Date: Wed Jun 20 14:48:44 2007
New Revision: 5427
Modified:
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
merge trunk 5425 to 5426
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Jun 20 14:48:44 2007
@@ -1529,7 +1529,7 @@
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
sofia_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- sofia_endpoint_interface->interface_name = modname;
+ sofia_endpoint_interface->interface_name = "sofia";
sofia_endpoint_interface->io_routines = &sofia_io_routines;
sofia_endpoint_interface->state_handler = &sofia_event_handlers;
1
0
Author: greenlizard
Date: Wed Jun 20 13:06:05 2007
New Revision: 5425
Modified:
freeswitch/branches/greenlizard/Freeswitch.sln
freeswitch/branches/greenlizard/libs/sofia-sip/Makefile.am
freeswitch/branches/greenlizard/libs/sofia-sip/RELEASE
freeswitch/branches/greenlizard/libs/sofia-sip/configure.ac
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/docs/hide_emails.sh
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_basic_call.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_call_reject.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_cancel_bye.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_init.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_ops.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_refer.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_register.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_simple.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_sip_events.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c
freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c
freeswitch/branches/greenlizard/libs/sofia-sip/m4/sac-su2.m4
freeswitch/branches/greenlizard/src/include/switch.h
freeswitch/branches/greenlizard/src/include/switch_event.h
freeswitch/branches/greenlizard/src/include/switch_loadable_module.h
freeswitch/branches/greenlizard/src/include/switch_log.h
freeswitch/branches/greenlizard/src/include/switch_types.h
freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c
freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c
freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c
freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c
freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_reg.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c
freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c
freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c
freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c
freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c
freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
freeswitch/branches/greenlizard/src/switch_channel.c
freeswitch/branches/greenlizard/src/switch_core_io.c
freeswitch/branches/greenlizard/src/switch_core_session.c
freeswitch/branches/greenlizard/src/switch_event.c
freeswitch/branches/greenlizard/src/switch_log.c
freeswitch/branches/greenlizard/src/switch_rtp.c
freeswitch/branches/greenlizard/src/switch_stun.c
Log:
merge trunk 5395 to 5424
Modified: freeswitch/branches/greenlizard/Freeswitch.sln
==============================================================================
--- freeswitch/branches/greenlizard/Freeswitch.sln (original)
+++ freeswitch/branches/greenlizard/Freeswitch.sln Wed Jun 20 13:06:05 2007
@@ -3,20 +3,20 @@
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.vcproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.vcproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
ProjectSection(ProjectDependencies) = postProject
- {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
- {101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
- {EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
- {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
- {8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}
+ {8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
+ {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+ {F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
+ {101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+ {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.vcproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
@@ -26,28 +26,28 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsm", "src\mod\codecs\mod_gsm\mod_gsm.vcproj", "{4926323F-4EA8-4B7D-A3D3-65488725988F}"
ProjectSection(ProjectDependencies) = postProject
- {8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xmpp_event", "src\mod\event_handlers\mod_xmpp_event\mod_xmpp_event.vcproj", "{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}"
ProjectSection(ProjectDependencies) = postProject
- {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.vcproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
ProjectSection(ProjectDependencies) = postProject
- {3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_test", "src\mod\event_handlers\mod_event_test\mod_event_test.vcproj", "{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g711", "src\mod\codecs\mod_g711\mod_g711.vcproj", "{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}"
@@ -57,16 +57,16 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iax", "src\mod\endpoints\mod_iax\mod_iax.vcproj", "{3A5B9131-F20C-4A85-9447-6C1610941CEE}"
ProjectSection(ProjectDependencies) = postProject
- {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.vcproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_l16", "src\mod\codecs\mod_l16\mod_l16.vcproj", "{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}"
@@ -76,20 +76,20 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_softtimer", "src\mod\timers\mod_softtimer\mod_softtimer.vcproj", "{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_speex", "src\mod\codecs\mod_speex\mod_speex.vcproj", "{5580D60E-0F77-4716-9CD4-B8E5986FA375}"
ProjectSection(ProjectDependencies) = postProject
- {1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_woomera", "src\mod\endpoints\mod_woomera\mod_woomera.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
@@ -112,8 +112,8 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.vcproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
@@ -127,22 +127,22 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.vcproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_zeroconf", "src\mod\event_handlers\mod_zeroconf\mod_zeroconf.vcproj", "{C7705DC4-2088-493E-AF8D-65BC6D65C125}"
ProjectSection(ProjectDependencies) = postProject
- {0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.vcproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.vcproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
@@ -151,10 +151,10 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "src\mod\languages\mod_spidermonkey\mod_spidermonkey.vcproj", "{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}"
ProjectSection(ProjectDependencies) = postProject
- {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
- {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+ {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
@@ -176,22 +176,22 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
ProjectSection(ProjectDependencies) = postProject
- {989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.vcproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
ProjectSection(ProjectDependencies) = postProject
- {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{1906D736-08BD-4EE1-924F-B536249B9A54} = {1906D736-08BD-4EE1-924F-B536249B9A54}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.vcproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
@@ -205,42 +205,42 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.vcproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
ProjectSection(ProjectDependencies) = postProject
- {155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
- {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
- {356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
+ {A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+ {155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.vcproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.vcproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.vcproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.vcproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
ProjectSection(ProjectDependencies) = postProject
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr", "src\mod\event_handlers\mod_cdr\mod_cdr.vcproj", "{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
@@ -253,8 +253,8 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.vcproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
ProjectSection(ProjectDependencies) = postProject
- {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+ {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "libs\srtp\libsrtp.vcproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}"
@@ -279,8 +279,8 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
ProjectSection(ProjectDependencies) = postProject
- {101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
@@ -298,8 +298,8 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder static library", "libs\win32\howl\libmDNSResponder.vcproj", "{49C34584-B6DA-448F-83CF-27584DC9FC90}"
ProjectSection(ProjectDependencies) = postProject
- {0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
+ {0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.vcproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}"
@@ -319,34 +319,34 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.vcproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
ProjectSection(ProjectDependencies) = postProject
- {70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg726", "libs\codec\g726\libg726.vcproj", "{5A6A281A-AA50-470A-8305-202BDA1CD1BF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g726", "src\mod\codecs\mod_g726\mod_g726.vcproj", "{486369EB-F150-4B56-BCC8-77B9E18FF5F5}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {5A6A281A-AA50-470A-8305-202BDA1CD1BF}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg7xx", "libs\codec\g7xx\libg7xx.vcproj", "{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g722", "src\mod\codecs\mod_g722\mod_g722.vcproj", "{D42518CC-7475-454D-B392-0E132C07D761}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
ProjectSection(ProjectDependencies) = postProject
- {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+ {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.vcproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
@@ -358,84 +358,84 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.vcproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.vcproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSwitch.NET", "src\dotnet\FreeSwitch.NET.csproj", "{251CAABC-16C3-4593-A491-603B908094E0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_core_db", "src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.vcproj", "{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}"
ProjectSection(ProjectDependencies) = postProject
- {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_teletone", "src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.vcproj", "{8F992C49-6C51-412F-B2A3-34EAB708EB65}"
ProjectSection(ProjectDependencies) = postProject
- {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libudns", "libs\win32\udns\libudns.vcproj", "{4043FC6A-9A30-4577-8AD5-9B233C9575D8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applications\mod_enum\mod_enum.vcproj", "{71A967D5-0E99-4CEF-A587-98836EE6F2EF}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_etpan", "src\mod\languages\mod_spidermonkey_etpan\mod_spidermonkey_etpan.vcproj", "{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}"
ProjectSection(ProjectDependencies) = postProject
- {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+ {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_odbc", "src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.vcproj", "{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}"
ProjectSection(ProjectDependencies) = postProject
- {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libs\win32\etpan\libetpan.vcproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.vcproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
ProjectSection(ProjectDependencies) = postProject
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "say", "say", "{6CD61A1D-797C-470A-BE08-8C31B68BB336}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\mod_say_en\mod_say_en.vcproj", "{988CACF7-3FCB-4992-BE69-77872AE67DC8}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\portaudio\build\msvc\portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.vcproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amr", "src\mod\codecs\mod_amr\mod_amr.vcproj", "{8DEB383C-4091-4F42-A56F-C9E46D552D79}"
@@ -573,6 +573,9 @@
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h26x", "src\mod\codecs\mod_h26x\mod_h26x.vcproj", "{2C3C2423-234B-4772-8899-D3B137E5CA35}"
+ ProjectSection(ProjectDependencies) = postProject
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_esf", "src\mod\applications\mod_esf\mod_esf.vcproj", "{3850D93A-5F24-4922-BC1C-74D08C37C256}"
ProjectSection(ProjectDependencies) = postProject
@@ -1107,18 +1110,18 @@
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
- {30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5} = {2D57D093-3F8D-4729-AD9A-68E945C200A5}
+ {30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+ {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+ {C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+ {B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+ {71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+ {3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
{1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/Makefile.am
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/Makefile.am (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/Makefile.am Wed Jun 20 13:06:05 2007
@@ -24,7 +24,7 @@
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST += m4/sac-general.m4 m4/sac-su.m4 m4/sac-coverage.m4 \
+EXTRA_DIST += m4/sac-general.m4 m4/sac-coverage.m4 \
m4/sac-su2.m4 m4/sac-tport.m4 m4/sac-openssl.m4
EXTRA_DIST += docs/build_system.txt \
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/RELEASE (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/RELEASE Wed Jun 20 13:06:05 2007
@@ -24,6 +24,9 @@
New features in API are marked with Doxytag macro @VERSION_1_12_7.
libsofia-sip-ua:
+- Removed extra system headers from <sofia-sip/stun_common.h>
+- Added global variable su_socket_blocking. If it is set to true,
+ sockets are created as blocking.
- Added accessor function nta_outgoing_branch()
- **template**: Added foobar() function (sofia-sip/foobar.h).
- This release is ABI/API compatible with applications linked against
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/configure.ac (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/configure.ac Wed Jun 20 13:06:05 2007
@@ -69,7 +69,6 @@
SAC_SOFIA_SU
SAC_OPENSSL
SAC_TPORT
-SAC_SU
### internal modules
### ----------------
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/docs/hide_emails.sh
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/docs/hide_emails.sh (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/docs/hide_emails.sh Wed Jun 20 13:06:05 2007
@@ -29,9 +29,13 @@
#
# --------------------------------------------------------------------
-echo "Hiding email addresses in ${1:-.}"
+echo "Postprocessing HTML in ${1:-.}: hiding email addresses, fixing links"
find ${1:-.} -name '*.html' -print0 |
xargs -0 \
-sed -r -i 's/([:>;][a-z][-a-z.]*)((a)[a-z][a-z]*)\.[a-z][a-z]*(["<\&])/\1\2-email.address.hidden\3/gi'
-
+sed -r -i '
+# Hide e-mail addresses
+s/([:>;][a-z][-a-z.]*)((a)[a-z][a-z]*)\.[a-z][a-z]*(["<\&])/\1\2-email.address.hidden\3/gi;
+# Fix cross-module links
+s!doxygen="([a-z]*).doxytags:../\1/" href="../\1/\1_index.html"!doxygen="\1.doxytags:../\1/" href="../\1/index.html"!g;
+'
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag.h.in Wed Jun 20 13:06:05 2007
@@ -102,7 +102,7 @@
#define HTTPTAG_HTTP_REF(x) httptag_http_ref, httptag_http_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_http_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline
tag_value_t httptag_http_v(http_t const *v) { return (tag_value_t)v; }
su_inline
@@ -150,7 +150,7 @@
#define HTTPTAG_HEADER_REF(x) httptag_header_ref, httptag_header_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_header_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t
httptag_header_v(http_header_t const *v)
{ return (tag_value_t)v; }
@@ -220,7 +220,7 @@
#define HTTPTAG_#XXXXXX#_STR_REF(x) HTTPTAG_STR_REF(#xxxxxx#, x)
SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#_str_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t
httptag_#xxxxxx#_v(http_#xxxxxx#_t const *v)
{ return (tag_value_t)v; }
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h Wed Jun 20 13:06:05 2007
@@ -253,7 +253,7 @@
#define AUTHTAG_MODULE_REF(x) authtag_module_ref, authtag_module_vr((&x))
SOFIAPUBVAR tag_typedef_t authtag_module_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t authtag_module_v(auth_mod_t *v) {
return (tag_value_t)v;
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c Wed Jun 20 13:06:05 2007
@@ -1840,6 +1840,8 @@
return NULL;
}
+ b = b2;
+
continue;
}
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c Wed Jun 20 13:06:05 2007
@@ -797,7 +797,21 @@
{
size_t size = SIZE_MAX;
- char *s = msg_as_string(msg_home(msg), msg, NULL, 0, &size);
+ char *s;
+ char body[66 * 15 + 1];
+ int i;
+ msg_payload_t *pl;
+
+ /* Bug #1726034 */
+ for (i = 0; i < 15; i++)
+ strcpy(body + i * 66,
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n");
+ pl = msg_payload_make(msg_home(msg), body);
+
+ TEST(msg_header_insert(msg, (msg_pub_t *)tst, (void *)pl), 0);
+
+ s = msg_as_string(msg_home(msg), msg, NULL, 0, &size);
TEST_S(s,
"GET a-wife HTTP/1.1" CRLF
"Foo: bar" CRLF
@@ -806,7 +820,23 @@
"Content-Language: se-FI, fi-FI, sv-FI\r\n"
"Accept-Language: se, fi, sv\r\n"
CRLF
-"test" CRLF);
+"test" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" CRLF
+);
}
msg_destroy(msg);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Wed Jun 20 13:06:05 2007
@@ -2198,7 +2198,8 @@
TPTAG_SDWN_AFTER(stream),
TAG_END());
}
- } else {
+ }
+ else {
msg_destroy(msg);
if (stream) /* Send FIN */
tport_shutdown(tport, 1);
@@ -6172,13 +6173,6 @@
HTABLE_BODIES_WITH(outgoing_htable, oht, nta_outgoing_t, HTABLE_HASH_ORQ,
size_t, hash_value_t);
-static nta_outgoing_t *outgoing_create(nta_agent_t *agent,
- nta_response_f *callback,
- nta_outgoing_magic_t *magic,
- url_string_t const *route_url,
- tp_name_t const *tpn,
- msg_t *msg,
- tag_type_t tag, tag_value_t value, ...);
static int outgoing_features(nta_agent_t *agent, nta_outgoing_t *orq,
msg_t *msg, sip_t *sip,
tagi_t *tags);
@@ -6815,7 +6809,11 @@
/* select the tport to use for the outgoing message */
if (override_tport) {
/* note: no ref taken to the tport as its only used once here */
- tpn = tport_name(override_tport);
+ if (tport_is_secondary(override_tport)) {
+ tpn = tport_name(override_tport);
+ orq->orq_user_tport = 1;
+ }
+
}
if (route_url) {
@@ -7095,8 +7093,10 @@
if (cc)
nta_compartment_decref(&cc);
+ if (orq->orq_user_tport)
+ /* No retries */;
/* RFC3261, 18.1.1 */
- if (err == EMSGSIZE && !orq->orq_try_tcp_instead) {
+ else if (err == EMSGSIZE && !orq->orq_try_tcp_instead) {
if (strcasecmp(tpn->tpn_proto, "udp") == 0 ||
strcasecmp(tpn->tpn_proto, "*") == 0) {
outgoing_try_tcp_instead(orq);
@@ -10217,6 +10217,10 @@
}
+/** Return a new reference to the transaction transport.
+ *
+ * @note The referenced transport must be unreferenced with tport_unref()
+ */
tport_t *
nta_incoming_transport(nta_agent_t *agent,
nta_incoming_t *irq,
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h Wed Jun 20 13:06:05 2007
@@ -504,6 +504,7 @@
unsigned orq_completed : 1;
unsigned orq_delayed : 1;
unsigned orq_stripped_uri : 1;
+ unsigned orq_user_tport : 1; /**< Application provided tport - don't retry */
unsigned orq_try_tcp_instead : 1;
unsigned orq_try_udp_instead : 1;
unsigned orq_reliable : 1; /**< Transport is reliable */
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h Wed Jun 20 13:06:05 2007
@@ -101,7 +101,7 @@
NTH_DLL extern tag_typedef_t nthtag_error_msg_ref;
#define NTHTAG_ERROR_MSG_REF(x) nthtag_error_msg_ref, tag_bool_vr(&(x))
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
struct nth_client_s;
su_inline tag_value_t nthtag_template_v(struct nth_client_s const *v)
{ return (tag_value_t)v; }
@@ -119,7 +119,7 @@
NTH_DLL extern tag_typedef_t nthtag_template_ref;
#define NTHTAG_TEMPLATE_REF(x) nthtag_template_ref, nthtag_template_vr(&(x))
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t nthtag_message_v(struct msg_s *v)
{ return (tag_value_t)v; }
su_inline tag_value_t nthtag_message_vr(struct msg_s **vp)
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c Wed Jun 20 13:06:05 2007
@@ -570,6 +570,7 @@
if (c == INVALID_SOCKET) {
c = su_socket(t->t_addr->su_family, SOCK_STREAM, 0); TEST_1(c != SOCK_STREAM);
+ TEST_1(su_setblocking(c, 1) != -1);
TEST_1(connect(c, &t->t_addr->su_sa, t->t_addrlen) != -1);
while (su_root_step(t->t_root, 1) == 0);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua.c Wed Jun 20 13:06:05 2007
@@ -1049,7 +1049,7 @@
/** Get request message from saved nua event. @NEW_1_12_4. */
msg_t *nua_saved_event_request(nua_saved_event_t const *saved)
{
- return saved ? su_msg_data(saved)->e_msg : NULL;
+ return saved && saved[0] ? su_msg_data(saved)->e_msg : NULL;
}
/** Save nua event and its arguments */
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c Wed Jun 20 13:06:05 2007
@@ -48,7 +48,10 @@
/* ======================================================================== */
/* MESSAGE */
-/** Send an instant message.
+/**@fn void nua_message( \
+ * nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
+ *
+ * Send an instant message.
*
* Send an instant message using SIP MESSAGE method.
*
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c Wed Jun 20 13:06:05 2007
@@ -37,6 +37,8 @@
/** @internal SU network changed detector argument pointer type */
#define SU_NETWORK_CHANGED_MAGIC_T struct nua_s
+#define TP_CLIENT_T struct register_usage
+
#include <sofia-sip/string0.h>
#include <sofia-sip/su_strlst.h>
#include <sofia-sip/su_uniqueid.h>
@@ -46,7 +48,7 @@
#include <sofia-sip/sip_util.h>
#include <sofia-sip/sip_status.h>
-#define NTA_UPDATE_MAGIC_T struct nua_s
+#define NTA_UPDATE_MAGIC_T struct nua_handle_s
#include "nua_stack.h"
@@ -126,6 +128,7 @@
/** Status of registration */
unsigned nr_ready:1;
+
/** Kind of registration.
*
* If nr_default is true, this is not a real registration but placeholder
@@ -138,7 +141,11 @@
unsigned nr_default:1, nr_secure:1, nr_public:1, nr_ip4:1, nr_ip6:1;
/** Stack-generated contact */
- unsigned nr_by_stack:1, :0;
+ unsigned nr_by_stack:1;
+
+ unsigned:0;
+
+ int nr_error_report_id; /**< ID used to ask for error reports from tport */
sip_route_t *nr_route; /**< Outgoing Service-Route */
sip_path_t *nr_path; /**< Incoming Path */
@@ -205,6 +212,12 @@
nr->nr_compartment = NULL;
#endif
+ if (nr->nr_error_report_id)
+ tport_release(nr->nr_tport, nr->nr_error_report_id, NULL, NULL, nr, 0);
+
+ if (nr->nr_tport)
+ tport_unref(nr->nr_tport), nr->nr_tport = NULL;
+
ds->ds_has_register = 0; /* There can be only one */
}
@@ -222,6 +235,12 @@
/* ======================================================================== */
/* REGISTER */
+static void nua_register_connection_closed(tp_stack_t *sip_stack,
+ nua_registration_t *nr,
+ tport_t *tport,
+ msg_t *msg,
+ int error);
+
/* Interface towards outbound_t */
sip_contact_t *nua_handle_contact_by_via(nua_handle_t *nh,
su_home_t *home,
@@ -764,6 +783,7 @@
TAG_IF(unreg, NTATAG_SIGCOMP_CLOSE(1)),
TAG_IF(!unreg, NTATAG_COMP("sigcomp")),
#endif
+ NTATAG_TPORT(nr->nr_tport),
TAG_NEXT(tags));
}
@@ -827,6 +847,8 @@
msg_t *_reqmsg = nta_outgoing_getrequest(cr->cr_orq);
sip_t *req = sip_object(_reqmsg);
+ tport_t *tport;
+
msg_destroy(_reqmsg);
assert(nr); assert(sip); assert(req);
@@ -927,10 +949,26 @@
outbound_start_keepalive(nr->nr_ob, cr->cr_orq);
}
- /* persistant connection for registration */
- if (!nr->nr_tport)
- /* note: nta_outgoing_transport() takes a ref */
- nr->nr_tport = nta_outgoing_transport (cr->cr_orq);
+ tport = nta_outgoing_transport (cr->cr_orq);
+
+ /* cache persistant connection for registration */
+ if (tport && tport != nr->nr_tport) {
+ if (nr->nr_error_report_id) {
+ if (tport_release(nr->nr_tport, nr->nr_error_report_id, NULL, NULL, nr, 0) < 0)
+ SU_DEBUG_1(("nua_register: tport_release() failed\n"));
+ nr->nr_error_report_id = 0;
+ }
+ tport_unref(nr->nr_tport);
+ nr->nr_tport = tport;
+
+ if (tport_is_secondary(tport)) {
+ tport_set_params(tport, TPTAG_SDWN_ERROR(1), TAG_END());
+ nr->nr_error_report_id =
+ tport_pend(tport, NULL, nua_register_connection_closed, nr);
+ }
+ }
+ else
+ tport_unref(tport); /* note: nta_outgoing_transport() makes a ref */
nua_registration_set_ready(nr, 1);
}
@@ -943,9 +981,15 @@
outbound_stop_keepalive(nr->nr_ob);
/* release the persistant transport for registration */
- if (nr->nr_tport)
- tport_decref(&nr->nr_tport), nr->nr_tport = NULL;
+ if (nr->nr_tport) {
+ if (nr->nr_error_report_id) {
+ if (tport_release(nr->nr_tport, nr->nr_error_report_id, NULL, NULL, nr, 0) < 0)
+ SU_DEBUG_1(("nua_register: tport_release() failed\n"));
+ nr->nr_error_report_id = 0;
+ }
+ tport_unref(nr->nr_tport), nr->nr_tport = NULL;
+ }
nua_registration_set_ready(nr, 0);
}
@@ -953,6 +997,24 @@
return nua_base_client_response(cr, status, phrase, sip, NULL);
}
+static
+void nua_register_connection_closed(tp_stack_t *sip_stack,
+ nua_registration_t *nr,
+ tport_t *tport,
+ msg_t *msg,
+ int error)
+{
+ if (tport_release(nr->nr_tport, nr->nr_error_report_id, NULL, NULL, nr, 0) < 0)
+ SU_DEBUG_1(("nua_register: tport_release() failed\n"));
+
+ nr->nr_error_report_id = 0;
+ tport_unref(nr->nr_tport), nr->nr_tport = NULL;
+
+ /* Schedule re-REGISTER immediately */
+ nua_dialog_usage_refresh_at(nua_dialog_usage_public(nr), sip_now());
+}
+
+
static void nua_register_usage_refresh(nua_handle_t *nh,
nua_dialog_state_t *ds,
nua_dialog_usage_t *du,
@@ -978,8 +1040,8 @@
* @retval <0 try again later
*/
static int nua_register_usage_shutdown(nua_handle_t *nh,
- nua_dialog_state_t *ds,
- nua_dialog_usage_t *du)
+ nua_dialog_state_t *ds,
+ nua_dialog_usage_t *du)
{
nua_client_request_t *cr = du->du_cr;
nua_registration_t *nr = nua_dialog_usage_private(du);
@@ -1209,7 +1271,7 @@
}
}
- nta_agent_bind_tport_update(nua->nua_nta, nua, nua_stack_tport_update);
+ nta_agent_bind_tport_update(nua->nua_nta, (nta_update_magic_t *)nua, nua_stack_tport_update);
return 0;
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Wed Jun 20 13:06:05 2007
@@ -1627,7 +1627,8 @@
* (maybe NULL if call handle was created for this call)
* @param sip incoming INVITE request
* @param tags SOATAG_ACTIVE_AUDIO(), SOATAG_ACTIVE_VIDEO()
- *
+ *
+ * @par
* @par Responding to INVITE with nua_respond()
*
* If @a status in #nua_i_invite event is below 200, the application should
@@ -1700,6 +1701,7 @@
* #nua_i_prack, #nua_i_update, nua_update(),
* nua_invite(), #nua_r_invite
*
+ * @par
* @par Third Party Call Control
*
* When so called 2rd party call control is used, the initial @b INVITE may
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c Wed Jun 20 13:06:05 2007
@@ -121,7 +121,9 @@
/* ====================================================================== */
/* SUBSCRIBE */
-/** Subscribe to a SIP event.
+/**@fn void nua_subscribe(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
+ *
+ * Subscribe to a SIP event.
*
* Subscribe a SIP event using the SIP SUBSCRIBE request. If the
* SUBSCRBE is successful a subscription state is established and
@@ -145,7 +147,9 @@
* @sa NUTAG_SUBSTATE(), @RFC3265
*/
-/** Unsubscribe an event.
+/**@fn void nua_unsubscribe(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
+ *
+ * Unsubscribe an event.
*
* Unsubscribe an active or pending subscription with SUBSCRIBE request
* containing Expires: header with value 0. The dialog associated with
@@ -689,7 +693,9 @@
/* ======================================================================== */
/* REFER */
-/** Transfer a call.
+/**@fn void nua_refer(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
+ *
+ * Transfer a call.
*
* Send a REFER request asking the recipient to transfer the call.
*
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h Wed Jun 20 13:06:05 2007
@@ -166,7 +166,7 @@
* nua_respond()
*
* @par Parameter type
- * msg_t *
+ * nua_saved_event_t *
*
* @par Values
* Pointer to a saved event.
@@ -2270,7 +2270,7 @@
SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates_ref;
/* Pass nua handle as tagged argument */
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t nutag_handle_v(nua_handle_t *v) { return (tag_value_t)v; }
su_inline tag_value_t nutag_handle_vr(nua_handle_t **vp) {return(tag_value_t)vp;}
#else
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c Wed Jun 20 13:06:05 2007
@@ -128,7 +128,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *ep, *ei;
sip_t *sip;
if (print_headings)
@@ -193,10 +193,17 @@
TEST_1(is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
+ ei = event_by_type(e->next, nua_r_invite);
+ ep = event_by_type(e->next, nua_r_prack);
+ if (!ep) {
+ run_a_until(ctx, -1, until_final_response);
+ ep = event_by_type(e->next, nua_r_prack);
+ }
+
+ TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_prack);
TEST(e->data->e_status, 200);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 200);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_content_type);
@@ -206,7 +213,8 @@
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(!e->next);
+
+ TEST_1(!e->next || !ep->next);
free_events_in_list(ctx, a->events);
/*
@@ -321,13 +329,13 @@
struct endpoint *c = &ctx->c, *b = &ctx->b;
struct call *c_call = c->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *ep, *ei;
sip_t *sip;
sip_proxy_authenticate_t *au;
char const *md5 = NULL, *md5sess = NULL;
if (print_headings)
- printf("TEST NUA-10.1.1: Call with 100rel and 180\n");
+ printf("TEST NUA-10.1.3: Call with 100rel and 180\n");
/* Test for authentication during 100rel
@@ -405,8 +413,14 @@
TEST_1(is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
+ ei = event_by_type(e->next, nua_r_invite);
+ ep = event_by_type(e->next, nua_r_prack);
+ if (!ep) {
+ run_a_until(ctx, -1, until_final_response);
+ ep = event_by_type(e->next, nua_r_prack);
+ }
+ TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_prack);
if (e->data->e_status != 200 && md5 && !md5sess) {
if (e->data->e_status != 100) {
TEST(e->data->e_status, 407);
@@ -419,16 +433,15 @@
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
}
-
TEST(e->data->e_status, 200);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 200);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(!e->next);
+ TEST_1(!e->next || !ep->next || (ep->data->e_status != 200 && !e->next->next->next));
free_events_in_list(ctx, c->events);
/*
@@ -466,10 +479,10 @@
free_events_in_list(ctx, b->events);
if (print_headings)
- printf("TEST NUA-10.1.1: PASSED\n");
+ printf("TEST NUA-10.1.3: PASSED\n");
if (print_headings)
- printf("TEST NUA-10.1.2: terminate call\n");
+ printf("TEST NUA-10.1.4: terminate call\n");
BYE(b, b_call, b_call->nh, TAG_END());
run_bc_until(ctx, -1, until_terminated, -1, until_terminated);
@@ -496,7 +509,7 @@
nua_handle_destroy(b_call->nh), b_call->nh = NULL;
if (print_headings)
- printf("TEST NUA-10.1.2: PASSED\n");
+ printf("TEST NUA-10.1.4: PASSED\n");
END();
}
@@ -558,7 +571,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *ei, *ep;
if (print_headings)
printf("TEST NUA-10.2.1: Call with 100rel, 183 and 180\n");
@@ -590,26 +603,43 @@
TEST_1(is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
- TEST(e->data->e_status, 200);
+ TEST_1(e = e->next);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ ep = e->data->e_event == nua_r_prack ? e : NULL;
+
+ if (ep) {
+ TEST(ep->data->e_status, 200); TEST_1(e = e->next);
+ }
+
+ TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 180);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
TEST_1(!is_offer_answer_done(e->data->e_tags));
+
+ if (!ep) {
+ TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
+ TEST(e->data->e_status, 200);
+ }
+
+ ei = event_by_type(e->next, nua_r_invite);
+ ep = event_by_type(e->next, nua_r_prack);
+ if (!ep) {
+ run_a_until(ctx, -1, until_final_response);
+ ep = event_by_type(e->next, nua_r_prack);
+ }
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
+ TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_prack);
TEST(e->data->e_status, 200);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 200);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(!e->next);
+ TEST_1(!e->next || !ep->next);
free_events_in_list(ctx, a->events);
/*
@@ -879,7 +909,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *ep, *ei;
sip_t *sip;
if (print_headings)
@@ -969,7 +999,10 @@
TEST_1(!is_answer_recv(e->data->e_tags));
TEST_1(is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_update);
+ ei = event_by_type(e->next, nua_r_invite);
+ ep = event_by_type(e->next, nua_r_update);
+
+ TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_update);
TEST(e->data->e_status, 200);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_session_expires);
@@ -979,17 +1012,27 @@
TEST_1(is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 180);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_proceeding); /* PROCEEDING */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
+ if (e == ep) /* invite was responded before update */
+ e = ep->next->next;
+
+ ei = event_by_type(e->next, nua_r_invite);
+ ep = event_by_type(e->next, nua_r_prack);
+ if (!ep) {
+ run_a_until(ctx, -1, until_final_response);
+ ep = event_by_type(e->next, nua_r_prack);
+ }
+
+ TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_prack);
TEST(e->data->e_status, 200);
/* Does not have effect on call state */
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 200);
TEST_1(sip = sip_object(e->data->e_msg));
if (ctx->proxy_tests) {
@@ -1001,7 +1044,7 @@
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(!e->next);
+ TEST_1(!e->next || !ep->next);
free_events_in_list(ctx, a->events);
/*
@@ -1169,7 +1212,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *eu, *ei;
if (print_headings)
printf("TEST NUA-10.4.1: Call with preconditions and non-100rel 180\n");
@@ -1253,22 +1296,25 @@
TEST_1(!is_answer_recv(e->data->e_tags));
TEST_1(is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_update);
- TEST(e->data->e_status, 200);
+ eu = event_by_type(e->next, nua_r_update);
+ ei = event_by_type(e->next, nua_r_invite);
+ TEST_1(e = eu); TEST_E(e->data->e_event, nua_r_update);
+ TEST(e->data->e_status, 200);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
TEST_1(is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 180);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_proceeding); /* PROCEEDING */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
- TEST(e->data->e_status, 200);
+ TEST_1(e = eu->next->next == ei ? ei->next->next : eu->next->next);
+
+ TEST_E(e->data->e_event, nua_r_invite); TEST(e->data->e_status, 200);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
@@ -1445,7 +1491,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *ep, *ei;
sip_t *sip;
/* -------------------------------------------------------------------- */
@@ -1563,11 +1609,18 @@
TEST(callstate(e->data->e_tags), nua_callstate_proceeding); /* PROCEEDING */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_prack);
+ ei = event_by_type(e->next, nua_r_invite);
+ ep = event_by_type(e->next, nua_r_prack);
+ if (!ep) {
+ run_a_until(ctx, -1, until_final_response);
+ ep = event_by_type(e->next, nua_r_prack);
+ }
+
+ TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_prack);
TEST(e->data->e_status, 200);
/* Does not have effect on call state */
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_invite);
+ TEST_1(e = ei); TEST_E(e->data->e_event, nua_r_invite);
TEST(e->data->e_status, 200);
if (ctx->proxy_tests) {
TEST_1(sip = sip_object(e->data->e_msg));
@@ -1579,7 +1632,7 @@
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_ready); /* READY */
TEST_1(!is_offer_answer_done(e->data->e_tags));
- TEST_1(!e->next);
+ TEST_1(!e->next || !ep->next);
free_events_in_list(ctx, a->events);
/*
@@ -1846,7 +1899,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *ep, *ec;
if (print_headings)
printf("TEST NUA-10.7: CANCEL after 100rel 180\n");
@@ -1911,17 +1964,21 @@
TEST_1(is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
-#define NEXT_SKIP_PRACK_CANCEL() \
+#define NEXT_SKIP(x) \
do { TEST_1(e = e->next); } \
- while (e->data->e_event == nua_r_prack || e->data->e_event == nua_r_cancel)
+ while (x);
- NEXT_SKIP_PRACK_CANCEL();
+ NEXT_SKIP(e->data->e_event == nua_r_prack ||
+ e->data->e_event == nua_r_cancel ||
+ e->data->e_event == nua_i_state);
TEST_E(e->data->e_event, nua_r_invite);
if (e->data->e_status == 487) {
TEST(e->data->e_status, 487);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_terminated);
+ if (e->next)
+ NEXT_SKIP(e->data->e_event == nua_r_prack || e->data->e_event == nua_r_cancel);
TEST_1(!e->next);
}
else {
@@ -1932,7 +1989,8 @@
BYE(a, a_call, a_call->nh, TAG_END());
run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
- NEXT_SKIP_PRACK_CANCEL(); TEST_E(e->data->e_event, nua_r_bye);
+ NEXT_SKIP(e->data->e_event == nua_r_prack || e->data->e_event == nua_r_cancel);
+ TEST_E(e->data->e_event, nua_r_bye);
TEST(e->data->e_status, 200);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_terminated); /* TERMINATED */
@@ -1963,18 +2021,20 @@
TEST(callstate(e->data->e_tags), nua_callstate_early); /* EARLY */
TEST_1(is_answer_sent(e->data->e_tags));
- /* 180 is PRACKed */
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_prack);
- /* Does not have effect on call state */
+ ec = event_by_type(e->next, nua_i_cancel);
- if (e->next->data->e_event == nua_i_cancel) {
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_cancel);
+ if (ec) {
+ TEST_1(e = ec); TEST_E(e->data->e_event, nua_i_cancel);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_terminated); /* TERMINATED */
}
else {
- /* Respond with 200 OK */
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
+ /* 180 is PRACKed, PRACK does not have effect on call state */
+ ep = event_by_type(e->next, nua_i_prack);
+ if (ep) e = ep;
+ /* Responded with 200 OK */
+ TEST_1(e = event_by_type(e->next, nua_i_state));
+ TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_completed); /* COMPLETED */
TEST_1(!is_offer_answer_done(e->data->e_tags));
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_ack);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_basic_call.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_basic_call.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_basic_call.c Wed Jun 20 13:06:05 2007
@@ -1100,7 +1100,7 @@
nua_handle_destroy(b_call->nh), b_call->nh = NULL;
if (print_headings)
- printf("TEST NUA-3.4: PASSED\n");
+ printf("TEST NUA-3.5: PASSED\n");
END();
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_call_reject.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_call_reject.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_call_reject.c Wed Jun 20 13:06:05 2007
@@ -1520,7 +1520,7 @@
test_reject_302(ctx) ||
test_reject_401(ctx) ||
test_mime_negotiation(ctx) ||
- test_call_timeouts(ctx) ||
test_reject_401_aka(ctx) ||
+ test_call_timeouts(ctx) ||
0;
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_cancel_bye.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_cancel_bye.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_cancel_bye.c Wed Jun 20 13:06:05 2007
@@ -1349,11 +1349,14 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
struct event *e;
+ sip_t *sip = NULL;
+
+ int seen_401;
a_call->sdp = "m=audio 5008 RTP/AVP 8";
b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
-/* Early BYE 2
+/* Bad Contact URI
A B
|-------INVITE------>|
@@ -1362,14 +1365,17 @@
|<----180 Ringing----|
|<-------200---------|
| |
- |--------BYE-------->|
- |<------200 OK-------|
|--------ACK-------->|
| |
+ |<-------BYE---------|
+ |--------400-------->|
+ | |
+ |--------BYE-------->|
+ |<------200 OK-------|
| |
*/
if (print_headings)
- printf("TEST NUA-6.4.3: BYE call when completing\n");
+ printf("TEST NUA-6.4.3: Test dialog with bad Contact info\n");
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
@@ -1448,6 +1454,42 @@
if (print_headings)
printf("TEST NUA-6.4.3: PASSED\n");
+ if (!ctx->p)
+ return 0;
+
+ if (print_headings)
+ printf("TEST NUA-6.4.4: Wait for re-REGISTER after connection has been closed\n");
+
+ /* B is supposed to re-register pretty soon, wait for re-registration */
+
+ run_b_until(ctx, -1, save_until_final_response);
+
+ seen_401 = 0;
+
+ for (e = b->events->head; e; e = e->next) {
+ TEST_E(e->data->e_event, nua_r_register);
+ TEST_1(sip = sip_object(e->data->e_msg));
+
+ if (e->data->e_status == 200) {
+ TEST(e->data->e_status, 200);
+ TEST_1(seen_401);
+ TEST_1(sip->sip_contact);
+ }
+ else if (sip->sip_status && sip->sip_status->st_status == 401) {
+ seen_401 = 1;
+ }
+
+ if (!e->next)
+ break;
+ }
+ TEST_1(e);
+ TEST_S(sip->sip_contact->m_expires, "3600");
+ TEST_1(!e->next);
+ free_events_in_list(ctx, b->events);
+
+ if (print_headings)
+ printf("TEST NUA-6.4.4: PASSED\n");
+
END();
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_init.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_init.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_init.c Wed Jun 20 13:06:05 2007
@@ -70,8 +70,9 @@
sip_allow_t const *allow = NULL;
sip_supported_t const *supported = NULL;
char const *appl_method = NULL;
- url_t const *p_uri, *a_uri; /* Proxy URI */
+ url_t const *p_uri, *a_uri, *b_uri; /* Proxy URI */
char const *a_bind, *a_bind2;
+ url_t b_proxy[1];
a_bind = a_bind2 = "sip:0.0.0.0:*";
@@ -121,7 +122,7 @@
printf("TEST NUA-2.1.1: PASSED\n");
}
- p_uri = a_uri = test_proxy_uri(ctx->p);
+ p_uri = a_uri = b_uri = test_proxy_uri(ctx->p);
if (start_nat && p_uri == NULL)
p_uri = url_hdup(ctx->home, (void *)o_proxy);
@@ -257,8 +258,15 @@
ctx->b.instance = nua_generate_instance_identifier(ctx->home);
+ if (ctx->p) {
+ /* B uses TCP when talking with proxy */
+ *b_proxy = *b_uri;
+ b_uri = b_proxy;
+ b_proxy->url_params = "transport=tcp";
+ }
+
ctx->b.nua = nua_create(ctx->root, b_callback, ctx,
- NUTAG_PROXY(p_uri ? p_uri : o_proxy),
+ NUTAG_PROXY(b_uri ? b_uri : o_proxy),
SIPTAG_FROM_STR("sip:bob@example.org"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5006 RTP/AVP 8 0"),
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c Wed Jun 20 13:06:05 2007
@@ -211,6 +211,18 @@
else if (strcmp(argv[i], "--loop") == 0) {
o_alarm = 0, o_loop = 1;
}
+ else if (strcmp(argv[i], "--print-tags") == 0) {
+ ctx->print_tags = 1;
+ }
+ else if (strcmp(argv[i], "--tags=a") == 0) {
+ ctx->a.print_tags = 1;
+ }
+ else if (strcmp(argv[i], "--tags=b") == 0) {
+ ctx->b.print_tags = 1;
+ }
+ else if (strcmp(argv[i], "--tags=c") == 0) {
+ ctx->c.print_tags = 1;
+ }
else if (strcmp(argv[i], "--log=a") == 0) {
ctx->a.logging = 1;
}
@@ -317,8 +329,8 @@
retval |= test_rejects(ctx); SINGLE_FAILURE_CHECK();
retval |= test_call_cancel(ctx); SINGLE_FAILURE_CHECK();
retval |= test_call_destroy(ctx); SINGLE_FAILURE_CHECK();
- retval |= test_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_early_bye(ctx); SINGLE_FAILURE_CHECK();
+ retval |= test_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_reinvites(ctx); SINGLE_FAILURE_CHECK();
retval |= test_session_timer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_refer(ctx); SINGLE_FAILURE_CHECK();
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h Wed Jun 20 13:06:05 2007
@@ -124,6 +124,7 @@
su_root_t *root;
int threading, proxy_tests, expensive, quit_on_single_failure, osx_runloop;
+ int print_tags;
char const *external_proxy;
int proxy_logging;
@@ -133,6 +134,7 @@
struct context *ctx; /* Backpointer */
int logging;
+ int print_tags;
int running;
@@ -196,6 +198,9 @@
struct eventlist *list,
struct event *e);
+struct event *event_by_type(struct event *e, nua_event_t);
+size_t count_events(struct event const *e);
+
#define CONDITION_PARAMS \
nua_event_t event, \
int status, char const *phrase, \
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_ops.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_ops.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_ops.c Wed Jun 20 13:06:05 2007
@@ -190,7 +190,8 @@
ep->name, (void *)nh, operation);
}
- if ((tstflags & tst_verbatim) && tags)
+ if (tags &&
+ ((tstflags & tst_verbatim) || ctx->print_tags || ep->print_tags))
tl_print(stderr, "", tags);
}
@@ -499,6 +500,27 @@
}
}
+struct event *event_by_type(struct event *e, nua_event_t etype)
+{
+ for (; e; e = e->next) {
+ if (e->data->e_event == etype)
+ break;
+ }
+
+ return e;
+}
+
+size_t count_events(struct event const *e)
+{
+ size_t n;
+
+ for (n = 0; e; e = e->next)
+ n++;
+
+ return n;
+}
+
+
int is_special(nua_event_t e)
{
if (e == nua_i_active || e == nua_i_terminated)
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.c Wed Jun 20 13:06:05 2007
@@ -53,6 +53,8 @@
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/msg_addr.h>
#include <sofia-sip/hostdomain.h>
+#include <sofia-sip/tport.h>
+#include <sofia-sip/nta_tport.h>
#include <stdlib.h>
#include <assert.h>
@@ -111,6 +113,8 @@
sip_time_t min_expires, expires, max_expires;
sip_time_t session_expires, min_se;
+
+ int outbound_tcp; /**< Use inbound TCP connection as outbound */
} prefs;
};
@@ -119,7 +123,6 @@
url_t const *);
static void registration_entry_destroy(struct registration_entry *e);
-
struct registration_entry
{
struct registration_entry *next, **prev;
@@ -132,14 +135,16 @@
struct binding
{
struct binding *next, **prev;
- sip_contact_t *contact; /* bindings */
+ sip_contact_t *contact; /* binding */
sip_time_t registered, expires; /* When registered and when expires */
- sip_call_id_t *call_id;
+ sip_call_id_t *call_id;
uint32_t cseq;
+ tport_t *tport; /**< Reference to tport */
};
static struct binding *binding_new(su_home_t *home,
sip_contact_t *contact,
+ tport_t *tport,
sip_call_id_t *call_id,
uint32_t cseq,
sip_time_t registered,
@@ -147,7 +152,9 @@
static void binding_destroy(su_home_t *home, struct binding *b);
static int binding_is_active(struct binding const *b)
{
- return b->expires > sip_now();
+ return
+ b->expires > sip_now() &&
+ (b->tport == NULL || tport_is_clear_to_send(b->tport));
}
LIST_PROTOS(static, proxy_transaction, struct proxy_transaction);
@@ -195,6 +202,8 @@
static struct registration_entry *
registration_entry_find(struct proxy const *proxy, url_t const *uri);
+static int close_tports(void *proxy);
+
static auth_challenger_t registrar_challenger[1];
static auth_challenger_t proxy_challenger[1];
@@ -268,6 +277,8 @@
proxy->prefs.session_expires = 180;
proxy->prefs.min_se = 90;
+ proxy->prefs.outbound_tcp = 1;
+
if (!proxy->defleg ||
!proxy->example_net || !proxy->example_org || !proxy->example_com)
return -1;
@@ -302,11 +313,11 @@
nta_outgoing_destroy(t->client), t->client = NULL;
}
- nta_agent_destroy(proxy->agent);
-
while (proxy->entries)
registration_entry_destroy(proxy->entries);
+ nta_agent_destroy(proxy->agent);
+
free(proxy->tags);
}
@@ -396,6 +407,38 @@
}
}
+void test_proxy_set_outbound(struct proxy *p,
+ int use_outbound)
+{
+ if (p) {
+ p->prefs.outbound_tcp = use_outbound;
+ }
+}
+
+void test_proxy_get_outbound(struct proxy *p,
+ int *return_use_outbound)
+{
+ if (p) {
+ if (return_use_outbound)
+ *return_use_outbound = p->prefs.outbound_tcp;
+ }
+}
+
+int test_proxy_close_tports(struct proxy *p)
+{
+ if (p) {
+ int retval = -EPROTO;
+
+ su_task_execute(su_clone_task(p->clone), close_tports, p, &retval);
+
+ if (retval < 0)
+ return errno = -retval, -1;
+ else
+ return 0;
+ }
+ return errno = EFAULT, -1;
+}
+
/* ---------------------------------------------------------------------- */
static sip_contact_t *create_transport_contacts(struct proxy *p)
@@ -449,6 +492,7 @@
sip_session_expires_t *x = NULL, x0[1];
sip_min_se_t *min_se = NULL, min_se0[1];
char const *require = NULL;
+ tport_t *tport = NULL;
mf = sip->sip_max_forwards;
@@ -529,8 +573,9 @@
nta_incoming_treply(irq, SIP_480_TEMPORARILY_UNAVAILABLE, TAG_END());
return 480;
}
-
+
target = b->contact->m_url;
+ tport = b->tport;
}
t = proxy_transaction_new(proxy);
@@ -560,6 +605,7 @@
SIPTAG_SESSION_EXPIRES(x),
SIPTAG_MIN_SE(min_se),
SIPTAG_REQUIRE_STR(require),
+ NTATAG_TPORT(tport),
TAG_END());
if (t->client == NULL) {
proxy_transaction_destroy(t);
@@ -734,9 +780,10 @@
static int check_out_of_order(struct proxy *p, auth_status_t *as,
struct registration_entry *e, sip_t const *);
static int binding_update(struct proxy *p,
- auth_status_t *as,
- struct registration_entry *e,
- sip_t const *sip);
+ auth_status_t *as,
+ struct registration_entry *e,
+ nta_incoming_t *irq,
+ sip_t const *sip);
sip_contact_t *binding_contacts(su_home_t *home, struct binding *bindings);
@@ -768,10 +815,11 @@
assert(as->as_status >= 200);
nta_incoming_treply(irq,
- as->as_status, as->as_phrase,
- SIPTAG_HEADER((void *)as->as_info),
- SIPTAG_HEADER((void *)as->as_response),
- TAG_END());
+ as->as_status, as->as_phrase,
+ SIPTAG_HEADER((void *)as->as_info),
+ SIPTAG_HEADER((void *)as->as_response),
+ TAG_END());
+
status = as->as_status;
su_home_unref(as->as_home);
@@ -816,7 +864,7 @@
if (!e)
return set_status(as, SIP_500_INTERNAL_SERVER_ERROR);
- if (binding_update(p, as, e, sip))
+ if (binding_update(p, as, e, irq, sip))
return as->as_status;
msg_header_free(p->home, (void *)e->contacts);
@@ -954,6 +1002,7 @@
static
struct binding *binding_new(su_home_t *home,
sip_contact_t *contact,
+ tport_t *tport,
sip_call_id_t *call_id,
uint32_t cseq,
sip_time_t registered,
@@ -968,6 +1017,7 @@
*m = *contact; m->m_next = NULL;
b->contact = sip_contact_dup(home, m);
+ b->tport = tport_ref(tport);
b->call_id = sip_call_id_dup(home, call_id);
b->cseq = cseq;
b->registered = registered;
@@ -992,6 +1042,7 @@
}
msg_header_free(home, (void *)b->contact);
msg_header_free(home, (void *)b->call_id);
+ tport_unref(b->tport);
su_free(home, b);
}
@@ -999,16 +1050,21 @@
int binding_update(struct proxy *p,
auth_status_t *as,
struct registration_entry *e,
+ nta_incoming_t *irq,
sip_t const *sip)
{
struct binding *b, *old, *next, *last, *bindings = NULL, **bb = &bindings;
sip_contact_t *m;
sip_time_t expires;
-
sip_time_t now = sip_now();
+ tport_t *tport = NULL;
assert(sip->sip_contact);
+ if (p->prefs.outbound_tcp &&
+ str0casecmp(sip->sip_via->v_protocol, sip_transport_tcp) == 0)
+ tport = nta_incoming_transport(p->agent, irq, NULL);
+
/* Create new bindings */
for (m = sip->sip_contact; m; m = m->m_next) {
if (m->m_url->url_type == url_any)
@@ -1022,7 +1078,7 @@
msg_header_remove_param(m->m_common, "expires");
- b = binding_new(p->home, m, sip->sip_call_id, sip->sip_cseq->cs_seq,
+ b = binding_new(p->home, m, tport, sip->sip_call_id, sip->sip_cseq->cs_seq,
now, now + expires);
if (!b)
break;
@@ -1030,6 +1086,8 @@
*bb = b, b->prev = bb, bb = &b->next;
}
+ tport_unref(tport);
+
last = NULL;
if (m == NULL) {
@@ -1095,3 +1153,25 @@
return retval;
}
+
+/* ---------------------------------------------------------------------- */
+
+static int close_tports(void *_proxy)
+{
+ struct proxy *p = _proxy;
+ struct registration_entry *e;
+ struct binding *b;
+
+ /* Close all outbound transports */
+ for (e = p->entries; e; e = e->next) {
+ for (b = e->bindings; b; b = b->next) {
+ if (b->tport) {
+ tport_shutdown(b->tport, 2);
+ tport_unref(b->tport);
+ b->tport = NULL;
+ }
+ }
+ }
+
+ return 0;
+}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.h Wed Jun 20 13:06:05 2007
@@ -56,6 +56,8 @@
sip_time_t *return_session_expires,
sip_time_t *return_min_se);
+int test_proxy_close_tports(struct proxy *p);
+
SOFIA_END_DECLS
#endif
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_refer.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_refer.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_refer.c Wed Jun 20 13:06:05 2007
@@ -113,7 +113,7 @@
struct call *a_call = a->call, *b_call = b->call, *c_call = c->call;
struct call *a_refer, *a_c2, *b_refer;
struct eventlist *a_revents, *b_revents;
- struct event *e;
+ struct event *e, *notify_e;
sip_t const *sip;
sip_event_t const *a_event, *b_event;
sip_refer_to_t const *refer_to;
@@ -280,21 +280,38 @@
TAG_END()), 1);
TEST_1(b_event); TEST_1(b_event->o_id);
TEST_1(b_event = sip_event_dup(tmphome, b_event));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_refer);
+
+ notify_e = NULL;
+
+ TEST_1(e = e->next);
+ if (e->data->e_event == nua_i_notify) {
+ notify_e = e;
+ TEST_1(e = e->next);
+ }
+ TEST_E(e->data->e_event, nua_r_refer);
TEST(e->data->e_status, 202);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_SIZE(strtoul(b_event->o_id, NULL, 10), sip->sip_cseq->cs_seq);
if (a_refer != a_call) {
- if (b_revents->head->next->next == NULL)
- run_ab_until(ctx, -1, save_until_received, nua_i_notify, save_events);
- else if (a_revents->head->next == NULL)
+ while (!notify_e) {
+ for (e = b_revents->head; e; e = e->next) {
+ if (e->data->e_event == nua_i_notify) {
+ notify_e = e;
+ break;
+ }
+ }
+ if (!notify_e)
+ run_ab_until(ctx, -1, save_until_received, nua_i_notify, save_events);
+ }
+
+ if (a_revents->head->next == NULL)
run_a_until(ctx, -1, save_until_received);
TEST_1(e = a_revents->head->next); TEST_E(e->data->e_event, nua_r_notify);
TEST_1(!e->next);
- TEST_1(e = b_revents->head->next->next);
+ TEST_1(e = notify_e);
TEST_E(e->data->e_event, nua_i_notify);
TEST(e->data->e_status, 200);
TEST_1(sip = sip_object(e->data->e_msg));
@@ -304,8 +321,8 @@
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "pending");
TEST_1(sip->sip_payload && sip->sip_payload->pl_data);
- TEST_S(sip->sip_payload->pl_data, "SIP/2.0 100 Trying\r\n");
- TEST_1(!e->next);
+ TEST_M(sip->sip_payload->pl_data, "SIP/2.0 100 Trying\r\n",
+ sip->sip_payload->pl_len);
}
free_events_in_list(ctx, a_revents);
@@ -363,7 +380,8 @@
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "pending");
TEST_1(sip->sip_payload && sip->sip_payload->pl_data);
- TEST_S(sip->sip_payload->pl_data, "SIP/2.0 100 Trying\r\n");
+ TEST_M(sip->sip_payload->pl_data, "SIP/2.0 100 Trying\r\n",
+ sip->sip_payload->pl_len);
TEST_1(e = e->next);
}
TEST_E(e->data->e_event, nua_r_subscribe);
@@ -476,7 +494,7 @@
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "active");
TEST_1(sip->sip_payload && sip->sip_payload->pl_data);
- TEST_S(sip->sip_payload->pl_data, "SIP/2.0 180 Ringing\r\n");
+ TEST_M(sip->sip_payload->pl_data, "SIP/2.0 180 Ringing\r\n", sip->sip_payload->pl_len);
TEST_1(sip->sip_event);
if (refer_with_id)
TEST_S(sip->sip_event->o_id, b_event->o_id);
@@ -486,7 +504,7 @@
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "terminated");
TEST_1(sip->sip_payload && sip->sip_payload->pl_data);
- TEST_S(sip->sip_payload->pl_data, "SIP/2.0 200 OK\r\n");
+ TEST_M(sip->sip_payload->pl_data, "SIP/2.0 200 OK\r\n", sip->sip_payload->pl_len);
TEST_1(sip->sip_event);
if (refer_with_id)
TEST_S(sip->sip_event->o_id, b_event->o_id);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_register.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_register.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_register.c Wed Jun 20 13:06:05 2007
@@ -200,6 +200,10 @@
m->m_display = "B";
m->m_url->url_user = "b";
+ /* Include "tcp" transport parameter in Contact */
+ if (ctx->p)
+ m->m_url->url_params = "transport=tcp";
+
REGISTER(b, b_reg, b_reg->nh, SIPTAG_TO(b->to),
SIPTAG_CONTACT(m),
/* Do not include credentials unless challenged */
@@ -229,11 +233,14 @@
TEST_S(sip->sip_contact->m_display, "B");
TEST_S(sip->sip_contact->m_url->url_user, "b");
free_events_in_list(ctx, b->events);
+
if (print_headings)
printf("TEST NUA-2.3.2: PASSED\n");
- if (ctx->p)
+ if (ctx->p) {
+ test_proxy_close_tports(ctx->p);
test_proxy_set_expiration(ctx->p, 600, 3600, 36000);
+ }
if (print_headings)
printf("TEST NUA-2.3.3: REGISTER c\n");
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_simple.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_simple.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_simple.c Wed Jun 20 13:06:05 2007
@@ -1194,7 +1194,7 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *en, *es;
sip_t const *sip;
tagi_t const *n_tags, *r_tags;
@@ -1220,22 +1220,16 @@
/* Client events:
nua_method(), nua_i_notify/nua_r_method, nua_i_notify
*/
- TEST_1(e = a->events->head);
- if (e->data->e_event == nua_i_notify) {
- TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_subscribe);
- r_tags = e->data->e_tags;
- }
- else {
- TEST_E(e->data->e_event, nua_r_method);
- TEST(e->data->e_status, 202);
- r_tags = e->data->e_tags;
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
- }
+ TEST_1(en = event_by_type(a->events->head, nua_i_notify));
+ TEST_1(es = event_by_type(a->events->head, nua_r_method));
+
+ TEST_1(e = en); TEST_E(e->data->e_event, nua_i_notify);
+ TEST_1(sip = sip_object(e->data->e_msg));
+ n_tags = e->data->e_tags;
+
+ TEST_1(e = es); TEST_E(e->data->e_event, nua_r_method);
+ r_tags = e->data->e_tags;
+
TEST_1(sip->sip_event); TEST_S(sip->sip_event->o_type, "presence");
TEST_1(sip->sip_content_type);
TEST_S(sip->sip_content_type->c_type, "application/pidf+xml");
@@ -1245,7 +1239,12 @@
TEST_1(tl_find(n_tags, nutag_substate));
TEST(tl_find(n_tags, nutag_substate)->t_value, nua_substate_pending);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_notify);
+ if (es->next == en)
+ e = en->next;
+ else
+ e = es->next;
+
+ TEST_1(e); TEST_E(e->data->e_event, nua_i_notify);
n_tags = e->data->e_tags;
TEST_1(tl_find(n_tags, nutag_substate));
TEST(tl_find(n_tags, nutag_substate)->t_value, nua_substate_terminated);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_sip_events.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_sip_events.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/nua/test_sip_events.c Wed Jun 20 13:06:05 2007
@@ -89,9 +89,9 @@
struct endpoint *a = &ctx->a, *b = &ctx->b;
struct call *a_call = a->call, *b_call = b->call;
- struct event *e;
+ struct event *e, *en, *es;
sip_t const *sip;
- tagi_t const *n_tags, *r_tags;
+ tagi_t const *t, *n_tags, *r_tags;
url_t b_url[1];
nea_sub_t *sub = NULL;
@@ -206,26 +206,25 @@
/* Client events:
nua_subscribe(), nua_i_notify/nua_r_subscribe
*/
- TEST_1(e = a->events->head);
- if (e->data->e_event == nua_i_notify) {
- TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_subscribe);
- r_tags = e->data->e_tags;
- TEST_1(tl_find(r_tags, nutag_substate));
- TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_active);
+ TEST_1(en = event_by_type(a->events->head, nua_i_notify));
+ TEST_1(es = event_by_type(a->events->head, nua_r_subscribe));
+
+ TEST_1(e = es); TEST_E(e->data->e_event, nua_r_subscribe);
+ r_tags = e->data->e_tags;
+ TEST_1(tl_find(r_tags, nutag_substate));
+ if (es->next == en) {
+ TEST_1(200 <= e->data->e_status && e->data->e_status < 300);
+ TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_embryonic);
}
else {
- TEST_E(e->data->e_event, nua_r_subscribe);
- TEST(e->data->e_status, 202);
- r_tags = e->data->e_tags;
- TEST_1(tl_find(r_tags, nutag_substate));
- TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_embryonic);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
+ TEST_1(200 <= e->data->e_status && e->data->e_status < 300);
+ TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_active);
}
+
+ TEST_1(e = en); TEST_E(e->data->e_event, nua_i_notify);
+ TEST_1(sip = sip_object(e->data->e_msg));
+ n_tags = e->data->e_tags;
+
TEST_1(sip->sip_event); TEST_S(sip->sip_event->o_type, "presence");
TEST_1(sip->sip_content_type);
TEST_S(sip->sip_content_type->c_type, "application/pidf+xml");
@@ -234,7 +233,7 @@
TEST_1(sip->sip_subscription_state->ss_expires);
TEST_1(tl_find(n_tags, nutag_substate));
TEST(tl_find(n_tags, nutag_substate)->t_value, nua_substate_active);
- TEST_1(!e->next);
+ TEST_1(!en->next || !es->next);
free_events_in_list(ctx, a->events);
if (print_headings)
@@ -302,7 +301,7 @@
UNSUBSCRIBE(a, a_call, a_call->nh, TAG_END());
- run_ab_until(ctx, -1, save_until_notified_and_responded,
+ run_ab_until(ctx, -1, save_until_final_response,
-1, NULL /* XXX save_until_received */);
/* Client events:
@@ -313,26 +312,21 @@
TEST_E(e->data->e_event, nua_i_notify);
TEST_1(sip = sip_object(e->data->e_msg));
n_tags = e->data->e_tags;
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_unsubscribe);
- TEST_1(tl_find(e->data->e_tags, nutag_substate));
- TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
- nua_substate_terminated);
- }
- else {
- TEST_E(e->data->e_event, nua_r_unsubscribe);
- TEST(e->data->e_status, 202);
- TEST_1(tl_find(e->data->e_tags, nutag_substate));
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
+ TEST_1(sip->sip_event);
+ TEST_1(sip->sip_subscription_state);
+ TEST_S(sip->sip_subscription_state->ss_substate, "terminated");
+ TEST_1(!sip->sip_subscription_state->ss_expires);
+ TEST_1(tl_find(n_tags, nutag_substate));
+ TEST(tl_find(n_tags, nutag_substate)->t_value, nua_substate_terminated);
+ TEST_1(e = e->next);
}
- TEST_1(sip->sip_event);
- TEST_1(sip->sip_subscription_state);
- TEST_S(sip->sip_subscription_state->ss_substate, "terminated");
- TEST_1(!sip->sip_subscription_state->ss_expires);
- TEST_1(tl_find(n_tags, nutag_substate));
- TEST(tl_find(n_tags, nutag_substate)->t_value, nua_substate_terminated);
- TEST_1(!e->next);
+ TEST_E(e->data->e_event, nua_r_unsubscribe);
+ TEST_1(tl_find(e->data->e_tags, nutag_substate));
+ TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
+ nua_substate_terminated);
+ /* Currently, NOTIFY is dropped after successful response to unsubscribe */
+ /* But we don't really care.. */
+ /* TEST_1(!e->next); */
free_events_in_list(ctx, a->events);
if (print_headings)
@@ -383,26 +377,18 @@
/* Client events:
nua_subscribe(), nua_i_notify/nua_r_subscribe
*/
- TEST_1(e = a->events->head);
- if (e->data->e_event == nua_i_notify) {
- TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_subscribe);
- TEST_1(tl_find(e->data->e_tags, nutag_substate));
- TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
- nua_substate_pending);
- }
- else {
- TEST_E(e->data->e_event, nua_r_subscribe);
- TEST(e->data->e_status, 202);
- TEST_1(tl_find(e->data->e_tags, nutag_substate));
- TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
- nua_substate_embryonic);
- TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_notify);
- TEST_1(sip = sip_object(e->data->e_msg));
- n_tags = e->data->e_tags;
- }
+ TEST_1(en = event_by_type(a->events->head, nua_i_notify));
+ TEST_1(es = event_by_type(a->events->head, nua_r_subscribe));
+
+ e = es; TEST_E(e->data->e_event, nua_r_subscribe);
+ TEST_1(t = tl_find(e->data->e_tags, nutag_substate));
+ TEST_1(t->t_value == nua_substate_pending ||
+ t->t_value == nua_substate_embryonic);
+
+ e = en; TEST_E(e->data->e_event, nua_i_notify);
+ TEST_1(sip = sip_object(e->data->e_msg));
+ n_tags = e->data->e_tags;
+
TEST_1(sip->sip_event); TEST_S(sip->sip_event->o_type, "presence");
TEST_S(sip->sip_event->o_id, "1");
TEST_1(sip->sip_content_type);
@@ -417,7 +403,7 @@
TEST_1(tl_find(n_tags, nutag_substate));
TEST(tl_find(n_tags, nutag_substate)->t_value,
nua_substate_pending);
- TEST_1(!e->next);
+ TEST_1(!en->next || !es->next);
free_events_in_list(ctx, a->events);
/*
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c Wed Jun 20 13:06:05 2007
@@ -718,6 +718,9 @@
* it is like "Contact: url:foo,sip:bar,sip:zunk"
*/
c = *s; *s = '\0'; /* terminate temporarily */
+ /* Do not accept an empty URL */
+ if (addr_spec[0] == '\0')
+ return -1;
if (url_d(return_url, addr_spec) == -1)
return -1;
*s = c; /* return terminator */
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag.h.in Wed Jun 20 13:06:05 2007
@@ -104,7 +104,7 @@
#define SIPTAG_SIP_REF(x) siptag_sip_ref, siptag_sip_vr(&(x))
SOFIAPUBVAR tag_typedef_t siptag_sip_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline
tag_value_t siptag_sip_v(sip_t const *v) { return (tag_value_t)v; }
su_inline
@@ -136,7 +136,7 @@
#define SIPTAG_HEADER_REF(x) siptag_header_ref, siptag_header_vr(&(x))
SOFIAPUBVAR tag_typedef_t siptag_header_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t
siptag_header_v(sip_header_t const *v)
{ return (tag_value_t)v; }
@@ -240,7 +240,7 @@
#define SIPTAG_#XXXXXX#_STR_REF(x) siptag_#xxxxxx#_str_ref, tag_str_vr(&(x))
SOFIAPUBVAR tag_typedef_t siptag_#xxxxxx#_str_ref;
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t
siptag_#xxxxxx#_v(sip_#xxxxxx#_t const *v)
{ return (tag_value_t)v; }
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c Wed Jun 20 13:06:05 2007
@@ -405,6 +405,8 @@
TEST_1(!sip_from_create(home, (void *)"sip:joe@[baa"));
+ TEST_1(!sip_from_make(home, (void *)"tester <>;tag=fasjfuios"));
+
TEST_1(f = sip_from_make(home, (void *)"sip:joe@bar (foo)"));
su_free(home, f);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c Wed Jun 20 13:06:05 2007
@@ -80,9 +80,19 @@
{
soa_session_t sss_session[1];
char *sss_audio_aux;
+ int sss_ordered_user; /**< User SDP is ordered */
+ int sss_reuse_rejected; /**< Try to reuse rejected media line slots */
+
+ /** Mapping from user SDP m= lines to session SDP m= lines */
+ int *sss_u2s;
+ /** Mapping from session SDP m= lines to user SDP m= lines */
+ int *sss_s2u;
}
soa_static_session_t;
+#define U2S_NOT_USED (-1)
+#define U2S_SENTINEL (-2)
+
static int soa_static_init(char const *, soa_session_t *, soa_session_t *);
static void soa_static_deinit(soa_session_t *);
static int soa_static_set_params(soa_session_t *ss, tagi_t const *tags);
@@ -152,10 +162,14 @@
{
soa_static_session_t *sss = (soa_static_session_t *)ss;
char const *audio_aux = sss->sss_audio_aux;
+ int ordered_user = sss->sss_ordered_user;
+ int reuse_rejected = sss->sss_reuse_rejected;
int n, m;
n = tl_gets(tags,
SOATAG_AUDIO_AUX_REF(audio_aux),
+ SOATAG_ORDERED_USER_REF(ordered_user),
+ SOATAG_REUSE_REJECTED_REF(reuse_rejected),
TAG_END());
if (n > 0 && str0casecmp(audio_aux, sss->sss_audio_aux)) {
@@ -167,6 +181,9 @@
su_free(ss->ss_home, tbf);
}
+ sss->sss_ordered_user = ordered_user != 0;
+ sss->sss_reuse_rejected = reuse_rejected != 0;
+
m = soa_base_set_params(ss, tags);
if (m < 0)
return m;
@@ -182,6 +199,8 @@
n = tl_tgets(tags,
SOATAG_AUDIO_AUX(sss->sss_audio_aux),
+ SOATAG_ORDERED_USER(sss->sss_ordered_user),
+ SOATAG_REUSE_REJECTED(sss->sss_reuse_rejected),
TAG_END());
m = soa_base_get_params(ss, tags);
if (m < 0)
@@ -204,6 +223,10 @@
tl = soa_base_get_paramlist(ss,
TAG_IF(sss->sss_audio_aux,
SOATAG_AUDIO_AUX(sss->sss_audio_aux)),
+ TAG_IF(sss->sss_ordered_user,
+ SOATAG_ORDERED_USER(1)),
+ TAG_IF(sss->sss_reuse_rejected,
+ SOATAG_REUSE_REJECTED(1)),
TAG_NEXT(ta_args(ta)));
ta_end(ta);
@@ -239,6 +262,7 @@
}
/** Generate a rejected m= line */
+static
sdp_media_t *soa_sdp_make_rejected_media(su_home_t *home,
sdp_media_t const *m,
sdp_session_t *sdp,
@@ -263,6 +287,7 @@
/** Expand a @a truncated SDP.
*/
+static
sdp_session_t *soa_sdp_expand_media(su_home_t *home,
sdp_session_t const *truncated,
sdp_session_t const *complete)
@@ -312,6 +337,7 @@
}
/** Check if codec is in auxiliary list */
+static
int soa_sdp_is_auxiliary_codec(sdp_rtpmap_t const *rm, char const *auxiliary)
{
char const *codec;
@@ -342,68 +368,84 @@
return 0;
}
+static
+sdp_rtpmap_t *soa_sdp_media_matching_rtpmap(sdp_rtpmap_t const *from,
+ sdp_rtpmap_t const *anylist,
+ char const *auxiliary)
+{
+ sdp_rtpmap_t const *rm;
+
+ for (rm = anylist; rm; rm = rm->rm_next) {
+ /* Ignore auxiliary codecs */
+ if (auxiliary && soa_sdp_is_auxiliary_codec(rm, auxiliary))
+ continue;
-/** Find first matching media in table. */
-sdp_media_t *soa_sdp_matching(soa_session_t *ss,
- sdp_media_t *mm[],
- sdp_media_t const *with,
- int *return_common_codecs)
+ if (sdp_rtpmap_find_matching(from, rm))
+ return (sdp_rtpmap_t *)rm;
+ }
+
+ return NULL;
+}
+
+#define SDP_MEDIA_NONE ((sdp_media_t *)-1)
+
+/** Find first matching media in table @a mm.
+ *
+ * - if allow_rtp_mismatch == 0, search for a matching codec
+ * - if allow_rtp_mismatch == 1, prefer m=line with matching codec
+ * - if allow_rtp_mismatch > 1, ignore codecs
+ */
+static
+int soa_sdp_matching_mindex(soa_session_t *ss,
+ sdp_media_t *mm[],
+ sdp_media_t const *with,
+ int *return_codec_mismatch)
{
int i, j = -1;
- sdp_media_t *m;
- sdp_rtpmap_t const *rm;
soa_static_session_t *sss = (soa_static_session_t *)ss;
- char const *auxiliary;
+ int rtp = sdp_media_uses_rtp(with), dummy;
+ char const *auxiliary = NULL;
- auxiliary = with->m_type == sdp_media_audio ? sss->sss_audio_aux : NULL;
+ if (return_codec_mismatch == NULL)
+ return_codec_mismatch = &dummy;
- /* Looking for a single codec */
- if (with->m_rtpmaps && with->m_rtpmaps->rm_next == NULL)
- auxiliary = NULL;
+ if (with->m_type == sdp_media_audio) {
+ auxiliary = sss->sss_audio_aux;
+ /* Looking for a single codec */
+ if (with->m_rtpmaps && with->m_rtpmaps->rm_next == NULL)
+ auxiliary = NULL;
+ }
for (i = 0; mm[i]; i++) {
+ if (mm[i] == SDP_MEDIA_NONE)
+ continue;
+
if (!sdp_media_match_with(mm[i], with))
continue;
- if (!sdp_media_uses_rtp(with))
+ if (!rtp)
break;
- if (!return_common_codecs)
+ if (soa_sdp_media_matching_rtpmap(with->m_rtpmaps,
+ mm[i]->m_rtpmaps,
+ auxiliary))
break;
- /* Check also rtpmaps */
- for (rm = mm[i]->m_rtpmaps; rm; rm = rm->rm_next) {
- /* Ignore auxiliary codecs */
- if (auxiliary && soa_sdp_is_auxiliary_codec(rm, auxiliary))
- continue;
-
- if (sdp_rtpmap_find_matching(with->m_rtpmaps, rm))
- break;
- }
- if (rm)
- break;
if (j == -1)
j = i;
}
- if (return_common_codecs)
- *return_common_codecs = mm[i] != NULL;
-
- if (mm[i] == NULL && j != -1)
- i = j; /* return m= line without common codecs */
-
- m = mm[i];
-
- for (; mm[i]; i++)
- mm[i] = mm[i + 1];
-
- return m;
+ if (mm[i])
+ return *return_codec_mismatch = 0, i;
+ else
+ return *return_codec_mismatch = 1, j;
}
/** Set payload types in @a l_m according to the values in @a r_m.
*
* @retval number of common codecs
*/
+static
int soa_sdp_set_rtpmap_pt(sdp_media_t *l_m,
sdp_media_t const *r_m)
{
@@ -511,6 +553,7 @@
*
* @return Number of common codecs
*/
+static
int soa_sdp_sort_rtpmap(sdp_rtpmap_t **inout_list,
sdp_rtpmap_t const *rrm,
char const *auxiliary)
@@ -564,6 +607,7 @@
*
* @return Number of common codecs
*/
+static
int soa_sdp_select_rtpmap(sdp_rtpmap_t **inout_list,
sdp_rtpmap_t const *rrm,
char const *auxiliary,
@@ -597,139 +641,220 @@
return common_codecs;
}
-/** Sort and select rtpmaps within session */
-int soa_sdp_upgrade_rtpmaps(soa_session_t *ss,
- sdp_session_t *session,
- sdp_session_t const *remote)
+
+/** Sort and select rtpmaps */
+static
+int soa_sdp_media_upgrade_rtpmaps(soa_session_t *ss,
+ sdp_media_t *sm,
+ sdp_media_t const *rm)
{
soa_static_session_t *sss = (soa_static_session_t *)ss;
+ char const *auxiliary = NULL;
+ int common_codecs;
+
+ common_codecs = soa_sdp_set_rtpmap_pt(sm, rm);
+
+ if (rm->m_type == sdp_media_audio)
+ auxiliary = sss->sss_audio_aux;
+
+ if (ss->ss_rtp_sort == SOA_RTP_SORT_REMOTE ||
+ (ss->ss_rtp_sort == SOA_RTP_SORT_DEFAULT &&
+ rm->m_mode == sdp_recvonly)) {
+ soa_sdp_sort_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary);
+ }
+
+ if (common_codecs == 0)
+ ;
+ else if (ss->ss_rtp_select == SOA_RTP_SELECT_SINGLE) {
+ soa_sdp_select_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary, 1);
+ }
+ else if (ss->ss_rtp_select == SOA_RTP_SELECT_COMMON) {
+ soa_sdp_select_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary, 0);
+ }
+
+ return common_codecs;
+}
+
+
+/** Sort and select rtpmaps within session */
+static
+int soa_sdp_session_upgrade_rtpmaps(soa_session_t *ss,
+ sdp_session_t *session,
+ sdp_session_t const *remote)
+{
sdp_media_t *sm;
sdp_media_t const *rm;
for (sm = session->sdp_media, rm = remote->sdp_media;
sm && rm;
sm = sm->m_next, rm = rm->m_next) {
- if (sm->m_rejected)
- continue;
- if (sdp_media_uses_rtp(sm)) {
- int common_codecs = soa_sdp_set_rtpmap_pt(sm, rm);
-
- char const *auxiliary =
- rm->m_type == sdp_media_audio ? sss->sss_audio_aux : NULL;
-
- if (ss->ss_rtp_sort == SOA_RTP_SORT_REMOTE ||
- (ss->ss_rtp_sort == SOA_RTP_SORT_DEFAULT &&
- rm->m_mode == sdp_recvonly)) {
- soa_sdp_sort_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary);
- }
-
- if (common_codecs == 0)
- ;
- else if (ss->ss_rtp_select == SOA_RTP_SELECT_SINGLE) {
- soa_sdp_select_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary, 1);
- }
- else if (ss->ss_rtp_select == SOA_RTP_SELECT_COMMON) {
- soa_sdp_select_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps, auxiliary, 0);
- }
- }
+ if (!sm->m_rejected && sdp_media_uses_rtp(sm))
+ soa_sdp_media_upgrade_rtpmaps(ss, sm, rm);
}
return 0;
}
-
/** Upgrade m= lines within session */
+static
int soa_sdp_upgrade(soa_session_t *ss,
su_home_t *home,
sdp_session_t *session,
- sdp_session_t const *caps,
- sdp_session_t const *upgrader)
+ sdp_session_t const *user,
+ sdp_session_t const *remote,
+ int **return_u2s,
+ int **return_s2u)
{
soa_static_session_t *sss = (soa_static_session_t *)ss;
- int Ns, Nc, Nu, size, i, j;
- sdp_media_t *m, **mm, *cm;
- sdp_media_t **s_media, **o_media, **c_media;
- sdp_media_t const **u_media;
+ int Ns, Nu, Nr, size, i, j;
+ sdp_media_t *m, **mm, *um;
+ sdp_media_t **s_media, **o_media, **u_media;
+ sdp_media_t const *rm, **r_media;
+ int *u2s = NULL, *s2u = NULL;
+
+ if (session == NULL || user == NULL)
+ return (errno = EFAULT), -1;
Ns = sdp_media_count(session, sdp_media_any, 0, 0, 0);
- Nc = sdp_media_count(caps, sdp_media_any, 0, 0, 0);
- Nu = sdp_media_count(upgrader, sdp_media_any, 0, 0, 0);
+ Nu = sdp_media_count(user, sdp_media_any, 0, 0, 0);
+ Nr = sdp_media_count(remote, sdp_media_any, 0, 0, 0);
- if (caps == upgrader)
- size = Ns + Nc + 1;
- else if (Ns < Nu)
- size = Nu + 1;
+ if (remote == NULL)
+ size = Ns + Nu + 1;
+ else if (Ns < Nr)
+ size = Nr + 1;
else
size = Ns + 1;
s_media = su_zalloc(home, size * (sizeof *s_media));
o_media = su_zalloc(home, (Ns + 1) * (sizeof *o_media));
- c_media = su_zalloc(home, (Nc + 1) * (sizeof *c_media));
u_media = su_zalloc(home, (Nu + 1) * (sizeof *u_media));
+ r_media = su_zalloc(home, (Nr + 1) * (sizeof *r_media));
- cm = sdp_media_dup_all(home, caps->sdp_media, session);
+ um = sdp_media_dup_all(home, user->sdp_media, session);
- if (!s_media || !c_media || !u_media || !cm)
+ if (!s_media || !u_media || !r_media || !um)
return -1;
+ u2s = su_alloc(home, (Nu + 1) * sizeof(*u2s));
+ s2u = su_alloc(home, size * sizeof(*s2u));
+ if (!u2s || !s2u)
+ return -1;
+
+ for (i = 0; i < Nu; i++)
+ u2s[i] = U2S_NOT_USED;
+ u2s[i] = U2S_SENTINEL;
+
+ for (i = 0; i <= size; i++)
+ s2u[i] = U2S_NOT_USED;
+ s2u[i] = U2S_SENTINEL;
+
for (i = 0, m = session->sdp_media; m && i < Ns; m = m->m_next)
o_media[i++] = m;
assert(i == Ns);
- for (i = 0, m = cm; m && i < Nc; m = m->m_next)
- c_media[i++] = m;
- assert(i == Nc);
- for (i = 0, m = upgrader->sdp_media; m && i < Nu; m = m->m_next)
+ for (i = 0, m = um; m && i < Nu; m = m->m_next)
u_media[i++] = m;
assert(i == Nu);
+ m = remote ? remote->sdp_media : NULL;
+ for (i = 0; m && i < Nr; m = m->m_next)
+ r_media[i++] = m;
+ assert(i == Nr);
+
+ if (sss->sss_ordered_user && sss->sss_u2s) { /* User SDP is ordered */
+ for (j = 0; sss->sss_u2s[j] != U2S_SENTINEL; j++) {
+ i = sss->sss_u2s[j];
+ if (i == U2S_NOT_USED)
+ continue;
+ if (j >= Nu) /* lines removed from user SDP */
+ continue;
+ s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE;
+ u2s[j] = i, s2u[i] = j;
+ }
+ }
- if (caps != upgrader) {
+ if (remote) {
/* Update session according to remote */
- for (i = 0; i < Nu; i++) {
- int common_codecs = 0;
+ for (i = 0; i < Nr; i++) {
+ rm = r_media[i];
+ m = s_media[i];
+
+ if (!m) {
+ int codec_mismatch = 0;
+
+ if (!rm->m_rejected)
+ j = soa_sdp_matching_mindex(ss, u_media, rm, &codec_mismatch);
+ else
+ j = -1;
+
+ if (j == -1) {
+ s_media[i] = soa_sdp_make_rejected_media(home, rm, session, 0);
+ continue;
+ }
+ else if (codec_mismatch && !ss->ss_rtp_mismatch) {
+ m = soa_sdp_make_rejected_media(home, u_media[j], session, 1);
+ soa_sdp_set_rtpmap_pt(s_media[i] = m, rm);
+ continue;
+ }
+
+ s_media[i] = m = u_media[j]; u_media[j] = SDP_MEDIA_NONE;
+ u2s[j] = i, s2u[i] = j;
+ }
- m = soa_sdp_matching(ss, c_media, u_media[i], &common_codecs);
+ if (sdp_media_uses_rtp(rm))
+ soa_sdp_media_upgrade_rtpmaps(ss, m, rm);
+ }
+ }
+ else if (sss->sss_ordered_user) {
+ /* Update session with unused media in u_media */
- if (!m || u_media[i]->m_rejected) {
- m = soa_sdp_make_rejected_media(home, u_media[i], session, 0);
+ if (!sss->sss_reuse_rejected) {
+ /* Mark previously used slots */
+ for (i = 0; i < Ns; i++) {
+ if (s_media[i])
+ continue;
+ s_media[i] = soa_sdp_make_rejected_media(home, o_media[i], session, 0);
}
- else if (sdp_media_uses_rtp(m)) {
- /* Process rtpmaps */
- char const *auxiliary =
- m->m_type == sdp_media_audio ? sss->sss_audio_aux : NULL;
-
- if (!common_codecs && !ss->ss_rtp_mismatch)
- m = soa_sdp_make_rejected_media(home, m, session, 1);
- soa_sdp_set_rtpmap_pt(m, u_media[i]);
-
- if (ss->ss_rtp_sort == SOA_RTP_SORT_REMOTE ||
- (ss->ss_rtp_sort == SOA_RTP_SORT_DEFAULT &&
- u_media[i]->m_mode == sdp_recvonly)) {
- soa_sdp_sort_rtpmap(&m->m_rtpmaps, u_media[i]->m_rtpmaps, auxiliary);
- }
+ }
- if (common_codecs &&
- (ss->ss_rtp_select == SOA_RTP_SELECT_SINGLE ||
- ss->ss_rtp_select == SOA_RTP_SELECT_COMMON)) {
- soa_sdp_select_rtpmap(&m->m_rtpmaps, u_media[i]->m_rtpmaps, auxiliary,
- ss->ss_rtp_select == SOA_RTP_SELECT_SINGLE);
- }
+ for (j = 0; j < Nu; j++) {
+ if (u_media[j] == SDP_MEDIA_NONE)
+ continue;
+
+ for (i = 0; i < size - 1; i++) {
+ if (s_media[i] != NULL)
+ continue;
+ s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE;
+ u2s[j] = i, s2u[i] = j;
}
- s_media[i] = m;
+ assert(i != size);
}
}
else {
- /* Update session according to local */
+ /* Match unused user media by media types with the existing session */
for (i = 0; i < Ns; i++) {
- m = soa_sdp_matching(ss, c_media, o_media[i], NULL);
- if (!m)
- m = soa_sdp_make_rejected_media(home, o_media[i], session, 0);
- s_media[i] = m;
+ if (s_media[i])
+ continue;
+
+ j = soa_sdp_matching_mindex(ss, u_media, o_media[i], NULL);
+ if (j == -1) {
+ s_media[i] = soa_sdp_make_rejected_media(home, o_media[i], session, 0);
+ continue;
+ }
+
+ s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE;
+ u2s[j] = i, s2u[i] = j;
}
+
/* Here we just append new media at the end */
- for (j = 0; c_media[j]; j++)
- s_media[i++] = c_media[j];
+ for (j = 0; j < Nu; j++) {
+ if (u_media[j] != SDP_MEDIA_NONE) {
+ s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE;
+ u2s[j] = i, s2u[i] = j;
+ i++;
+ }
+ }
assert(i <= size);
}
@@ -739,10 +864,46 @@
}
*mm = NULL;
+#ifndef NDEBUG
+ for (j = i; j < size; j++)
+ assert(s2u[j] == U2S_NOT_USED);
+#endif
+
+ s2u[size = i] = U2S_SENTINEL;
+ *return_u2s = u2s;
+ *return_s2u = s2u;
+
+#ifndef NDEBUG /* X check */
+ for (j = 0; j < Nu; j++) {
+ i = u2s[j];
+ assert(i == U2S_NOT_USED || s2u[i] == j);
+ }
+ for (i = 0; i < size; i++) {
+ j = s2u[i];
+ assert(j == U2S_NOT_USED || u2s[j] == i);
+ }
+#endif
+
return 0;
}
+int *u2s_alloc(su_home_t *home, int const *u2s)
+{
+ if (u2s) {
+ int i, *a;
+ for (i = 0; u2s[i] != U2S_SENTINEL; i++)
+ ;
+ a = su_alloc(home, (i + 1) * (sizeof *u2s));
+ if (a)
+ memcpy(a, u2s, (i + 1) * (sizeof *u2s));
+ return a;
+ }
+
+ return NULL;
+}
+
/** Check if @a session contains media that are rejected by @a remote. */
+static
int soa_sdp_reject_is_needed(sdp_session_t const *session,
sdp_session_t const *remote)
{
@@ -774,6 +935,7 @@
}
/** If m= line is rejected by remote mark m= line rejected within session */
+static
int soa_sdp_reject(su_home_t *home,
sdp_session_t *session,
sdp_session_t const *remote)
@@ -813,6 +975,7 @@
}
/** Check if @a session mode should be changed. */
+static
int soa_sdp_mode_set_is_needed(sdp_session_t const *session,
sdp_session_t const *remote,
char const *hold)
@@ -855,6 +1018,7 @@
/** Update mode within session */
+static
int soa_sdp_mode_set(sdp_session_t *session,
sdp_session_t const *remote,
char const *hold)
@@ -908,6 +1072,8 @@
enum offer_answer_action action,
char const *by)
{
+ soa_static_session_t *sss = (soa_static_session_t *)ss;
+
char c_address[64];
sdp_session_t *local = ss->ss_local->ssd_sdp;
sdp_session_t local0[1];
@@ -922,6 +1088,8 @@
sdp_connection_t *c, c0[1] = {{ sizeof(c0) }};
sdp_time_t t[1] = {{ sizeof(t) }};
+ int *u2s = NULL, *s2u = NULL, *tbf;
+
char const *phrase = "Internal Media Error";
su_home_t tmphome[SU_HOME_AUTO_SIZE(8192)];
@@ -991,7 +1159,7 @@
*local0 = *local, local = local0;
SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by,
"upgrade with local description"));
- soa_sdp_upgrade(ss, tmphome, local, user, user);
+ soa_sdp_upgrade(ss, tmphome, local, user, NULL, &u2s, &s2u);
break;
case generate_answer:
/* Upgrade local SDP based on remote SDP */
@@ -1003,7 +1171,7 @@
*local0 = *local, local = local0;
SU_DEBUG_7(("soa_static(%p, %s): %s\n", (void *)ss, by,
"upgrade with remote description"));
- soa_sdp_upgrade(ss, tmphome, local, user, remote);
+ soa_sdp_upgrade(ss, tmphome, local, user, remote, &u2s, &s2u);
}
break;
case process_answer:
@@ -1074,7 +1242,7 @@
*local0 = *local, local = local0;
DUP_LOCAL(local);
}
- soa_sdp_upgrade_rtpmaps(ss, local, remote);
+ soa_sdp_session_upgrade_rtpmaps(ss, local, remote);
}
break;
case generate_offer:
@@ -1125,9 +1293,16 @@
soa_description_free(ss, ss->ss_previous);
+ if (u2s) {
+ u2s = u2s_alloc(ss->ss_home, u2s);
+ s2u = u2s_alloc(ss->ss_home, s2u);
+ if (!u2s || !s2u)
+ goto internal_error;
+ }
+
if (ss->ss_local->ssd_sdp != local &&
sdp_session_cmp(ss->ss_local->ssd_sdp, local)) {
- /* We have modfied local session: update origin-line */
+ /* We have modified local session: update origin-line */
if (local->sdp_origin != o)
*o = *local->sdp_origin, local->sdp_origin = o;
o->o_version++;
@@ -1151,10 +1326,24 @@
/* Update the unparsed and pretty-printed descriptions */
if (soa_description_set(ss, ss->ss_local, local, NULL, 0) < 0) {
+ if (action == generate_offer) {
+ /* Remove 2nd reference to local session state */
+ memset(ss->ss_previous, 0, (sizeof *ss->ss_previous));
+ ss->ss_previous_user_version = 0;
+ ss->ss_previous_remote_version = 0;
+ }
+
+ su_free(ss->ss_home, u2s), su_free(ss->ss_home, s2u);
+
goto internal_error;
}
}
+ if (u2s) {
+ tbf = sss->sss_u2s, sss->sss_u2s = u2s, su_free(ss->ss_home, tbf);
+ tbf = sss->sss_s2u, sss->sss_s2u = s2u, su_free(ss->ss_home, tbf);
+ }
+
/* Update version numbers */
switch (action) {
case generate_offer:
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c Wed Jun 20 13:06:05 2007
@@ -604,3 +604,32 @@
* @sa soa_set_params(), nua_invite(), @ref nua_event_diagram_call_hold
*/
tag_typedef_t soatag_hold = STRTAG_TYPEDEF(hold);
+
+
+/**@def SOATAG_ORDERED_USER(x)
+ *
+ * Take account strict ordering of user SDP m=lines. If user SDP has been
+ * updated, the new media lines replace old ones even if the media type has
+ * been changed. This allows the application to replace @b m=audio with
+ * @b m=image/t38, for instance.
+ *
+ * @par Used with
+ * soa_set_params(), soa_get_params(), soa_get_paramlist() \n
+ *
+ * @par Parameter type
+ * boolean
+ *
+ * @par Values
+ * - false (0) - update session with user SDP based on media type
+ * - true (1) - update session with m= line in user SDP based on their order
+ *
+ * The default value is false and session are updated based on media types.
+ *
+ *
+ * Corresponding tag taking a reference parameter is SOATAG_RTP_SELECT_REF().
+ *
+ * @sa @RFC3264 section 8.3.3, T.38
+ */
+tag_typedef_t soatag_ordered_user = BOOLTAG_TYPEDEF(ordered_user);
+
+tag_typedef_t soatag_reuse_rejected = BOOLTAG_TYPEDEF(reuse_rejected);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h Wed Jun 20 13:06:05 2007
@@ -244,6 +244,20 @@
#define SOATAG_HOLD_REF(x) soatag_hold_ref, tag_str_vr(&(x))
SOFIAPUBVAR tag_typedef_t soatag_hold_ref;
+#define SOATAG_ORDERED_USER(x) soatag_ordered_user, tag_bool_v(x)
+SOFIAPUBVAR tag_typedef_t soatag_ordered_user;
+
+#define SOATAG_ORDERED_USER_REF(x) \
+ soatag_ordered_user_ref, tag_bool_vr(&(x))
+SOFIAPUBVAR tag_typedef_t soatag_ordered_user_ref;
+
+#define SOATAG_REUSE_REJECTED(x) soatag_reuse_rejected, tag_bool_v(x)
+SOFIAPUBVAR tag_typedef_t soatag_reuse_rejected;
+
+#define SOATAG_REUSE_REJECTED_REF(x) \
+ soatag_reuse_rejected_ref, tag_bool_vr(&(x))
+SOFIAPUBVAR tag_typedef_t soatag_reuse_rejected_ref;
+
SOFIA_END_DECLS
#endif /* SOA_TAG_H */
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c Wed Jun 20 13:06:05 2007
@@ -519,7 +519,7 @@
/* 'B' will reject. */
TEST(soa_set_params(a,
SOATAG_HOLD(NULL), /* 'A' will release hold. */
- SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8\r\n"
+ SOATAG_USER_SDP_STR("m=audio 5008 RTP/AVP 0 8\r\ni=x\r\n"
"m=video 5006 RTP/AVP 34\r\n"),
TAG_END()), 2);
@@ -663,7 +663,7 @@
TEST_1(m = b_sdp->sdp_media); TEST_1(m->m_rejected);
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 96);
TEST_S(rm->rm_encoding, "G7231");
- /* Not using payload type 97 from offer */
+ /* Not reusing payload type 97 from offer */
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 98);
TEST_S(rm->rm_encoding, "G729");
TEST_1(!rm->rm_next);
@@ -1141,6 +1141,128 @@
END();
}
+int test_media_replace(struct context *ctx)
+{
+ BEGIN();
+ int n;
+
+ soa_session_t *a, *b;
+
+ char const *offer = NONE, *answer = NONE;
+ isize_t offerlen = (isize_t)-1, answerlen = (isize_t)-1;
+
+ sdp_session_t const *a_sdp, *b_sdp;
+ sdp_media_t const *m;
+
+ char const a_caps[] =
+ "v=0\r\n"
+ "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
+ "c=IN IP4 127.0.0.2\r\n"
+ "m=audio 5008 RTP/AVP 0 8\r\n"
+ ;
+
+ char const b_caps[] =
+ "m=audio 5004 RTP/AVP 0 8\n"
+ "a=rtpmap:96 G7231/8000\n"
+ "a=rtpmap:97 G729/8000\n"
+ "m=image 5556 UDPTL t38\r\n"
+ "a=T38FaxVersion:0\r\n"
+ "a=T38MaxBitRate:9600\r\n"
+ "a=T38FaxFillBitRemoval:0\r\n"
+ "a=T38FaxTranscodingMMR:0\r\n"
+ "a=T38FaxTranscodingJBIG:0\r\n"
+ "a=T38FaxRateManagement:transferredTCF\r\n"
+ "a=T38FaxMaxDatagram:400\r\n";
+
+ TEST_1(a = soa_create("static", ctx->root, ctx));
+ TEST_1(b = soa_create("static", ctx->root, ctx));
+
+ TEST(soa_set_user_sdp(a, 0, a_caps, strlen(a_caps)), 1);
+ TEST(soa_set_user_sdp(b, 0, b_caps, strlen(b_caps)), 1);
+
+ n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(a, NULL, &offer, &offerlen); TEST(n, 1);
+ TEST_1(offer != NULL && offer != NONE);
+ n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1);
+ n = soa_get_local_sdp(b, NULL, &answer, &answerlen); TEST(n, 0);
+ n = soa_generate_answer(b, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1);
+ TEST_1(answer != NULL && answer != NONE);
+ n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1);
+ n = soa_process_answer(a, test_completed); TEST(n, 0);
+
+ TEST_1(soa_is_complete(b));
+ TEST(soa_activate(b, NULL), 0);
+
+ TEST_1(soa_is_complete(a));
+ TEST(soa_activate(a, NULL), 0);
+
+ TEST(soa_is_audio_active(a), SOA_ACTIVE_SENDRECV);
+ TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV);
+
+ /* ---------------------------------------------------------------------- */
+
+ /* Re-O/A: replace media stream */
+
+ /* Accept media without common codecs */
+ TEST_1(soa_set_params(a, SOATAG_RTP_MISMATCH(0),
+ SOATAG_ORDERED_USER(1),
+ SOATAG_USER_SDP_STR(
+ "v=0\r\n"
+ "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
+ "c=IN IP4 127.0.0.2\r\n"
+ "m=image 16384 UDPTL t38\r\n"
+ "a=T38FaxVersion:0\r\n"
+ "a=T38MaxBitRate:9600\r\n"
+ "a=T38FaxFillBitRemoval:0\r\n"
+ "a=T38FaxTranscodingMMR:0\r\n"
+ "a=T38FaxTranscodingJBIG:0\r\n"
+ "a=T38FaxRateManagement:transferredTCF\r\n"
+ "a=T38FaxMaxDatagram:400\r\n"
+ ),
+ TAG_END()));
+
+ n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(a, &a_sdp, &offer, &offerlen); TEST(n, 1);
+ TEST_1(offer != NULL && offer != NONE);
+ n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1);
+ n = soa_generate_answer(b, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1);
+ TEST_1(answer != NULL && answer != NONE);
+ n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1);
+ n = soa_process_answer(a, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(a, &a_sdp, NULL, NULL); TEST(n, 1);
+
+ TEST_1(soa_is_complete(b));
+ TEST(soa_activate(b, NULL), 0);
+
+ TEST_1(soa_is_complete(a));
+ TEST(soa_activate(a, NULL), 0);
+
+ TEST_1(m = a_sdp->sdp_media); TEST_1(!m->m_rejected);
+ TEST(m->m_type, sdp_media_image);
+ TEST(m->m_proto, sdp_proto_udptl);
+ TEST_1(m->m_format);
+ TEST_S(m->m_format->l_text, "t38");
+
+ TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
+ TEST(m->m_type, sdp_media_image);
+ TEST(m->m_proto, sdp_proto_udptl);
+ TEST_1(m->m_format);
+ TEST_S(m->m_format->l_text, "t38");
+
+ TEST(soa_is_audio_active(a), SOA_ACTIVE_DISABLED);
+ TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_DISABLED);
+
+ TEST_VOID(soa_terminate(a, NULL));
+ TEST_VOID(soa_terminate(b, NULL));
+
+ TEST_VOID(soa_destroy(a));
+ TEST_VOID(soa_destroy(b));
+
+ END();
+}
+
int test_asynch_offer_answer(struct context *ctx)
{
@@ -1332,6 +1454,7 @@
retval |= test_params(ctx); SINGLE_FAILURE_CHECK();
retval |= test_static_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_codec_selection(ctx); SINGLE_FAILURE_CHECK();
+ retval |= test_media_replace(ctx); SINGLE_FAILURE_CHECK();
retval |= test_asynch_offer_answer(ctx); SINGLE_FAILURE_CHECK();
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_configure.h.in Wed Jun 20 13:06:05 2007
@@ -88,6 +88,9 @@
/** Define as suitable declarator static inline functions */
#undef su_inline
+/** Define as 1 the tag value casts use inlined functions */
+#undef SU_INLINE_TAG_CAST
+
/** Define this as 1 if we can use tags directly from stack. */
#undef SU_HAVE_TAGSTACK
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h Wed Jun 20 13:06:05 2007
@@ -171,7 +171,7 @@
#define SU_ALIGN(x) \
((sizeof(void *) - ((intptr_t)(x) & (sizeof(void *) - 1))) & (sizeof(void *) - 1))
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t tag_int_v(int v) { return (tag_value_t)v; }
su_inline tag_value_t tag_int_vr(int *vp) { return (tag_value_t)vp; }
su_inline tag_value_t tag_uint_v(unsigned v) { return (tag_value_t)v; }
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h Wed Jun 20 13:06:05 2007
@@ -48,7 +48,7 @@
SOFIAPUBFUN void tl_print(FILE *f, char const *title, tagi_t const lst[]);
-#if SU_HAVE_INLINE
+#if SU_INLINE_TAG_CAST
su_inline tag_value_t tag_socket_v(su_socket_t v) {
return (tag_value_t)v;
}
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su.c Wed Jun 20 13:06:05 2007
@@ -51,14 +51,18 @@
#endif
int su_socket_close_on_exec = 0;
+int su_socket_blocking = 0;
/** Create an endpoint for communication. */
su_socket_t su_socket(int af, int socktype, int proto)
{
su_socket_t s = socket(af, socktype, proto);
#if SU_HAVE_BSDSOCK
- if (s != INVALID_SOCKET && su_socket_close_on_exec) {
- fcntl(s, F_SETFD, FD_CLOEXEC); /* Close on exec */
+ if (s != INVALID_SOCKET) {
+ if (su_socket_close_on_exec)
+ fcntl(s, F_SETFD, FD_CLOEXEC); /* Close on exec */
+ if (!su_socket_blocking) /* All sockets are born blocking */
+ su_setblocking(s, 0);
}
#endif
return s;
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c Wed Jun 20 13:06:05 2007
@@ -540,7 +540,6 @@
init(child, magic) == 0)
return 0;
- deinit(child, magic);
su_msg_destroy(return_clone);
su_root_destroy(child);
return -1;
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c Wed Jun 20 13:06:05 2007
@@ -204,6 +204,8 @@
TEST(getsockname(l, &su.su_sa, &sulen), 0);
TEST(listen(l, 5), 0);
+
+ TEST(su_setblocking(s, 1), 0);
TEST(connect(s, &su.su_sa, sulen), 0);
a = accept(l, &csu.su_sa, &csulen); TEST_1(a != -1);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h Wed Jun 20 13:06:05 2007
@@ -279,6 +279,9 @@
/** Test if transport is connected. @NEW_1_12_5 */
TPORT_DLL int tport_is_connected(tport_t const *self);
+/** Test if transport can be used to send message. @NEW_1_12_7 */
+TPORT_DLL int tport_is_clear_to_send(tport_t const *self);
+
/** Set transport magic. */
TPORT_DLL void tport_set_magic(tport_t *self, tp_magic_t *magic);
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h Wed Jun 20 13:06:05 2007
@@ -403,7 +403,7 @@
* Use with tport_tcreate(), nua_create(), nta_agent_create(),
* nth_engine_create(), or initial nth_site_create().
*
- * @sa #TPORT_DUMP, TPTAG_DUMP()
+ * @sa #TPORT_LOG environment variable, TPTAG_DUMP()
*
* @NEW_1_12_5
*/
@@ -418,7 +418,7 @@
* Use with tport_tcreate(), nta_agent_create(), nua_create(),
* nth_engine_create(), or initial nth_site_create().
*
- * @sa #TPORT_DUMP, TPTAG_LOG().
+ * @sa #TPORT_DUMP environment variable, TPTAG_LOG().
*
* @NEW_1_12_5
*/
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Wed Jun 20 13:06:05 2007
@@ -166,7 +166,7 @@
self->tp_pri->pri_primary != self;
}
-/** Test if transport has been registered */
+/** Test if transport has been registered to su_root_t */
int tport_is_registered(tport_t const *self)
{
return self->tp_index != 0;
@@ -291,6 +291,19 @@
return self->tp_is_connected;
}
+/** Test if transport can be used to send message. @NEW_1_12_7 */
+int tport_is_clear_to_send(tport_t const *self)
+{
+ return
+ tport_is_master(self) ||
+ tport_is_primary(self) ||
+ (tport_is_secondary(self) &&
+ tport_is_registered(self) &&
+ self->tp_reusable &&
+ !self->tp_closed &&
+ !self->tp_send_close);
+}
+
/** MTU for transport */
su_inline unsigned tport_mtu(tport_t const *self)
{
@@ -1164,7 +1177,7 @@
if (self == NULL)
return su_seterrno(EINVAL);
- memcpy(tpp, tpp0 = self->tp_params, sizeof *tpp);
+ memcpy(tpp, tpp0 = self->tp_params, sizeof tpp);
mtu = tpp->tpp_mtu;
connect = tpp->tpp_conn_orient;
@@ -1220,9 +1233,10 @@
if (tport_is_secondary(self) &&
self->tp_params == self->tp_pri->pri_primary->tp_params) {
tpp0 = su_zalloc(self->tp_home, sizeof *tpp0); if (!tpp0) return -1;
+ self->tp_params = tpp0;
}
- memcpy(tpp0, tpp, sizeof *tpp);
+ memcpy(tpp0, tpp, sizeof tpp);
return n;
}
@@ -1963,7 +1977,7 @@
*/
void tport_close(tport_t *self)
{
- SU_DEBUG_5(("%s(%p): " TPN_FORMAT "\n", "tport_close", (void *)self,
+ SU_DEBUG_5(("%s(%p): " TPN_FORMAT "\n", "tport_close", (void *)self,
TPN_ARGS(self->tp_name)));
self->tp_closed = 1;
@@ -2360,6 +2374,7 @@
else if (errcode > 0)
errmsg = su_strerror(errcode);
else
+ /* Should be something like ENOTCONN */
errcode = 0, errmsg = "stream closed";
if (addr && addr->su_family == AF_UNSPEC)
@@ -2369,12 +2384,12 @@
if (errcode > 0 && tport_has_connection(self))
self->tp_reusable = 0;
- if (addr == NULL && tport_is_connection_oriented(self))
- addr = self->tp_addr;
-
/* Report error */
if (addr && tport_pending_error(self, addr, errcode))
;
+ else if (tport_is_secondary(self) &&
+ tport_pending_error(self, NULL, errcode) > 0)
+ ;
else if (self->tp_master->mr_tpac->tpac_error) {
char *dstname = NULL;
char hp[TPORT_HOSTPORTSIZE];
@@ -3070,30 +3085,24 @@
/* Select a primary protocol, make a fresh connection */
self = primary->pri_primary;
}
+ else if (tport_is_secondary(self) && tport_is_clear_to_send(self)) {
+ self = self;
+ }
+ /*
+ * Try to find an already open connection to the destination,
+ * or get a primary protocol
+ */
else {
- if (tport_is_secondary(self) &&
- tport_is_registered(self) &&
- self->tp_reusable &&
- !self->tp_closed &&
- !self->tp_send_close) {
- self = self;
- }
- /*
- * Try to find an already open connection to the destination,
- * or get a primary protocol
- */
- else {
- /* If primary, resolve the destination address, store it in the msg */
- if (tport_resolve(primary->pri_primary, msg, tpn) < 0) {
- return NULL;
- }
- resolved = 1;
-
- self = tport_by_addrinfo(primary, msg_addrinfo(msg), tpn);
-
- if (!self)
- self = primary->pri_primary;
+ /* If primary, resolve the destination address, store it in the msg */
+ if (tport_resolve(primary->pri_primary, msg, tpn) < 0) {
+ return NULL;
}
+ resolved = 1;
+
+ self = tport_by_addrinfo(primary, msg_addrinfo(msg), tpn);
+
+ if (!self)
+ self = primary->pri_primary;
}
if (tport_is_primary(self)) {
@@ -3878,9 +3887,12 @@
{
tport_pending_t *pending;
- if (self == NULL || msg == NULL || callback == NULL || client == NULL)
+ if (self == NULL || callback == NULL || client == NULL)
return -1;
-
+
+ if (msg == NULL && tport_is_primary(self))
+ return -1;
+
SU_DEBUG_7(("tport_pend(%p): pending %p for %s/%s:%s (already %u)\n",
(void *)self, (void *)msg,
self->tp_protoname, self->tp_host, self->tp_port,
@@ -3930,7 +3942,7 @@
{
tport_pending_t *pending;
- if (self == NULL || msg == NULL || pendd <= 0 || pendd > (int)self->tp_plen)
+ if (self == NULL || pendd <= 0 || pendd > (int)self->tp_plen)
return su_seterrno(EINVAL), -1;
pending = self->tp_pending + (pendd - 1);
@@ -3968,7 +3980,7 @@
msg_t *msg;
su_addrinfo_t const *ai;
- assert(self); assert(dst);
+ assert(self);
callbacks = 0;
reported = ++self->tp_reported;
@@ -3979,22 +3991,25 @@
for (i = 0; i < self->tp_plen; i++) {
pending = self->tp_pending + i;
- if (!pending->p_callback || !pending->p_msg)
+ if (!pending->p_callback)
continue;
if (pending->p_reported == reported)
continue;
msg = pending->p_msg;
- ai = msg_addrinfo(msg);
- if (su_cmp_sockaddr(dst, (su_sockaddr_t *)ai->ai_addr) != 0)
- continue;
+ if (dst && msg) {
+ ai = msg_addrinfo(msg);
- pending->p_reported = reported;
+ if (su_cmp_sockaddr(dst, (su_sockaddr_t *)ai->ai_addr) != 0)
+ continue;
+ }
msg_set_errno(msg, error);
+ pending->p_reported = reported;
+
pending->p_callback(self->TP_STACK, pending->p_client, self, msg, error);
callbacks++;
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c Wed Jun 20 13:06:05 2007
@@ -252,9 +252,9 @@
tport_dump_iovec(self, msg, n, iovec, veclen, "recv", "from");
/* Mark buffer as used */
- msg_recv_commit(msg, n, 0);
+ msg_recv_commit(msg, n, n == 0);
- return 1;
+ return n != 0;
}
ssize_t tport_send_stream(tport_t const *self, msg_t *msg,
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c Wed Jun 20 13:06:05 2007
@@ -214,6 +214,15 @@
TEST_S(u->url_fragment, "foo");
}
+ {
+ url_t u[1];
+ char b2[6] = "";
+
+ memset(u, 0xff, sizeof u);
+ TEST(url_d(u, b2), 0);
+ TEST(u->url_type, url_unknown);
+ }
+
su_home_deinit(home);
END();
Modified: freeswitch/branches/greenlizard/libs/sofia-sip/m4/sac-su2.m4
==============================================================================
--- freeswitch/branches/greenlizard/libs/sofia-sip/m4/sac-su2.m4 (original)
+++ freeswitch/branches/greenlizard/libs/sofia-sip/m4/sac-su2.m4 Wed Jun 20 13:06:05 2007
@@ -2,11 +2,11 @@
dnl su module
dnl ======================================================================
+AC_DEFUN([SAC_SU])
+
AC_DEFUN([SAC_SOFIA_SU], [
# Beginning of SAC_SOFIA_SU
-AC_REQUIRE([SAC_WITH_RT])
-
# ======================================================================
# Check for features used by su
@@ -66,6 +66,16 @@
AC_REQUIRE([AC_C_INLINE])
+AC_ARG_ENABLE(tag-cast,
+[ --disable-tag-cast cast tag values with inlined functions [[enabled]]],
+ , enable_tag_cast=yes)
+
+if test "$enable_tag_cast" = "yes"; then
+ tag_cast=1
+else
+ tag_cast=0
+fi
+
case "$ac_cv_c_inline" in
yes) SAC_SU_DEFINE(su_inline, static inline, [
Define to declarator for static inline functions.
@@ -76,15 +86,20 @@
SAC_SU_DEFINE(SU_HAVE_INLINE, 1, [
Define to 1 if you have inline functions.
])dnl
+ SAC_SU_DEFINE_UNQUOTED(SU_INLINE_TAG_CAST, $tag_cast, [
+ Define to 1 if you use inline function to cast tag values.
+ ])dnl
;;
no | "" )
SAC_SU_DEFINE(su_inline, static)dnl
SAC_SU_DEFINE(SU_INLINE, /*inline*/)dnl
SAC_SU_DEFINE(SU_HAVE_INLINE, 0)dnl
+ SAC_SU_DEFINE(SU_INLINE_TAG_CAST, 0)dnl
;;
*) SAC_SU_DEFINE_UNQUOTED(su_inline, static $ac_cv_c_inline)dnl
SAC_SU_DEFINE_UNQUOTED(SU_INLINE, $ac_cv_c_inline)dnl
SAC_SU_DEFINE(SU_HAVE_INLINE, 1)dnl
+ SAC_SU_DEFINE_UNQUOTED(SU_INLINE_TAG_CAST, $tag_cast)dnl
;;
esac
@@ -368,7 +383,15 @@
# Checks for libraries
# ===========================================================================
-SAC_CHECK_SU_LIBS
+AC_CHECK_LIB(pthread, pthread_create)
+AC_CHECK_LIB(socket, socketpair,,,-lnsl)
+
+AC_ARG_WITH(rt,
+[ --with-rt use POSIX realtime library [[used by default]]])
+if test "${with_rt}" != no; then
+ AC_SEARCH_LIBS(clock_gettime, rt)
+ AC_CHECK_FUNCS([clock_gettime clock_getcpuclockid])
+fi
# No GLib path explicitly defined, use pkg-config
AC_ARG_WITH(glib,
@@ -470,11 +493,6 @@
[Define to 1 if you have if_nameindex().])
fi
-AC_REQUIRE([SAC_WITH_RT])
-if test "${with_rt}" != no; then
- AC_CHECK_FUNCS([clock_gettime clock_getcpuclockid])
-fi
-
SAC_REPLACE_FUNCS([memmem memccpy memspn memcspn strcasestr strtoull \
inet_ntop inet_pton poll])
Modified: freeswitch/branches/greenlizard/src/include/switch.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch.h Wed Jun 20 13:06:05 2007
@@ -99,7 +99,6 @@
#include <switch_resample.h>
#include <switch_ivr.h>
#include <switch_rtp.h>
-#include <switch_stun.h>
#include <switch_log.h>
#include <switch_xml.h>
#include <switch_core_event_hook.h>
Modified: freeswitch/branches/greenlizard/src/include/switch_event.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_event.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_event.h Wed Jun 20 13:06:05 2007
@@ -208,7 +208,7 @@
\param user_data optional user specific data to pass whenever the callback is invoked
\return SWITCH_STATUS_SUCCESS if the event was binded
*/
-SWITCH_DECLARE(switch_status_t) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback,
+SWITCH_DECLARE(switch_status_t) switch_event_bind(const char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback,
void *user_data);
/*!
Modified: freeswitch/branches/greenlizard/src/include/switch_loadable_module.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_loadable_module.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_loadable_module.h Wed Jun 20 13:06:05 2007
@@ -257,18 +257,60 @@
\return SWITCH_STATUS_SUCCESS on a successful load
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename);
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_reload(void);
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_pause(void);
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_resume(void);
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_status(void);
SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void);
-
/*!
\brief Shutdown a module
\return SWITCH_STATUS_SUCCESS on a successful shutdown
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void);
+
+#define SWITCH_ADD_API(api_int, int_name, descript, funcptr, syntax_string) \
+ for (;;) { \
+ api_int = (switch_api_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_API_INTERFACE); \
+ api_int->interface_name = int_name; \
+ api_int->desc = descript; \
+ api_int->function = funcptr; \
+ api_int->syntax = syntax_string; \
+ break; \
+ }
+
+#define SWITCH_ADD_CHAT(chat_int, int_name, funcptr) \
+ for (;;) { \
+ chat_int = (switch_chat_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_CHAT_INTERFACE); \
+ chat_int->chat_send = funcptr; \
+ chat_int->interface_name = int_name; \
+ break; \
+ }
+
+#define SWITCH_ADD_APP(app_int, int_name, short_descript, long_descript, funcptr, syntax_string, app_flags) \
+ for (;;) { \
+ app_int = (switch_application_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_APPLICATION_INTERFACE); \
+ app_int->interface_name = int_name; \
+ app_int->application_function = funcptr; \
+ app_int->short_desc = short_descript; \
+ app_int->long_desc = long_descript; \
+ app_int->syntax = syntax_string; \
+ app_interface->flags = app_flags; \
+ break; \
+ }
+
+#define SWITCH_ADD_DIALPLAN(dp_int, int_name, funcptr) \
+ for (;;) { \
+ dp_int = (switch_dialplan_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_DIALPLAN_INTERFACE); \
+ dp_int->hunt_function = funcptr; \
+ dp_int->interface_name = int_name; \
+ break; \
+ }
+
+#define SWITCH_ADD_CODEC(codec_int, int_name, implementation) \
+ for (;;) { \
+ codec_int = (switch_codec_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_CODEC_INTERFACE); \
+ codec_int->implementations = implementation; \
+ codec_int->interface_name = int_name; \
+ break; \
+ }
+
///\}
SWITCH_END_EXTERN_C
Modified: freeswitch/branches/greenlizard/src/include/switch_log.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_log.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_log.h Wed Jun 20 13:06:05 2007
@@ -61,7 +61,7 @@
switch_time_t timestamp;
/*! A pointer to where the actual content of the message starts (skipping past the preformatted portion) */
char *content;
-
+ const char *userdata;
/* To maintain abi, only add new elements to the end of this struct and do not delete any elements */
} switch_log_node_t;
@@ -95,7 +95,7 @@
\note there are channel macros to supply the first 4 parameters
*/
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line,
- switch_log_level_t level, const char *fmt, ...) PRINTF_FUNCTION(6, 7);
+ const char *userdata, switch_log_level_t level, const char *fmt, ...) PRINTF_FUNCTION(7, 8);
/*!
\brief Shut down the logging engine
Modified: freeswitch/branches/greenlizard/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_types.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_types.h Wed Jun 20 13:06:05 2007
@@ -511,9 +511,9 @@
SCSMF_DYNAMIC = (1 << 0)
} switch_core_session_message_flag_t;
-#define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__
-#define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__
-#define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__
+#define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
+#define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
+#define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
/*!
\enum switch_channel_state_t
@@ -1034,9 +1034,14 @@
typedef struct switch_core_port_allocator switch_core_port_allocator_t;
typedef struct switch_media_bug switch_media_bug_t;
typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t);
+
typedef void (*switch_application_function_t) (switch_core_session_t *, char *);
+#define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, char *data)
+
typedef void (*switch_event_callback_t) (switch_event_t *);
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);
+#define SWITCH_STANDARD_DIALPLAN(name) static switch_caller_extension_t * name (switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+
typedef struct switch_scheduler_task switch_scheduler_task_t;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c Wed Jun 20 13:06:05 2007
@@ -39,25 +39,6 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load);
SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, NULL, NULL);
-static switch_api_interface_t ctl_api_interface;
-static switch_api_interface_t uuid_bridge_api_interface;
-static switch_api_interface_t session_record_api_interface;
-static switch_api_interface_t status_api_interface;
-static switch_api_interface_t show_api_interface;
-static switch_api_interface_t pause_api_interface;
-static switch_api_interface_t transfer_api_interface;
-static switch_api_interface_t load_api_interface;
-static switch_api_interface_t unload_api_interface;
-static switch_api_interface_t reload_api_interface;
-static switch_api_interface_t kill_api_interface;
-static switch_api_interface_t originate_api_interface;
-static switch_api_interface_t media_api_interface;
-static switch_api_interface_t hold_api_interface;
-static switch_api_interface_t broadcast_api_interface;
-static switch_api_interface_t sched_broadcast_api_interface;
-static switch_api_interface_t sched_transfer_api_interface;
-static switch_api_interface_t sched_hangup_api_interface;
-
SWITCH_STANDARD_API(status_function)
{
uint8_t html = 0;
@@ -108,6 +89,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define CTL_SYNTAX "[hupall|pause|resume|shutdown]"
SWITCH_STANDARD_API(ctl_function)
{
int argc;
@@ -115,7 +97,7 @@
uint32_t arg = 0;
if (switch_strlen_zero(cmd)) {
- stream->write_function(stream, "USAGE: %s\n", ctl_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", CTL_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -150,6 +132,7 @@
}
+#define LOAD_SYNTAX "<mod_name>"
SWITCH_STANDARD_API(load_function)
{
const char *err;
@@ -159,7 +142,7 @@
}
if (switch_strlen_zero(cmd)) {
- stream->write_function(stream, "USAGE: %s\n", load_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", LOAD_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -181,7 +164,7 @@
}
if (switch_strlen_zero(cmd)) {
- stream->write_function(stream, "USAGE: %s\n", unload_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", LOAD_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -212,6 +195,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define KILL_SYNTAX "<uuid>"
SWITCH_STANDARD_API(kill_function)
{
switch_core_session_t *ksession = NULL;
@@ -221,7 +205,7 @@
}
if (!cmd) {
- stream->write_function(stream, "USAGE: %s\n", kill_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", KILL_SYNTAX);
} else if ((ksession = switch_core_session_locate(cmd))) {
switch_channel_t *channel = switch_core_session_get_channel(ksession);
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
@@ -234,6 +218,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define TRANSFER_SYNTAX "<uuid> <dest-exten> [<dialplan>] [<context>]"
SWITCH_STANDARD_API(transfer_function)
{
switch_core_session_t *tsession = NULL;
@@ -269,13 +254,14 @@
}
}
- stream->write_function(stream, "USAGE: %s\n", transfer_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", TRANSFER_SYNTAX);
done:
switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS;
}
+#define TONE_DETECT_SYNTAX "<uuid> <key> <tone_spec> [<flags> <timeout> <app> <args>]"
SWITCH_STANDARD_API(tone_detect_session_function)
{
char *argv[6] = { 0 };
@@ -325,6 +311,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define SCHED_TRANSFER_SYNTAX "[+]<time> <uuid> <extension> [<dialplan>] [<context>]"
SWITCH_STANDARD_API(sched_transfer_function)
{
switch_core_session_t *tsession = NULL;
@@ -340,7 +327,7 @@
}
if (switch_strlen_zero(cmd) || argc < 2 || argc > 5) {
- stream->write_function(stream, "USAGE: %s\n", sched_transfer_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", SCHED_TRANSFER_SYNTAX);
} else {
char *uuid = argv[1];
char *dest = argv[2];
@@ -367,6 +354,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define SCHED_HANGUP_SYNTAX "[+]<time> <uuid> [<cause>]"
SWITCH_STANDARD_API(sched_hangup_function)
{
switch_core_session_t *hsession = NULL;
@@ -382,7 +370,7 @@
}
if (switch_strlen_zero(cmd) || argc < 1) {
- stream->write_function(stream, "USAGE: %s\n", sched_hangup_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", SCHED_HANGUP_SYNTAX);
} else {
char *uuid = argv[1];
char *cause_str = argv[2];
@@ -412,7 +400,7 @@
return SWITCH_STATUS_SUCCESS;
}
-
+#define MEDIA_SYNTAX "<uuid>"
SWITCH_STANDARD_API(uuid_media_function)
{
char *mycmd = NULL, *argv[4] = { 0 };
@@ -428,7 +416,7 @@
}
if (switch_strlen_zero(cmd) || argc < 1) {
- stream->write_function(stream, "USAGE: %s\n", media_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", MEDIA_SYNTAX);
} else {
if (!strcmp(argv[0], "off")) {
status = switch_ivr_nomedia(argv[1], SMF_REBRIDGE);
@@ -447,7 +435,7 @@
return SWITCH_STATUS_SUCCESS;
}
-
+#define BROADCAST_SYNTAX "<uuid> <path> [aleg|bleg|both]"
SWITCH_STANDARD_API(uuid_broadcast_function)
{
char *mycmd = NULL, *argv[4] = { 0 };
@@ -463,7 +451,7 @@
}
if (switch_strlen_zero(cmd) || argc < 2) {
- stream->write_function(stream, "USAGE: %s\n", broadcast_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", BROADCAST_SYNTAX);
} else {
switch_media_flag_t flags = SMF_NONE;
@@ -487,7 +475,7 @@
return SWITCH_STATUS_SUCCESS;
}
-
+#define SCHED_BROADCAST_SYNTAX "[+]<time> <uuid> <path> [aleg|bleg|both]"
SWITCH_STANDARD_API(sched_broadcast_function)
{
char *mycmd = NULL, *argv[4] = { 0 };
@@ -503,7 +491,7 @@
}
if (switch_strlen_zero(cmd) || argc < 3) {
- stream->write_function(stream, "USAGE: %s\n", sched_broadcast_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", SCHED_BROADCAST_SYNTAX);
} else {
switch_media_flag_t flags = SMF_NONE;
time_t when;
@@ -534,6 +522,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define HOLD_SYNTAX "<uuid>"
SWITCH_STANDARD_API(uuid_hold_function)
{
char *mycmd = NULL, *argv[4] = { 0 };
@@ -549,7 +538,7 @@
}
if (switch_strlen_zero(cmd) || argc < 1) {
- stream->write_function(stream, "USAGE: %s\n", hold_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", HOLD_SYNTAX);
} else {
if (!strcmp(argv[0], "off")) {
status = switch_ivr_unhold_uuid(argv[1]);
@@ -568,6 +557,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define UUID_SYNTAX "<uuid> <other_uuid>"
SWITCH_STANDARD_API(uuid_bridge_function)
{
char *mycmd = NULL, *argv[4] = { 0 };
@@ -582,7 +572,7 @@
}
if (switch_strlen_zero(cmd) || argc != 2) {
- stream->write_function(stream, "USAGE: %s\n", uuid_bridge_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", UUID_SYNTAX);
} else {
if (switch_ivr_uuid_bridge(argv[0], argv[1]) != SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "Invalid uuid\n");
@@ -593,6 +583,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define SESS_REC_SYNTAX "<uuid> [start|stop] <path> [<limit>]"
SWITCH_STANDARD_API(session_record_function)
{
switch_core_session_t *rsession = NULL;
@@ -643,7 +634,7 @@
usage:
- stream->write_function(stream, "USAGE: %s\n", session_record_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", SESS_REC_SYNTAX);
switch_safe_free(mycmd);
@@ -724,6 +715,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define PAUSE_SYNTAX "<uuid> <on|off>"
SWITCH_STANDARD_API(pause_function)
{
switch_core_session_t *psession = NULL;
@@ -739,7 +731,7 @@
}
if (switch_strlen_zero(cmd) || argc < 2) {
- stream->write_function(stream, "USAGE: %s\n", pause_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", PAUSE_SYNTAX);
} else {
char *uuid = argv[0];
char *dest = argv[1];
@@ -764,6 +756,7 @@
return SWITCH_STATUS_SUCCESS;
}
+#define ORIGINATE_SYNTAX "<call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]"
SWITCH_STANDARD_API(originate_function)
{
switch_channel_t *caller_channel;
@@ -785,7 +778,7 @@
}
if (switch_strlen_zero(cmd) || argc < 2 || argc > 7) {
- stream->write_function(stream, "USAGE: %s\n", originate_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", ORIGINATE_SYNTAX);
switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS;
}
@@ -1097,6 +1090,7 @@
return 0;
}
+#define SHOW_SYNTAX "codec|application|api|dialplan|file|timer|calls|channels"
SWITCH_STANDARD_API(show_function)
{
char sql[1024];
@@ -1129,7 +1123,7 @@
// If you changes the field qty or order of any of these select
// statmements, you must also change show_callback and friends to match!
if (!command) {
- stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", SHOW_SYNTAX);
return SWITCH_STATUS_SUCCESS;
} else if (!strcmp(command, "codec") || !strcmp(command, "dialplan") || !strcmp(command, "file") || !strcmp(command, "timer")) {
sprintf(sql, "select type, name from interfaces where type = '%s'", command);
@@ -1153,7 +1147,7 @@
snprintf(sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api'");
}
} else {
- stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", SHOW_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -1247,224 +1241,36 @@
return SWITCH_STATUS_SUCCESS;
}
-
-static switch_api_interface_t xml_wrap_api_interface = {
- /*.interface_name */ "xml_wrap",
- /*.desc */ "Wrap another api command in xml",
- /*.function */ xml_wrap_api_function,
- /*.syntax */ "<command> <args>",
- /*.next */ NULL
-};
-
-static switch_api_interface_t sched_del_api_interface = {
- /*.interface_name */ "sched_del",
- /*.desc */ "Delete a Scheduled task",
- /*.function */ sched_del_function,
- /*.syntax */ "<task_id>|<group_id>",
- /*.next */ &xml_wrap_api_interface
-};
-
-static switch_api_interface_t sched_api_api_interface = {
- /*.interface_name */ "sched_api",
- /*.desc */ "Schedule an api command",
- /*.function */ sched_api_function,
- /*.syntax */ "[+]<time> <group_name> <command_string>",
- /*.next */ &sched_del_api_interface
-};
-
-static switch_api_interface_t sched_transfer_api_interface = {
- /*.interface_name */ "sched_transfer",
- /*.desc */ "Schedule a broadcast event to a running call",
- /*.function */ sched_transfer_function,
- /*.syntax */ "[+]<time> <uuid> <extension> [<dialplan>] [<context>]",
- /*.next */ &sched_api_api_interface
-};
-
-static switch_api_interface_t sched_broadcast_api_interface = {
- /*.interface_name */ "sched_broadcast",
- /*.desc */ "Schedule a broadcast event to a running call",
- /*.function */ sched_broadcast_function,
- /*.syntax */ "[+]<time> <uuid> <path> [aleg|bleg|both]",
- /*.next */ &sched_transfer_api_interface
-};
-
-static switch_api_interface_t sched_hangup_api_interface = {
- /*.interface_name */ "sched_hangup",
- /*.desc */ "Schedule a running call to hangup",
- /*.function */ sched_hangup_function,
- /*.syntax */ "[+]<time> <uuid> [<cause>]",
- /*.next */ &sched_broadcast_api_interface
-};
-
-static switch_api_interface_t version_api_interface = {
- /*.interface_name */ "version",
- /*.desc */ "Show version of the switch",
- /*.function */ version_function,
- /*.syntax */ "",
- /*.next */ &sched_hangup_api_interface
-};
-
-static switch_api_interface_t help_api_interface = {
- /*.interface_name */ "help",
- /*.desc */ "Show help for all the api commands",
- /*.function */ help_function,
- /*.syntax */ "",
- /*.next */ &version_api_interface,
-};
-
-static switch_api_interface_t ctl_api_interface = {
- /*.interface_name */ "fsctl",
- /*.desc */ "control messages",
- /*.function */ ctl_function,
- /*.syntax */ "[hupall|pause|resume|shutdown]",
- /*.next */ &help_api_interface
-};
-
-static switch_api_interface_t media_api_interface = {
- /*.interface_name */ "media",
- /*.desc */ "media",
- /*.function */ uuid_media_function,
- /*.syntax */ "<uuid>",
- /*.next */ &ctl_api_interface
-};
-
-static switch_api_interface_t hold_api_interface = {
- /*.interface_name */ "hold",
- /*.desc */ "hold",
- /*.function */ uuid_hold_function,
- /*.syntax */ "<uuid>",
- /*.next */ &media_api_interface
-};
-
-static switch_api_interface_t broadcast_api_interface = {
- /*.interface_name */ "broadcast",
- /*.desc */ "broadcast",
- /*.function */ uuid_broadcast_function,
- /*.syntax */ "<uuid> <path> [aleg|bleg|both]",
- /*.next */ &hold_api_interface
-};
-
-static switch_api_interface_t session_record_api_interface = {
- /*.interface_name */ "session_record",
- /*.desc */ "session record",
- /*.function */ session_record_function,
- /*.syntax */ "<uuid> [start|stop] <path> [<limit>]",
- /*.next */ &broadcast_api_interface
-};
-
-static switch_api_interface_t session_displace_api_interface = {
- /*.interface_name */ "session_displace",
- /*.desc */ "session displace",
- /*.function */ session_displace_function,
- /*.syntax */ "<uuid> [start|stop] <path> [<limit>] [mux]",
- /*.next */ &broadcast_api_interface
-};
-
-static switch_api_interface_t uuid_bridge_api_interface = {
- /*.interface_name */ "uuid_bridge",
- /*.desc */ "uuid_bridge",
- /*.function */ uuid_bridge_function,
- /*.syntax */ "<uuid> <other_uuid>",
- /*.next */ &session_displace_api_interface
-};
-
-static switch_api_interface_t status_api_interface = {
- /*.interface_name */ "status",
- /*.desc */ "status",
- /*.function */ status_function,
- /*.syntax */ "",
- /*.next */ &uuid_bridge_api_interface
-};
-
-static switch_api_interface_t show_api_interface = {
- /*.interface_name */ "show",
- /*.desc */ "Show",
- /*.function */ show_function,
- /*.syntax */ "codec|application|api|dialplan|file|timer|calls|channels",
- /*.next */ &status_api_interface
-};
-
-static switch_api_interface_t pause_api_interface = {
- /*.interface_name */ "pause",
- /*.desc */ "Pause",
- /*.function */ pause_function,
- /*.syntax */ "<uuid> <on|off>",
- /*.next */ &show_api_interface
-};
-
-static switch_api_interface_t transfer_api_interface = {
- /*.interface_name */ "transfer",
- /*.desc */ "Transfer",
- /*.function */ transfer_function,
- /*.syntax */ "<uuid> <dest-exten> [<dialplan>] [<context>]",
- /*.next */ &pause_api_interface
-};
-
-static switch_api_interface_t load_api_interface = {
- /*.interface_name */ "load",
- /*.desc */ "Load Module",
- /*.function */ load_function,
- /*.syntax */ "<mod_name>",
- /*.next */ &transfer_api_interface
-};
-
-static switch_api_interface_t unload_api_interface = {
- /*.interface_name */ "unload",
- /*.desc */ "Unoad Module",
- /*.function */ unload_function,
- /*.syntax */ "<mod_name>",
- /*.next */ &load_api_interface
-};
-
-static switch_api_interface_t reload_api_interface = {
- /*.interface_name */ "reloadxml",
- /*.desc */ "Reload XML",
- /*.function */ reload_function,
- /*.syntax */ "",
- /*.next */ &unload_api_interface,
-
-};
-
-static switch_api_interface_t kill_api_interface = {
- /*.interface_name */ "killchan",
- /*.desc */ "Kill Channel",
- /*.function */ kill_function,
- /*.syntax */ "<uuid>",
- /*.next */ &reload_api_interface
-};
-
-static switch_api_interface_t tone_detect_session_interface = {
- /*.interface_name */ "tone_detect",
- /*.desc */ "Start Tone Detection on a channel",
- /*.function */ tone_detect_session_function,
- /*.syntax */
- "<uuid> <key> <tone_spec> [<flags> <timeout> <app> <args>]",
- /*.next */ &kill_api_interface
-};
-
-static switch_api_interface_t originate_api_interface = {
- /*.interface_name */ "originate",
- /*.desc */ "Originate a Call",
- /*.function */ originate_function,
- /*.syntax */
- "<call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]",
- /*.next */ &tone_detect_session_interface
-};
-
-static switch_loadable_module_interface_t commands_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ &originate_api_interface
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
{
- /* connect my internal structure to the blank pointer passed to me */
- *module_interface = &commands_module_interface;
+ switch_api_interface_t *commands_api_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+ SWITCH_ADD_API(commands_api_interface, "originate", "Originate a Call", originate_function, ORIGINATE_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "tone_detect", "Start Tone Detection on a channel", tone_detect_session_function, TONE_DETECT_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "killchan", "Kill Channel", kill_function, KILL_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "reloadxml", "Reload XML", reload_function, "");
+ SWITCH_ADD_API(commands_api_interface, "unload", "Unload Module", unload_function, LOAD_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "load", "Load Module", load_function, LOAD_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "transfer", "Transfer Module", transfer_function, TRANSFER_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "pause", "Pause", pause_function, PAUSE_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "show", "Show", show_function, SHOW_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "status", "status", status_function, "");
+ SWITCH_ADD_API(commands_api_interface, "uuid_bridge", "uuid_bridge", uuid_bridge_function, UUID_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "session_displace", "session displace", session_displace_function, "<uuid> [start|stop] <path> [<limit>] [mux]");
+ SWITCH_ADD_API(commands_api_interface, "session_record", "session record", session_record_function, SESS_REC_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "broadcast", "broadcast", uuid_broadcast_function, BROADCAST_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "hold", "hold", uuid_hold_function, HOLD_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "media", "media", uuid_media_function, MEDIA_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "fsctl", "control messages", ctl_function, CTL_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "help", "Show help for all the api commands", help_function, "");
+ SWITCH_ADD_API(commands_api_interface, "version", "Show version of the switch", version_function, "");
+ SWITCH_ADD_API(commands_api_interface, "sched_hangup", "Schedule a running call to hangup", sched_hangup_function, SCHED_HANGUP_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "sched_broadcast", "Schedule a broadcast event to a running call", sched_broadcast_function, SCHED_BROADCAST_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "sched_transfer", "Schedule a broadcast event to a running call", sched_transfer_function, SCHED_TRANSFER_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "sched_api", "Schedule an api command", sched_api_function, "[+]<time> <group_name> <command_string>");
+ SWITCH_ADD_API(commands_api_interface, "sched_del", "Delete a Scheduled task", sched_del_function, "<task_id>|<group_id>");
+ SWITCH_ADD_API(commands_api_interface, "xml_wrap", "Wrap another api command in xml", xml_wrap_api_function, "<command> <args>");
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_NOUNLOAD;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c Wed Jun 20 13:06:05 2007
@@ -39,7 +39,7 @@
static const char global_app_name[] = "conference";
static char *global_cf_name = "conference.conf";
-static switch_api_interface_t conf_api_interface;
+static char *api_syntax;
/* Size to allocate for audio buffers */
#define CONF_BUFFER_SIZE 1024 * 128
@@ -307,7 +307,7 @@
static switch_status_t conference_outcall_bg(conference_obj_t * conference,
char *conference_name,
switch_core_session_t *session, char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num);
-static void conference_function(switch_core_session_t *session, char *data);
+SWITCH_STANDARD_APP(conference_function);
static void launch_conference_thread(conference_obj_t * conference);
static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread, void *obj);
static switch_status_t conference_local_play_file(conference_obj_t * conference,
@@ -3523,7 +3523,7 @@
if (strcasecmp(argv[0], "list") == 0) {
conf_api_sub_list(NULL, stream, argc, argv);
} else if (strcasecmp(argv[0], "help") == 0 || strcasecmp(argv[0], "commands") == 0) {
- stream->write_function(stream, "%s\n", conf_api_interface.syntax);
+ stream->write_function(stream, "%s\n", api_syntax);
} else if (argv[1] && strcasecmp(argv[1], "dial") == 0) {
if (conf_api_sub_dial(NULL, stream, argc, argv) != SWITCH_STATUS_SUCCESS) {
/* command returned error, so show syntax usage */
@@ -3855,7 +3855,7 @@
}
-static void conference_auto_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(conference_auto_function)
{
switch_channel_t *channel = NULL;
call_list_t *call_list, *np;
@@ -3890,7 +3890,7 @@
}
/* Application interface function that is called from the dialplan to join the channel to a conference */
-static void conference_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(conference_function)
{
switch_codec_t *read_codec = NULL;
uint32_t flags = 0;
@@ -4338,30 +4338,6 @@
switch_thread_create(&thread, thd_attr, conference_record_thread_run, rec, rec->pool);
}
-static switch_application_interface_t conference_autocall_application_interface = {
- /*.interface_name */ "conference_set_auto_outcall",
- /*.application_function */ conference_auto_function,
- NULL, NULL, NULL,
- /* flags */ SAF_NONE,
- /*.next */
-};
-
-static switch_application_interface_t conference_application_interface = {
- /*.interface_name */ global_app_name,
- /*.application_function */ conference_function,
- NULL, NULL, NULL,
- /* flags */ SAF_NONE,
- /*.next */ &conference_autocall_application_interface
-};
-
-static switch_api_interface_t conf_api_interface = {
- /*.interface_name */ "conference",
- /*.desc */ "Conference module commands",
- /*.function */ conf_api_main,
- /*.syntax *//* see switch_module_load, this is built on the fly */
- /*.next */
-};
-
static switch_status_t chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint)
{
char name[512] = "", *p, *lbuf = NULL;
@@ -4412,7 +4388,7 @@
#if 0
else {
if (strcasecmp(argv[0], "help") == 0 || strcasecmp(argv[0], "commands") == 0) {
- stream.write_function(&stream, "%s\n", conf_api_interface.syntax);
+ stream.write_function(&stream, "%s\n", api_syntax);
/* find a normal command */
} else {
conf_api_dispatch(conference, &stream, argc, argv, (const char *) body, 0);
@@ -4431,26 +4407,6 @@
return SWITCH_STATUS_SUCCESS;
}
-static switch_chat_interface_t conference_chat_interface = {
- /*.name */ CONF_CHAT_PROTO,
- /*.chat_send */ chat_send,
-
-};
-
-static switch_loadable_module_interface_t conference_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ &conference_application_interface,
- /*.api_interface */ &conf_api_interface,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL,
- /*.chat_interface */ &conference_chat_interface
-};
-
static switch_status_t conf_default_controls(conference_obj_t * conference)
{
switch_status_t status = SWITCH_STATUS_FALSE;
@@ -4941,10 +4897,16 @@
uint32_t i;
size_t nl, ol = 0;
char *p = NULL;
+ switch_chat_interface_t *chat_interface;
+ switch_api_interface_t *api_interface;
+ switch_application_interface_t *app_interface;
switch_status_t status = SWITCH_STATUS_SUCCESS;
memset(&globals, 0, sizeof(globals));
+ /* Connect my internal structure to the blank pointer passed to me */
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
/* build api interface help ".syntax" field string */
p = strdup("");
for (i = 0; i < CONFFUNCAPISIZE; i++) {
@@ -4962,13 +4924,12 @@
}
}
- /* install api interface help ".syntax" field string */
- if (p != NULL) {
- conf_api_interface.syntax = p;
- }
+ api_syntax = p;
- /* Connect my internal structure to the blank pointer passed to me */
- *module_interface = &conference_module_interface;
+ SWITCH_ADD_API(api_interface, "conference", "Conference module commands", conf_api_main, p);
+ SWITCH_ADD_APP(app_interface, global_app_name, global_app_name, NULL, conference_function, NULL, SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "conference_set_auto_outcall", "conference_set_auto_outcall", NULL, conference_auto_function, NULL, SAF_NONE);
+ SWITCH_ADD_CHAT(chat_interface, CONF_CHAT_PROTO, chat_send);
/* create/register custom event message type */
if (switch_event_reserve_subclass(CONF_EVENT_MAINT) != SWITCH_STATUS_SUCCESS) {
@@ -4977,10 +4938,7 @@
}
/* Setup the pool */
- if (switch_core_new_memory_pool(&globals.conference_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no conference pool\n");
- return SWITCH_STATUS_TERM;
- }
+ globals.conference_pool = pool;
/* Setup a hash to store conferences by name */
switch_core_hash_init(&globals.conference_hash, globals.conference_pool);
@@ -5015,9 +4973,7 @@
}
/* free api interface help ".syntax" field string */
- if (conf_api_interface.syntax != NULL) {
- free((char *) conf_api_interface.syntax);
- }
+ switch_safe_free(api_syntax);
}
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c Wed Jun 20 13:06:05 2007
@@ -37,10 +37,8 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load);
SWITCH_MODULE_DEFINITION(mod_dptools, mod_dptools_load, NULL, NULL);
-static switch_application_interface_t detect_speech_application_interface;
-static switch_application_interface_t exe_application_interface;
-
-static void detect_speech_function(switch_core_session_t *session, char *data)
+#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume"
+SWITCH_STANDARD_APP(detect_speech_function)
{
char *argv[4];
int argc;
@@ -62,12 +60,13 @@
switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);
}
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", detect_speech_application_interface.syntax);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", DETECT_SPEECH_SYNTAX);
}
}
-static void exe_function(switch_core_session_t *session, char *data)
+#define EXE_SYNTAX "<extension> <dialplan> <context>"
+SWITCH_STANDARD_APP(exe_function)
{
char *argv[4];
int argc;
@@ -83,11 +82,11 @@
context = argv[2];
switch_core_session_execute_exten(session, extension, dialplan, context);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", exe_application_interface.syntax);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", EXE_SYNTAX);
}
}
-static void ring_ready_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(ring_ready_function)
{
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
@@ -95,7 +94,7 @@
switch_channel_ring_ready(channel);
}
-static void queue_dtmf_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(queue_dtmf_function)
{
switch_channel_t *channel;
if (!switch_strlen_zero(data)) {
@@ -105,7 +104,7 @@
}
}
-static void transfer_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(transfer_function)
{
int argc;
char *argv[4] = { 0 };
@@ -120,7 +119,7 @@
}
}
-static void sched_transfer_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(sched_transfer_function)
{
int argc;
char *argv[4] = { 0 };
@@ -143,7 +142,7 @@
}
}
-static void sched_hangup_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(sched_hangup_function)
{
int argc;
char *argv[5] = { 0 };
@@ -177,7 +176,7 @@
}
-static void sched_broadcast_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(sched_broadcast_function)
{
int argc;
char *argv[6] = { 0 };
@@ -213,7 +212,7 @@
}
}
-static void sleep_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(sleep_function)
{
if (switch_strlen_zero(data)) {
@@ -224,12 +223,12 @@
}
}
-static void eval_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(eval_function)
{
return;
}
-static void phrase_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(phrase_function)
{
switch_channel_t *channel;
char *mydata = NULL;
@@ -255,7 +254,7 @@
}
-static void hangup_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(hangup_function)
{
switch_channel_t *channel;
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
@@ -270,7 +269,7 @@
switch_channel_hangup(channel, cause);
}
-static void answer_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(answer_function)
{
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
@@ -279,7 +278,7 @@
switch_channel_answer(channel);
}
-static void pre_answer_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(pre_answer_function)
{
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
@@ -288,7 +287,7 @@
switch_channel_pre_answer(channel);
}
-static void redirect_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(redirect_function)
{
switch_core_session_message_t msg = { 0 };
@@ -300,7 +299,7 @@
}
-static void reject_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(reject_function)
{
switch_core_session_message_t msg = { 0 };
@@ -313,7 +312,7 @@
}
-static void set_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(set_function)
{
switch_channel_t *channel;
char *var, *val = NULL;
@@ -339,7 +338,7 @@
}
}
-static void export_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(export_function)
{
switch_channel_t *channel;
char *exports, *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
@@ -387,7 +386,7 @@
}
}
-static void unset_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(unset_function)
{
switch_channel_t *channel;
@@ -402,7 +401,7 @@
}
}
-static void log_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(log_function)
{
switch_channel_t *channel;
char *level, *log_str;
@@ -426,7 +425,7 @@
}
-static void info_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(info_function)
{
switch_channel_t *channel;
switch_event_t *event;
@@ -444,7 +443,7 @@
}
-static void privacy_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(privacy_function)
{
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
@@ -480,7 +479,7 @@
}
}
-static void strftime_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(strftime_function)
{
char *argv[2];
int argc;
@@ -607,7 +606,7 @@
}
#endif
-static void ivr_application_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(ivr_application_function)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
char *params;
@@ -651,23 +650,29 @@
}
-static void dtm_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(dtmf_session_function)
{
switch_ivr_inband_dtmf_session(session);
}
-static void stop_dtmf_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(stop_dtmf_session_function)
{
switch_ivr_stop_inband_dtmf_session(session);
}
-static void fax_detect_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(fax_detect_session_function)
{
switch_ivr_tone_detect_session(session, "fax", "1100.0", "r", 0, NULL, NULL);
}
-static void tone_detect_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(system_session_function)
+{
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Executing command: %s\n",data);
+ system(data);
+}
+
+SWITCH_STANDARD_APP(tone_detect_session_function)
{
char *argv[6] = { 0 };
int argc;
@@ -699,13 +704,13 @@
switch_ivr_tone_detect_session(session, argv[0], argv[1], argv[2], to, argv[4], argv[5]);
}
-static void stop_fax_detect_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(stop_fax_detect_session_function)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Disabling tone detection\n");
switch_ivr_stop_tone_detect_session(session);
}
-static void echo_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(echo_function)
{
switch_channel_t *channel;
@@ -717,7 +722,7 @@
switch_channel_set_state(channel, CS_LOOPBACK);
}
-static void park_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(park_function)
{
switch_ivr_park(session, NULL);
@@ -753,7 +758,7 @@
}
-static void speak_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(speak_function)
{
switch_channel_t *channel;
char buf[10];
@@ -802,7 +807,7 @@
}
-static void playback_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(playback_function)
{
switch_channel_t *channel;
char *file_name = NULL;
@@ -820,7 +825,7 @@
}
-static void gentones_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(gentones_function)
{
switch_channel_t *channel;
char *tone_script = NULL;
@@ -849,7 +854,7 @@
}
-static void displace_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(displace_session_function)
{
switch_channel_t *channel;
char *path = NULL;
@@ -877,7 +882,7 @@
}
-static void stop_displace_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(stop_displace_session_function)
{
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
@@ -887,7 +892,7 @@
}
-static void record_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(record_function)
{
switch_channel_t *channel;
switch_status_t status;
@@ -919,7 +924,7 @@
}
-static void record_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(record_session_function)
{
switch_channel_t *channel;
char *p, *path = NULL;
@@ -943,7 +948,7 @@
}
-static void stop_record_session_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(stop_record_session_function)
{
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
@@ -956,7 +961,7 @@
/* Bridge Functions */
/********************************************************************************/
-static void audio_bridge_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(audio_bridge_function)
{
switch_channel_t *caller_channel;
switch_core_session_t *peer_session = NULL;
@@ -1040,460 +1045,73 @@
}
}
-static switch_api_interface_t strepoch_api_interface = {
- /*.interface_name */ "strepoch",
- /*.desc */ "Convert a date string into epoch time",
- /*.function */ strepoch_api_function,
- /*.syntax */ "<string>",
- /*.next */ NULL
-};
-
-static switch_api_interface_t chat_api_interface = {
- /*.interface_name */ "chat",
- /*.desc */ "chat",
- /*.function */ chat_api_function,
- /*.syntax */ "<proto>|<from>|<to>|<message>",
- /*.next */ &strepoch_api_interface
-};
-
-static switch_api_interface_t dptools_api_interface = {
- /*.interface_name */ "strftime",
- /*.desc */ "strftime",
- /*.function */ strftime_api_function,
- /*.syntax */ "<format_string>",
- /*.next */ &chat_api_interface
-};
-
-static switch_api_interface_t presence_api_interface = {
- /*.interface_name */ "presence",
- /*.desc */ "presence",
- /*.function */ presence_api_function,
- /*.syntax */ "<user> <rpid> <message>",
- /*.next */ &dptools_api_interface
-};
-
-
-static switch_application_interface_t bridge_application_interface = {
- /*.interface_name */ "bridge",
- /*.application_function */ audio_bridge_function,
- /* long_desc */ "Bridge the audio between two sessions",
- /* short_desc */ "Bridge Audio",
- /* syntax */ "<channel_url>",
- /* flags */ SAF_SUPPORT_NOMEDIA
-};
-
-static switch_application_interface_t speak_application_interface = {
- /*.interface_name */ "speak",
- /*.application_function */ speak_function,
- /* long_desc */ "Speak text to a channel via the tts interface",
- /* short_desc */ "Speak text",
- /* syntax */ "<engine>|<voice>|<text>",
- /* flags */ SAF_NONE,
- &bridge_application_interface
-};
-
-static switch_application_interface_t displace_application_interface = {
- /*.interface_name */ "displace_session",
- /*.application_function */ displace_session_function,
- /* long_desc */ "Displace audio from a file to the channels input",
- /* short_desc */ "Displace File",
- /* syntax */ "<path> [+time_limit_ms] [mux]",
- /* flags */ SAF_NONE,
- &speak_application_interface
-};
-
-static switch_application_interface_t stop_displace_application_interface = {
- /*.interface_name */ "stop_displace_session",
- /*.application_function */ stop_displace_session_function,
- /* long_desc */ "Stop Displacing to a file",
- /* short_desc */ "Stop Displace File",
- /* syntax */ "<path>",
- /* flags */ SAF_NONE,
- &displace_application_interface
-};
-
-static switch_application_interface_t record_application_interface = {
- /*.interface_name */ "record",
- /*.application_function */ record_function,
- /* long_desc */ "Record a file from the channels input",
- /* short_desc */ "Record File",
- /* syntax */ "<path> [+time_limit_ms]",
- /* flags */ SAF_NONE,
- &stop_displace_application_interface
-};
-
-
-static switch_application_interface_t record_session_application_interface = {
- /*.interface_name */ "record_session",
- /*.application_function */ record_session_function,
- /* long_desc */ "Starts a background recording of the entire session",
- /* short_desc */ "Record Session",
- /* syntax */ "<path>",
- /* flags */ SAF_NONE,
- &record_application_interface
-};
-
-
-static switch_application_interface_t stop_record_session_application_interface = {
- /*.interface_name */ "stop_record_session",
- /*.application_function */ stop_record_session_function,
- /* long_desc */ "Stops a background recording of the entire session",
- /* short_desc */ "Stop Record Session",
- /* syntax */ "<path>",
- /* flags */ SAF_NONE,
- &record_session_application_interface
-};
-
-static switch_application_interface_t playback_application_interface = {
- /*.interface_name */ "playback",
- /*.application_function */ playback_function,
- /* long_desc */ "Playback a file to the channel",
- /* short_desc */ "Playback File",
- /* syntax */ "<path>",
- /* flags */ SAF_NONE,
- /*.next */ &stop_record_session_application_interface
-};
-
-static switch_application_interface_t gentones_application_interface = {
- /*.interface_name */ "gentones",
- /*.application_function */ gentones_function,
- /* long_desc */ "Generate tones to the channel",
- /* short_desc */ "Generate Tones",
- /* syntax */ "<tgml_script>[|<loops>]",
- /* flags */ SAF_NONE,
- /*.next */ &playback_application_interface
-};
-
-static switch_application_interface_t park_application_interface = {
- /*.interface_name */ "park",
- /*.application_function */ park_function,
- /* long_desc */ NULL,
- /* short_desc */ NULL,
- /* syntax */ NULL,
- /* flags */ SAF_NONE,
- /*.next */ &gentones_application_interface
-};
-
-static switch_application_interface_t echo_application_interface = {
- /*.interface_name */ "echo",
- /*.application_function */ echo_function,
- /* long_desc */ "Perform an echo test against the calling channel",
- /* short_desc */ "Echo",
- /* syntax */ "",
- /* flags */ SAF_NONE,
- /*.next */ &park_application_interface
-};
-
-
-static switch_application_interface_t tone_detect_application_interface = {
- /*.interface_name */ "tone_detect",
- /*.application_function */ tone_detect_session_function,
- /* long_desc */ "Detect tones",
- /* short_desc */ "Detect tones",
- /* syntax */ "",
- /* flags */ SAF_NONE,
- /*.next */ &echo_application_interface
-};
-
-static switch_application_interface_t fax_detect_application_interface = {
- /*.interface_name */ "fax_detect",
- /*.application_function */ fax_detect_session_function,
- /* long_desc */ "Detect fax send tone",
- /* short_desc */ "Detect faxes",
- /* syntax */ "",
- /* flags */ SAF_NONE,
- /*.next */ &tone_detect_application_interface
-};
-
-static switch_application_interface_t stop_tone_detect_application_interface = {
- /*.interface_name */ "stop_tone_detect",
- /*.application_function */ stop_fax_detect_session_function,
- /* long_desc */ "Stop detecting tones",
- /* short_desc */ "stop detecting tones",
- /* syntax */ "",
- /* flags */ SAF_NONE,
- /* next */ &fax_detect_application_interface
-};
-
-static switch_application_interface_t dtmf_application_interface = {
- /*.interface_name */ "start_dtmf",
- /*.application_function */ dtm_session_function,
- /* long_desc */ "Detect inband dtmf on the session",
- /* short_desc */ "Detect dtmf",
- /* syntax */ "",
- /* flags */ SAF_NONE,
- /* next */ &stop_tone_detect_application_interface
-};
-
-static switch_application_interface_t stop_dtmf_application_interface = {
- /*.interface_name */ "stop_dtmf",
- /*.application_function */ stop_dtmf_session_function,
- /* long_desc */ "Stop detecting inband dtmf.",
- /* short_desc */ "stop inband dtmf.",
- /* syntax */ "",
- /* flags */ SAF_NONE,
- &dtmf_application_interface
-};
-
-static switch_application_interface_t exe_application_interface = {
- /*.interface_name */ "execute_extension",
- /*.application_function */ exe_function,
- /*.long_desc */ "Execute an extension",
- /*.short_desc */ "Execute an extension",
- /*.syntax */ "<extension> <dialplan> <context>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &stop_dtmf_application_interface
-};
-
-static switch_application_interface_t sched_transfer_application_interface = {
- /*.interface_name */ "sched_transfer",
- /*.application_function */ sched_transfer_function,
- /*.long_desc */ "Schedule a transfer in the future",
- /*.short_desc */ "Schedule a transfer in the future",
- /*.syntax */ "[+]<time> <extension> <dialplan> <context>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &exe_application_interface
-};
-
-static switch_application_interface_t sched_broadcast_application_interface = {
- /*.interface_name */ "sched_broadcast",
- /*.application_function */ sched_broadcast_function,
- /*.long_desc */ "Schedule a broadcast in the future",
- /*.short_desc */ "Schedule a broadcast in the future",
- /*.syntax */ "[+]<time> <path> [aleg|bleg|both]",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &sched_transfer_application_interface
-};
-
-static switch_application_interface_t sched_hangup_application_interface = {
- /*.interface_name */ "sched_hangup",
- /*.application_function */ sched_hangup_function,
- /*.long_desc */ "Schedule a hangup in the future",
- /*.short_desc */ "Schedule a hangup in the future",
- /*.syntax */ "[+]<time> [<cause>]",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &sched_broadcast_application_interface
-};
-
-
-static switch_application_interface_t queuedtmf_application_interface = {
- /*.interface_name */ "queue_dtmf",
- /*.application_function */ queue_dtmf_function,
- /* long_desc */ "Queue dtmf to be sent from a session",
- /* short_desc */ "Queue dtmf to be sent",
- /* syntax */ "<dtmf_data>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &sched_hangup_application_interface
-};
-
-static switch_application_interface_t reject_application_interface = {
- /*.interface_name */ "reject",
- /*.application_function */ reject_function,
- /* long_desc */ "Send a reject message to a session.",
- /* short_desc */ "Send session reject",
- /* syntax */ "<reject_data>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &queuedtmf_application_interface
-};
-
-static switch_application_interface_t redirect_application_interface = {
- /*.interface_name */ "redirect",
- /*.application_function */ redirect_function,
- /* long_desc */ "Send a redirect message to a session.",
- /* short_desc */ "Send session redirect",
- /* syntax */ "<redirect_data>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &reject_application_interface
-};
-
-static switch_application_interface_t ivr_application_interface = {
- /*.interface_name */ "ivr",
- /*.application_function */ ivr_application_function,
- /* long_desc */ "Run an ivr menu.",
- /* short_desc */ "Run an ivr menu",
- /* syntax */ "<menu_name>",
- /* flags */ SAF_NONE,
- /*.next */ &redirect_application_interface
-};
-
-static switch_application_interface_t detect_speech_application_interface = {
- /*.interface_name */ "detect_speech",
- /*.application_function */ detect_speech_function,
- /* long_desc */ "Detect speech on a channel.",
- /* short_desc */ "Detect speech",
- /* syntax */ "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume",
- /* flags */ SAF_NONE,
- /*.next */ &ivr_application_interface
-};
-
-static switch_application_interface_t ring_ready_application_interface = {
- /*.interface_name */ "ring_ready",
- /*.application_function */ ring_ready_function,
- /* long_desc */ "Indicate Ring_Ready on a channel.",
- /* short_desc */ "Indicate Ring_Ready",
- /* syntax */ "",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &detect_speech_application_interface
-};
-
-static switch_application_interface_t unset_application_interface = {
- /*.interface_name */ "unset",
- /*.application_function */ unset_function,
- /* long_desc */ "Unset a channel varaible for the channel calling the application.",
- /* short_desc */ "Unset a channel varaible",
- /* syntax */ "<varname>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &ring_ready_application_interface
-};
-
-static switch_application_interface_t set_application_interface = {
- /*.interface_name */ "set",
- /*.application_function */ set_function,
- /* long_desc */ "Set a channel varaible for the channel calling the application.",
- /* short_desc */ "Set a channel varaible",
- /* syntax */ "<varname>=<value>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &unset_application_interface
-};
-
-static switch_application_interface_t export_application_interface = {
- /*.interface_name */ "export",
- /*.application_function */ export_function,
- /* long_desc */ "Set and export a channel varaible for the channel calling the application.",
- /* short_desc */ "Export a channel varaible across a bridge",
- /* syntax */ "<varname>=<value>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &set_application_interface
-};
-
-static switch_application_interface_t info_application_interface = {
- /*.interface_name */ "info",
- /*.application_function */ info_function,
- /* long_desc */ "Display Call Info",
- /* short_desc */ "Display Call Info",
- /* syntax */ "",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &export_application_interface
-};
-
-static switch_application_interface_t log_application_interface = {
- /*.interface_name */ "log",
- /*.application_function */ log_function,
- /* long_desc */ "Logs a channel varaible for the channel calling the application.",
- /* short_desc */ "Logs a channel varaible",
- /* syntax */ "<varname>",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &info_application_interface
-};
-
-
-static switch_application_interface_t hangup_application_interface = {
- /*.interface_name */ "hangup",
- /*.application_function */ hangup_function,
- /* long_desc */ "Hangup the call for a channel.",
- /* short_desc */ "Hangup the call",
- /* syntax */ "[<cause>]",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &log_application_interface
-};
-
-static switch_application_interface_t answer_application_interface = {
- /*.interface_name */ "answer",
- /*.application_function */ answer_function,
- /* long_desc */ "Answer the call for a channel.",
- /* short_desc */ "Answer the call",
- /* syntax */ "",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &hangup_application_interface
-};
-
-static switch_application_interface_t pre_answer_application_interface = {
- /*.interface_name */ "pre_answer",
- /*.application_function */ pre_answer_function,
- /* long_desc */ "Pre-Answer the call for a channel.",
- /* short_desc */ "Pre-Answer the call",
- /* syntax */ "",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &answer_application_interface
-};
-
-static switch_application_interface_t eval_application_interface = {
- /*.interface_name */ "eval",
- /*.application_function */ eval_function,
- /* long_desc */ "Do Nothing",
- /* short_desc */ "Do Nothing",
- /* syntax */ "",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &pre_answer_application_interface
-};
-
-static switch_application_interface_t phrase_application_interface = {
- /*.interface_name */ "phrase",
- /*.application_function */ phrase_function,
- /* long_desc */ "Say a Phrase",
- /* short_desc */ "Say a Phrase",
- /* syntax */ "<macro_name>,<data>",
- /* flags */ SAF_NONE,
- /*.next */ &eval_application_interface
-};
-
-static switch_application_interface_t strftime_application_interface = {
- /*.interface_name */ "strftime",
- /*.application_function */ strftime_function,
- /* long_desc */ NULL,
- /* short_desc */ NULL,
- /* syntax */ NULL,
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &phrase_application_interface
-};
-
-static switch_application_interface_t sleep_application_interface = {
- /*.interface_name */ "sleep",
- /*.application_function */ sleep_function,
- /* long_desc */
- "Pause the channel for a given number of milliseconds, consuming the audio for that period of time.",
- /* short_desc */ "Pause a channel",
- /* syntax */ "<pausemilliseconds>",
- /* flags */ SAF_NONE,
- /* next */ &strftime_application_interface
-};
-
-static switch_application_interface_t transfer_application_interface = {
- /*.interface_name */ "transfer",
- /*.application_function */ transfer_function,
- /* long_desc */ "Immediatly transfer the calling channel to a new extension",
- /* short_desc */ "Transfer a channel",
- /* syntax */ "<exten> [<dialplan> <context>]",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /* next */ &sleep_application_interface
-};
-
-static switch_application_interface_t privacy_application_interface = {
- /*.interface_name */ "privacy",
- /*.application_function */ privacy_function,
- /* long_desc */ "Set caller privacy on calls.",
- /* short_desc */ "Set privacy on calls",
- /* syntax */ "off|on|name|full|number",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ &transfer_application_interface
-};
-
-static switch_loadable_module_interface_t dptools_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ NULL,
- /*.codec_interface = */ NULL,
- /*.application_interface */ &privacy_application_interface,
- /*.api_interface */ &presence_api_interface
-};
+#define SPEAK_DESC "Speak text to a channel via the tts interface"
+#define DISPLACE_DESC "Displace audio from a file to the channels input"
+#define SESS_REC_DESC "Starts a background recording of the entire session"
+#define STOP_SESS_REC_DESC "Stops a background recording of the entire session"
+#define SCHED_TRANSF_DESCR "Schedule a transfer in the future"
+#define SCHED_BROADCAST_DESCR "Schedule a broadcast in the future"
+#define SCHED_HANGUP_DESCR "Schedule a hangup in the future"
+#define UNSET_LONG_DESC "Unset a channel varaible for the channel calling the application."
+#define SET_LONG_DESC "Set a channel varaible for the channel calling the application."
+#define EXPORT_LONG_DESC "Set and export a channel varaible for the channel calling the application."
+#define LOG_LONG_DESC "Logs a channel varaible for the channel calling the application."
+#define TRANSFER_LONG_DESC "Immediatly transfer the calling channel to a new extension"
+#define SLEEP_LONG_DESC "Pause the channel for a given number of milliseconds, consuming the audio for that period of time."
SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
{
+ switch_api_interface_t *api_interface;
+ switch_application_interface_t *app_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &dptools_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_API(api_interface, "strepoch", "Convert a date string into epoch time", strepoch_api_function, "<string>");
+ SWITCH_ADD_API(api_interface, "chat", "chat", chat_api_function, "<proto>|<from>|<to>|<message>");
+ SWITCH_ADD_API(api_interface, "strftime", "strftime", strftime_api_function, "<format_string>");
+ SWITCH_ADD_API(api_interface, "presence", "presence", presence_api_function, "<user> <rpid> <message>");
+ SWITCH_ADD_APP(app_interface, "privacy", "Set privacy on calls", "Set caller privacy on calls.", privacy_function, "off|on|name|full|number", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "transfer", "Transfer a channel", TRANSFER_LONG_DESC, transfer_function, "<exten> [<dialplan> <context>]", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "sleep", "Pause a channel", SLEEP_LONG_DESC, sleep_function, "<pausemilliseconds>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "strftime", NULL, NULL, strftime_function, NULL, SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "phrase", "Say a Phrase", "Say a Phrase", phrase_function, "<macro_name>,<data>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "eval", "Do Nothing", "Do Nothing", eval_function, "", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "pre_answer", "Pre-Answer the call", "Pre-Answer the call for a channel.", pre_answer_function, "", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "answer", "Answer the call", "Answer the call for a channel.", answer_function, "", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "hangup", "Hangup the call", "Hangup the call for a channel.", hangup_function, "[<cause>]", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "log", "Logs a channel varaible", LOG_LONG_DESC, log_function, "<varname>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "info", "Display Call Info", "Display Call Info", info_function, "", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "export", "Export a channel varaible across a bridge", EXPORT_LONG_DESC, export_function, "<varname>=<value>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "set", "Set a channel varaible", SET_LONG_DESC, set_function, "<varname>=<value>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "unset", "Unset a channel varaible", UNSET_LONG_DESC, unset_function, "<varname>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "ring_ready", "Indicate Ring_Ready", "Indicate Ring_Ready on a channel.", ring_ready_function, "", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "detect_speech", "Detect speech", "Detect speech on a channel.", detect_speech_function, DETECT_SPEECH_SYNTAX, SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "ivr", "Run an ivr menu", "Run an ivr menu.", ivr_application_function, "<menu_name>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "redirect", "Send session redirect", "Send a redirect message to a session.", redirect_function, "<redirect_data>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "reject", "Send session reject", "Send a reject message to a session.", reject_function, "<reject_data>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "queue_dtmf", "Queue dtmf to be sent", "Queue dtmf to be sent from a session", queue_dtmf_function, "<dtmf_data>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "sched_hangup", SCHED_HANGUP_DESCR, SCHED_HANGUP_DESCR, sched_hangup_function, "[+]<time> [<cause>]", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "sched_broadcast", SCHED_BROADCAST_DESCR, SCHED_BROADCAST_DESCR, sched_broadcast_function, "[+]<time> <path> [aleg|bleg|both]", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "sched_transfer", SCHED_TRANSF_DESCR, SCHED_TRANSF_DESCR, sched_transfer_function, "[+]<time> <extension> <dialplan> <context>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "execute_extension", "Execute an extension", "Execute an extension", exe_function, EXE_SYNTAX, SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "stop_tone_detect", "stop detecting tones", "Stop detecting tones", stop_fax_detect_session_function, "", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "fax_detect", "Detect faxes", "Detect fax send tone", fax_detect_session_function, "", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "tone_detect", "Detect tones", "Detect tones", tone_detect_session_function, "", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "echo", "Echo", "Perform an echo test against the calling channel", echo_function, "", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "park", NULL, NULL, park_function, NULL, SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "gentones", "Generate Tones", "Generate tones to the channel", gentones_function, "<tgml_script>[|<loops>]", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "playback", "Playback File", "Playback a file to the channel", playback_function, "<path>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "stop_record_session", "Stop Record Session", STOP_SESS_REC_DESC, stop_record_session_function, "<path>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function, "<path> [+time_limit_ms]", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "stop_displace_session", "Stop Displace File", "Stop Displacing to a file", stop_displace_session_function, "<path>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "displace_session", "Displace File", DISPLACE_DESC, displace_session_function, "<path> [+time_limit_ms] [mux]", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "speak", "Speak text", SPEAK_DESC, speak_function, "<engine>|<voice>|<text>", SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "bridge", "Bridge Audio", "Bridge the audio between two sessions", audio_bridge_function, "<channel_url>", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "system", "Execute a system command", "Execute a system command", system_session_function, "<command>", SAF_SUPPORT_NOMEDIA);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c Wed Jun 20 13:06:05 2007
@@ -111,13 +111,6 @@
switch_xml_t cfg, xml = NULL, param, settings, route, routes;
switch_status_t status = SWITCH_STATUS_SUCCESS;
- memset(&globals, 0, sizeof(globals));
- if (switch_core_new_memory_pool(&globals.pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- status = SWITCH_STATUS_TERM;
- goto done;
- }
-
switch_core_hash_init(&globals.routes, globals.pool);
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
@@ -521,7 +514,7 @@
}
-static switch_caller_extension_t *enum_dialplan_hunt(switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+SWITCH_STANDARD_DIALPLAN(enum_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
enum_record_t *results, *rp;
@@ -564,7 +557,7 @@
}
-static void enum_app_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(enum_app_function)
{
int argc = 0;
char *argv[4] = { 0 };
@@ -685,54 +678,26 @@
}
-static switch_dialplan_interface_t enum_dialplan_interface = {
- /*.interface_name = */ "enum",
- /*.hunt_function = */ enum_dialplan_hunt
- /*.next = NULL */
-};
-
-static switch_application_interface_t enum_application_interface = {
- /*.interface_name */ "enum",
- /*.application_function */ enum_app_function,
- /* long_desc */ "Perform an ENUM lookup",
- /* short_desc */ "Perform an ENUM lookup",
- /* syntax */ "<number> [<root>]",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ NULL
-};
-
-static switch_api_interface_t enum_api_interface = {
- /*.interface_name */ "enum",
- /*.desc */ "ENUM",
- /*.function */ enum_function,
- /*.syntax */ "",
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t enum_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ &enum_dialplan_interface,
- /*.codec_interface */ NULL,
- /*.application_interface */ &enum_application_interface,
- /*.api_interface */ &enum_api_interface,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load)
{
+ switch_api_interface_t *api_interface;
+ switch_application_interface_t *app_interface;
+ switch_dialplan_interface_t *dp_interface;
if (dns_init(0) < 0) {
return SWITCH_STATUS_FALSE;
}
+ memset(&globals, 0, sizeof(globals));
+ globals.pool = pool;
+
load_config();
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &enum_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_API(api_interface, "enum", "ENUM", enum_function, "");
+ SWITCH_ADD_APP(app_interface, "enum", "Perform an ENUM lookup", "Perform an ENUM lookup", enum_app_function, "<number> [<root>]", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_DIALPLAN(dp_interface, "enum", enum_dialplan_hunt);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c Wed Jun 20 13:06:05 2007
@@ -54,7 +54,7 @@
SEND_TYPE_NOMEDIA = 3
} ls_how_t;
-static void bcast_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(bcast_function)
{
switch_channel_t *channel;
switch_socket_t *socket;
@@ -228,36 +228,18 @@
}
-static switch_application_interface_t bcast_application_interface = {
- /*.interface_name */ "esf_ls_page_group",
- /*.application_function */ bcast_function,
- NULL, NULL, NULL,
- /* flags */ SAF_NONE,
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t mod_ivrtest_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ NULL,
- /*.codec_interface = */ NULL,
- /*.application_interface */ &bcast_application_interface
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load)
{
+ switch_application_interface_t *app_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &mod_ivrtest_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_APP(app_interface, "esf_ls_page_group", NULL, NULL, bcast_function, NULL, SAF_NONE);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
-
-//switch_status_t switch_module_runtime(void)
-
/* For Emacs:
* Local Variables:
* mode:c
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c Wed Jun 20 13:06:05 2007
@@ -152,7 +152,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static void rss_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(rss_function)
{
switch_channel_t *channel;
switch_status_t status;
@@ -613,33 +613,14 @@
switch_core_session_reset(session);
}
-static switch_application_interface_t rss_application_interface = {
- /*.interface_name */ "rss",
- /*.application_function */ rss_function,
- NULL, NULL, NULL,
- /* flags */ SAF_NONE,
- /*.next */ NULL
-};
-
-
-static switch_loadable_module_interface_t rss_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ &rss_application_interface,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_rss_load)
{
+ switch_application_interface_t *app_interface;
+
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &rss_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_APP(app_interface, "rss", NULL, NULL, rss_function, NULL, SAF_NONE);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c (original)
+++ freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c Wed Jun 20 13:06:05 2007
@@ -402,33 +402,9 @@
}
-static switch_speech_interface_t cepstral_speech_interface = {
- /*.interface_name */ "cepstral",
- /*.speech_open */ cepstral_speech_open,
- /*.speech_close */ cepstral_speech_close,
- /*.speech_feed_tts */ cepstral_speech_feed_tts,
- /*.speech_read_tts */ cepstral_speech_read_tts,
- /*.speech_flush_tts */ cepstral_speech_flush_tts,
- /*.speech_text_param_tts */ cepstral_text_param_tts,
- /*.speech_numeric_param_tts */ cepstral_numeric_param_tts,
- /*.speech_numeric_param_tts */ cepstral_float_param_tts
-};
-
-static switch_loadable_module_interface_t cepstral_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ &cepstral_speech_interface,
- /*.directory_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load)
{
+ switch_speech_interface_t *speech_interface;
/* Open the Swift TTS Engine */
if (SWIFT_FAILED(engine = swift_engine_open(NULL))) {
@@ -437,7 +413,17 @@
}
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &cepstral_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ speech_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SPEECH_INTERFACE);
+ speech_interface->interface_name = "cepstral";
+ speech_interface->speech_open = cepstral_speech_open;
+ speech_interface->speech_close = cepstral_speech_close;
+ speech_interface->speech_feed_tts = cepstral_speech_feed_tts;
+ speech_interface->speech_read_tts = cepstral_speech_read_tts;
+ speech_interface->speech_flush_tts = cepstral_speech_flush_tts;
+ speech_interface->speech_text_param_tts = cepstral_text_param_tts;
+ speech_interface->speech_numeric_param_tts = cepstral_numeric_param_tts;
+ speech_interface->speech_float_param_tts = cepstral_float_param_tts;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c Wed Jun 20 13:06:05 2007
@@ -310,22 +310,9 @@
/*.destroy */ switch_amr_destroy,
};
-static switch_codec_interface_t amr_codec_interface = {
- /*.interface_name */ "GSM-AMR",
- /*.implementations */ &amr_implementation,
-};
-
-static switch_loadable_module_interface_t amr_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &amr_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load)
{
+ switch_codec_interface_t *codec_interface;
#ifndef AMR_PASSTHROUGH
char *cf = "amr.conf";
switch_xml_t cfg, xml, settings, param;
@@ -347,7 +334,8 @@
#endif
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &amr_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "GSM-AMR", &amr_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c Wed Jun 20 13:06:05 2007
@@ -392,33 +392,13 @@
/*.next */ &g711a_8k_20ms_implementation
};
-
-
-static switch_codec_interface_t g711a_codec_interface = {
- /*.interface_name */ "g711 alaw",
- /*.implementations */ &g711a_8k_10ms_implementation
-};
-
-static switch_codec_interface_t g711u_codec_interface = {
- /*.interface_name */ "g711 ulaw",
- /*.implementations */ &g711u_8k_10ms_implementation,
- /*.next */ &g711a_codec_interface
-};
-
-static switch_loadable_module_interface_t g711_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &g711u_codec_interface,
- /*.application_interface */ NULL
-};
-
-
SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &g711_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "g711 ulaw", &g711u_8k_10ms_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "g711 alaw", &g711a_8k_10ms_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c Wed Jun 20 13:06:05 2007
@@ -159,24 +159,12 @@
/*.next */ &g722_8k_implementation
};
-static switch_codec_interface_t g722_codec_interface = {
- /*.interface_name */ "g722",
- /*.implementations */ &g722_16k_implementation
-};
-
-static switch_loadable_module_interface_t g722_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &g722_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &g722_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "g722", &g722_16k_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c Wed Jun 20 13:06:05 2007
@@ -189,24 +189,12 @@
/*.destroy */ switch_g723_destroy,
};
-static switch_codec_interface_t g723_1_codec_interface = {
- /*.interface_name */ "g723.1 6.3k",
- /*.implementations */ &g723_1_implementation,
-};
-
-static switch_loadable_module_interface_t g723_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &g723_1_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &g723_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "g723.1 6.3k", &g723_1_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c Wed Jun 20 13:06:05 2007
@@ -368,68 +368,19 @@
/*.destroy */ switch_g726_destroy,
};
-static switch_codec_interface_t g726_16k_codec_interface = {
- /*.interface_name */ "G.726 16k",
- /*.implementations */ &g726_16k_implementation,
-};
-
-static switch_codec_interface_t g726_24k_codec_interface = {
- /*.interface_name */ "G.726 24k",
- /*.implementations */ &g726_24k_implementation,
- /*.next */ &g726_16k_codec_interface
-};
-
-static switch_codec_interface_t g726_32k_codec_interface = {
- /*.interface_name */ "G.726 32k",
- /*.implementations */ &g726_32k_implementation,
- /*.next */ &g726_24k_codec_interface
-};
-
-static switch_codec_interface_t g726_40k_codec_interface = {
- /*.interface_name */ "G.726 40k",
- /*.implementations */ &g726_40k_implementation,
- /*.next */ &g726_32k_codec_interface
-};
-
-static switch_codec_interface_t aal2_g726_16k_codec_interface = {
- /*.interface_name */ "G.726 16k (aal2)",
- /*.implementations */ &aal2_g726_16k_implementation,
- /*.next */ &g726_40k_codec_interface
-};
-
-static switch_codec_interface_t aal2_g726_24k_codec_interface = {
- /*.interface_name */ "G.726 24k (aal2)",
- /*.implementations */ &aal2_g726_24k_implementation,
- /*.next */ &aal2_g726_16k_codec_interface
-};
-
-static switch_codec_interface_t aal2_g726_32k_codec_interface = {
- /*.interface_name */ "G.726 32k (aal2)",
- /*.implementations */ &aal2_g726_32k_implementation,
- /*.next */ &aal2_g726_24k_codec_interface
-};
-
-static switch_codec_interface_t aal2_g726_40k_codec_interface = {
- /*.interface_name */ "G.726 40k (aal2)",
- /*.implementations */ &aal2_g726_40k_implementation,
- /*.next */ &aal2_g726_32k_codec_interface
-};
-
-
-
-static switch_loadable_module_interface_t g726_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &aal2_g726_40k_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &g726_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 40k (aal2)", &aal2_g726_40k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 32k (aal2)", &aal2_g726_32k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 24k (aal2)", &aal2_g726_24k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 16k (aal2)", &aal2_g726_16k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 40k", &g726_40k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 32k", &g726_32k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 24k", &g726_24k_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "G.726 16k", &g726_16k_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c Wed Jun 20 13:06:05 2007
@@ -295,25 +295,12 @@
&g729_10ms_8k_implementation
};
-static switch_codec_interface_t g729_codec_interface = {
- /*.interface_name */ "g729",
- /*.implementations */ &g729_8k_implementation,
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t g729_module_interface = {
- /*.module_name */ "g729",
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &g729_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &g729_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "g729", &g729_8k_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c Wed Jun 20 13:06:05 2007
@@ -153,24 +153,13 @@
/*.decode */ switch_gsm_decode,
/*.destroy */ switch_gsm_destroy,
};
-static switch_codec_interface_t gsm_codec_interface = {
- /*.interface_name */ "gsm",
- /*.implementations */ &gsm_8k_implementation,
-};
-static switch_loadable_module_interface_t gsm_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &gsm_codec_interface,
- /*.application_interface */ NULL
-};
SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load)
{
-
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &gsm_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "gsm", &gsm_8k_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c Wed Jun 20 13:06:05 2007
@@ -117,25 +117,13 @@
/*.next = */&h264_90000_implementation
};
-static switch_codec_interface_t h26x_codec_interface = {
- /*.interface_name */ "h26x video (passthru)",
- /*.implementations */ &h263_90000_implementation
-};
-
-static switch_loadable_module_interface_t h26x_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &h26x_codec_interface,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
-};
SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &h26x_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "h26x video (passthru)", &h263_90000_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c Wed Jun 20 13:06:05 2007
@@ -287,40 +287,14 @@
/*.destroy */ switch_ilbc_destroy
};
-
-static switch_codec_interface_t ilbc_20ms_codec_interface = {
- /*.interface_name */ "ilbc",
- /*.implementations */ &ilbc_8k_20ms_nonext_implementation
-};
-
-static switch_codec_interface_t ilbc_102_codec_interface = {
- /*.interface_name */ "ilbc",
- /*.implementations */ &ilbc_102_8k_20ms_implementation,
- /*.next */ &ilbc_20ms_codec_interface
-};
-
-static switch_codec_interface_t ilbc_codec_interface = {
- /*.interface_name */ "ilbc",
- /*.implementations */ &ilbc_8k_20ms_implementation,
- /*.next */ &ilbc_102_codec_interface
-};
-
-
-static switch_loadable_module_interface_t ilbc_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &ilbc_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load)
{
-
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &ilbc_module_interface;
-
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "ilbc", &ilbc_8k_20ms_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "ilbc", &ilbc_102_8k_20ms_implementation);
+ SWITCH_ADD_CODEC(codec_interface, "ilbc", &ilbc_8k_20ms_nonext_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c Wed Jun 20 13:06:05 2007
@@ -406,28 +406,12 @@
/*.next */ &raw_8k_20ms_implementation
};
-
-static switch_codec_interface_t raw_codec_interface = {
- /*.interface_name */ "raw signed linear (16 bit)",
- /*.implementations */ &raw_8k_10ms_implementation
-};
-
-static switch_loadable_module_interface_t raw_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &raw_codec_interface,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- ///*.file_interface*/ &raw_file_interface
-};
-
-
SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &raw_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "raw signed linear (16 bit)", &raw_8k_10ms_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c Wed Jun 20 13:06:05 2007
@@ -390,24 +390,12 @@
/*.next */ &speex_8k_30ms_implementation
};
-static switch_codec_interface_t speex_codec_interface = {
- /*.interface_name */ "speex",
- /*.implementations */ &speex_8k_20ms_implementation
-};
-
-static switch_loadable_module_interface_t speex_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ &speex_codec_interface,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load)
{
+ switch_codec_interface_t *codec_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &speex_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_CODEC(codec_interface, "speex", &speex_8k_20ms_implementation);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c (original)
+++ freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c Wed Jun 20 13:06:05 2007
@@ -83,7 +83,7 @@
switch_xml_free(xml);
}
-static switch_caller_extension_t *directory_dialplan_hunt(switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+SWITCH_STANDARD_DIALPLAN(directory_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
@@ -151,27 +151,14 @@
}
-static switch_dialplan_interface_t directory_dialplan_interface = {
- /*.interface_name = */ "directory",
- /*.hunt_function = */ directory_dialplan_hunt
- /*.next = NULL */
-};
-
-static switch_loadable_module_interface_t directory_dialplan_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ &directory_dialplan_interface,
- /*.codec_interface = */ NULL,
- /*.application_interface = */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load)
{
+ switch_dialplan_interface_t *dp_interface;
load_config();
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &directory_dialplan_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_DIALPLAN(dp_interface, "directory", directory_dialplan_hunt);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c (original)
+++ freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c Wed Jun 20 13:06:05 2007
@@ -292,7 +292,7 @@
return status;
}
-static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+SWITCH_STANDARD_DIALPLAN(dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
@@ -377,27 +377,13 @@
return extension;
}
-
-static switch_dialplan_interface_t dialplan_interface = {
- /*.interface_name = */ "XML",
- /*.hunt_function = */ dialplan_hunt
- /*.next = NULL */
-};
-
-static switch_loadable_module_interface_t dialplan_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ &dialplan_interface,
- /*.codec_interface = */ NULL,
- /*.application_interface = */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load)
{
+ switch_dialplan_interface_t *dp_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &dialplan_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_DIALPLAN(dp_interface, "XML", dialplan_hunt);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c (original)
+++ freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c Wed Jun 20 13:06:05 2007
@@ -198,33 +198,19 @@
}
-static switch_directory_interface_t ldap_directory_interface = {
- /*.interface_name */ "ldap",
- /*.directory_open */ mod_ldap_open,
- /*.directory_close */ mod_ldap_close,
- /*.directory_query */ mod_ldap_query,
- /*.directory_next */ mod_ldap_next,
- /*.directory_next_pair */ mod_ldap_next_pair
-};
-
-
-static switch_loadable_module_interface_t ldap_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ &ldap_directory_interface
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load)
{
+ switch_directory_interface_t *dir_interface;
+
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &ldap_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ dir_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_DIRECTORY_INTERFACE);
+ dir_interface->interface_name = "ldap";
+ dir_interface->directory_open = mod_ldap_open;
+ dir_interface->directory_close = mod_ldap_close;
+ dir_interface->directory_query = mod_ldap_query;
+ dir_interface->directory_next = mod_ldap_next;
+ dir_interface->directory_next_pair = mod_ldap_next_pair;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c Wed Jun 20 13:06:05 2007
@@ -30,6 +30,7 @@
*
*/
#include <switch.h>
+#include <switch_stun.h>
#include <libdingaling.h>
#ifdef SWITCH_HAVE_ODBC
#include <switch_odbc.h>
@@ -48,6 +49,7 @@
SWITCH_MODULE_DEFINITION(mod_dingaling, mod_dingaling_load, mod_dingaling_shutdown, NULL);
static switch_memory_pool_t *module_pool = NULL;
+static switch_endpoint_interface_t *channel_endpoint_interface;
static char sub_sql[] =
"CREATE TABLE jabber_subscriptions (\n"
@@ -730,7 +732,7 @@
if (strlen(xmltxt) > 2) {
xml = switch_xml_parse_str(xmltxt, strlen(xmltxt));
form = switch_xml_toxml(xml);
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level,
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, level,
"%s:\n-------------------------------------------------------------------------------\n"
"%s\n", ll, form);
switch_xml_free(xml);
@@ -739,7 +741,7 @@
}
}
} else {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level, "%s\n", data);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, level, "%s\n", data);
}
}
va_end(ap);
@@ -1590,65 +1592,6 @@
/*.receive_event */ channel_receive_event
};
-static switch_endpoint_interface_t channel_endpoint_interface = {
- /*.interface_name */ "dingaling",
- /*.io_routines */ &channel_io_routines,
- /*.event_handlers */ &channel_event_handlers,
- /*.private */ NULL,
- /*.next */ NULL
-};
-
-
-static switch_api_interface_t debug_api_interface = {
- /*.interface_name */ "dl_debug",
- /*.desc */ "DingaLing Debug",
- /*.function */ dl_debug,
- /*.syntax */ "dl_debug [true|false]",
- /*.next */ NULL
-};
-
-static switch_api_interface_t pres_api_interface = {
- /*.interface_name */ "dl_pres",
- /*.desc */ "DingaLing Presence",
- /*.function */ dl_pres,
- /*.syntax */ "dl_pres <profile_name>",
- /*.next */ &debug_api_interface
-};
-
-static switch_api_interface_t logout_api_interface = {
- /*.interface_name */ "dl_logout",
- /*.desc */ "DingaLing Logout",
- /*.function */ dl_logout,
- /*.syntax */ "dl_logout <profile_name>",
- /*.next */ &pres_api_interface
-};
-
-static switch_api_interface_t login_api_interface = {
- /*.interface_name */ "dl_login",
- /*.desc */ "DingaLing Login",
- /*.function */ dl_login,
- /*.syntax */ "dl_login <profile_name>",
- /*.next */ &logout_api_interface
-};
-
-static switch_chat_interface_t channel_chat_interface = {
- /*.name */ MDL_CHAT_PROTO,
- /*.chat_send */ chat_send,
-};
-
-static switch_loadable_module_interface_t channel_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ &channel_endpoint_interface,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ &login_api_interface,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL,
- /*.chat_interface */ &channel_chat_interface
-};
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
@@ -1658,7 +1601,7 @@
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
- if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
+ if ((*new_session = switch_core_session_request(channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile = NULL;
@@ -1828,11 +1771,10 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load)
{
+ switch_chat_interface_t *chat_interface;
+ switch_api_interface_t *api_interface;
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
+ module_pool = pool;
load_config();
@@ -1873,7 +1815,22 @@
}
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &channel_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ channel_endpoint_interface->interface_name = modname;
+ channel_endpoint_interface->io_routines = &channel_io_routines;
+ channel_endpoint_interface->state_handler = &channel_event_handlers;
+
+#define PRES_SYNTAX "dl_pres <profile_name>"
+#define LOGOUT_SYNTAX "dl_logout <profile_name>"
+#define LOGIN_SYNTAX "dl_login <profile_name>"
+#define DEBUG_SYNTAX "dl_debug [true|false]"
+
+ SWITCH_ADD_API(api_interface, "dl_debug", "DingaLing Debug", dl_debug, DEBUG_SYNTAX);
+ SWITCH_ADD_API(api_interface, "dl_pres", "DingaLing Presence", dl_pres, PRES_SYNTAX);
+ SWITCH_ADD_API(api_interface, "dl_logout", "DingaLing Logout", dl_logout, LOGOUT_SYNTAX);
+ SWITCH_ADD_API(api_interface, "dl_login", "DingaLing Login", dl_login, LOGIN_SYNTAX);
+ SWITCH_ADD_CHAT(chat_interface, MDL_CHAT_PROTO, chat_send);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -2059,7 +2016,7 @@
}
if (!cmd) {
- stream->write_function(stream, "USAGE: %s\n", pres_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", PRES_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -2086,7 +2043,7 @@
}
if (!cmd) {
- stream->write_function(stream, "USAGE: %s\n", logout_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", LOGOUT_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -2113,7 +2070,7 @@
}
if (switch_strlen_zero(cmd)) {
- stream->write_function(stream, "USAGE: %s\n", login_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -2122,7 +2079,7 @@
argc = switch_separate_string(myarg, ';', argv, (sizeof(argv) / sizeof(argv[0])));
if (switch_strlen_zero(cmd) || argc != 1) {
- stream->write_function(stream, "USAGE: %s\n", login_api_interface.syntax);
+ stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
@@ -2603,7 +2560,7 @@
status = LDL_STATUS_FALSE;
goto done;
}
- if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
+ if ((session = switch_core_session_request(channel_endpoint_interface, NULL)) != 0) {
switch_core_session_add_stream(session, NULL);
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c Wed Jun 20 13:06:05 2007
@@ -44,7 +44,7 @@
SWITCH_MODULE_DEFINITION(mod_portaudio, mod_portaudio_load, mod_portaudio_shutdown, NULL);
static switch_memory_pool_t *module_pool = NULL;
-//static int running = 1;
+static switch_endpoint_interface_t *channel_endpoint_interface;
#define SAMPLE_TYPE paInt16
//#define SAMPLE_TYPE paFloat32
@@ -158,8 +158,6 @@
static int get_dev_by_name(char *name, int in);
static int get_dev_by_number(int number, int in);
static switch_status_t pa_cmd(const char *dest, switch_core_session_t *session, switch_stream_handle_t *stream);
- static switch_status_t padep(const char *dest, switch_core_session_t *session, switch_stream_handle_t *stream);
-
/*
State methods they get called when the state changes to the specific state
@@ -734,54 +732,6 @@
return SWITCH_STATUS_SUCCESS;
}
-static switch_api_interface_t send_dtmf_interface = {
- /*.interface_name */ "padtmf",
- /*.desc */ "DEPRICATED (see 'pa')",
- /*.function */ padep,
- /*.syntax */ "DEPRICATED (see 'pa')",
- /*.next */ NULL
-};
-
-static switch_api_interface_t answer_call_interface = {
- /*.interface_name */ "paoffhook",
- /*.desc */ "DEPRICATED (see 'pa')",
- /*.function */ padep,
- /*.syntax */ "DEPRICATED (see 'pa')",
- /*.next */ &send_dtmf_interface
-};
-
-static switch_api_interface_t channel_info_interface = {
- /*.interface_name */ "painfo",
- /*.desc */ "DEPRICATED (see 'pa')",
- /*.function */ padep,
- /*.syntax */ "DEPRICATED (see 'pa')",
- /*.next */ &answer_call_interface
-};
-
-static switch_api_interface_t channel_hup_interface = {
- /*.interface_name */ "pahup",
- /*.desc */ "DEPRICATED (see 'pa')",
- /*.function */ padep,
- /*.syntax */ "DEPRICATED (see 'pa')",
- /*.next */ &channel_info_interface
-};
-
-static switch_api_interface_t channel_call_interface = {
- /*.interface_name */ "pacall",
- /*.desc */ "DEPRICATED (see 'pa')",
- /*.function */ padep,
- /*.syntax */ "DEPRICATED (see 'pa')",
- /*.next */ &channel_hup_interface
-};
-
-static switch_api_interface_t channel_api_interface = {
- /*.interface_name */ "pa",
- /*.desc */ "PortAudio",
- /*.function */ pa_cmd,
- /*.syntax */ "<command> [<args>]",
- /*.next */ &channel_call_interface
-};
-
static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
@@ -802,24 +752,6 @@
/*.receive_message */ channel_receive_message
};
-static switch_endpoint_interface_t channel_endpoint_interface = {
- /*.interface_name */ "portaudio",
- /*.io_routines */ &channel_io_routines,
- /*.event_handlers */ &channel_event_handlers,
- /*.private */ NULL,
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t channel_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ &channel_endpoint_interface,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ &channel_api_interface
-};
-
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/
@@ -828,7 +760,7 @@
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
- if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
+ if ((*new_session = switch_core_session_request(channel_endpoint_interface, pool)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
@@ -876,13 +808,10 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load)
{
-
switch_status_t status;
+ switch_api_interface_t *api_interface;
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
+ module_pool = pool;
Pa_Initialize();
@@ -921,7 +850,13 @@
switch_set_flag((&globals.cng_frame), SFF_CNG);
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &channel_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ channel_endpoint_interface->interface_name = modname;
+ channel_endpoint_interface->io_routines = &channel_io_routines;
+ channel_endpoint_interface->state_handler = &channel_event_handlers;
+
+ SWITCH_ADD_API(api_interface, "pa", "PortAudio", pa_cmd, "<command> [<args>]");
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -1639,7 +1574,7 @@
}
dest = argv[0];
- if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
+ if ((session = switch_core_session_request(channel_endpoint_interface, NULL)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
char *dialplan = globals.dialplan;
@@ -1713,12 +1648,6 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_STANDARD_API(padep)
-{
- stream->write_function(stream, "This command no longer exists (try 'pa help')\n");
- return SWITCH_STATUS_SUCCESS;
-}
-
SWITCH_STANDARD_API(pa_cmd)
{
char *argv[1024] = { 0 };
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Jun 20 13:06:05 2007
@@ -43,7 +43,7 @@
SWITCH_MODULE_DEFINITION(mod_sofia, mod_sofia_load, mod_sofia_shutdown, NULL);
struct mod_sofia_globals mod_sofia_globals;
-switch_endpoint_interface_t sofia_endpoint_interface;
+switch_endpoint_interface_t *sofia_endpoint_interface;
static switch_frame_t silence_frame = { 0 };
static char silence_data[13] = "";
@@ -1288,56 +1288,11 @@
/*.on_transmit */ sofia_on_transmit
};
-switch_endpoint_interface_t sofia_endpoint_interface = {
- /*.interface_name */ "sofia",
- /*.io_routines */ &sofia_io_routines,
- /*.event_handlers */ &sofia_event_handlers,
- /*.private */ NULL,
- /*.next */ NULL
-};
-
-static switch_chat_interface_t sofia_chat_interface = {
- /*.name */ SOFIA_CHAT_PROTO,
- /*.sofia_presence_chat_send */ sofia_presence_chat_send,
-
-};
-
static switch_status_t sofia_manage(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen)
{
return SWITCH_STATUS_SUCCESS;
}
-static switch_management_interface_t sofia_management_interface = {
- /*.relative_oid */ "1",
- /*.management_function */ sofia_manage
-};
-
-static switch_api_interface_t sofia_api_interface = {
- /*.interface_name */ "sofia",
- /*.desc */ "Sofia Controls",
- /*.function */ sofia_function,
- /*.syntax */ "<cmd> <args>",
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t sofia_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ &sofia_endpoint_interface,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ &sofia_api_interface,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL,
- /*.chat_interface */ &sofia_chat_interface,
- /*.say_interface */ NULL,
- /*.asr_interface */ NULL,
- /*.management_interface */ &sofia_management_interface
-};
-
-
static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
@@ -1354,7 +1309,7 @@
*new_session = NULL;
- if (!(nsession = switch_core_session_request(&sofia_endpoint_interface, pool))) {
+ if (!(nsession = switch_core_session_request(sofia_endpoint_interface, pool))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n");
goto done;
}
@@ -1503,6 +1458,9 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
{
+ switch_chat_interface_t *chat_interface;
+ switch_api_interface_t *api_interface;
+ switch_management_interface_t *management_interface;
silence_frame.data = silence_data;
silence_frame.datalen = sizeof(silence_data);
@@ -1510,10 +1468,7 @@
silence_frame.flags = SFF_CNG;
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
+ module_pool = pool;
memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals));
switch_mutex_init(&mod_sofia_globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
@@ -1536,43 +1491,54 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for profiles to start\n");
switch_yield(1500000);
- if (switch_event_bind((char *) modname, SWITCH_EVENT_CUSTOM, MULTICAST_EVENT, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+ if (switch_event_bind(modname, SWITCH_EVENT_CUSTOM, MULTICAST_EVENT, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_TERM;
}
- if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
+ if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
!= SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
- if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
+ if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
!= SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
- if (switch_event_bind((char *) modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
+ if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
!= SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
- if (switch_event_bind((char *) modname, SWITCH_EVENT_ROSTER, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
+ if (switch_event_bind(modname, SWITCH_EVENT_ROSTER, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_event_handler, NULL)
!= SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
- if (switch_event_bind((char *) modname, SWITCH_EVENT_MESSAGE_WAITING, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_mwi_event_handler, NULL)
+ if (switch_event_bind(modname, SWITCH_EVENT_MESSAGE_WAITING, SWITCH_EVENT_SUBCLASS_ANY, sofia_presence_mwi_event_handler, NULL)
!= SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &sofia_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ sofia_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ sofia_endpoint_interface->interface_name = modname;
+ sofia_endpoint_interface->io_routines = &sofia_io_routines;
+ sofia_endpoint_interface->state_handler = &sofia_event_handlers;
+
+ management_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_MANAGEMENT_INTERFACE);
+ management_interface->relative_oid = "1";
+ management_interface->management_function = sofia_manage;
+
+ SWITCH_ADD_API(api_interface, "sofia", "Sofia Controls", sofia_function, "<cmd> <args>");
+ SWITCH_ADD_CHAT(chat_interface, SOFIA_CHAT_PROTO, sofia_presence_chat_send);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h Wed Jun 20 13:06:05 2007
@@ -465,7 +465,7 @@
void sofia_glue_do_xfer_invite(switch_core_session_t *session);
uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sip_t const *sip,
sofia_regtype_t regtype, char *key, uint32_t keylen, switch_event_t **v_event);
-extern switch_endpoint_interface_t sofia_endpoint_interface;
+extern switch_endpoint_interface_t *sofia_endpoint_interface;
void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip);
switch_status_t sofia_on_hangup(switch_core_session_t *session);
char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup);
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c Wed Jun 20 13:06:05 2007
@@ -1771,7 +1771,7 @@
is_auth++;
}
- if (!(session = switch_core_session_request(&sofia_endpoint_interface, NULL))) {
+ if (!(session = switch_core_session_request(sofia_endpoint_interface, NULL))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Session Alloc Failed!\n");
nua_respond(nh, SIP_503_SERVICE_UNAVAILABLE, TAG_END());
return;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Jun 20 13:06:05 2007
@@ -33,6 +33,7 @@
*
*/
#include "mod_sofia.h"
+#include <switch_stun.h>
switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt);
switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int force);
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_reg.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_reg.c Wed Jun 20 13:06:05 2007
@@ -904,7 +904,7 @@
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if ((gateway = (sofia_gateway_t *) switch_core_hash_find(mod_sofia_globals.gateway_hash, key))) {
if (switch_thread_rwlock_tryrdlock(gateway->profile->rwlock) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_ERROR, "Profile %s is locked\n", gateway->profile->name);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "Profile %s is locked\n", gateway->profile->name);
gateway = NULL;
}
}
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c Wed Jun 20 13:06:05 2007
@@ -222,7 +222,7 @@
va_start(ap, fmt);
if ((ret = switch_vasprintf(&data, fmt, ap)) != -1) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level, "%s", data);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, level, "%s", data);
}
va_end(ap);
}
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c Wed Jun 20 13:06:05 2007
@@ -54,6 +54,7 @@
SWITCH_MODULE_DEFINITION(mod_woomera, mod_woomera_load, mod_woomera_shutdown, mod_woomera_runtime);
static switch_memory_pool_t *module_pool = NULL;
+static switch_endpoint_interface_t *woomera_endpoint_interface;
#define STRLEN 15
#define FRAME_LEN 480
@@ -459,24 +460,6 @@
/*.waitfor_write */ woomera_waitfor_write
};
-static switch_endpoint_interface_t woomera_endpoint_interface = {
- /*.interface_name */ "woomera",
- /*.io_routines */ &woomera_io_routines,
- /*.event_handlers */ &woomera_event_handlers,
- /*.private */ NULL,
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t woomera_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ &woomera_endpoint_interface,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL
-};
-
-
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/
@@ -484,7 +467,7 @@
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
- if ((*new_session = switch_core_session_request(&woomera_endpoint_interface, pool)) != 0) {
+ if ((*new_session = switch_core_session_request(woomera_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel_t *channel;
@@ -1226,7 +1209,7 @@
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n", name);
- if ((session = switch_core_session_request(&woomera_endpoint_interface, NULL)) != 0) {
+ if ((session = switch_core_session_request(woomera_endpoint_interface, NULL)) != 0) {
struct private_object *tech_pvt;
switch_channel_t *channel;
@@ -1294,9 +1277,9 @@
return SWITCH_STATUS_SUCCESS;
}
+
SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load)
{
-
struct woomera_profile *profile = &default_profile;
char *cf = "woomera.conf";
switch_xml_t cfg, xml, settings, param, xmlp;
@@ -1360,27 +1343,19 @@
switch_xml_free(xml);
-
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
-
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
- return SWITCH_STATUS_MEMERR;
- }
- return SWITCH_STATUS_MEMERR;
- }
-
-
+ module_pool = pool;
if (switch_mutex_init(&default_profile.iolock, SWITCH_MUTEX_NESTED, module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH no lock\n");
return SWITCH_STATUS_TERM;
}
-
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &woomera_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ woomera_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ woomera_endpoint_interface->interface_name = modname;
+ woomera_endpoint_interface->io_routines = &woomera_io_routines;
+ woomera_endpoint_interface->state_handler = &woomera_event_handlers;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp Wed Jun 20 13:06:05 2007
@@ -68,56 +68,6 @@
/*.on_transmit */ NULL
};
-static switch_api_interface_t modcdr_show_available_api = {
- /*.interface_name */ "modcdr_show_available",
- /*.desc */ "Displays the currently compiled-in mod_cdr backend loggers.",
- /*.function */ modcdr_show_available,
- /*.syntax */ "modcdr_queue_show_available",
- /*.next */ 0
-};
-
-static switch_api_interface_t modcdr_show_active_api = {
- /*.interface_name */ "modcdr_show_active",
- /*.desc */ "Displays the currently active mod_cdr backend loggers.",
- /*.function */ modcdr_show_active,
- /*.syntax */ "modcdr_queue_show_active",
- /*.next */ &modcdr_show_available_api
-};
-
-static switch_api_interface_t modcdr_queue_resume_api = {
- /*.interface_name */ "modcdr_queue_resume",
- /*.desc */ "Manually resumes the popping of objects from the queue.",
- /*.function */ modcdr_queue_resume,
- /*.syntax */ "modcdr_queue_resume",
- /*.next */ &modcdr_show_active_api
-};
-
-static switch_api_interface_t modcdr_queue_pause_api = {
- /*.interface_name */ "modcdr_queue_pause",
- /*.desc */ "Manually pauses the popping of objects from the queue. (DANGER: Can suck your memory away rather quickly.)",
- /*.function */ modcdr_queue_pause,
- /*.syntax */ "modcdr_queue_pause",
- /*.next */ &modcdr_queue_resume_api
-};
-
-static switch_api_interface_t modcdr_reload_interface_api = {
- /*.interface_name */ "modcdr_reload",
- /*.desc */ "Reload mod_cdr's configuration",
- /*.function */ modcdr_reload,
- /*.syntax */ "modcdr_reload",
- /*.next */ &modcdr_queue_pause_api
-};
-
-static switch_loadable_module_interface_t cdr_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /* api_interface */ &modcdr_reload_interface_api
-};
-
static switch_status_t my_on_hangup(switch_core_session_t *session)
{
switch_thread_rwlock_rdlock(cdr_rwlock);
@@ -126,18 +76,25 @@
return SWITCH_STATUS_SUCCESS;
}
+#define AVAIL_DESCR "Displays the currently compiled-in mod_cdr backend loggers."
+#define ACTIVE_DESCR "Displays the currently active mod_cdr backend loggers."
+#define RESUME_DESCR "Manually resumes the popping of objects from the queue."
+#define PAUSE_DESCR "Manually pauses the popping of objects from the queue. (DANGER: Can suck your memory away rather quickly.)"
SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load)
{
+ switch_api_interface_t *api_interface;
+
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &cdr_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_API(api_interface, "modcdr_reload", "Reload mod_cdr's configuration", modcdr_reload, "");
+ SWITCH_ADD_API(api_interface, "modcdr_queue_pause", PAUSE_DESCR, modcdr_queue_pause, "");
+ SWITCH_ADD_API(api_interface, "modcdr_queue_resume", RESUME_DESCR, modcdr_queue_resume, "");
+ SWITCH_ADD_API(api_interface, "modcdr_show_active", ACTIVE_DESCR, modcdr_show_active, "");
+ SWITCH_ADD_API(api_interface, "modcdr_show_available", AVAIL_DESCR, modcdr_show_available, "");
switch_core_add_state_handler(&state_handlers);
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS)
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH - Can't swim, no pool\n");
- return SWITCH_STATUS_TERM;
- }
+ module_pool = pool;
switch_thread_rwlock_create(&cdr_rwlock,module_pool);
newcdrcontainer = new CDRContainer(module_pool); // Instantiates the new object, automatically loads config
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c Wed Jun 20 13:06:05 2007
@@ -176,25 +176,12 @@
}
-static switch_loadable_module_interface_t event_test_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL
-};
-
-
SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load)
{
memset(&globals, 0, sizeof(globals));
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
+ module_pool = pool;
switch_core_hash_init(&globals.event_hash, module_pool);
@@ -231,10 +218,8 @@
return SWITCH_STATUS_TERM;
}
-
-
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &event_test_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
if (switch_event_bind((char *) modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Wed Jun 20 13:06:05 2007
@@ -161,7 +161,7 @@
switch_mutex_unlock(listen_list.mutex);
}
-static void socket_function(switch_core_session_t *session, char *data)
+SWITCH_STANDARD_APP(socket_function)
{
char *host, *port_name;
switch_socket_t *new_sock;
@@ -251,28 +251,6 @@
}
-static switch_application_interface_t socket_application_interface = {
- /*.interface_name */ "socket",
- /*.application_function */ socket_function,
- /* long_desc */ "Connect to a socket",
- /* short_desc */ "Connect to a socket",
- /* syntax */ "<ip>[:<port>]",
- /* flags */ SAF_SUPPORT_NOMEDIA,
- /*.next */ NULL
-};
-
-
-
-static switch_loadable_module_interface_t event_socket_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ &socket_application_interface
-};
-
-
static void close_socket(switch_socket_t ** sock)
{
switch_mutex_lock(listen_list.sock_mutex);
@@ -303,11 +281,13 @@
return SWITCH_STATUS_SUCCESS;
}
-
SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load)
{
+ switch_application_interface_t *app_interface;
+
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &event_socket_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_APP(app_interface, "socket", "Connect to a socket", "Connect to a socket", socket_function, "<ip>[:<port>]", SAF_SUPPORT_NOMEDIA);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c Wed Jun 20 13:06:05 2007
@@ -71,20 +71,8 @@
}
}
-
-
-static switch_loadable_module_interface_t event_test_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL
-};
-
#define MY_EVENT_COOL "test::cool"
-
#ifdef TORTURE_ME
#define TTHREADS 500
static int THREADS = 0;
@@ -128,14 +116,14 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &event_test_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
if (switch_event_reserve_subclass(MY_EVENT_COOL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass!");
return SWITCH_STATUS_GENERR;
}
- if (switch_event_bind((char *) modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+ if (switch_event_bind(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c Wed Jun 20 13:06:05 2007
@@ -37,7 +37,8 @@
#include <freeradius-client.h>
#include "mod_radius_cdr.h"
-static const char modname[] = "mod_radius_cdr";
+SWITCH_MODULE_LOAD_FUNCTION(mod_radius_cdr_load);
+SWITCH_MODULE_DEFINITION(mod_radius_cdr, mod_radius_cdr_load, NULL, NULL);
static char cf[] = "mod_radius_cdr.conf";
static char my_dictionary[PATH_MAX];
@@ -466,17 +467,7 @@
/*.on_transmit */ NULL
};
-
-static const switch_loadable_module_interface_t mod_radius_cdr_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ NULL,
- /*.codec_interface = */ NULL,
- /*.application_interface */ NULL
-};
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_radius_cdr_load)
{
if (load_config() != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_TERM;
@@ -485,7 +476,7 @@
/* test global state handlers */
switch_core_add_state_handler(&state_handlers);
- *module_interface = &mod_radius_cdr_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c Wed Jun 20 13:06:05 2007
@@ -391,19 +391,10 @@
}
-static switch_loadable_module_interface_t xmpp_event_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &xmpp_event_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
if (load_config() != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_FALSE;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c Wed Jun 20 13:06:05 2007
@@ -237,16 +237,6 @@
}
-
-static switch_loadable_module_interface_t zeroconf_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL
-};
-
#define MY_EVENT_PUBLISH "zeroconf::broadcast"
#define MY_EVENT_UNPUBLISH "zeroconf::unbroadcast"
@@ -266,10 +256,7 @@
memset(&globals, 0, sizeof(globals));
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
+ module_pool = pool;
switch_mutex_init(&globals.zc_lock, SWITCH_MUTEX_NESTED, module_pool);
@@ -293,7 +280,7 @@
}
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &zeroconf_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c (original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c Wed Jun 20 13:06:05 2007
@@ -138,34 +138,10 @@
static char *supported_formats[SWITCH_MAX_CODECS] = { 0 };
-static switch_file_interface_t native_file_file_interface = {
- /*.interface_name */ modname,
- /*.file_open */ native_file_file_open,
- /*.file_close */ native_file_file_close,
- /*.file_read */ native_file_file_read,
- /*.file_write */ native_file_file_write,
- /*.file_seek */ native_file_file_seek,
- /*.file_set_string */ native_file_file_set_string,
- /*.file_get_string */ native_file_file_get_string,
- /*.extens */ NULL,
- /*.next */ NULL,
-};
-
-static switch_loadable_module_interface_t native_file_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ &native_file_file_interface
-};
-
-
SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
{
+ switch_file_interface_t *file_interface;
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
uint32_t num_codecs = switch_loadable_module_get_codecs(NULL, codecs, sizeof(codecs) / sizeof(codecs[0]));
@@ -175,9 +151,17 @@
supported_formats[x] = codecs[x]->iananame;
}
- /* connect my internal structure to the blank pointer passed to me */
- native_file_file_interface.extens = supported_formats;
- *module_interface = &native_file_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
+ file_interface->interface_name = modname;
+ file_interface->extens = supported_formats;
+ file_interface->file_open = native_file_file_open;
+ file_interface->file_close = native_file_file_close;
+ file_interface->file_read = native_file_file_read;
+ file_interface->file_write = native_file_file_write;
+ file_interface->file_seek = native_file_file_seek;
+ file_interface->file_set_string = native_file_file_set_string;
+ file_interface->file_get_string = native_file_file_get_string;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c (original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c Wed Jun 20 13:06:05 2007
@@ -253,30 +253,6 @@
static char **supported_formats;
-static switch_file_interface_t sndfile_file_interface = {
- /*.interface_name */ modname,
- /*.file_open */ sndfile_file_open,
- /*.file_close */ sndfile_file_close,
- /*.file_read */ sndfile_file_read,
- /*.file_write */ sndfile_file_write,
- /*.file_seek */ sndfile_file_seek,
- /*.file_set_string */ sndfile_file_set_string,
- /*.file_get_string */ sndfile_file_get_string,
- /*.extens */ NULL,
- /*.next */ NULL,
-};
-
-static switch_loadable_module_interface_t sndfile_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ &sndfile_file_interface
-};
-
static switch_status_t setup_formats(void)
{
SF_FORMAT_INFO info;
@@ -364,6 +340,7 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load)
{
+ switch_file_interface_t *file_interface;
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
@@ -377,8 +354,17 @@
}
/* connect my internal structure to the blank pointer passed to me */
- sndfile_file_interface.extens = supported_formats;
- *module_interface = &sndfile_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
+ file_interface->interface_name = modname;
+ file_interface->extens = supported_formats;
+ file_interface->file_open = sndfile_file_open;
+ file_interface->file_close = sndfile_file_close;
+ file_interface->file_read = sndfile_file_read;
+ file_interface->file_write = sndfile_file_write;
+ file_interface->file_seek = sndfile_file_seek;
+ file_interface->file_set_string = sndfile_file_set_string;
+ file_interface->file_get_string = sndfile_file_get_string;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c Wed Jun 20 13:06:05 2007
@@ -79,29 +79,6 @@
destroy_perl(&my_perl);
}
-static switch_application_interface_t perl_application_interface = {
- /*.interface_name */ "perl",
- /*.application_function */ perl_function,
- NULL, NULL, NULL,
- /* flags */ SAF_NONE,
- /* should we support no media mode here? If so, we need to detect the mode, and either disable the media functions or indicate media if/when we need */
- /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t perl_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ &perl_application_interface,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
-
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown)
{
if (globals.my_perl) {
@@ -115,7 +92,7 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load)
{
-
+ switch_application_interface_t *app_interface;
PerlInterpreter *my_perl;
char code[1024];
@@ -135,7 +112,8 @@
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &perl_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_APP(app_interface, "perl", NULL, NULL, perl_function, NULL, SAF_NONE);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Wed Jun 20 13:06:05 2007
@@ -629,7 +629,7 @@
message = "(N/A)";
}
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, filename, modname, line, SWITCH_LOG_ERROR, "%s %s%s\n", ex, message, text);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, filename, modname, line, NULL, SWITCH_LOG_ERROR, "%s %s%s\n", ex, message, text);
}
@@ -2588,12 +2588,12 @@
}
if ((msg = JS_GetStringBytes(JS_ValueToString(cx, argv[1])))) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "console_log", line, level, "%s", msg);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "console_log", line, NULL, level, "%s", msg);
return JS_TRUE;
}
} else if (argc > 0) {
if ((msg = JS_GetStringBytes(JS_ValueToString(cx, argv[0])))) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "console_log", line, level, "%s", msg);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "console_log", line, NULL, level, "%s", msg);
return JS_TRUE;
}
}
@@ -2914,7 +2914,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
SWITCH_STANDARD_API(launch_async)
{
@@ -2928,48 +2927,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
-static switch_application_interface_t ivrtest_application_interface = {
- /*.interface_name */ "javascript",
- /*.application_function */ js_dp_function,
- /* long_desc */ "Run a javascript ivr on a channel",
- /* short_desc */ "Launch JS ivr.",
- /* syntax */ "<script> [additional_vars [...]]",
- /* flags */ SAF_NONE,
- /* should we support no media mode here? If so, we need to detect the mode, and either disable the media functions or indicate media if/when we need */
- /*.next */ NULL
-};
-
-
-static switch_api_interface_t jsapi_interface = {
- /*.interface_name */ "jsapi",
- /*.desc */ "execute an api call",
- /*.function */ jsapi_function,
- /*.syntax */ "jsapi <script> [additional_vars [...]]",
- /*.next */ NULL
-};
-
-static switch_api_interface_t js_run_interface = {
- /*.interface_name */ "jsrun",
- /*.desc */ "run a script",
- /*.function */ launch_async,
- /*.syntax */ "jsrun <script> [additional_vars [...]]",
- /*.next */ &jsapi_interface
-};
-
-static switch_loadable_module_interface_t spidermonkey_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ &ivrtest_application_interface,
- /*.api_interface */ &js_run_interface,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
static void message_query_handler(switch_event_t *event)
{
char *account = switch_event_get_header(event, "message-account");
@@ -2994,6 +2951,8 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load)
{
+ switch_api_interface_t *api_interface;
+ switch_application_interface_t *app_interface;
switch_status_t status;
if ((status = init_js()) != SWITCH_STATUS_SUCCESS) {
@@ -3007,7 +2966,10 @@
}
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &spidermonkey_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_API(api_interface, "jsrun", "run a script", launch_async, "jsrun <script> [additional_vars [...]]");
+ SWITCH_ADD_API(api_interface, "jsapi", "execute an api call", jsapi_function, "jsapi <script> [additional_vars [...]]");
+ SWITCH_ADD_APP(app_interface, "javascript", "Launch JS ivr", "Run a javascript ivr on a channel", js_dp_function, "<script> [additional_vars [...]]", SAF_NONE);
curl_global_init(CURL_GLOBAL_ALL);
Modified: freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c (original)
+++ freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c Wed Jun 20 13:06:05 2007
@@ -56,19 +56,6 @@
};
#endif
-static switch_loadable_module_interface_t console_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
static switch_memory_pool_t *module_pool = NULL;
static switch_hash_t *log_hash = NULL;
static switch_hash_t *name_hash = NULL;
@@ -192,14 +179,10 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_console_load)
{
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
-
+ module_pool = pool;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &console_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
/* setup my logger function */
switch_log_bind_logger(switch_console_logger, SWITCH_LOG_DEBUG);
Modified: freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c (original)
+++ freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c Wed Jun 20 13:06:05 2007
@@ -510,37 +510,18 @@
return SWITCH_STATUS_FALSE;
}
-static switch_say_interface_t es_say_interface = {
- /*.name */ "es",
- /*.say_function */ en_say,
-};
-
-static switch_say_interface_t en_say_interface = {
- /*.name */ "en",
- /*.say_function */ en_say,
- /*.next */ &es_say_interface
-};
-
-static switch_loadable_module_interface_t say_en_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL,
- /*.chat_interface */ NULL,
- /*.say_inteface */ &en_say_interface,
- /*.asr_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load)
{
+ switch_say_interface_t *say_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &say_en_module_interface;
+ *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 = "en";
+ say_interface->say_function = en_say;
+ say_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SAY_INTERFACE);
+ say_interface->interface_name = "es";
+ say_interface->say_function = en_say;
+
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c (original)
+++ freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c Wed Jun 20 13:06:05 2007
@@ -186,31 +186,20 @@
return SWITCH_STATUS_SUCCESS;
}
-static switch_timer_interface_t timer_interface = {
- /*.interface_name */ "soft",
- /*.timer_init */ timer_init,
- /*.timer_next */ timer_next,
- /*.timer_step */ timer_step,
- /*.timer_check */ timer_check,
- /*.timer_destroy */ timer_destroy
-};
-
-static switch_loadable_module_interface_t softtimer_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ &timer_interface
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load)
{
-
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_MEMERR;
- }
+ switch_timer_interface_t *timer_interface;
+ module_pool = pool;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &softtimer_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ timer_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_TIMER_INTERFACE);
+ timer_interface->interface_name = "soft";
+ timer_interface->timer_init = timer_init;
+ timer_interface->timer_next = timer_next;
+ timer_interface->timer_step = timer_step;
+ timer_interface->timer_check = timer_check;
+ timer_interface->timer_destroy = timer_destroy;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Wed Jun 20 13:06:05 2007
@@ -91,22 +91,12 @@
/*.on_transmit */ NULL
};
-
-static switch_loadable_module_interface_t xml_cdr_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ NULL,
- /*.codec_interface = */ NULL,
- /*.application_interface */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
{
/* test global state handlers */
switch_core_add_state_handler(&state_handlers);
- *module_interface = &xml_cdr_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Wed Jun 20 13:06:05 2007
@@ -143,20 +143,6 @@
return xml;
}
-
-static switch_loadable_module_interface_t xml_curl_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
static switch_status_t do_config(void)
{
char *cf = "xml_curl.conf";
@@ -234,7 +220,7 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &xml_curl_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
if (do_config() == SWITCH_STATUS_SUCCESS) {
curl_global_init(CURL_GLOBAL_ALL);
Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Wed Jun 20 13:06:05 2007
@@ -47,19 +47,6 @@
SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime);
SWITCH_MODULE_DEFINITION(mod_xml_rpc, mod_xml_rpc_load, mod_xml_rpc_shutdown, mod_xml_rpc_runtime);
-static switch_loadable_module_interface_t xml_rpc_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ NULL,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
-};
-
static struct {
uint16_t port;
uint8_t running;
@@ -69,10 +56,10 @@
} globals;
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm)
- SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_user, globals.user)
- SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_pass, globals.pass)
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_user, globals.user)
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_pass, globals.pass)
- static switch_status_t do_config(void)
+ static switch_status_t do_config(void)
{
char *cf = "xml_rpc.conf";
switch_xml_t cfg, xml, settings, param;
@@ -118,7 +105,7 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &xml_rpc_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
memset(&globals, 0, sizeof(globals));
Modified: freeswitch/branches/greenlizard/src/switch_channel.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_channel.c (original)
+++ freeswitch/branches/greenlizard/src/switch_channel.c Wed Jun 20 13:06:05 2007
@@ -319,9 +319,10 @@
if (!(v = switch_core_hash_find(channel->variables, varname))) {
if (!channel->caller_profile || !(v = switch_caller_get_field_by_name(channel->caller_profile, varname))) {
if (!strcmp(varname, "base_dir")) {
- return SWITCH_GLOBAL_dirs.base_dir;
+ v = SWITCH_GLOBAL_dirs.base_dir;
+ } else {
+ v = switch_core_get_variable(varname);
}
- v = switch_core_get_variable(varname);
}
}
switch_mutex_unlock(channel->profile_mutex);
@@ -711,7 +712,7 @@
if (state > CS_RING) {
switch_channel_presence(channel, "unknown", (char *) state_names[state]);
}
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_DEBUG, "%s State Change %s -> %s\n",
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "%s State Change %s -> %s\n",
channel->name, state_names[last_state], state_names[state]);
switch_mutex_lock(channel->flag_mutex);
channel->state = state;
@@ -742,7 +743,7 @@
}
} else {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_WARNING,
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_WARNING,
"%s Invalid State Change %s -> %s\n", channel->name, state_names[last_state], state_names[state]);
/* we won't tolerate an invalid state change so we can make sure we are as robust as a nice cup of dark coffee! */
@@ -1049,7 +1050,7 @@
switch_channel_state_t last_state = channel->state;
channel->state = CS_HANGUP;
channel->hangup_cause = hangup_cause;
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n",
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n",
channel->name, state_names[last_state], switch_channel_cause2str(channel->hangup_cause));
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HANGUP) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", "%s", switch_channel_cause2str(channel->hangup_cause));
@@ -1072,7 +1073,7 @@
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_channel_t *channel, const char *file, const char *func, int line)
{
if (!switch_channel_test_flag(channel, CF_RING_READY)) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_NOTICE, "Ring-Ready %s!\n", channel->name);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Ring-Ready %s!\n", channel->name);
switch_channel_set_flag(channel, CF_RING_READY);
return SWITCH_STATUS_SUCCESS;
}
@@ -1092,7 +1093,7 @@
char *uuid;
switch_core_session_t *other_session;
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_NOTICE, "Pre-Answer %s!\n", channel->name);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Pre-Answer %s!\n", channel->name);
switch_channel_set_flag(channel, CF_EARLY_MEDIA);
switch_channel_set_variable(channel, "endpoint_disposition", "EARLY MEDIA");
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_PROGRESS) == SWITCH_STATUS_SUCCESS) {
@@ -1168,7 +1169,7 @@
status = switch_core_session_receive_message(channel->session, &msg);
if (status == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_NOTICE, "Ring Ready %s!\n", channel->name);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Ring Ready %s!\n", channel->name);
}
return status;
@@ -1213,7 +1214,7 @@
}
switch_channel_set_variable(channel, "endpoint_disposition", "ANSWER");
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_NOTICE, "Channel [%s] has been answered\n", channel->name);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Channel [%s] has been answered\n", channel->name);
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/branches/greenlizard/src/switch_core_io.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_io.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_io.c Wed Jun 20 13:06:05 2007
@@ -746,7 +746,7 @@
switch_io_event_hook_kill_channel_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_DEBUG, "Kill %s [%s]\n", switch_channel_get_name(session->channel),
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "Kill %s [%s]\n", switch_channel_get_name(session->channel),
SIG_NAMES[sig]);
if (session->endpoint_interface->io_routines->kill_channel) {
Modified: freeswitch/branches/greenlizard/src/switch_core_session.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_session.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_session.c Wed Jun 20 13:06:05 2007
@@ -658,7 +658,7 @@
switch_memory_pool_t *pool;
switch_event_t *event;
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_NOTICE, "Close Channel %s [%s]\n",
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Close Channel %s [%s]\n",
switch_channel_get_name((*session)->channel),
switch_channel_state_name(switch_channel_get_state((*session)->channel)));
Modified: freeswitch/branches/greenlizard/src/switch_event.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_event.c (original)
+++ freeswitch/branches/greenlizard/src/switch_event.c Wed Jun 20 13:06:05 2007
@@ -870,7 +870,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_DECLARE(switch_status_t) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback,
+SWITCH_DECLARE(switch_status_t) switch_event_bind(const char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback,
void *user_data)
{
switch_event_node_t *event_node;
Modified: freeswitch/branches/greenlizard/src/switch_log.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_log.c (original)
+++ freeswitch/branches/greenlizard/src/switch_log.c Wed Jun 20 13:06:05 2007
@@ -164,7 +164,7 @@
}
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line,
- switch_log_level_t level, const char *fmt, ...)
+ const char *userdata, switch_log_level_t level, const char *fmt, ...)
{
char *data = NULL;
char *new_fmt = NULL;
Modified: freeswitch/branches/greenlizard/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_rtp.c (original)
+++ freeswitch/branches/greenlizard/src/switch_rtp.c Wed Jun 20 13:06:05 2007
@@ -32,6 +32,7 @@
*/
#include <switch.h>
+#include <switch_stun.h>
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
Modified: freeswitch/branches/greenlizard/src/switch_stun.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_stun.c (original)
+++ freeswitch/branches/greenlizard/src/switch_stun.c Wed Jun 20 13:06:05 2007
@@ -31,6 +31,7 @@
*
*/
#include <switch.h>
+#include <switch_stun.h>
struct value_mapping {
const uint32_t value;
1
0
[Freeswitch-branches] [commit] r5419 - in freeswitch/branches/greenlizard/src: . include mod/languages/mod_python
by Freeswitch SVN 20 Jun '07
by Freeswitch SVN 20 Jun '07
20 Jun '07
Author: greenlizard
Date: Wed Jun 20 10:27:37 2007
New Revision: 5419
Modified:
freeswitch/branches/greenlizard/src/include/switch_cpp.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/branches/greenlizard/src/switch_cpp.cpp
Log:
implement recordFile() method
Modified: freeswitch/branches/greenlizard/src/include/switch_cpp.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_cpp.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_cpp.h Wed Jun 20 10:27:37 2007
@@ -68,6 +68,17 @@
void setVariable(char *var, char *val);
char *getVariable(char *var);
+
+ /** \brief Record to a file
+ * \param filename
+ * \param <[max_len]> maximum length of the recording in seconds
+ * \param <[silence_threshold]> energy level audio must fall below
+ * to be considered silence (500 is a good starting point).
+ * \param <[silence_secs]> seconds of silence to interrupt the record.
+ */
+ int recordFile(char *file_name, int max_len=0, int silence_threshold=0, int silence_secs=0);
+
+
/** \brief Set attributes of caller data for purposes of outgoing calls
* \param var - the variable name, eg, "caller_id_name"
* \param val - the data to set, eg, "bob"
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py Wed Jun 20 10:27:37 2007
@@ -106,6 +106,7 @@
def hangup(*args): return _freeswitch.CoreSession_hangup(*args)
def setVariable(*args): return _freeswitch.CoreSession_setVariable(*args)
def getVariable(*args): return _freeswitch.CoreSession_getVariable(*args)
+ def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args)
def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args)
def originate(*args): return _freeswitch.CoreSession_originate(*args)
def playFile(*args): return _freeswitch.CoreSession_playFile(*args)
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Wed Jun 20 10:27:37 2007
@@ -3745,6 +3745,73 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int arg3 = (int) 0 ;
+ int arg4 = (int) 0 ;
+ int arg5 = (int) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ int val5 ;
+ int ecode5 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO|OOO:CoreSession_recordFile",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_recordFile" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_recordFile" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ if (obj2) {
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_recordFile" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ }
+ if (obj3) {
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoreSession_recordFile" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ }
+ if (obj4) {
+ ecode5 = SWIG_AsVal_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CoreSession_recordFile" "', argument " "5"" of type '" "int""'");
+ }
+ arg5 = static_cast< int >(val5);
+ }
+ result = (int)(arg1)->recordFile(arg2,arg3,arg4,arg5);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_CoreSession_setCallerData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -4821,6 +4888,7 @@
{ (char *)"CoreSession_hangup", _wrap_CoreSession_hangup, METH_VARARGS, NULL},
{ (char *)"CoreSession_setVariable", _wrap_CoreSession_setVariable, METH_VARARGS, NULL},
{ (char *)"CoreSession_getVariable", _wrap_CoreSession_getVariable, METH_VARARGS, NULL},
+ { (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL},
{ (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL},
{ (char *)"CoreSession_playFile", _wrap_CoreSession_playFile, METH_VARARGS, NULL},
Modified: freeswitch/branches/greenlizard/src/switch_cpp.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_cpp.cpp (original)
+++ freeswitch/branches/greenlizard/src/switch_cpp.cpp Wed Jun 20 10:27:37 2007
@@ -304,6 +304,20 @@
return SWITCH_STATUS_FALSE;
}
+int CoreSession::recordFile(char *file_name, int max_len, int silence_threshold, int silence_secs)
+{
+ switch_file_handle_t fh = { 0 };
+ switch_status_t status;
+
+ fh.thresh = silence_threshold;
+ fh.silence_hits = silence_secs;
+ store_file_handle(&fh);
+ begin_allow_threads();
+ status = switch_ivr_record_file(session, &fh, file_name, &args, max_len);
+ end_allow_threads();
+ return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
+
+}
void CoreSession::setCallerData(char *var, char *val) {
1
0