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
- 1655 discussions
Author: sphere
Date: Thu Dec 14 21:12:38 2006
New Revision: 3667
Added:
freeswitch/branches/johnc/
Log:
Creating empty folder for johnc
1
0
[commit] r3660 - in freeswitch/branches/jkr888/trunk: scripts src/mod/languages/mod_python
by Freeswitch SVN 14 Dec '06
by Freeswitch SVN 14 Dec '06
14 Dec '06
Author: jkr888
Date: Thu Dec 14 17:37:54 2006
New Revision: 3660
Modified:
freeswitch/branches/jkr888/trunk/scripts/mytest.py
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/Makefile
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
Log:
Modified: freeswitch/branches/jkr888/trunk/scripts/mytest.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/scripts/mytest.py (original)
+++ freeswitch/branches/jkr888/trunk/scripts/mytest.py Thu Dec 14 17:37:54 2006
@@ -13,22 +13,22 @@
newSession = SessionContainer(sys.argv[0])
-newSession.console_log("1","test from my python program\n")
-newSession.console_clean_log("This is fs_consol_clean\n")
+#newSession.console_log("1","test from my python program\n")
+#newSession.console_clean_log("This is fs_consol_clean\n")
newSession.answer()
-newSession.set_dtmf_callback(onDTMF)
-newSession.set_tts_parms("cepstral", "david")
+#newSession.set_dtmf_callback(onDTMF)
+#newSession.set_tts_parms("cepstral", "david")
-newSession.play_file("/root/test.gsm", "")
-newSession.speak_text("Please enter telephone number with area code and press pound sign. ")
+#newSession.play_file("/root/test.gsm", "")
+#newSession.speak_text("Please enter telephone number with area code and press pound sign. ")
-input = newSession.get_digits("", 11, "*#", 10000)
+#input = newSession.get_digits("", 11, "*#", 10000)
-newSession.console_log("1","result from get digits is "+ input +"\n")
+#newSession.console_log("1","result from get digits is "+ input +"\n")
-phone_number = newSession.play_and_get_digits(5, 10, 3, 10000, "*#", "/var/lib/asterisk/sounds/callfwd-intro-us-only.gsm",
- "/var/lib/asterisk/sounds/callfwd-invalid-entry.gsm", "", "");
+phone_number = newSession.play_and_get_digits(5, 11, 3, 10000, "*#", "/var/lib/asterisk/sounds/callfwd-intro-us-only.gsm",
+ "/var/lib/asterisk/sounds/callfwd-invalid-entry.gsm", "", "^17322969239$");
newSession.console_log("1","result from play_and_get_digits is "+ phone_number +"\n")
newSession.transfer("1000", "XML", "default")
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/Makefile
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/Makefile (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/Makefile Thu Dec 14 17:37:54 2006
@@ -50,4 +50,5 @@
install:
# cp -f py_$(PYMOD).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
cp -f $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
+ cp -f freeswitch.py $(PREFIX)/lib/python2.4/site-packages/
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp Thu Dec 14 17:37:54 2006
@@ -33,14 +33,20 @@
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, msg);
}
-void SessionContainer::answer()
+int SessionContainer::answer()
{
- switch_channel_answer(channel);
+ switch_status_t status;
+
+ status = switch_channel_answer(channel);
+ return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
-void SessionContainer::pre_answer()
+int SessionContainer::pre_answer()
{
+ switch_status_t status;
+
switch_channel_pre_answer(channel);
+ return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
void SessionContainer::hangup(char *cause)
@@ -70,6 +76,7 @@
int SessionContainer::play_file(char *file, char *timer_name)
{
switch_status_t status;
+
if (switch_strlen_zero(timer_name)) {
timer_name = NULL;
}
@@ -83,7 +90,6 @@
}
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
-
}
void SessionContainer::set_dtmf_callback(PyObject *pyfunc)
@@ -118,23 +124,30 @@
voice_name = voice_name_p;
}
-void SessionContainer::get_digits(char *dtmf_buf, int len, char *terminators, int timeout)
+int SessionContainer::get_digits(char *dtmf_buf, int len, char *terminators, char *terminator, int timeout)
{
- char terminator;
+ switch_status_t status;
- switch_ivr_collect_digits_count(session, dtmf_buf,(uint32_t) len,(uint32_t) len, terminators, &terminator, (uint32_t) timeout);
-
+ status = switch_ivr_collect_digits_count(session, dtmf_buf,(uint32_t) len,(uint32_t) len, terminators, terminator, (uint32_t) timeout);
+ return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
-void SessionContainer::transfer(char *extension, char *dialplan, char *context)
+int SessionContainer::transfer(char *extension, char *dialplan, char *context)
{
- switch_ivr_session_transfer(session, extension, dialplan, context);
+ switch_status_t status;
+
+ status = switch_ivr_session_transfer(session, extension, dialplan, context);
+ return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
-void SessionContainer::play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
+int SessionContainer::play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex)
{
- switch_play_and_get_digits( session, (uint32_t) min_digits,(uint32_t) max_digits,(uint32_t) max_tries, (uint32_t) timeout,
+ switch_status_t status;
+
+ status = switch_play_and_get_digits( session, (uint32_t) min_digits,(uint32_t) max_digits,
+ (uint32_t) max_tries, (uint32_t) timeout,
terminators, audio_files, bad_input_audio_files, dtmf_buf, 128, digits_regex);
+ return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h Thu Dec 14 17:37:54 2006
@@ -29,8 +29,8 @@
~SessionContainer();
void console_log(char *level_str, char *msg);
void console_clean_log(char *msg);
- void answer();
- void pre_answer();
+ int answer();
+ int pre_answer();
void hangup(char *cause);
void set_variable(char *var, char *val);
void get_variable(char *var, char *val);
@@ -39,9 +39,9 @@
void set_dtmf_callback(PyObject *pyfunc);
int speak_text(char *text);
void set_tts_parms(char *tts_name, char *voice_name);
- void get_digits(char *dtmf_buf, int len, char *terminators, int timeout);
- void transfer(char *extensions, char *dialplan, char *context);
- void play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
+ int get_digits(char *dtmf_buf, int len, char *terminators, char *terminator, int timeout);
+ int transfer(char *extensions, char *dialplan, char *context);
+ int play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex);
protected:
};
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i Thu Dec 14 17:37:54 2006
@@ -2,6 +2,7 @@
%include "cstring.i"
%cstring_bounded_mutable(char *dtmf_buf, 128);
+%cstring_bounded_mutable(char *terminator, 8);
%{
#include "freeswitch_python.h"
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Thu Dec 14 17:37:54 2006
@@ -1933,14 +1933,17 @@
static PyObject *_wrap_SessionContainer_answer(PyObject *, PyObject *args) {
PyObject *resultobj = NULL;
SessionContainer *arg1 = (SessionContainer *) 0 ;
+ int result;
PyObject * obj0 = 0 ;
if(!PyArg_ParseTuple(args,(char *)"O:SessionContainer_answer",&obj0)) goto fail;
SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1)) SWIG_fail;
- (arg1)->answer();
+ result = (int)(arg1)->answer();
- Py_INCREF(Py_None); resultobj = Py_None;
+ {
+ resultobj = SWIG_From_int(static_cast<int >(result));
+ }
return resultobj;
fail:
return NULL;
@@ -1950,14 +1953,17 @@
static PyObject *_wrap_SessionContainer_pre_answer(PyObject *, PyObject *args) {
PyObject *resultobj = NULL;
SessionContainer *arg1 = (SessionContainer *) 0 ;
+ int result;
PyObject * obj0 = 0 ;
if(!PyArg_ParseTuple(args,(char *)"O:SessionContainer_pre_answer",&obj0)) goto fail;
SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1)) SWIG_fail;
- (arg1)->pre_answer();
+ result = (int)(arg1)->pre_answer();
- Py_INCREF(Py_None); resultobj = Py_None;
+ {
+ resultobj = SWIG_From_int(static_cast<int >(result));
+ }
return resultobj;
fail:
return NULL;
@@ -2170,15 +2176,19 @@
char *arg2 = (char *) 0 ;
int arg3 ;
char *arg4 = (char *) 0 ;
- int arg5 ;
+ char *arg5 = (char *) 0 ;
+ int arg6 ;
+ int result;
char temp2[128+1] ;
+ char temp5[8+1] ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
- if(!PyArg_ParseTuple(args,(char *)"OOOOO:SessionContainer_get_digits",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail;
+ if(!PyArg_ParseTuple(args,(char *)"OOOOOO:SessionContainer_get_digits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail;
SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
if (SWIG_arg_fail(1)) SWIG_fail;
{
@@ -2198,13 +2208,25 @@
SWIG_arg_fail(4);SWIG_fail;
}
{
- arg5 = static_cast<int >(SWIG_As_int(obj4));
- if (SWIG_arg_fail(5)) SWIG_fail;
+ char *t = 0; size_t n;
+ SWIG_AsCharPtrAndSize(obj4, &t, &n);
+ if (SWIG_arg_fail(5)) SWIG_fail;
+ if ( n > (size_t)8 ) n = (size_t)8;
+ memcpy(temp5, t, sizeof(char)*n);
+ temp5[n] = 0;
+ arg5 = (char *) temp5;
}
- (arg1)->get_digits(arg2,arg3,arg4,arg5);
+ {
+ arg6 = static_cast<int >(SWIG_As_int(obj5));
+ if (SWIG_arg_fail(6)) SWIG_fail;
+ }
+ result = (int)(arg1)->get_digits(arg2,arg3,arg4,arg5,arg6);
- Py_INCREF(Py_None); resultobj = Py_None;
+ {
+ resultobj = SWIG_From_int(static_cast<int >(result));
+ }
arg2[128] = 0; resultobj = t_output_helper(resultobj, SWIG_FromCharPtr(arg2));
+ arg5[8] = 0; resultobj = t_output_helper(resultobj, SWIG_FromCharPtr(arg5));
return resultobj;
fail:
return NULL;
@@ -2217,6 +2239,7 @@
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
char *arg4 = (char *) 0 ;
+ int result;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
@@ -2234,9 +2257,11 @@
if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
SWIG_arg_fail(4);SWIG_fail;
}
- (arg1)->transfer(arg2,arg3,arg4);
+ result = (int)(arg1)->transfer(arg2,arg3,arg4);
- Py_INCREF(Py_None); resultobj = Py_None;
+ {
+ resultobj = SWIG_From_int(static_cast<int >(result));
+ }
return resultobj;
fail:
return NULL;
@@ -2255,6 +2280,7 @@
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
char *arg10 = (char *) 0 ;
+ int result;
char temp9[128+1] ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -2307,9 +2333,11 @@
if (!SWIG_AsCharPtr(obj9, (char**)&arg10)) {
SWIG_arg_fail(10);SWIG_fail;
}
- (arg1)->play_and_get_digits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+ result = (int)(arg1)->play_and_get_digits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
- Py_INCREF(Py_None); resultobj = Py_None;
+ {
+ resultobj = SWIG_From_int(static_cast<int >(result));
+ }
arg9[128] = 0; resultobj = t_output_helper(resultobj, SWIG_FromCharPtr(arg9));
return resultobj;
fail:
1
0
Author: sphere
Date: Thu Dec 14 02:00:33 2006
New Revision: 3648
Added:
freeswitch/branches/fonomni/
Log:
Creating empty folder for fonomni
1
0
[commit] r3645 - in freeswitch/branches/knhor/trunk: . src src/mod/endpoints/mod_sofia src/mod/languages/mod_spidermonkey
by Freeswitch SVN 14 Dec '06
by Freeswitch SVN 14 Dec '06
14 Dec '06
Author: knhor
Date: Wed Dec 13 21:30:39 2006
New Revision: 3645
Modified:
freeswitch/branches/knhor/trunk/ (props changed)
freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/branches/knhor/trunk/src/switch_rtp.c
Log:
Merged revisions 3640-3642 via svnmerge from trunk
Modified: freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Dec 13 21:30:39 2006
@@ -1468,6 +1468,9 @@
if ((vad_in && inb) || (vad_out && !inb)) {
switch_rtp_enable_vad(tech_pvt->rtp_session, tech_pvt->session, &tech_pvt->read_codec, SWITCH_VAD_FLAG_TALKING);
switch_set_flag_locked(tech_pvt, TFLAG_VAD);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTP Engage VAD for %s ( %s %s )\n",
+ switch_channel_get_name(switch_core_session_get_channel(tech_pvt->session)),
+ vad_in ? "in" : "", vad_out ? "out" : "");
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err);
@@ -4367,7 +4370,7 @@
}
}
- if (status == 401 || status == 407) {
+ if (sip && (status == 401 || status == 407)) {
sip_r_challenge(status, phrase, nua, profile, nh, sofia_private, sip, tags);
goto done;
}
Modified: freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Wed Dec 13 21:30:39 2006
@@ -793,13 +793,19 @@
static JSBool session_flush_digits(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
- switch_channel_t *channel;
char buf[256];
switch_size_t has;
+ switch_channel_t *channel;
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if ((has = switch_channel_has_dtmf(channel))) {
switch_channel_dequeue_dtmf(channel, buf, has);
}
@@ -812,7 +818,17 @@
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_event_t *event;
+ switch_channel_t *channel;
+ channel = switch_core_session_get_channel(jss->session);
+ assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
while (switch_core_session_dequeue_event(jss->session, &event) == SWITCH_STATUS_SUCCESS) {
switch_event_destroy(&event);
}
@@ -837,6 +853,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if (argc > 0) {
file_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -885,7 +908,7 @@
JS_ResumeRequest(cx, cb_state.saveDepth);
*rval = cb_state.ret;
- return (switch_channel_ready(channel)) ? JS_TRUE : JS_FALSE;
+ return JS_TRUE;
}
@@ -902,6 +925,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if (argc > 0) {
if ((function = JS_ValueToFunction(cx, argv[0]))) {
@@ -931,7 +961,7 @@
*rval = cb_state.ret;
- return (switch_channel_ready(channel)) ? JS_TRUE : JS_FALSE;
+ return JS_TRUE;
}
static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
@@ -950,6 +980,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if (argc > 0) {
file_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -994,7 +1031,7 @@
JS_ResumeRequest(cx, cb_state.saveDepth);
*rval = cb_state.ret;
- return (switch_channel_ready(channel)) ? JS_TRUE : JS_FALSE;
+ return JS_TRUE;
}
static JSBool session_set_variable(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
@@ -1005,6 +1042,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
+
if (argc > 1) {
char *var, *val;
@@ -1027,6 +1071,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
+
if (argc > 0) {
char *var, *val;
@@ -1063,6 +1114,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if (argc > 0) {
tts_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -1113,7 +1171,7 @@
JS_ResumeRequest(cx, cb_state.saveDepth);
*rval = cb_state.ret;
- return (switch_channel_ready(channel)) ? JS_TRUE : JS_FALSE;
+ return JS_TRUE;
}
static JSBool session_get_digits(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
@@ -1123,6 +1181,17 @@
char *buf;
int digits;
int32 timeout = 5000;
+ switch_channel_t *channel;
+
+ channel = switch_core_session_get_channel(jss->session);
+ assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if (argc > 0) {
char term;
@@ -1151,6 +1220,13 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
+
switch_channel_answer(channel);
return JS_TRUE;
}
@@ -1162,6 +1238,7 @@
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
*rval = BOOLEAN_TO_JSVAL( switch_channel_ready(channel) ? JS_TRUE : JS_FALSE );
return JS_TRUE;
@@ -1176,8 +1253,10 @@
switch_time_t started;
unsigned int elapsed;
int32 timeout = 60;
+
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
started = switch_time_now();
if (argc > 0) {
@@ -1209,8 +1288,10 @@
switch_time_t started;
unsigned int elapsed;
int32 timeout = 60;
+
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
+
started = switch_time_now();
if (argc > 0) {
@@ -1237,6 +1318,19 @@
static JSBool session_execute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
JSBool retval = JS_FALSE;
+ switch_channel_t *channel;
+ struct js_session *jss = JS_GetPrivate(cx, obj);
+
+ channel = switch_core_session_get_channel(jss->session);
+ assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
+
if (argc > 1) {
const switch_application_interface_t *application_interface;
char *app_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -1262,7 +1356,18 @@
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_event_t *event;
+ switch_channel_t *channel;
+ channel = switch_core_session_get_channel(jss->session);
+ assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
+
if (switch_core_session_dequeue_event(jss->session, &event) == SWITCH_STATUS_SUCCESS) {
JSObject *Event;
struct event_obj *eo;
@@ -1319,13 +1424,20 @@
char *cause_name = NULL;
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+ channel = switch_core_session_get_channel(jss->session);
+ assert(channel != NULL);
+
+ if (!switch_channel_ready(channel)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
+ *rval = BOOLEAN_TO_JSVAL( JS_FALSE );
+ return JS_TRUE;
+ }
+
if (argc > 1) {
cause_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
cause = switch_channel_str2cause(cause_name);
}
- channel = switch_core_session_get_channel(jss->session);
- assert(channel != NULL);
switch_channel_hangup(channel, cause);
switch_core_session_kill_channel(jss->session, SWITCH_SIG_KILL);
Modified: freeswitch/branches/knhor/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/switch_rtp.c (original)
+++ freeswitch/branches/knhor/trunk/src/switch_rtp.c Wed Dec 13 21:30:39 2006
@@ -1160,7 +1160,7 @@
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_GOOGLEHACK) && rtp_session->send_msg.header.pt == 97) {
rtp_session->recv_msg.header.pt = 102;
}
-
+
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD) &&
rtp_session->recv_msg.header.pt == rtp_session->vad_data.read_codec->implementation->ianacode &&
((datalen == rtp_session->vad_data.read_codec->implementation->encoded_bytes_per_frame) ||
@@ -1171,7 +1171,8 @@
uint32_t len = sizeof(decoded);
time_t now = time(NULL);
send = 0;
-
+
+
if (rtp_session->vad_data.scan_freq && rtp_session->vad_data.next_scan <= now) {
rtp_session->vad_data.bg_count = rtp_session->vad_data.bg_level = 0;
rtp_session->vad_data.next_scan = now + rtp_session->vad_data.scan_freq;
@@ -1191,7 +1192,7 @@
uint32_t energy = 0;
uint32_t x, y = 0, z = len / sizeof(int16_t);
uint32_t score = 0;
-
+
if (z) {
for (x = 0; x < z; x++) {
energy += abs(decoded[y]);
1
0
[commit] r3644 - in freeswitch/branches/knhor/trunk: . src src/mod/endpoints/mod_sofia
by Freeswitch SVN 14 Dec '06
by Freeswitch SVN 14 Dec '06
14 Dec '06
Author: knhor
Date: Wed Dec 13 21:29:33 2006
New Revision: 3644
Modified:
freeswitch/branches/knhor/trunk/ (props changed)
freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/branches/knhor/trunk/src/switch_rtp.c
Log:
Merged revisions 3635-3639 via svnmerge from trunk
Modified: freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Dec 13 21:29:33 2006
@@ -454,7 +454,7 @@
char uridigest[2 * SU_MD5_DIGEST_SIZE + 1];
char bigdigest[2 * SU_MD5_DIGEST_SIZE + 1];
char *nonce, *uri, *qop, *cnonce, *nc, *response, *input = NULL, *input2 = NULL;
- auth_res_t ret = AUTH_OK;
+ auth_res_t ret = AUTH_FORBIDDEN;
char *npassword = NULL;
int cnt = 0;
nonce = uri = qop = cnonce = nc = response = NULL;
@@ -527,7 +527,7 @@
su_md5_strupdate(&ctx, input2);
su_md5_hexdigest(&ctx, bigdigest);
su_md5_deinit(&ctx);
-
+
if (!strcasecmp(bigdigest, response)) {
ret = AUTH_OK;
} else {
@@ -1437,6 +1437,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTP CHANGING DEST TO: [%s:%d]\n",
tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port);
+ /* Reactivate the NAT buster flag. */
+ switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
}
return SWITCH_STATUS_SUCCESS;
}
@@ -2815,7 +2817,6 @@
}
sql = switch_mprintf("select passwd from sip_authentication where nonce='%q'", nonce);
-
if (switch_core_db_prepare(db, sql, -1, &stmt, 0)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Statement Error!\n");
goto fail;
@@ -2939,9 +2940,11 @@
}
if (authorization) {
- auth_res = parse_auth(profile, authorization, (char *)sip->sip_request->rq_method_name, key, keylen);
+ if ((auth_res = parse_auth(profile, authorization, (char *)sip->sip_request->rq_method_name, key, keylen)) == AUTH_STALE) {
+ stale = 1;
+ }
- if (auth_res != AUTH_OK && auth_res != AUTH_STALE) {
+ if (auth_res != AUTH_OK && !stale) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "send %s for [%s@%s]\n",
forbidden ? "forbidden" : "challange",
from_user, from_host);
@@ -3014,15 +3017,14 @@
switch_uuid_format(uuid_str, &uuid);
sql = switch_mprintf("delete from sip_authentication where user='%q' and host='%q';\n"
- "insert into sip_authentication values('%q','%q','%q','%q', %ld)",
- from_user,
- from_host,
- from_user,
- from_host,
- hexdigest,
- uuid_str,
- time(NULL) + 60);
-
+ "insert into sip_authentication values('%q','%q','%q','%q', %ld)",
+ from_user,
+ from_host,
+ from_user,
+ from_host,
+ hexdigest,
+ uuid_str,
+ time(NULL) + 60);
auth_str = switch_mprintf("Digest realm=\"%q\", nonce=\"%q\",%s algorithm=MD5, qop=\"auth\"", from_host, uuid_str,
stale ? " stale=\"true\"," : "");
@@ -4165,7 +4167,8 @@
sip_t const *sip,
tagi_t tags[])
{
- handle_register(nua, profile, nh, sip, REG_REGISTER, NULL, 0);
+ char key[128] = "";
+ handle_register(nua, profile, nh, sip, REG_REGISTER, key, sizeof(key));
}
Modified: freeswitch/branches/knhor/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/switch_rtp.c (original)
+++ freeswitch/branches/knhor/trunk/src/switch_rtp.c Wed Dec 13 21:29:33 2006
@@ -865,18 +865,15 @@
if (rtp_session->recv_msg.header.version) {
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && rtp_session->from_addr->port) {
- if ((rtp_session->from_addr->port != rtp_session->remote_port)) {
+ char *tx_host;
+ char *old_host;
+ char bufa[30], bufb[30];
+ tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
+ old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
+
+ if ((rtp_session->from_addr->port != rtp_session->remote_port) || strcmp(tx_host, old_host)) {
const char *err;
- char *tx_host;
uint32_t old = rtp_session->remote_port;
- char *old_host;
- char bufa[30], bufb[30];
-
- //switch_sockaddr_ip_get(&tx_host, rtp_session->from_addr);
- //switch_sockaddr_ip_get(&old_host, rtp_session->remote_addr);
-
- tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
- old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
if (!switch_strlen_zero(tx_host) && rtp_session->from_addr->port > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %s:%u to %s:%u\n",
1
0
[commit] r3636 - in freeswitch/branches/jkr888/trunk: scripts src/mod/languages/mod_python
by Freeswitch SVN 13 Dec '06
by Freeswitch SVN 13 Dec '06
13 Dec '06
Author: jkr888
Date: Wed Dec 13 14:59:24 2006
New Revision: 3636
Modified:
freeswitch/branches/jkr888/trunk/scripts/mytest.py
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
Log:
Modified: freeswitch/branches/jkr888/trunk/scripts/mytest.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/scripts/mytest.py (original)
+++ freeswitch/branches/jkr888/trunk/scripts/mytest.py Wed Dec 13 14:59:24 2006
@@ -27,6 +27,10 @@
newSession.console_log("1","result from get digits is "+ input +"\n")
+phone_number = newSession.play_and_get_digits(5, 10, 3, 10000, "*#", "/var/lib/asterisk/sounds/callfwd-intro-us-only.gsm",
+ "/var/lib/asterisk/sounds/callfwd-invalid-entry.gsm", "", "");
+
+newSession.console_log("1","result from play_and_get_digits is "+ phone_number +"\n")
newSession.transfer("1000", "XML", "default")
#newSession.hangup("1")
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py Wed Dec 13 14:59:24 2006
@@ -67,6 +67,7 @@
def set_tts_parms(*args): return _freeswitch.SessionContainer_set_tts_parms(*args)
def get_digits(*args): return _freeswitch.SessionContainer_get_digits(*args)
def transfer(*args): return _freeswitch.SessionContainer_transfer(*args)
+ def play_and_get_digits(*args): return _freeswitch.SessionContainer_play_and_get_digits(*args)
class SessionContainerPtr(SessionContainer):
def __init__(self, this):
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp Wed Dec 13 14:59:24 2006
@@ -131,5 +131,10 @@
switch_ivr_session_transfer(session, extension, dialplan, context);
}
-
+void SessionContainer::play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
+ char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex)
+{
+ switch_play_and_get_digits( session, (uint32_t) min_digits,(uint32_t) max_digits,(uint32_t) max_tries, (uint32_t) timeout,
+ terminators, audio_files, bad_input_audio_files, dtmf_buf, 128, digits_regex);
+}
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h Wed Dec 13 14:59:24 2006
@@ -41,6 +41,8 @@
void set_tts_parms(char *tts_name, char *voice_name);
void get_digits(char *dtmf_buf, int len, char *terminators, int timeout);
void transfer(char *extensions, char *dialplan, char *context);
+ void play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators,
+ char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex);
protected:
};
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Wed Dec 13 14:59:24 2006
@@ -2243,6 +2243,80 @@
}
+static PyObject *_wrap_SessionContainer_play_and_get_digits(PyObject *, PyObject *args) {
+ PyObject *resultobj = NULL;
+ SessionContainer *arg1 = (SessionContainer *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ int arg4 ;
+ int arg5 ;
+ char *arg6 = (char *) 0 ;
+ char *arg7 = (char *) 0 ;
+ char *arg8 = (char *) 0 ;
+ char *arg9 = (char *) 0 ;
+ char *arg10 = (char *) 0 ;
+ char temp9[128+1] ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
+ PyObject * obj6 = 0 ;
+ PyObject * obj7 = 0 ;
+ PyObject * obj8 = 0 ;
+ PyObject * obj9 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:SessionContainer_play_and_get_digits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail;
+ SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
+ if (SWIG_arg_fail(1)) SWIG_fail;
+ {
+ arg2 = static_cast<int >(SWIG_As_int(obj1));
+ if (SWIG_arg_fail(2)) SWIG_fail;
+ }
+ {
+ arg3 = static_cast<int >(SWIG_As_int(obj2));
+ if (SWIG_arg_fail(3)) SWIG_fail;
+ }
+ {
+ arg4 = static_cast<int >(SWIG_As_int(obj3));
+ if (SWIG_arg_fail(4)) SWIG_fail;
+ }
+ {
+ arg5 = static_cast<int >(SWIG_As_int(obj4));
+ if (SWIG_arg_fail(5)) SWIG_fail;
+ }
+ if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
+ SWIG_arg_fail(6);SWIG_fail;
+ }
+ if (!SWIG_AsCharPtr(obj6, (char**)&arg7)) {
+ SWIG_arg_fail(7);SWIG_fail;
+ }
+ if (!SWIG_AsCharPtr(obj7, (char**)&arg8)) {
+ SWIG_arg_fail(8);SWIG_fail;
+ }
+ {
+ char *t = 0; size_t n;
+ SWIG_AsCharPtrAndSize(obj8, &t, &n);
+ if (SWIG_arg_fail(9)) SWIG_fail;
+ if ( n > (size_t)128 ) n = (size_t)128;
+ memcpy(temp9, t, sizeof(char)*n);
+ temp9[n] = 0;
+ arg9 = (char *) temp9;
+ }
+ if (!SWIG_AsCharPtr(obj9, (char**)&arg10)) {
+ SWIG_arg_fail(10);SWIG_fail;
+ }
+ (arg1)->play_and_get_digits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+
+ Py_INCREF(Py_None); resultobj = Py_None;
+ arg9[128] = 0; resultobj = t_output_helper(resultobj, SWIG_FromCharPtr(arg9));
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject * SessionContainer_swigregister(PyObject *, PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
@@ -2268,6 +2342,7 @@
{ (char *)"SessionContainer_set_tts_parms", _wrap_SessionContainer_set_tts_parms, METH_VARARGS, NULL},
{ (char *)"SessionContainer_get_digits", _wrap_SessionContainer_get_digits, METH_VARARGS, NULL},
{ (char *)"SessionContainer_transfer", _wrap_SessionContainer_transfer, METH_VARARGS, NULL},
+ { (char *)"SessionContainer_play_and_get_digits", _wrap_SessionContainer_play_and_get_digits, METH_VARARGS, NULL},
{ (char *)"SessionContainer_swigregister", SessionContainer_swigregister, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
};
1
0
[commit] r3635 - in freeswitch/branches/knhor/trunk: . build conf libs/libdingaling libs/libdingaling/src libs/libresample/src src/mod/applications/mod_conference src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_portaudio
by Freeswitch SVN 13 Dec '06
by Freeswitch SVN 13 Dec '06
13 Dec '06
Author: knhor
Date: Wed Dec 13 13:04:49 2006
New Revision: 3635
Removed:
freeswitch/branches/knhor/trunk/libs/libresample/src/config.h
Modified:
freeswitch/branches/knhor/trunk/ (props changed)
freeswitch/branches/knhor/trunk/build/buildlib.sh
freeswitch/branches/knhor/trunk/conf/freeswitch.xml
freeswitch/branches/knhor/trunk/libs/libdingaling/.update
freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c
freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h
freeswitch/branches/knhor/trunk/libs/libresample/src/ (props changed)
freeswitch/branches/knhor/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
Log:
Merged revisions 3599-3634 via svnmerge from trunk
Modified: freeswitch/branches/knhor/trunk/build/buildlib.sh
==============================================================================
--- freeswitch/branches/knhor/trunk/build/buildlib.sh (original)
+++ freeswitch/branches/knhor/trunk/build/buildlib.sh Wed Dec 13 13:04:49 2006
@@ -20,6 +20,11 @@
fi
fi
+GZCAT=`which gzcat 2>/dev/null`
+if [ -z "$GZCAT" ] ; then
+ GZCAT=zcat
+fi
+
install=
base=http://svn.freeswitch.org/downloads/libs
@@ -52,15 +57,18 @@
fi
fi
if [ ! -d $uncompressed ] ; then
- tar -zxvf $tar
+ $GZCAT $tar | tar xf -
fi
fi
-
-if [ ! -f $root/.nothanks ] && [ $uncompressed/.complete -ot $uncompressed ] ; then
+if [ -f $uncompressed/.complete ] ; then
+if [ ! -n "$(find $uncompressed/.complete -prune -newer $uncompressed)" ]; then
+if [ ! -f $root/.nothanks ] ; then
echo remove stale .complete
rm $uncompressed/.complete
sh -c "cd $uncompressed && $MAKE clean distclean"
fi
+fi
+fi
if [ -f $uncompressed/.complete ] ; then
echo $uncompressed already installed
@@ -88,6 +96,8 @@
fi
if [ $? = 0 ] ; then
+ touch .complete
+ sleep 1
touch .complete
else
echo ERROR
Modified: freeswitch/branches/knhor/trunk/conf/freeswitch.xml
==============================================================================
--- freeswitch/branches/knhor/trunk/conf/freeswitch.xml (original)
+++ freeswitch/branches/knhor/trunk/conf/freeswitch.xml Wed Dec 13 13:04:49 2006
@@ -5,8 +5,8 @@
<configuration name="switch.conf" description="Modules">
<settings>
- <!--Most channels to allow at once -->
- <param name="max-sessions" value="1000"/>
+ <!--Most channels to allow at once -->
+ <param name="max-sessions" value="1000"/>
</settings>
<!--Any variables defined here will be available in every channel, in the dialplan etc -->
<variables>
@@ -18,70 +18,70 @@
<configuration name="modules.conf" description="Modules">
<modules>
- <!-- Loggers (I'd load these first) -->
- <load module="mod_console"/>
- <!-- <load module="mod_syslog"/> -->
+ <!-- Loggers (I'd load these first) -->
+ <load module="mod_console"/>
+ <!-- <load module="mod_syslog"/> -->
- <!-- Multi-Faceted -->
+ <!-- Multi-Faceted -->
<!-- mod_enum is a dialplan interface, an application interface and an api command interface -->
- <load module="mod_enum"/>
+ <load module="mod_enum"/>
- <!-- XML Interfaces -->
- <!-- <load module="mod_xml_rpc"/> -->
- <!-- <load module="mod_xml_curl"/> -->
+ <!-- XML Interfaces -->
+ <!-- <load module="mod_xml_rpc"/> -->
+ <!-- <load module="mod_xml_curl"/> -->
- <!-- Event Handlers -->
- <!-- <load module="mod_cdr"/> -->
- <!-- <load module="mod_event_multicast"/> -->
- <!-- <load module="mod_event_socket"/> -->
- <!-- <load module="mod_xmpp_event"/> -->
- <!-- <load module="mod_zeroconf"/> -->
+ <!-- Event Handlers -->
+ <!-- <load module="mod_cdr"/> -->
+ <!-- <load module="mod_event_multicast"/> -->
+ <!-- <load module="mod_event_socket"/> -->
+ <!-- <load module="mod_xmpp_event"/> -->
+ <!-- <load module="mod_zeroconf"/> -->
- <!-- Directory Interfaces -->
- <!-- <load module="mod_ldap"/> -->
+ <!-- Directory Interfaces -->
+ <!-- <load module="mod_ldap"/> -->
- <!-- Endpoints -->
- <!-- <load module="mod_dingaling"/> -->
- <!--<load module="mod_iax"/>-->
- <load module="mod_portaudio"/>
- <load module="mod_sofia"/>
- <!-- <load module="mod_wanpipe"/> -->
- <!-- <load module="mod_woomera"/> -->
+ <!-- Endpoints -->
+ <!-- <load module="mod_dingaling"/> -->
+ <!--<load module="mod_iax"/>-->
+ <load module="mod_portaudio"/>
+ <load module="mod_sofia"/>
+ <!-- <load module="mod_wanpipe"/> -->
+ <!-- <load module="mod_woomera"/> -->
- <!-- Applications -->
- <load module="mod_bridgecall"/>
- <load module="mod_commands"/>
- <load module="mod_conference"/>
- <load module="mod_dptools"/>
- <load module="mod_echo"/>
- <!--<load module="mod_park"/>-->
- <load module="mod_playback"/>
+ <!-- Applications -->
+ <load module="mod_bridgecall"/>
+ <load module="mod_commands"/>
+ <load module="mod_conference"/>
+ <load module="mod_dptools"/>
+ <load module="mod_echo"/>
+ <!--<load module="mod_park"/>-->
+ <load module="mod_playback"/>
- <!-- Dialplan Interfaces -->
- <!-- <load module="mod_dialplan_directory"/> -->
- <load module="mod_dialplan_xml"/>
+ <!-- Dialplan Interfaces -->
+ <!-- <load module="mod_dialplan_directory"/> -->
+ <load module="mod_dialplan_xml"/>
- <!-- Codec Interfaces -->
- <load module="mod_g711"/>
- <load module="mod_gsm"/>
- <!-- <load module="mod_ilbc"/> -->
- <load module="mod_l16"/>
- <!-- <load module="mod_speex"/> -->
+ <!-- Codec Interfaces -->
+ <load module="mod_g711"/>
+ <load module="mod_gsm"/>
+ <!-- <load module="mod_ilbc"/> -->
+ <load module="mod_l16"/>
+ <!-- <load module="mod_speex"/> -->
- <!-- File Format Interfaces -->
- <load module="mod_sndfile"/>
- <load module="mod_native_file"/>
+ <!-- File Format Interfaces -->
+ <load module="mod_sndfile"/>
+ <load module="mod_native_file"/>
- <!-- Timers -->
- <load module="mod_softtimer"/>
+ <!-- Timers -->
+ <load module="mod_softtimer"/>
- <!-- Languages -->
- <!-- <load module="mod_spidermonkey"/> -->
- <!-- <load module="mod_perl"/> -->
+ <!-- Languages -->
+ <!-- <load module="mod_spidermonkey"/> -->
+ <!-- <load module="mod_perl"/> -->
- <!-- ASR /TTS -->
- <!-- <load module="mod_cepstral"/> -->
- <!-- <load module="mod_rss"/> -->
+ <!-- ASR /TTS -->
+ <!-- <load module="mod_cepstral"/> -->
+ <!-- <load module="mod_rss"/> -->
</modules>
</configuration>
@@ -95,29 +95,29 @@
<configuration name="event_multicast.conf" description="Multicast Event">
<settings>
- <param name="address" value="225.1.1.1"/>
- <param name="port" value="4242"/>
- <param name="bindings" value="all"/>
+ <param name="address" value="225.1.1.1"/>
+ <param name="port" value="4242"/>
+ <param name="bindings" value="all"/>
</settings>
</configuration>
<configuration name="event_socket.conf" description="Socket Client">
<settings>
- <param name="listen-ip" value="127.0.0.1"/>
- <param name="listen-port" value="8021"/>
- <param name="password" value="ClueCon"/>
+ <param name="listen-ip" value="127.0.0.1"/>
+ <param name="listen-port" value="8021"/>
+ <param name="password" value="ClueCon"/>
</settings>
</configuration>
<configuration name="iax.conf" description="IAX Configuration">
<settings>
- <param name="debug" value="0"/>
- <!-- <param name="ip" value="1.2.3.4"> -->
- <param name="port" value="4569"/>
- <param name="dialplan" value="XML"/>
- <param name="codec-prefs" value="PCMU@20i,PCMA,speex,L16"/>
- <param name="codec-master" value="us"/>
- <param name="codec-rates" value="8"/>
+ <param name="debug" value="0"/>
+ <!-- <param name="ip" value="1.2.3.4"> -->
+ <param name="port" value="4569"/>
+ <param name="dialplan" value="XML"/>
+ <param name="codec-prefs" value="PCMU@20i,PCMA,speex,L16"/>
+ <param name="codec-master" value="us"/>
+ <param name="codec-rates" value="8"/>
</settings>
</configuration>
@@ -125,57 +125,57 @@
<!-- pick a file name, a function name or 'all' -->
<!-- map as many as you need for specific debugging -->
<mappings>
- <!-- <param name="log_event" value="DEBUG"/> -->
- <param name="all" value="DEBUG"/>
+ <!-- <param name="log_event" value="DEBUG"/> -->
+ <param name="all" value="DEBUG"/>
</mappings>
</configuration>
<configuration name="sofia.conf" description="sofia Endpoint">
<profiles>
- <profile name="mydomain1.com">
- <registrations>
- <!-- <registration name="asterlink">
- <param name="register-scheme" value="Digest"/>
- <param name="register-realm" value=""/>
- <param name="register-username" value="1001"/>
- <param name="register-password" value="nhy65tgb"/>
- <param name="register-from" value="sip:1001@208.64.200.40"/>
- <param name="register-to" value="sip:1001@conference.freeswitch.org"/>
- <param name="register-proxy" value="sip:conference.freeswitch.org:5060"/>
- <param name="register-frequency" value="20"/>
- </registration> -->
- </registrations>
- <settings>
- <param name="debug" value="1"/>
- <param name="rfc2833-pt" value="101"/>
- <param name="sip-port" value="5060"/>
- <param name="dialplan" value="XML"/>
- <param name="dtmf-duration" value="100"/>
- <param name="codec-prefs" value="PCMU@20i"/>
- <param name="codec-ms" value="20"/>
- <param name="use-rtp-timer" value="true"/>
- <param name="rtp-timer-name" value="soft"/>
- <param name="rtp-ip" value="192.168.1.20"/>
- <param name="sip-ip" value="mydomain1.com"/>
+ <profile name="mydomain1.com">
+ <registrations>
+ <!-- <registration name="asterlink">
+ <param name="register-scheme" value="Digest"/>
+ <param name="register-realm" value=""/>
+ <param name="register-username" value="1001"/>
+ <param name="register-password" value="nhy65tgb"/>
+ <param name="register-from" value="sip:1001@208.64.200.40"/>
+ <param name="register-to" value="sip:1001@conference.freeswitch.org"/>
+ <param name="register-proxy" value="sip:conference.freeswitch.org:5060"/>
+ <param name="register-frequency" value="20"/>
+ </registration> -->
+ </registrations>
+ <settings>
+ <param name="debug" value="1"/>
+ <param name="rfc2833-pt" value="101"/>
+ <param name="sip-port" value="5060"/>
+ <param name="dialplan" value="XML"/>
+ <param name="dtmf-duration" value="100"/>
+ <param name="codec-prefs" value="PCMU@20i"/>
+ <param name="codec-ms" value="20"/>
+ <param name="use-rtp-timer" value="true"/>
+ <param name="rtp-timer-name" value="soft"/>
+ <param name="rtp-ip" value="192.168.1.20"/>
+ <param name="sip-ip" value="mydomain1.com"/>
- <!-- this lets anything register -->
- <!-- comment the next line and uncomment one or both of the other 2 lines for call authentication -->
- <param name="accept-blind-reg" value="true"/>
+ <!-- this lets anything register -->
+ <!-- comment the next line and uncomment one or both of the other 2 lines for call authentication -->
+ <param name="accept-blind-reg" value="true"/>
- <!--<param name="auth-calls" value="true"/>-->
- <!-- on authed calls, authenticate *all* the packets not just invite -->
- <!--<param name="auth-all-packets" value="true"/>-->
+ <!--<param name="auth-calls" value="true"/>-->
+ <!-- on authed calls, authenticate *all* the packets not just invite -->
+ <!--<param name="auth-all-packets" value="true"/>-->
- <!-- optional ; -->
- <!-- <param name="ext-rtp-ip" value="stun:stun.server.com"/>-->
- <!-- <param name="ext-rtp-ip" value="100.101.102.103"/> -->
- <!-- VAD choose one (out is a good choice); -->
- <!-- <param name="vad" value="in"/> -->
- <!-- <param name="vad" value="out"/> -->
- <!-- <param name="vad" value="both"/> -->
- <!--<param name="alias" value="sip:10.0.1.251:5555"/>-->
- </settings>
- </profile>
+ <!-- optional ; -->
+ <!-- <param name="ext-rtp-ip" value="stun:stun.server.com"/>-->
+ <!-- <param name="ext-rtp-ip" value="100.101.102.103"/> -->
+ <!-- VAD choose one (out is a good choice); -->
+ <!-- <param name="vad" value="in"/> -->
+ <!-- <param name="vad" value="out"/> -->
+ <!-- <param name="vad" value="both"/> -->
+ <!--<param name="alias" value="sip:10.0.1.251:5555"/>-->
+ </settings>
+ </profile>
</profiles>
</configuration>
@@ -190,147 +190,147 @@
<!-- info - informational message -->
<!-- debug - debug-level message -->
<settings>
- <param name="ident" value="freeswitch"/>
- <param name="facility" value="user"/>
- <param name="format" value="${time} - ${message}"/>
- <param name="level" value="debug,info,warning-alert"/>
+ <param name="ident" value="freeswitch"/>
+ <param name="facility" value="user"/>
+ <param name="format" value="${time} - ${message}"/>
+ <param name="level" value="debug,info,warning-alert"/>
</settings>
</configuration>
<configuration name="woomera.conf" description="Woomera Endpoint">
<settings>
- <param name="debug" value="0"/>
+ <param name="debug" value="0"/>
</settings>
<interface>
- <param name="host" value="localhost"/>
- <param name="port" value="42420"/>
- <param name="audio-ip" value="127.0.0.1"/>
- <param name="dialplan" value="XML"/>
+ <param name="host" value="localhost"/>
+ <param name="port" value="42420"/>
+ <param name="audio-ip" value="127.0.0.1"/>
+ <param name="dialplan" value="XML"/>
</interface>
</configuration>
<configuration name="wanpipe.conf" description="Sangoma Wanpipe Endpoint">
<settings>
- <param name="debug" value="1"/>
- <param name="dialplan" value="XML"/>
- <param name="mtu" value="320"/>
- <param name="dtmf-on" value="800"/>
- <param name="dtmf-off" value="100"/>
- <param name="supress-dtmf-tone" value="yes"/>
+ <param name="debug" value="1"/>
+ <param name="dialplan" value="XML"/>
+ <param name="mtu" value="320"/>
+ <param name="dtmf-on" value="800"/>
+ <param name="dtmf-off" value="100"/>
+ <param name="supress-dtmf-tone" value="yes"/>
</settings>
<span>
- <param name="span" value="1"/>
- <param name="node" value="cpe"/>
- <!-- <param name="switch" value="ni2"/> -->
- <param name="switch" value="dms100"/>
- <!-- <param name="switch" value="lucent5e"/> -->
- <!-- <param name="switch" value="att4ess"/> -->
- <!-- <param name="switch" value="euroisdn"/> -->
- <!-- <param name="switch" value="gr303eoc"/> -->
- <!-- <param name="switch" value="gr303tmc"/> -->
- <param name="dp" value="national"/>
- <!-- <param name="dp" value="international"/> -->
- <!-- <param name="dp" value="local"/> -->
- <!-- <param name="dp" value="private"/> -->
- <!-- <param name="dp" value="unknown"/> -->
- <param name="l1" value="ulaw"/>
- <!-- <param name="l1" value="alaw"/> -->
- <param name="bchan" value="1-23"/>
- <param name="dchan" value="24"/>
- <param name="dialplan" value="XML"/>
+ <param name="span" value="1"/>
+ <param name="node" value="cpe"/>
+ <!-- <param name="switch" value="ni2"/> -->
+ <param name="switch" value="dms100"/>
+ <!-- <param name="switch" value="lucent5e"/> -->
+ <!-- <param name="switch" value="att4ess"/> -->
+ <!-- <param name="switch" value="euroisdn"/> -->
+ <!-- <param name="switch" value="gr303eoc"/> -->
+ <!-- <param name="switch" value="gr303tmc"/> -->
+ <param name="dp" value="national"/>
+ <!-- <param name="dp" value="international"/> -->
+ <!-- <param name="dp" value="local"/> -->
+ <!-- <param name="dp" value="private"/> -->
+ <!-- <param name="dp" value="unknown"/> -->
+ <param name="l1" value="ulaw"/>
+ <!-- <param name="l1" value="alaw"/> -->
+ <param name="bchan" value="1-23"/>
+ <param name="dchan" value="24"/>
+ <param name="dialplan" value="XML"/>
</span>
</configuration>
<configuration name="portaudio.conf" description="Soundcard Endpoint">
<settings>
- <param name="debug" value="2"/>
- <param name="dialplan" value="XML"/>
+ <param name="debug" value="2"/>
+ <param name="dialplan" value="XML"/>
- <!-- partial string match on something in the name or the device # -->
- <param name="indev" value="USB"/>
- <param name="outdev" value="USB"/>
+ <!-- partial string match on something in the name or the device # -->
+ <param name="indev" value="USB"/>
+ <param name="outdev" value="USB"/>
- <param name="cid-name" value="FreeSwitch"/>
- <param name="cid-num" value="5555551212"/>
+ <param name="cid-name" value="FreeSwitch"/>
+ <param name="cid-num" value="5555551212"/>
</settings>
</configuration>
<configuration name="zeroconf.conf" description="Zeroconf Event Handler">
<settings>
- <param name="publish" value="yes"/>
- <param name="browse" value="_sip._udp"/>
+ <param name="publish" value="yes"/>
+ <param name="browse" value="_sip._udp"/>
</settings>
</configuration>
<configuration name="xmpp_event.conf" description="XMPP Event Handler">
<settings>
- <param name="#debug" value="1"/>
- <param name="jid" value="freeswitch(a)my.jabber.com/me"/>
- <param name="passwd" value="mypass"/>
- <param name="target-jid" value="freeswitch(a)reader.org/him"/>
+ <param name="#debug" value="1"/>
+ <param name="jid" value="freeswitch(a)my.jabber.com/me"/>
+ <param name="passwd" value="mypass"/>
+ <param name="target-jid" value="freeswitch(a)reader.org/him"/>
</settings>
</configuration>
<configuration name="dialplan_directory.conf" description="Dialplan Directory">
<settings>
- <param name="directory-name" value="ldap"/>
- <param name="host" value="ldap.freeswitch.org"/>
- <param name="dn" value="cn=Manager,dc=freeswitch,dc=org"/>
- <param name="pass" value="test"/>
- <param name="base" value="dc=freeswitch,dc=org"/>
+ <param name="directory-name" value="ldap"/>
+ <param name="host" value="ldap.freeswitch.org"/>
+ <param name="dn" value="cn=Manager,dc=freeswitch,dc=org"/>
+ <param name="pass" value="test"/>
+ <param name="base" value="dc=freeswitch,dc=org"/>
</settings>
</configuration>
<configuration name="dingaling.conf" description="XMPP Jingle Endpoint">
<settings>
- <param name="debug" value="0"/>
- <param name="codec-prefs" value="PCMU"/>
+ <param name="debug" value="0"/>
+ <param name="codec-prefs" value="PCMU"/>
</settings>
<!-- *NOTE* change <x-profile></x-profile> to <profile></profile> to enable -->
<!-- Client Profile (Original mode) -->
<x-profile type="client">
- <param name="name" value="mydomain.com"/>
- <param name="login" value="myjid(a)myserver.com/talk"/>
- <param name="password" value="mypass"/>
- <param name="dialplan" value="XML"/>
- <param name="message" value="Jingle all the way"/>
- <param name="rtp-ip" value="10.0.0.1"/>
- <param name="auto-login" value="true"/>
+ <param name="name" value="mydomain.com"/>
+ <param name="login" value="myjid(a)myserver.com/talk"/>
+ <param name="password" value="mypass"/>
+ <param name="dialplan" value="XML"/>
+ <param name="message" value="Jingle all the way"/>
+ <param name="rtp-ip" value="10.0.0.1"/>
+ <param name="auto-login" value="true"/>
<param name="auto-reply" value="Press *Call* to call FreeSWITCH and be sure to come to ClueCon! http://www.cluecon.com"/>
- <!-- SASL "plain" or "md5" -->
- <param name="sasl" value="plain"/>
- <!-- if the server where the jabber is hosted is not the same as the one in the jid -->
- <!--<param name="server" value="alternate.server.com"/>-->
- <!-- Enable TLS or not -->
- <param name="tls" value="true"/>
- <!-- disable to trade async for more calls -->
- <param name="use-rtp-timer" value="true"/>
- <!-- or -->
- <!-- <param name="rtp-ip" value="my_lan_ip"/> -->
- <!-- <param name="ext-rtp-ip" value="stun:stun.server.com"/> -->
- <!-- default extension (if one cannot be determined) -->
- <param name="exten" value="888"/>
- <!-- VAD choose one -->
- <!-- <param name="vad" value="in"/> -->
- <!-- <param name="vad" value="out"/> -->
- <param name="vad" value="both"/>
+ <!-- SASL "plain" or "md5" -->
+ <param name="sasl" value="plain"/>
+ <!-- if the server where the jabber is hosted is not the same as the one in the jid -->
+ <!--<param name="server" value="alternate.server.com"/>-->
+ <!-- Enable TLS or not -->
+ <param name="tls" value="true"/>
+ <!-- disable to trade async for more calls -->
+ <param name="use-rtp-timer" value="true"/>
+ <!-- or -->
+ <!-- <param name="rtp-ip" value="my_lan_ip"/> -->
+ <!-- <param name="ext-rtp-ip" value="stun:stun.server.com"/> -->
+ <!-- default extension (if one cannot be determined) -->
+ <param name="exten" value="888"/>
+ <!-- VAD choose one -->
+ <!-- <param name="vad" value="in"/> -->
+ <!-- <param name="vad" value="out"/> -->
+ <param name="vad" value="both"/>
</x-profile>
<!-- Component (Server to Server Login) -->
<x-profile type="component">
<!-- All traffic for *(a)sub.mydomain.com will come to you -->
<param name="name" value="sub.mydomain.com"/>
- <param name="password" value="secret"/>
+ <param name="password" value="secret"/>
<param name="dialplan" value="XML"/>
<param name="rtp-ip" value="208.64.200.42"/>
<param name="server" value="jabber.server.org:5347"/>
- <!-- disable to trade async for more calls -->
- <param name="use-rtp-timer" value="true"/>
+ <!-- disable to trade async for more calls -->
+ <param name="use-rtp-timer" value="true"/>
<!-- "_auto_" means the extension will be automaticly set to the called jid -->
- <param name="exten" value="_auto_"/>
- <!--<param name="vad" value="both"/>-->
+ <param name="exten" value="_auto_"/>
+ <!--<param name="vad" value="both"/>-->
</x-profile>
</configuration>
@@ -347,109 +347,131 @@
<configuration name="xml_rpc.conf" description="XML RPC">
<settings>
- <!-- The port where you want to run the http service (default 8080) -->
- <param name="http-port" value="8080"/>
- <!-- if all 3 of the following params exist all http traffic will require auth -->
- <param name="auth-realm" value="freeswitch"/>
- <param name="auth-user" value="freeswitch"/>
- <param name="auth-pass" value="works"/>
+ <!-- The port where you want to run the http service (default 8080) -->
+ <param name="http-port" value="8080"/>
+ <!-- if all 3 of the following params exist all http traffic will require auth -->
+ <param name="auth-realm" value="freeswitch"/>
+ <param name="auth-user" value="freeswitch"/>
+ <param name="auth-pass" value="works"/>
</settings>
</configuration>
<configuration name="rss.conf" description="RSS Parser">
<feeds>
- <!-- Just download the files to wherever and refer to them here -->
- <!-- <feed name="Slash Dot">/home/rss/rss.rss</feed> -->
- <!-- <feed name="News Forge">/home/rss/newsforge.rss</feed> -->
+ <!-- Just download the files to wherever and refer to them here -->
+ <!-- <feed name="Slash Dot">/home/rss/rss.rss</feed> -->
+ <!-- <feed name="News Forge">/home/rss/newsforge.rss</feed> -->
</feeds>
</configuration>
<!-- None of these paths are real if you want any of these options you need to really set them up -->
<configuration name="conference.conf" description="Audio Conference">
- <!-- Profiles are collections of settings you can reference by name. -->
+ <!-- Advertise certian presence on startup . -->
+ <advertise>
+ <room name="888(a)sub.mydomain.com" status="FreeSWITCH"/>
+ </advertise>
+ <!-- Profiles are collections of settings you can reference by name. -->
<profiles>
- <profile name="default">
- <!-- Sample Rate-->
- <param name="rate" value="8000"/>
- <!-- Number of milliseconds per frame -->
- <param name="interval" value="20"/>
- <!-- Energy level required for audio to be sent to the other users -->
- <param name="energy-level" value="300"/>
- <!-- TTS Engine to use -->
- <!--<param name="tts-engine" value="cepstral"/>-->
- <!-- TTS Voice to use -->
- <!--<param name="tts-voice" value="david"/>-->
+ <profile name="default">
+ <!-- Domain (for presence) -->
+ <param name="domain" value="sub.mydomain.com"/>
+ <!-- Sample Rate-->
+ <param name="rate" value="8000"/>
+ <!-- Number of milliseconds per frame -->
+ <param name="interval" value="20"/>
+ <!-- Energy level required for audio to be sent to the other users -->
+ <param name="energy-level" value="300"/>
+ <!-- TTS Engine to use -->
+ <!--<param name="tts-engine" value="cepstral"/>-->
+ <!-- TTS Voice to use -->
+ <!--<param name="tts-voice" value="david"/>-->
- <!-- If TTS is enabled all audio-file params not beginning with -->
- <!-- '/' or with drive: (i.e. c:) will be considered text to say with TTS -->
+ <!-- If TTS is enabled all audio-file params not beginning with -->
+ <!-- '/' or with drive: (i.e. c:) will be considered text to say with TTS -->
- <!-- File to play to acknowledge succees -->
- <!--<param name="ack-sound" value="/soundfiles/beep.wav"/>-->
- <!-- File to play to acknowledge failure -->
- <!--<param name="nack-sound" value="/soundfiles/beeperr.wav"/>-->
- <!-- File to play to acknowledge muted -->
- <!--<param name="muted-sound" value="/soundfiles/muted.wav"/>-->
- <!-- File to play to acknowledge unmuted -->
- <!--<param name="unmuted-sound" value="/soundfiles/unmuted.wav"/>-->
- <!-- File to play if you are alone in the conference -->
- <!--<param name="alone-sound" value="/soundfiles/yactopitc.wav"/>-->
- <!-- File to play when you join the conference -->
- <!--<param name="enter-sound" value="/soundfiles/welcome.wav"/>-->
- <!-- File to play when you leave the conference -->
- <!--<param name="exit-sound" value="/soundfiles/exit.wav"/>-->
- <!-- File to play when you ae ejected from the conference -->
- <!--<param name="kicked-sound" value="/soundfiles/kicked.wav"/>-->
- <!-- File to play when the conference is locked -->
- <!--<param name="locked-sound" value="/soundfiles/locked.wav"/>-->
- <!-- File to play to prompt for a pin -->
- <!--<param name="pin-sound" value="/soundfiles/pin.wav"/>-->
- <!-- File to play to when the pin is invalid -->
- <!--<param name="bad-pin-sound" value="/soundfiles/invalid-pin.wav"/>-->
- <!-- Conference pin -->
- <!--<param name="pin" value="12345"/>-->
- <!-- Default Caller ID Name for outbound calls -->
- <param name="caller-id-name" value="FreeSWITCH"/>
- <!-- Default Caller ID Number for outbound calls -->
- <param name="caller-id-number" value="8777423583"/>
- </profile>
+ <!-- File to play to acknowledge succees -->
+ <!--<param name="ack-sound" value="/soundfiles/beep.wav"/>-->
+ <!-- File to play to acknowledge failure -->
+ <!--<param name="nack-sound" value="/soundfiles/beeperr.wav"/>-->
+ <!-- File to play to acknowledge muted -->
+ <!--<param name="muted-sound" value="/soundfiles/muted.wav"/>-->
+ <!-- File to play to acknowledge unmuted -->
+ <!--<param name="unmuted-sound" value="/soundfiles/unmuted.wav"/>-->
+ <!-- File to play if you are alone in the conference -->
+ <!--<param name="alone-sound" value="/soundfiles/yactopitc.wav"/>-->
+ <!-- File to play when you join the conference -->
+ <!--<param name="enter-sound" value="/soundfiles/welcome.wav"/>-->
+ <!-- File to play when you leave the conference -->
+ <!--<param name="exit-sound" value="/soundfiles/exit.wav"/>-->
+ <!-- File to play when you ae ejected from the conference -->
+ <!--<param name="kicked-sound" value="/soundfiles/kicked.wav"/>-->
+ <!-- File to play when the conference is locked -->
+ <!--<param name="locked-sound" value="/soundfiles/locked.wav"/>-->
+ <!-- File to play to prompt for a pin -->
+ <!--<param name="pin-sound" value="/soundfiles/pin.wav"/>-->
+ <!-- File to play to when the pin is invalid -->
+ <!--<param name="bad-pin-sound" value="/soundfiles/invalid-pin.wav"/>-->
+ <!-- Conference pin -->
+ <!--<param name="pin" value="12345"/>-->
+ <!-- Default Caller ID Name for outbound calls -->
+ <param name="caller-id-name" value="FreeSWITCH"/>
+ <!-- Default Caller ID Number for outbound calls -->
+ <param name="caller-id-number" value="8777423583"/>
+ </profile>
</profiles>
</configuration>
<configuration name="enum.conf" description="ENUM Module">
<settings>
- <param name="default-root" value="e164.org"/>
+ <param name="default-root" value="e164.org"/>
</settings>
<routes>
- <route service="E2U+SIP" regex="sip:(.*)" replace="sofia/test/$1"/>
- <route service="E2U+IAX2" regex="iax2:(.*)" replace="iax/$1"/>
- <route service="E2U+XMPP" regex="XMPP:(.*)" replace="dingaling/jingle/$1"/>
+ <route service="E2U+SIP" regex="sip:(.*)" replace="sofia/test/$1"/>
+ <route service="E2U+IAX2" regex="iax2:(.*)" replace="iax/$1"/>
+ <route service="E2U+XMPP" regex="XMPP:(.*)" replace="dingaling/jingle/$1"/>
</routes>
</configuration>
<configuration name="ivr.conf" description="IVR menus">
- <menus>
- <menu name="main" greet-long="/soundfiles/greet-long.wav" greet-short="/soundfiles/greet-short.wav" invalid-sound="/soundfiles/invalid.wav" exit-sound="/soundfiles/exit.wav" timeout ="15" max-failures="3">
- <entry action="menu-exit" digits="*"/>
- <entry action="menu-sub" digits="2" param="menu2"/>
- <entry action="menu-exec-api" digits="3" param="api arg"/>
- <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
- <entry action="menu-back" digits="5"/>
- <entry action="menu-call-transfer" digits="7" param="888"/>
- <entry action="menu-sub" digits="8" param="menu8"/>>
- </menu>
- <menu name="menu8" greet-long="/soundfiles/greet-long.wav" greet-short="/soundfiles/greet-short.wav" invalid-sound="/soundfiles/invalid.wav" exit-sound="/soundfiles/exit.wav" timeout ="15" max-failures="3">
- <entry action="menu-back" digits="#"/>
- <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
- <entry action="menu-top" digits="*"/>
- </menu>
- <menu name="menu2" greet-long="/soundfiles/greet-long.wav" greet-short="/soundfiles/greet-short.wav" invalid-sound="/soundfiles/invalid.wav" exit-sound="/soundfiles/exit.wav" timeout ="15" max-failures="3">
- <entry action="menu-back" digits="#"/>
- <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
- <entry action="menu-top" digits="*"/>
- </menu>
- </menus>
+ <menus>
+ <menu name="main"
+ greet-long="/soundfiles/greet-long.wav"
+ greet-short="/soundfiles/greet-short.wav"
+ invalid-sound="/soundfiles/invalid.wav"
+ exit-sound="/soundfiles/exit.wav" timeout ="15" max-failures="3">
+ <entry action="menu-exit" digits="*"/>
+ <entry action="menu-sub" digits="2" param="menu2"/>
+ <entry action="menu-exec-api" digits="3" param="api arg"/>
+ <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
+ <entry action="menu-back" digits="5"/>
+ <entry action="menu-call-transfer" digits="7" param="888"/>
+ <entry action="menu-sub" digits="8" param="menu8"/>>
+ </menu>
+ <menu name="menu8"
+ greet-long="/soundfiles/greet-long.wav"
+ greet-short="/soundfiles/greet-short.wav"
+ invalid-sound="/soundfiles/invalid.wav"
+ exit-sound="/soundfiles/exit.wav"
+ timeout ="15"
+ max-failures="3">
+ <entry action="menu-back" digits="#"/>
+ <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
+ <entry action="menu-top" digits="*"/>
+ </menu>
+ <menu name="menu2"
+ greet-long="/soundfiles/greet-long.wav"
+ greet-short="/soundfiles/greet-short.wav"
+ invalid-sound="/soundfiles/invalid.wav"
+ exit-sound="/soundfiles/exit.wav"
+ timeout ="15"
+ max-failures="3">
+ <entry action="menu-back" digits="#"/>
+ <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
+ <entry action="menu-top" digits="*"/>
+ </menu>
+ </menus>
</configuration>
</section>
@@ -462,47 +484,47 @@
<!-- *NOTE* The special context name 'any' will match any context -->
<context name="default">
<extension name="tollfree">
- <condition field="destination_number" expression="^(18(0{2}|8{2}|7{2}|6{2})\d{7})$">
+ <condition field="destination_number" expression="^(18(0{2}|8{2}|7{2}|6{2})\d{7})$">
<action application="enum" data="$1"/>
<action application="bridge" data="${enum_auto_route}"/>
- </condition>
+ </condition>
</extension>
<!-- Call the FreeSWITCH conference via SIP -->
- <!--<extension name="FreeSWITCH Conference SIP">-->
- <!--<condition field="destination_number" expression="^888$">-->
- <!--<action application="bridge" data="sofia/test/888(a)conference.freeswitch.org"/>-->
- <!--</condition>-->
- <!--</extension> -->
+ <!--<extension name="FreeSWITCH Conference SIP">-->
+ <!--<condition field="destination_number" expression="^888$">-->
+ <!--<action application="bridge" data="sofia/test/888(a)conference.freeswitch.org"/>-->
+ <!--</condition>-->
+ <!--</extension> -->
<!-- Call the FreeSWITCH conference via IAX -->
- <!--<extension name="FreeSWITCH Conference IAX">-->
- <!--<condition field="destination_number" expression="^8888$">-->
- <!--<action application="bridge" data="iax/guest(a)conference.freeswitch.org/888"/>-->
- <!--</condition>-->
- <!--</extension>-->
+ <!--<extension name="FreeSWITCH Conference IAX">-->
+ <!--<condition field="destination_number" expression="^8888$">-->
+ <!--<action application="bridge" data="iax/guest(a)conference.freeswitch.org/888"/>-->
+ <!--</condition>-->
+ <!--</extension>-->
<extension name="testmusic">
- <condition field="destination_number" expression="^1234$">
+ <condition field="destination_number" expression="^1234$">
<!-- Request a certain tone/file to be played while you wait for the call to be answered-->
<action application="set" data="ringback=${us-ring}"/>
<!--<action application="set" data="ringback=/home/ring.wav"/>-->
- <action application="bridge" data="sofia/test/1234(a)conference.freeswitch.org"/>
- </condition>
+ <action application="bridge" data="sofia/test/1234(a)conference.freeswitch.org"/>
+ </condition>
</extension>
<!-- Enter an existing conference -->
<extension name="1000">
- <condition field="destination_number" expression="^1000$">
- <action application="conference" data="freeswitch"/>
- </condition>
+ <condition field="destination_number" expression="^1000$">
+ <action application="conference" data="freeswitch"/>
+ </condition>
</extension>
<!-- Start a dynamic conference and call someone at the same time -->
<extension name="2000">
- <condition field="destination_number" expression="^2000$">
- <action application="conference" data="bridge:mydynaconf:sofia/test/1234@conference.freeswitch.org"/>
- </condition>
+ <condition field="destination_number" expression="^2000$">
+ <action application="conference" data="bridge:mydynaconf:sofia/test/1234@conference.freeswitch.org"/>
+ </condition>
</extension>
<!-- extensions starting with 4, all the numbers after 4 form a numeric filename -->
@@ -515,33 +537,33 @@
<!-- the desired file. This is for demo purposes both actions -->
<!-- could have been under the same <extension> tag as well. -->
<extension name="playsound1" continue="true">
- <condition field="source" expression="mod_sofia"/>
- <condition field="destination_number" expression="^4(\d+)">
- <action application="playback" data="/var/sounds/beep.gsm"/>
- </condition>
+ <condition field="source" expression="mod_sofia"/>
+ <condition field="destination_number" expression="^4(\d+)">
+ <action application="playback" data="/var/sounds/beep.gsm"/>
+ </condition>
</extension>
<extension name="playsound2">
- <condition field="source" expression="mod_sofia"/>
- <condition field="destination_number" expression="^4(\d+)">
- <action application="playback" data="/root/$1.raw"/>
- </condition>
+ <condition field="source" expression="mod_sofia"/>
+ <condition field="destination_number" expression="^4(\d+)">
+ <action application="playback" data="/root/$1.raw"/>
+ </condition>
</extension>
<!-- send everything with a certian RDNIS to Wanpipe ISDN -->
<extension name="To PRI">
- <condition field="rdnis" expression="8881231234"/>
- <condition field="destination_number" expression="(.*)">
- <action application="bridge" data="wanpipe/a/a/$1"/>
- </condition>
+ <condition field="rdnis" expression="8881231234"/>
+ <condition field="destination_number" expression="(.*)">
+ <action application="bridge" data="wanpipe/a/a/$1"/>
+ </condition>
</extension>
<!-- Call *MUST* originate from mod_iax and also be dialing ext 9999-->
<extension name="9999">
- <condition field="source" expression="mod_iax"/>
- <condition field="destination_number" expression="9999">
- <action application="playback" data="/var/sounds/beep.gsm"/>
- </condition>
+ <condition field="source" expression="mod_iax"/>
+ <condition field="destination_number" expression="9999">
+ <action application="playback" data="/var/sounds/beep.gsm"/>
+ </condition>
</extension>
</context>
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/.update
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/.update (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/.update Wed Dec 13 13:04:49 2006
@@ -1 +1 @@
-Fri Dec 1 21:13:04 EST 2006
+Tue Dec 12 11:55:02 EST 2006
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c Wed Dec 13 13:04:49 2006
@@ -701,6 +701,8 @@
if (type && !strcasecmp(type, "unavailable")) {
signal = LDL_SIGNAL_PRESENCE_OUT;
+ } else if (type && !strcasecmp(type, "probe")) {
+ signal = LDL_SIGNAL_PRESENCE_PROBE;
} else {
signal = LDL_SIGNAL_PRESENCE_IN;
}
@@ -725,20 +727,15 @@
}
-
if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
apr_cpystrn(buffer->buf, from, buffer->len);
fflush(stderr);
buffer->hit = 1;
}
- if (!type || (type && strcasecmp(type, "probe"))) {
-
- if (handle->session_callback) {
- handle->session_callback(handle, NULL, signal, to, id, status ? status : "n/a", show ? show : "n/a");
- }
- }
-
+ if (handle->session_callback) {
+ handle->session_callback(handle, NULL, signal, to, id, status ? status : "n/a", show ? show : "n/a");
+ }
return IKS_FILTER_EAT;
}
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h Wed Dec 13 13:04:49 2006
@@ -125,6 +125,7 @@
LDL_SIGNAL_MSG,
LDL_SIGNAL_PRESENCE_IN,
LDL_SIGNAL_PRESENCE_OUT,
+ LDL_SIGNAL_PRESENCE_PROBE,
LDL_SIGNAL_ROSTER,
LDL_SIGNAL_SUBSCRIBE,
LDL_SIGNAL_UNSUBSCRIBE,
Modified: freeswitch/branches/knhor/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/applications/mod_conference/mod_conference.c Wed Dec 13 13:04:49 2006
@@ -1357,7 +1357,7 @@
write_frame.data = data;
use_buffer = member->mux_buffer;
- while ((write_frame.datalen = (uint32_t)switch_buffer_read(use_buffer, write_frame.data, bytes))) {
+ if ((write_frame.datalen = (uint32_t)switch_buffer_read(use_buffer, write_frame.data, bytes))) {
if (write_frame.datalen && switch_test_flag(member, MFLAG_CAN_HEAR)) {
write_frame.samples = write_frame.datalen / 2;
@@ -1370,10 +1370,11 @@
}
switch_mutex_unlock(member->audio_out_mutex);
+ continue;
}
- }
+ }
- switch_core_timer_next(&timer);
+ switch_core_timer_next(&timer);
} /* Rinse ... Repeat */
if (member->digit_stream != NULL) {
Modified: freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Wed Dec 13 13:04:49 2006
@@ -2107,7 +2107,7 @@
}
if (is_special(to)) {
- ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+ ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
}
#if 0
@@ -2116,7 +2116,7 @@
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+ //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
switch_event_fire(&event);
}
@@ -2130,6 +2130,11 @@
switch_event_fire(&event);
}
break;
+ case LDL_SIGNAL_PRESENCE_PROBE:
+ if (is_special(to)) {
+ ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
+ }
+ break;
case LDL_SIGNAL_PRESENCE_IN:
if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {
@@ -2148,7 +2153,7 @@
if (is_special(to)) {
- ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+ ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
}
#if 0
if (is_special(to)) {
@@ -2156,13 +2161,14 @@
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+ //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
switch_event_fire(&event);
}
}
break;
#endif
+
case LDL_SIGNAL_PRESENCE_OUT:
if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {
Modified: freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c Wed Dec 13 13:04:49 2006
@@ -149,8 +149,12 @@
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL INIT %d %d\n", switch_channel_get_name(channel),
- switch_channel_get_state(channel), switch_test_flag(tech_pvt, TFLAG_ANSWER));
+ switch_channel_get_state(channel), switch_test_flag(tech_pvt, TFLAG_ANSWER));
+
+
+ engage_device(tech_pvt);
+
while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
if (switch_time_now() - last >= waitsec) {
char buf[512];
@@ -159,8 +163,8 @@
snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id);
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_RINGING) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_info", buf);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call_id", tech_pvt->call_id);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_info", "%s", buf);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call_id", "%s", tech_pvt->call_id);
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
@@ -171,10 +175,6 @@
switch_yield(50000);
}
- if (switch_channel_ready(channel)) {
- /* Turn on the device */
- engage_device(tech_pvt);
- }
}
1
0
Author: jkr888
Date: Wed Dec 13 12:20:17 2006
New Revision: 3634
Modified:
freeswitch/branches/jkr888/trunk/scripts/mytest.py
Log:
Modified: freeswitch/branches/jkr888/trunk/scripts/mytest.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/scripts/mytest.py (original)
+++ freeswitch/branches/jkr888/trunk/scripts/mytest.py Wed Dec 13 12:20:17 2006
@@ -11,14 +11,10 @@
else:
return 0
-uuid = sys.argv[0]
+newSession = SessionContainer(sys.argv[0])
-newSession = SessionContainer(uuid)
-
newSession.console_log("1","test from my python program\n")
-
newSession.console_clean_log("This is fs_consol_clean\n")
-newSession.console_clean_log("My uuid is " + uuid + "\n")
newSession.answer()
newSession.set_dtmf_callback(onDTMF)
1
0
Author: sphere
Date: Tue Dec 12 23:25:32 2006
New Revision: 3633
Added:
freeswitch/branches/dangkhoa/
Log:
Creating empty folder for dangkhoa
1
0
[commit] r3632 - in freeswitch/branches/jkr888/trunk: scripts src/mod/languages/mod_python
by Freeswitch SVN 12 Dec '06
by Freeswitch SVN 12 Dec '06
12 Dec '06
Author: jkr888
Date: Tue Dec 12 18:11:11 2006
New Revision: 3632
Modified:
freeswitch/branches/jkr888/trunk/scripts/mytest.py
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
Log:
Modified: freeswitch/branches/jkr888/trunk/scripts/mytest.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/scripts/mytest.py (original)
+++ freeswitch/branches/jkr888/trunk/scripts/mytest.py Tue Dec 12 18:11:11 2006
@@ -1,20 +1,16 @@
-import sys, time
from freeswitch import *
+import sys, time
-loop = 1
-
-def DTMFscanner(input, itype, buf, buflen):
+def onDTMF(input, itype, buf, buflen):
print "input=",input
print "itype=",itype
print "buf=",buf
print "buflen",buflen
- return 0
+ if input == "#":
+ return 1
+ else:
+ return 0
-print "Hello World"
-print sys.path
-print dir()
-print sys.argv
-
uuid = sys.argv[0]
newSession = SessionContainer(uuid)
@@ -25,24 +21,17 @@
newSession.console_clean_log("My uuid is " + uuid + "\n")
newSession.answer()
-newSession.set_dtmf_callback(DTMFscanner)
+newSession.set_dtmf_callback(onDTMF)
newSession.set_tts_parms("cepstral", "david")
-#fs_switch_ivr_session_transfer(session, "1234", "XML", "default")
newSession.play_file("/root/test.gsm", "")
+newSession.speak_text("Please enter telephone number with area code and press pound sign. ")
-#fs_switch_ivr_speak_text2(session, "cepstral", "david", "<break time='1s' />Welcome to my first python scripts running from <emphasis level='strong'>free switch </emphasis>application.")
-newSession.speak_text("The first of Europe's gamers got their hands on Nintendo's new video-game console on Friday after stores across the continent opened their doors at midnight to end die-hard fans long wait for a Wii.")
+input = newSession.get_digits("", 11, "*#", 10000)
-#fs_switch_ivr_speak_text(session,
-# "cepstral",
-# "david",
-# None,
-# 0,
-# None,
-# "Welcome to my first python application",
-# None,
-# 0)
+newSession.console_log("1","result from get digits is "+ input +"\n")
-newSession.hangup("1")
+newSession.transfer("1000", "XML", "default")
+
+#newSession.hangup("1")
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py Tue Dec 12 18:11:11 2006
@@ -65,6 +65,8 @@
def set_dtmf_callback(*args): return _freeswitch.SessionContainer_set_dtmf_callback(*args)
def speak_text(*args): return _freeswitch.SessionContainer_speak_text(*args)
def set_tts_parms(*args): return _freeswitch.SessionContainer_set_tts_parms(*args)
+ def get_digits(*args): return _freeswitch.SessionContainer_get_digits(*args)
+ def transfer(*args): return _freeswitch.SessionContainer_transfer(*args)
class SessionContainerPtr(SessionContainer):
def __init__(self, this):
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp Tue Dec 12 18:11:11 2006
@@ -117,3 +117,19 @@
tts_name = tts_name_p;
voice_name = voice_name_p;
}
+
+void SessionContainer::get_digits(char *dtmf_buf, int len, char *terminators, int timeout)
+{
+ char terminator;
+
+ switch_ivr_collect_digits_count(session, dtmf_buf,(uint32_t) len,(uint32_t) len, terminators, &terminator, (uint32_t) timeout);
+
+}
+
+void SessionContainer::transfer(char *extension, char *dialplan, char *context)
+{
+ switch_ivr_session_transfer(session, extension, dialplan, context);
+}
+
+
+
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h Tue Dec 12 18:11:11 2006
@@ -39,6 +39,8 @@
void set_dtmf_callback(PyObject *pyfunc);
int speak_text(char *text);
void set_tts_parms(char *tts_name, char *voice_name);
+ void get_digits(char *dtmf_buf, int len, char *terminators, int timeout);
+ void transfer(char *extensions, char *dialplan, char *context);
protected:
};
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python.i Tue Dec 12 18:11:11 2006
@@ -1,4 +1,8 @@
%module freeswitch
+%include "cstring.i"
+
+%cstring_bounded_mutable(char *dtmf_buf, 128);
+
%{
#include "freeswitch_python.h"
%}
Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Tue Dec 12 18:11:11 2006
@@ -1604,7 +1604,146 @@
/*@@*/
+SWIGINTERN int
+ SWIG_CheckLongInRange(long value, long min_value, long max_value,
+ const char *errmsg)
+{
+ if (value < min_value) {
+ if (errmsg) {
+ PyErr_Format(PyExc_OverflowError,
+ "value %ld is less than '%s' minimum %ld",
+ value, errmsg, min_value);
+ }
+ return 0;
+ } else if (value > max_value) {
+ if (errmsg) {
+ PyErr_Format(PyExc_OverflowError,
+ "value %ld is greater than '%s' maximum %ld",
+ value, errmsg, max_value);
+ }
+ return 0;
+ }
+ return 1;
+}
+
+SWIGINTERN int
+ SWIG_AsVal_long(PyObject * obj, long* val)
+{
+ if (PyLong_Check(obj)) {
+ long v = PyLong_AsLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return 1;
+ } else {
+ if (!val) PyErr_Clear();
+ return 0;
+ }
+ }
+ if (PyInt_Check(obj)) {
+ if (val) *val = PyInt_AsLong(obj);
+ return 1;
+ }
+ if (val) {
+ SWIG_type_error("long", obj);
+ }
+ return 0;
+ }
+
+
+#if INT_MAX != LONG_MAX
+SWIGINTERN int
+ SWIG_AsVal_int(PyObject *obj, int *val)
+{
+ const char* errmsg = val ? "int" : (char*)0;
+ long v;
+ if (SWIG_AsVal_long(obj, &v)) {
+ if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) {
+ if (val) *val = static_cast<int >(v);
+ return 1;
+ } else {
+ return 0;
+ }
+ } else {
+ PyErr_Clear();
+ }
+ if (val) {
+ SWIG_type_error(errmsg, obj);
+ }
+ return 0;
+}
+#else
+SWIGINTERNINLINE int
+ SWIG_AsVal_int(PyObject *obj, int *val)
+{
+ return SWIG_AsVal_long(obj,(long*)val);
+}
+#endif
+
+
+SWIGINTERNINLINE int
+SWIG_As_int(PyObject* obj)
+{
+ int v;
+ if (!SWIG_AsVal_int(obj, &v)) {
+ /*
+ this is needed to make valgrind/purify happier.
+ */
+ memset((void*)&v, 0, sizeof(int));
+ }
+ return v;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_Check_int(PyObject* obj)
+{
+ return SWIG_AsVal_int(obj, (int*)0);
+}
+
+
+SWIGINTERN PyObject*
+t_output_helper(PyObject* target, PyObject* o) {
+ if (!target) {
+ target = o;
+ } else if (target == Py_None) {
+ Py_DECREF(target);
+ target = o;
+ } else {
+ if (!PyList_Check(target)) {
+ PyObject *o2 = target;
+ target = PyList_New(1);
+ PyList_SetItem(target, 0, o2);
+ }
+ PyList_Append(target,o);
+ Py_DECREF(o);
+ }
+ return target;
+}
+
+
+SWIGINTERN PyObject *
+SWIG_FromCharPtr(const char* cptr)
+{
+ if (cptr) {
+ size_t size = strlen(cptr);
+ if (size > INT_MAX) {
+ return SWIG_NewPointerObj(const_cast<char* >(cptr),
+ SWIG_TypeQuery("char *"), 0);
+ } else {
+ if (size != 0) {
+ return PyString_FromStringAndSize(cptr, size);
+ } else {
+ return PyString_FromString(cptr);
+ }
+ }
+ }
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+
switch_status_t PythonDTMFCallback(switch_core_session_t *session,
void *input,
switch_input_type_t itype,
@@ -2025,6 +2164,85 @@
}
+static PyObject *_wrap_SessionContainer_get_digits(PyObject *, PyObject *args) {
+ PyObject *resultobj = NULL;
+ SessionContainer *arg1 = (SessionContainer *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int arg3 ;
+ char *arg4 = (char *) 0 ;
+ int arg5 ;
+ char temp2[128+1] ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"OOOOO:SessionContainer_get_digits",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail;
+ SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
+ if (SWIG_arg_fail(1)) SWIG_fail;
+ {
+ char *t = 0; size_t n;
+ SWIG_AsCharPtrAndSize(obj1, &t, &n);
+ if (SWIG_arg_fail(2)) SWIG_fail;
+ if ( n > (size_t)128 ) n = (size_t)128;
+ memcpy(temp2, t, sizeof(char)*n);
+ temp2[n] = 0;
+ arg2 = (char *) temp2;
+ }
+ {
+ arg3 = static_cast<int >(SWIG_As_int(obj2));
+ if (SWIG_arg_fail(3)) SWIG_fail;
+ }
+ if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
+ SWIG_arg_fail(4);SWIG_fail;
+ }
+ {
+ arg5 = static_cast<int >(SWIG_As_int(obj4));
+ if (SWIG_arg_fail(5)) SWIG_fail;
+ }
+ (arg1)->get_digits(arg2,arg3,arg4,arg5);
+
+ Py_INCREF(Py_None); resultobj = Py_None;
+ arg2[128] = 0; resultobj = t_output_helper(resultobj, SWIG_FromCharPtr(arg2));
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
+static PyObject *_wrap_SessionContainer_transfer(PyObject *, PyObject *args) {
+ PyObject *resultobj = NULL;
+ SessionContainer *arg1 = (SessionContainer *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"OOOO:SessionContainer_transfer",&obj0,&obj1,&obj2,&obj3)) goto fail;
+ SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
+ if (SWIG_arg_fail(1)) SWIG_fail;
+ if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
+ SWIG_arg_fail(2);SWIG_fail;
+ }
+ if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
+ SWIG_arg_fail(3);SWIG_fail;
+ }
+ if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
+ SWIG_arg_fail(4);SWIG_fail;
+ }
+ (arg1)->transfer(arg2,arg3,arg4);
+
+ Py_INCREF(Py_None); resultobj = Py_None;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject * SessionContainer_swigregister(PyObject *, PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
@@ -2048,6 +2266,8 @@
{ (char *)"SessionContainer_set_dtmf_callback", _wrap_SessionContainer_set_dtmf_callback, METH_VARARGS, NULL},
{ (char *)"SessionContainer_speak_text", _wrap_SessionContainer_speak_text, METH_VARARGS, NULL},
{ (char *)"SessionContainer_set_tts_parms", _wrap_SessionContainer_set_tts_parms, METH_VARARGS, NULL},
+ { (char *)"SessionContainer_get_digits", _wrap_SessionContainer_get_digits, METH_VARARGS, NULL},
+ { (char *)"SessionContainer_transfer", _wrap_SessionContainer_transfer, METH_VARARGS, NULL},
{ (char *)"SessionContainer_swigregister", SessionContainer_swigregister, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
};
1
0