freeswitch-svn
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
November 2007
- 10 participants
- 328 discussions
30 Nov '07
Author: anthm
Date: Fri Nov 30 18:45:27 2007
New Revision: 6455
Modified:
freeswitch/trunk/src/include/switch_xml.h
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c
freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
freeswitch/trunk/src/switch_xml.cpp
Log:
update
Modified: freeswitch/trunk/src/include/switch_xml.h
==============================================================================
--- freeswitch/trunk/src/include/switch_xml.h (original)
+++ freeswitch/trunk/src/include/switch_xml.h Fri Nov 30 18:45:27 2007
@@ -190,8 +190,8 @@
///\ must be freed.
///\param xml the xml node
///\return the xml text string
-SWITCH_DECLARE(char *) switch_xml_toxml(switch_xml_t xml);
-SWITCH_DECLARE(char *) switch_xml_toxml_buf(switch_xml_t xml, char *buf, switch_size_t buflen, switch_size_t offset);
+SWITCH_DECLARE(char *) switch_xml_toxml(switch_xml_t xml, switch_bool_t prn_header);
+SWITCH_DECLARE(char *) switch_xml_toxml_buf(switch_xml_t xml, char *buf, switch_size_t buflen, switch_size_t offset, switch_bool_t prn_header);
///\brief returns a NULL terminated array of processing instructions for the given
///\ target
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Fri Nov 30 18:45:27 2007
@@ -47,7 +47,7 @@
int argc;
char *mydata = NULL, *argv[3];
char *key, *user, *domain;
- char *xmlstr, *xs;
+ char *xmlstr;
if (!cmd) {
stream->write_function(stream, "bad args\n");
@@ -82,14 +82,10 @@
end:
if (xml && x_user) {
- xmlstr = switch_xml_toxml(x_user);
+ xmlstr = switch_xml_toxml(x_user, SWITCH_FALSE);
assert(xmlstr);
- if ((xs = strstr(xmlstr, "?>"))) {
- xs += 2;
- } else {
- xs = xmlstr;
- }
- stream->write_function(stream, "%s", xs);
+
+ stream->write_function(stream, "%s", xmlstr);
free(xmlstr);
switch_xml_free(xml);
@@ -1607,7 +1603,7 @@
snprintf(count, sizeof(count), "%d", holder.count);
switch_xml_set_attr(switch_xml_set_flag(holder.xml, SWITCH_XML_DUP), strdup("row_count"), strdup(count));
- xmlstr = switch_xml_toxml(holder.xml);
+ xmlstr = switch_xml_toxml(holder.xml, SWITCH_FALSE);
if (xmlstr) {
holder.stream->write_function(holder.stream, "%s", xmlstr);
Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Fri Nov 30 18:45:27 2007
@@ -527,7 +527,7 @@
switch_mutex_unlock(node->mutex);
}
}
- xml_text = switch_xml_toxml(x_report);
+ xml_text = switch_xml_toxml(x_report, SWITCH_FALSE);
assert(xml_text);
stream->write_function(stream, "%s\n", xml_text);
switch_xml_free(x_report);
Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Fri Nov 30 18:45:27 2007
@@ -2595,7 +2595,7 @@
sql = switch_mprintf("select * from voicemail_data where user='%s' and domain='%s' order by read_flags", user, domain);
vm_execute_sql_callback(profile, profile->mutex, sql, rss_callback, &holder);
- xmlstr = switch_xml_toxml(holder.xml);
+ xmlstr = switch_xml_toxml(holder.xml, SWITCH_TRUE);
stream->write_function(stream, "%s", xmlstr);
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Fri Nov 30 18:45:27 2007
@@ -731,7 +731,7 @@
*xmltxt++ = '\0';
if (strlen(xmltxt) > 2) {
xml = switch_xml_parse_str(xmltxt, strlen(xmltxt));
- form = switch_xml_toxml(xml);
+ form = switch_xml_toxml(xml, SWITCH_FALSE);
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, level,
"%s:\n-------------------------------------------------------------------------------\n"
"%s\n", ll, form);
@@ -2301,7 +2301,7 @@
switch_xml_set_attr(vcard, "xmlns", "vcard-tmp");
- if ((xmlstr = switch_xml_toxml(vcard))) {
+ if ((xmlstr = switch_xml_toxml(vcard, SWITCH_FALSE))) {
ldl_handle_send_vcard(handle, to, from, id, xmlstr);
sent = 1;
} else {
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Fri Nov 30 18:45:27 2007
@@ -471,7 +471,7 @@
etype = "xml";
if ((xml = switch_event_xmlize(event, "%s", ""))) {
- listener->ebuf = switch_xml_toxml(xml);
+ listener->ebuf = switch_xml_toxml(xml, SWITCH_FALSE);
switch_xml_free(xml);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "XML ERROR!\n");
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c Fri Nov 30 18:45:27 2007
@@ -50,7 +50,7 @@
default:
switch_event_serialize(event, &buf);
if ((xml = switch_event_xmlize(event, NULL))) {
- xmlstr = switch_xml_toxml(xml);
+ xmlstr = switch_xml_toxml(xml, SWITCH_FALSE);
dofree++;
}
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Fri Nov 30 18:45:27 2007
@@ -237,7 +237,7 @@
switch_xml_t xml;
char *xmlstr;
if ((xml = switch_event_xmlize(ro->stream->event, SWITCH_VA_NONE))) {
- xmlstr = switch_xml_toxml(xml);
+ xmlstr = switch_xml_toxml(xml, SWITCH_FALSE);
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, xmlstr));
return JS_TRUE;
}
@@ -646,7 +646,7 @@
switch_xml_t xml;
char *xmlstr;
if ((xml = switch_event_xmlize(eo->event, SWITCH_VA_NONE))) {
- xmlstr = switch_xml_toxml(xml);
+ xmlstr = switch_xml_toxml(xml, SWITCH_FALSE);
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, xmlstr));
switch_xml_free(xml);
free(xmlstr);
@@ -1898,7 +1898,7 @@
if (switch_ivr_generate_xml_cdr(jss->session, &cdr) == SWITCH_STATUS_SUCCESS) {
char *xml_text;
- if ((xml_text = switch_xml_toxml(cdr))) {
+ if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) {
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, xml_text));
}
switch_safe_free(xml_text);
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Fri Nov 30 18:45:27 2007
@@ -76,7 +76,7 @@
if (switch_ivr_generate_xml_cdr(session, &cdr) == SWITCH_STATUS_SUCCESS) {
/* build the XML */
- if (!(xml_text = switch_xml_toxml(cdr))) {
+ if (!(xml_text = switch_xml_toxml(cdr, SWITCH_TRUE))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
goto error;
}
Modified: freeswitch/trunk/src/switch_xml.cpp
==============================================================================
--- freeswitch/trunk/src/switch_xml.cpp (original)
+++ freeswitch/trunk/src/switch_xml.cpp Fri Nov 30 18:45:27 2007
@@ -1595,16 +1595,16 @@
}
}
-SWITCH_DECLARE(char *) switch_xml_toxml(switch_xml_t xml)
+SWITCH_DECLARE(char *) switch_xml_toxml(switch_xml_t xml, switch_bool_t prn_header)
{
char *s;
s = (char *)malloc(SWITCH_XML_BUFSIZE);
- return switch_xml_toxml_buf(xml, s, SWITCH_XML_BUFSIZE, 0);
+ return switch_xml_toxml_buf(xml, s, SWITCH_XML_BUFSIZE, 0, prn_header);
}
// converts an switch_xml structure back to xml, returning a string of xml date that
// must be freed
-SWITCH_DECLARE(char *) switch_xml_toxml_buf(switch_xml_t xml, char *buf, switch_size_t buflen, switch_size_t offset)
+SWITCH_DECLARE(char *) switch_xml_toxml_buf(switch_xml_t xml, char *buf, switch_size_t buflen, switch_size_t offset, switch_bool_t prn_header)
{
switch_xml_t p = (xml) ? xml->parent : NULL, o = (xml) ? xml->ordered : NULL;
switch_xml_root_t root = (switch_xml_root_t) xml;
@@ -1617,8 +1617,9 @@
assert(s != NULL);
memset(s, 0, max);
len += offset;
- len += sprintf(s + len, "<?xml version=\"1.0\"?>\n");
-
+ if (prn_header) {
+ len += sprintf(s + len, "<?xml version=\"1.0\"?>\n");
+ }
if (!xml || !xml->name) {
if (!(r = (char *)realloc(s, len + 1))) {
1
0
[Freeswitch-svn] [commit] r6454 - freeswitch/trunk/libs/libteletone/src
by Freeswitch SVN 30 Nov '07
by Freeswitch SVN 30 Nov '07
30 Nov '07
Author: anthm
Date: Fri Nov 30 18:30:40 2007
New Revision: 6454
Modified:
freeswitch/trunk/libs/libteletone/src/libteletone_detect.c
Log:
update
Modified: freeswitch/trunk/libs/libteletone/src/libteletone_detect.c
==============================================================================
--- freeswitch/trunk/libs/libteletone/src/libteletone_detect.c (original)
+++ freeswitch/trunk/libs/libteletone/src/libteletone_detect.c Fri Nov 30 18:30:40 2007
@@ -230,7 +230,7 @@
mt->energy += famp*famp;
- for(x = 0; x < mt->tone_count; x++) {
+ for(x = 0; x < TELETONE_MAX_TONES && x < mt->tone_count; x++) {
v1 = mt->gs[x].v2;
mt->gs[x].v2 = mt->gs[x].v3;
mt->gs[x].v3 = (float)(mt->gs[x].fac * mt->gs[x].v2 - v1 + famp);
@@ -247,13 +247,13 @@
}
eng_sum = 0;
- for(x = 0; x < mt->tone_count; x++) {
+ for(x = 0; x < TELETONE_MAX_TONES && x < mt->tone_count; x++) {
eng_all[x] = (float)(teletone_goertzel_result (&mt->gs[x]));
eng_sum += eng_all[x];
}
gtest = 0;
- for(x = 0; x < mt->tone_count; x++) {
+ for(x = 0; x < TELETONE_MAX_TONES && x < mt->tone_count; x++) {
gtest += teletone_goertzel_result (&mt->gs2[x]) < eng_all[x] ? 1 : 0;
}
@@ -281,7 +281,7 @@
}
/* Reinitialise the detector for the next block */
- for(x = 0; x < mt->tone_count; x++) {
+ for(x = 0; x < TELETONE_MAX_TONES && x < mt->tone_count; x++) {
goertzel_init (&mt->gs[x], &mt->tdd[x]);
goertzel_init (&mt->gs2[x], &mt->tdd[x]);
}
1
0
30 Nov '07
Author: anthm
Date: Fri Nov 30 17:56:01 2007
New Revision: 6453
Modified:
freeswitch/trunk/libs/xmlrpc-c/.update
freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/abyss.h
freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/server.c
freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/thread.c
freeswitch/trunk/src/include/switch_buffer.h
freeswitch/trunk/src/include/switch_ivr.h
freeswitch/trunk/src/include/switch_resample.h
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
freeswitch/trunk/src/switch_buffer.c
freeswitch/trunk/src/switch_core_io.c
freeswitch/trunk/src/switch_core_state_machine.c
freeswitch/trunk/src/switch_ivr_async.c
freeswitch/trunk/src/switch_resample.c
Log:
these aren't the droids you're looking for, move along....
Modified: freeswitch/trunk/libs/xmlrpc-c/.update
==============================================================================
--- freeswitch/trunk/libs/xmlrpc-c/.update (original)
+++ freeswitch/trunk/libs/xmlrpc-c/.update Fri Nov 30 17:56:01 2007
@@ -1 +1 @@
-Wed Apr 25 16:05:00 EDT 2007
+date
Modified: freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/abyss.h
==============================================================================
--- freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/abyss.h (original)
+++ freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/abyss.h Fri Nov 30 17:56:01 2007
@@ -48,7 +48,7 @@
** Maximum numer of simultaneous connections
*********************************************************************/
-#define MAX_CONN 16
+#define MAX_CONN 4000
/*********************************************************************
** Server Info Definitions
@@ -443,6 +443,7 @@
TList defaultfilenames;
void *defaulthandler;
abyss_bool advertise;
+ int running;
#ifndef _WIN32
uid_t uid;
gid_t gid;
Modified: freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/server.c
==============================================================================
--- freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/server.c (original)
+++ freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/server.c Fri Nov 30 17:56:01 2007
@@ -770,8 +770,8 @@
c[i].inUse = FALSE;
s=srv->listensock;
-
- while( 1 )
+ srv->running = 1;
+ while( srv->running )
{
/* collect all threads resources for closed connections */
for (i=0;i<MAX_CONN;i++)
Modified: freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/thread.c
==============================================================================
--- freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/thread.c (original)
+++ freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/thread.c Fri Nov 30 17:56:01 2007
@@ -41,7 +41,7 @@
#include "xmlrpc_config.h"
/* 16K is the minimum size of stack on Win32 */
-#define THREAD_STACK_SIZE (16*1024)
+#define THREAD_STACK_SIZE (240*1024)
/*********************************************************************
** Thread
Modified: freeswitch/trunk/src/include/switch_buffer.h
==============================================================================
--- freeswitch/trunk/src/include/switch_buffer.h (original)
+++ freeswitch/trunk/src/include/switch_buffer.h Fri Nov 30 17:56:01 2007
@@ -70,6 +70,11 @@
SWITCH_DECLARE(switch_status_t) switch_buffer_create_dynamic(switch_buffer_t **buffer, switch_size_t blocksize, switch_size_t start_len,
switch_size_t max_len);
+SWITCH_DECLARE(void) switch_buffer_add_mutex(switch_buffer_t *buffer, switch_mutex_t *mutex);
+SWITCH_DECLARE(void) switch_buffer_lock(switch_buffer_t *buffer);
+SWITCH_DECLARE(switch_status_t) switch_buffer_trylock(switch_buffer_t *buffer);
+SWITCH_DECLARE(void) switch_buffer_unlock(switch_buffer_t *buffer);
+
/*! \brief Get the length of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int size of the buffer.
@@ -137,6 +142,8 @@
*/
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer);
+SWITCH_DECLARE(switch_size_t) switch_buffer_zwrite(switch_buffer_t *buffer, const void *data, switch_size_t datalen);
+
/** @} */
SWITCH_END_EXTERN_C
Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h (original)
+++ freeswitch/trunk/src/include/switch_ivr.h Fri Nov 30 17:56:01 2007
@@ -204,7 +204,7 @@
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh);
-
+SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session_t *session, const char *uuid, switch_eavesdrop_flag_t flags);
SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_t *session, char *file, uint32_t limit, const char *flags);
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, const char *file);
Modified: freeswitch/trunk/src/include/switch_resample.h
==============================================================================
--- freeswitch/trunk/src/include/switch_resample.h (original)
+++ freeswitch/trunk/src/include/switch_resample.h Fri Nov 30 17:56:01 2007
@@ -165,6 +165,8 @@
SWITCH_DECLARE(void) switch_change_sln_volume(int16_t *data, uint32_t samples, int32_t vol);
///\}
+SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples);
+
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Fri Nov 30 17:56:01 2007
@@ -130,6 +130,12 @@
typedef uint8_t switch_byte_t;
typedef enum {
+ ED_MUX_READ = (1 << 0),
+ ED_MUX_WRITE = (1 << 1),
+ ED_DTMF = (1 << 2)
+} switch_eavesdrop_flag_t;
+
+typedef enum {
SCF_NONE = 0,
SCF_USE_SQL = ( 1 << 0),
SCF_NO_NEW_SESSIONS = (1 << 1),
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Fri Nov 30 17:56:01 2007
@@ -87,6 +87,29 @@
}
+
+
+#define eavesdrop_SYNTAX "<uuid>"
+SWITCH_STANDARD_APP(eavesdrop_function)
+{
+ char *argv[4];
+ int argc;
+ char *lbuf = NULL;
+ char *uuid;
+
+ if (data && (lbuf = switch_core_session_strdup(session, data))
+ && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
+ uuid = argv[0];
+
+ switch_ivr_eavesdrop_session(session, uuid, ED_DTMF);
+
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
+ }
+}
+
+
+
#define SET_USER_SYNTAX "<user>@<domain>"
SWITCH_STANDARD_APP(set_user_function)
{
@@ -1453,6 +1476,7 @@
SWITCH_ADD_APP(app_interface, "sched_broadcast", SCHED_BROADCAST_DESCR, SCHED_BROADCAST_DESCR, sched_broadcast_function, "[+]<time> <path> [aleg|bleg|both]", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "sched_transfer", SCHED_TRANSF_DESCR, SCHED_TRANSF_DESCR, sched_transfer_function, "[+]<time> <extension> <dialplan> <context>", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "execute_extension", "Execute an extension", "Execute an extension", exe_function, EXE_SYNTAX, SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "eavesdrop", "eavesdrop on a uuid", "eavesdrop on a uuid", eavesdrop_function, eavesdrop_SYNTAX, SAF_NONE);
SWITCH_ADD_APP(app_interface, "set_user", "Set a User", "Set a User", set_user_function, SET_USER_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_NONE);
Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Fri Nov 30 17:56:01 2007
@@ -2660,6 +2660,10 @@
char *path_info = NULL;
int rss = 0, xarg = 0;
+ if (session) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (stream->event) {
host = switch_event_get_header(stream->event, "http-host");
port = switch_event_get_header(stream->event, "http-port");
Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Fri Nov 30 17:56:01 2007
@@ -306,7 +306,7 @@
return 0;
- error:
+ error:
switch_mutex_lock(context->audio_mutex);
context->err++;
switch_mutex_unlock(context->audio_mutex);
@@ -419,7 +419,7 @@
return realsize;
- error:
+ error:
switch_mutex_lock(context->audio_mutex);
context->err++;
switch_mutex_unlock(context->audio_mutex);
@@ -512,7 +512,7 @@
switch_yield(100000);
}
- error:
+ error:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread Done\n");
context->thread_running = 0;
return NULL;
@@ -534,6 +534,7 @@
switch_thread_create(&thread, thd_attr, write_stream_thread, context, context->memory_pool);
}
+#define TC_BUFFER_SIZE 1024 * 32
static switch_status_t shout_file_open(switch_file_handle_t *handle, const char *path)
{
shout_context_t *context;
@@ -554,7 +555,7 @@
context->samplerate = handle->samplerate;
if (switch_test_flag(handle, SWITCH_FILE_FLAG_READ)) {
- if (switch_buffer_create_dynamic(&context->audio_buffer, MY_BLOCK_SIZE, MY_BUF_LEN, 0) != SWITCH_STATUS_SUCCESS) {
+ if (switch_buffer_create_dynamic(&context->audio_buffer, TC_BUFFER_SIZE, TC_BUFFER_SIZE * 2, 0) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
goto error;
}
@@ -708,7 +709,7 @@
return SWITCH_STATUS_SUCCESS;
- error:
+ error:
if (err) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: %s\n", err);
}
@@ -916,46 +917,431 @@
return SWITCH_STATUS_FALSE;
}
-static switch_file_interface_t shout_file_interface = {
- /*.interface_name */ modname,
- /*.file_open */ shout_file_open,
- /*.file_close */ shout_file_close,
- /*.file_read */ shout_file_read,
- /*.file_write */ shout_file_write,
- /*.file_seek */ shout_file_seek,
- /*.file_set_string */ shout_file_set_string,
- /*.file_get_string */ shout_file_get_string,
- /*.extens */ NULL,
- /*.next */ NULL,
-};
-static switch_loadable_module_interface_t shout_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ NULL,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL,
- /*.api_interface */ NULL,
- /*.file_interface */ &shout_file_interface,
- /*.speech_interface */ NULL,
- /*.directory_interface */ NULL
+static switch_bool_t telecast_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+ switch_buffer_t *buffer = (switch_buffer_t *) user_data;
+ uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
+ switch_frame_t frame = { 0 };
+
+ frame.data = data;
+ frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
+
+ switch (type) {
+ case SWITCH_ABC_TYPE_INIT:
+ break;
+ case SWITCH_ABC_TYPE_CLOSE:
+ break;
+ case SWITCH_ABC_TYPE_WRITE:
+ if (buffer) {
+ if (switch_core_media_bug_read(bug, &frame) == SWITCH_STATUS_SUCCESS) {
+ switch_buffer_lock(buffer);
+ switch_buffer_write(buffer, frame.data, frame.datalen);
+ switch_buffer_unlock(buffer);
+ }
+ } else {
+ return SWITCH_FALSE;
+ }
+ break;
+ case SWITCH_ABC_TYPE_READ:
+ default:
+ break;
+ }
+
+ return SWITCH_TRUE;
+}
+
+struct holder {
+ switch_stream_handle_t *stream;
+ switch_memory_pool_t *pool;
+ char *host;
+ char *port;
+ char *uri;
};
+static int web_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+ struct holder *holder = (struct holder *) pArg;
+ char title_b4[128] = "";
+ char title_aft[128*3] = "";
+ char *mp3, *m3u;
+
+
+ /*
+ 0 uuid VARCHAR(255),
+ 1 created VARCHAR(255),
+ 2 name VARCHAR(255),
+ 3 state VARCHAR(255),
+ 4 cid_name VARCHAR(255),
+ 5 cid_num VARCHAR(255),
+ 6 ip_addr VARCHAR(255),
+ 7 dest VARCHAR(255),
+ 8 application VARCHAR(255),
+ 9 application_data VARCHAR(255),
+ 10 read_codec VARCHAR(255),
+ 11 read_rate VARCHAR(255),
+ 12 write_codec VARCHAR(255),
+ 13 write_rate VARCHAR(255)
+ */
+
+
+
+ holder->stream->write_function(holder->stream,
+ "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>",
+ argv[1], argv[4], argv[5], argv[7], argv[8] ? argv[8] : "N/A", argv[9] ? argv[9] : "N/A", argv[10], argv[11]);
+
+ snprintf(title_b4, sizeof(title_b4), "%s <%s>", argv[4], argv[5]);
+ switch_url_encode(title_b4, title_aft, sizeof(title_aft)-1);
+
+ mp3 = switch_mprintf("http://%s:%s%s/mp3/%s/%s.mp3", holder->host, holder->port, holder->uri, argv[0], argv[5]);
+ m3u = switch_mprintf("http://%s:%s%s/m3u/mp3/%s/%s.mp3.m3u", holder->host, holder->port, holder->uri, argv[0], argv[5]);
+
+ holder->stream->write_function(holder->stream, "[<a href=%s>mp3</a>] ", mp3);
+ holder->stream->write_function(holder->stream, "[<a href=%s>m3u</a>]</td></tr>\n", m3u);
+
+ switch_safe_free(mp3);
+ switch_safe_free(m3u);
+ return 0;
+}
+
+
+void do_telecast(switch_stream_handle_t *stream)
+{
+ char *path_info = switch_event_get_header(stream->event, "http-path-info");
+ char *uuid = strdup(path_info + 4);
+ switch_core_session_t *tsession;
+ char *fname = "stream.mp3";
+
+ if ((fname = strchr(uuid, '/'))) {
+ *fname++ = '\0';
+ }
+
+ if (!(tsession = switch_core_session_locate(uuid))) {
+ char *ref = switch_event_get_header(stream->event, "http-referer");
+ stream->write_function(stream,"Content-type: text/html\r\n\r\n<h2>Not Found!</h2>\n"
+ "<META http-equiv=\"refresh\" content=\"1;URL=%s\">", ref);
+
+ } else {
+ switch_media_bug_t *bug = NULL;
+ switch_buffer_t *buffer;
+ switch_mutex_t *mutex;
+ switch_channel_t *channel = switch_core_session_get_channel(tsession);
+ lame_global_flags *gfp = NULL;
+ switch_codec_t *read_codec;
+
+
+ if (!(gfp = lame_init())) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate lame\n");
+ goto end;
+ }
+ read_codec = switch_core_session_get_read_codec(tsession);
+
+ lame_set_num_channels(gfp, read_codec->implementation->number_of_channels);
+ lame_set_in_samplerate(gfp, read_codec->implementation->actual_samples_per_second);
+ lame_set_brate(gfp, 24);
+ lame_set_mode(gfp, 3);
+ lame_set_quality(gfp, 2);
+ lame_set_errorf(gfp, log_error);
+ lame_set_debugf(gfp, log_debug);
+ lame_set_msgf(gfp, log_msg);
+ lame_set_bWriteVbrTag(gfp, 0);
+ lame_mp3_tags_fid(gfp, NULL);
+ lame_init_params(gfp);
+ lame_print_config(gfp);
+
+ switch_mutex_init(&mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(tsession));
+ switch_buffer_create_dynamic(&buffer, 1024, 2048, 0);
+ switch_buffer_add_mutex(buffer, mutex);
+
+ if (switch_core_media_bug_add(tsession, telecast_callback, buffer, 0, SMBF_READ_STREAM | SMBF_WRITE_STREAM, &bug) != SWITCH_STATUS_SUCCESS) {
+ goto end;
+ }
+
+ stream->write_function(stream,
+ "Content-type: audio/mpeg\r\n"
+ "Content-Disposition: inline; filename=\"%s\"\r\n\r\n",
+ fname);
+
+ while(switch_channel_ready(channel)) {
+ unsigned char mp3buf[TC_BUFFER_SIZE] = "";
+ int rlen;
+ uint8_t buf[1024];
+ switch_size_t bytes = 0;
+
+ if (switch_buffer_inuse(buffer) >= 1024) {
+ switch_buffer_lock(buffer);
+ bytes = switch_buffer_read(buffer, buf, sizeof(buf));
+ switch_buffer_unlock(buffer);
+ } else {
+ memset(buf, 0, bytes);
+ }
+
+ if ((rlen = lame_encode_buffer(gfp, (void *)buf, NULL, bytes / 2, mp3buf, sizeof(mp3buf))) < 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
+ goto end;
+ }
+
+ if (rlen) {
+ if (stream->raw_write_function(stream, mp3buf, rlen)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disconnected\n");
+ goto end;
+ }
+ }
+ }
+
+
+ end:
+
+ switch_safe_free(uuid);
+
+ if (gfp) {
+ lame_close(gfp);
+ gfp = NULL;
+ }
+
+ if (bug) {
+ switch_core_media_bug_remove(tsession, &bug);
+ }
+
+ if (buffer) {
+ switch_buffer_destroy(&buffer);
+ }
+
+ switch_core_session_rwunlock(tsession);
+ }
+
+}
+
+
+void do_broadcast(switch_stream_handle_t *stream)
+{
+ char *path_info = switch_event_get_header(stream->event, "http-path-info");
+ char *file;
+ lame_global_flags *gfp = NULL;
+ switch_file_handle_t fh = {0};
+ unsigned char mp3buf[TC_BUFFER_SIZE] = "";
+ uint8_t buf[1024];
+ int rlen;
+ int is_local = 0;
+
+ if (strstr(path_info + 7, "://")) {
+ file = strdup(path_info + 7);
+ is_local++;
+ } else {
+ file = switch_mprintf("%s/streamfiles/%s", SWITCH_GLOBAL_dirs.base_dir, path_info + 7);
+ }
+ assert(file);
+
+ if (switch_core_file_open(&fh,
+ file,
+ 0,
+ 0,
+ SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
+ memset(&fh, 0, sizeof(fh));
+ stream->write_function(stream, "Content-type: text/html\r\n\r\n<h2>File not found</h2>\n");
+ goto end;
+ }
+
+ if (switch_test_flag((&fh), SWITCH_FILE_NATIVE)) {
+ stream->write_function(stream, "Content-type: text/html\r\n\r\n<h2>File format not supported</h2>\n");
+ goto end;
+ }
+
+ if (!(gfp = lame_init())) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate lame\n");
+ goto end;
+ }
+
+ lame_set_num_channels(gfp, fh.channels);
+ lame_set_in_samplerate(gfp, fh.samplerate);
+ lame_set_brate(gfp, 24);
+ lame_set_mode(gfp, 3);
+ lame_set_quality(gfp, 2);
+ lame_set_errorf(gfp, log_error);
+ lame_set_debugf(gfp, log_debug);
+ lame_set_msgf(gfp, log_msg);
+ lame_set_bWriteVbrTag(gfp, 0);
+ lame_mp3_tags_fid(gfp, NULL);
+ lame_init_params(gfp);
+ lame_print_config(gfp);
+
+ stream->write_function(stream,
+ "Content-type: audio/mpeg\r\n"
+ "Content-Disposition: inline; filename=\"%s.mp3\"\r\n\r\n",
+ path_info + 7);
+
+
+
+ for(;;) {
+ switch_size_t samples = sizeof(buf) / 2;
+
+ switch_core_file_read(&fh, buf, &samples);
+
+ if (is_local) {
+ switch_yield(20000);
+ }
+
+ if (!samples) {
+ break;
+ }
+
+ if ((rlen = lame_encode_buffer(gfp, (void *)buf, NULL, samples, mp3buf, sizeof(mp3buf))) < 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
+ goto end;
+ }
+
+ if (rlen) {
+ if (stream->raw_write_function(stream, mp3buf, rlen)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disconnected\n");
+ goto end;
+ }
+ }
+
+
+ }
+
+
+ while ((rlen = lame_encode_flush(gfp, mp3buf, sizeof(mp3buf))) > 0) {
+ if (stream->raw_write_function(stream, mp3buf, rlen)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disconnected\n");
+ goto end;
+ }
+ }
+
+
+ end:
+
+ if (fh.channels) {
+ switch_core_file_close(&fh);
+ }
+
+ switch_safe_free(file);
+
+ if (gfp) {
+ lame_close(gfp);
+ gfp = NULL;
+ }
+
+}
+
+
+void do_index(switch_stream_handle_t *stream)
+{
+ switch_core_db_t *db = switch_core_db_handle();
+ const char *sql = "select * from channels";
+ struct holder holder;
+ char *errmsg;
+
+ holder.host = switch_event_get_header(stream->event, "http-host");
+ holder.port = switch_event_get_header(stream->event, "http-port");
+ holder.uri = switch_event_get_header(stream->event, "http-uri");
+ holder.stream = stream;
+
+ stream->write_function(stream, "Content-type: text/html\r\n\r\n");
+
+
+ stream->write_function(stream,
+ "<table align=center border=1 cellpadding=6 cellspacing=0>"
+ "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
+ "Created", "CID Name", "CID Num", "Ext", "App", "Data", "Codec", "Rate", "Listen"
+ );
+
+ switch_core_db_exec(db, sql, web_callback, &holder, &errmsg);
+
+ stream->write_function(stream,
+ "</table>");
+
+ if (errmsg) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error [%s]\n", errmsg);
+ switch_safe_free(errmsg);
+ }
+}
+
+#define TELECAST_SYNTAX ""
+
+SWITCH_STANDARD_API(telecast_api_function)
+{
+ char *host = NULL, *port = NULL, *uri = NULL, *path_info = NULL;
+
+
+ if (session) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (stream->event) {
+ host = switch_event_get_header(stream->event, "http-host");
+ port = switch_event_get_header(stream->event, "http-port");
+ uri = switch_event_get_header(stream->event, "http-uri");
+ path_info = switch_event_get_header(stream->event, "http-path-info");
+ }
+
+ if (!path_info) {
+ return SWITCH_STATUS_FALSE;
+ } else {
+ if (!strncmp(path_info, "index", 5)) {
+ do_index(stream);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (!strncmp(path_info, "m3u/", 4)) {
+ char *p;
+
+ if ((p = strstr(path_info, ".m3u"))) {
+ *p = '\0';
+ }
+
+ stream->write_function(stream, "Content-type: audio/x-mpegurl\r\n\r\nhttp://%s:%s%s/%s\n", host, port, uri, path_info + 4);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (!strncmp(path_info, "mp3/", 4)) {
+ do_telecast(stream);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (!strncmp(path_info, "stream/", 7)) {
+ do_broadcast(stream);
+ return SWITCH_STATUS_SUCCESS;
+ }
+ }
+
+ stream->write_function(stream, "Content-type: text/html\r\n\r\n<h2>Invalid URL</h2>\n");
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load)
{
+ switch_api_interface_t *shout_api_interface;
+ switch_file_interface_t *file_interface;
+
supported_formats[0] = "shout";
supported_formats[1] = "mp3";
- shout_file_interface.extens = supported_formats;
curl_global_init(CURL_GLOBAL_ALL);
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
+ file_interface->interface_name = modname;
+ file_interface->extens = supported_formats;
+ file_interface->file_open = shout_file_open;
+ file_interface->file_close = shout_file_close;
+ file_interface->file_read = shout_file_read;
+ file_interface->file_write = shout_file_write;
+ file_interface->file_seek = shout_file_seek;
+ file_interface->file_set_string = shout_file_set_string;
+ file_interface->file_get_string = shout_file_get_string;
+
+
+
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &shout_module_interface;
+ //*module_interface = &shout_module_interface;
shout_init();
InitMP3Constants();
+ SWITCH_ADD_API(shout_api_interface, "telecast", "telecast", telecast_api_function, TELECAST_SYNTAX);
+
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Fri Nov 30 17:56:01 2007
@@ -55,6 +55,7 @@
char *realm;
char *user;
char *pass;
+ TServer abyssServer;
} globals;
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm);
@@ -353,7 +354,7 @@
abyss_bool handler_hook(TSession * r)
{
//char *mime = "text/html";
- char buf[512] = "HTTP/1.1 200 OK\n";
+ char buf[80] = "HTTP/1.1 200 OK\n";
switch_stream_handle_t stream = { 0 };
char *command;
int i, j = 0;
@@ -542,6 +543,9 @@
HTTPWrite(r, buf, (uint32_t) strlen(buf));
+ //HTTPWrite(r, "<pre>\n\n", 7);
+
+
/* generation of the date field */
if (DateToString(&r->date, buf)) {
ResponseAddField(r,"Date", buf);
@@ -559,14 +563,21 @@
}
+ snprintf(buf, sizeof(buf), "Connection: close\r\n");
+ ConnWrite(r->conn, buf, (uint32_t) strlen(buf));
+
+
if (switch_api_execute(command, r->query, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
+ ResponseStatus(r, 200);
r->done = TRUE;
} else {
ResponseStatus(r, 404);
ResponseError(r);
}
- //HTTPWriteEnd(r);
+ SocketClose(&(r->conn->socket));
+ HTTPWriteEnd(r);
+ ConnClose(r->conn);
end:
@@ -661,7 +672,7 @@
SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
{
- TServer abyssServer;
+
xmlrpc_registry *registryP;
xmlrpc_env env;
char logfile[512];
@@ -690,22 +701,23 @@
}
snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch_http.log");
- ServerCreate(&abyssServer, "XmlRpcServer", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir, logfile);
+ ServerCreate(&globals.abyssServer, "XmlRpcServer", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir, logfile);
- xmlrpc_server_abyss_set_handler(&env, &abyssServer, "/RPC2", registryP);
+ xmlrpc_server_abyss_set_handler(&env, &globals.abyssServer, "/RPC2", registryP);
- if (ServerInit(&abyssServer) != TRUE) {
+ if (ServerInit(&globals.abyssServer) != TRUE) {
globals.running = 0;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to start HTTP Port %d\n", globals.port);
return SWITCH_STATUS_TERM;
}
- ServerAddHandler(&abyssServer, handler_hook);
- ServerAddHandler(&abyssServer, auth_hook);
+ ServerAddHandler(&globals.abyssServer, handler_hook);
+ ServerAddHandler(&globals.abyssServer, auth_hook);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Starting HTTP Port %d, DocRoot [%s]\n", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir);
while (globals.running) {
- ServerRunOnce2(&abyssServer, ABYSS_FOREGROUND);
+ //ServerRunOnce2(&globals.abyssServer, ABYSS_FOREGROUND);
+ ServerRun(&globals.abyssServer);
}
@@ -716,7 +728,9 @@
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown)
{
+ globals.abyssServer.running = 0;
globals.running = 0;
+
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/switch_buffer.c
==============================================================================
--- freeswitch/trunk/src/switch_buffer.c (original)
+++ freeswitch/trunk/src/switch_buffer.c Fri Nov 30 17:56:01 2007
@@ -46,6 +46,7 @@
switch_size_t datalen;
switch_size_t max_len;
switch_size_t blocksize;
+ switch_mutex_t *mutex;
uint32_t flags;
uint32_t id;
int32_t loops;
@@ -95,6 +96,33 @@
return SWITCH_STATUS_MEMERR;
}
+SWITCH_DECLARE(void) switch_buffer_add_mutex(switch_buffer_t *buffer, switch_mutex_t *mutex)
+{
+ buffer->mutex = mutex;
+}
+
+SWITCH_DECLARE(void) switch_buffer_lock(switch_buffer_t *buffer)
+{
+ if (buffer->mutex) {
+ switch_mutex_lock(buffer->mutex);
+ }
+}
+
+SWITCH_DECLARE(switch_status_t) switch_buffer_trylock(switch_buffer_t *buffer)
+{
+ if (buffer->mutex) {
+ return switch_mutex_lock(buffer->mutex);
+ }
+ return SWITCH_STATUS_FALSE;
+}
+
+SWITCH_DECLARE(void) switch_buffer_unlock(switch_buffer_t *buffer)
+{
+ if (buffer->mutex) {
+ switch_mutex_unlock(buffer->mutex);
+ }
+}
+
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer)
{
@@ -224,7 +252,7 @@
}
*/
if (switch_test_flag(buffer, SWITCH_BUFFER_FLAG_DYNAMIC)) {
- if (freespace < datalen) {
+ if (freespace < datalen && (!buffer->max_len || (buffer->datalen + datalen <= buffer->max_len))) {
switch_size_t new_size, new_block_size;
new_size = buffer->datalen + datalen;
@@ -266,6 +294,18 @@
buffer->head = buffer->data;
}
+SWITCH_DECLARE(switch_size_t) switch_buffer_zwrite(switch_buffer_t *buffer, const void *data, switch_size_t datalen)
+{
+ switch_size_t w;
+
+ if (!(w = switch_buffer_write(buffer, data, datalen))) {
+ switch_buffer_zero(buffer);
+ return switch_buffer_write(buffer, data, datalen);
+ }
+
+ return w;
+}
+
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer)
{
if (buffer && *buffer) {
Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c (original)
+++ freeswitch/trunk/src/switch_core_io.c Fri Nov 30 17:56:01 2007
@@ -150,7 +150,7 @@
goto done;
}
- if ((*frame)->codec->implementation->actual_samples_per_second != session->write_codec->implementation->actual_samples_per_second) {
+ if ((*frame)->codec->implementation->actual_samples_per_second != session->read_codec->implementation->actual_samples_per_second) {
do_resample = 1;
}
@@ -246,7 +246,9 @@
}
}
switch_mutex_unlock(bp->read_mutex);
- } else if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
+ }
+
+ if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
do_bugs = 0;
if (bp->callback) {
bp->read_replace_frame_in = read_frame;
@@ -432,7 +434,7 @@
need_codec = 1;
}
- if (frame->codec->implementation->actual_samples_per_second != session->read_codec->implementation->actual_samples_per_second) {
+ if (frame->codec->implementation->actual_samples_per_second != session->write_codec->implementation->actual_samples_per_second) {
need_codec = 1;
do_resample = 1;
}
@@ -489,6 +491,7 @@
return status;
}
}
+
if (session->write_resampler) {
short *data = write_frame->data;
@@ -509,6 +512,12 @@
write_frame->rate = session->write_resampler->to_rate;
}
+ if (do_bugs) {
+ do_write = 1;
+ write_frame = frame;
+ goto done;
+ }
+
if (session->bugs) {
switch_media_bug_t *bp, *dp, *last = NULL;
@@ -525,7 +534,9 @@
if (bp->callback) {
ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE);
}
- } else if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
+ }
+
+ if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
do_bugs = 0;
if (bp->callback) {
bp->write_replace_frame_in = write_frame;
@@ -561,12 +572,6 @@
switch_thread_rwlock_unlock(session->bug_rwlock);
}
- if (do_bugs) {
- do_write = 1;
- write_frame = frame;
- goto done;
- }
-
if (session->write_codec) {
if (write_frame->datalen == session->write_codec->implementation->bytes_per_frame) {
perfect = TRUE;
Modified: freeswitch/trunk/src/switch_core_state_machine.c
==============================================================================
--- freeswitch/trunk/src/switch_core_state_machine.c (original)
+++ freeswitch/trunk/src/switch_core_state_machine.c Fri Nov 30 17:56:01 2007
@@ -130,7 +130,8 @@
while (switch_channel_get_state(session->channel) == CS_EXECUTE && extension->current_application) {
char *expanded = NULL;
-
+ int nomedia = 0;
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Execute %s(%s)\n",
extension->current_application->application_name, switch_str_nil(extension->current_application->application_data));
if ((application_interface = switch_loadable_module_get_application_interface(extension->current_application->application_name)) == 0) {
@@ -138,19 +139,19 @@
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
return;
}
-
- if (switch_channel_test_flag(session->channel, CF_BYPASS_MEDIA) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application %s Cannot be used with NO_MEDIA mode!\n",
- extension->current_application->application_name);
- switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
- return;
- }
-
+
if (!application_interface->application_function) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Function for %s\n", extension->current_application->application_name);
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
return;
}
+
+ if (switch_channel_test_flag(session->channel, CF_BYPASS_MEDIA) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
+ switch_ivr_media(session->uuid_str, SMF_NONE);
+ nomedia++;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application %s Requires media!\n",
+ extension->current_application->application_name);
+ }
if ((expanded =
switch_channel_expand_variables(session->channel,
@@ -177,6 +178,12 @@
goto top;
}
+ if (nomedia) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application %s Releasing media\n",
+ extension->current_application->application_name);
+ switch_ivr_nomedia(session->uuid_str, SMF_NONE);
+ }
+
extension->current_application = extension->current_application->next;
}
Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c (original)
+++ freeswitch/trunk/src/switch_ivr_async.c Fri Nov 30 17:56:01 2007
@@ -307,6 +307,274 @@
}
+
+struct eavesdrop_pvt {
+ switch_buffer_t *buffer;
+ switch_mutex_t *mutex;
+ switch_buffer_t *r_buffer;
+ switch_mutex_t *r_mutex;
+ switch_buffer_t *w_buffer;
+ switch_mutex_t *w_mutex;
+ uint32_t flags;
+};
+
+
+static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+ struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) user_data;
+ uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
+ switch_frame_t frame = { 0 };
+
+ frame.data = data;
+ frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
+
+ switch (type) {
+ case SWITCH_ABC_TYPE_INIT:
+ break;
+ case SWITCH_ABC_TYPE_CLOSE:
+ break;
+ case SWITCH_ABC_TYPE_WRITE:
+ if (ep->buffer) {
+ if (switch_core_media_bug_read(bug, &frame) == SWITCH_STATUS_SUCCESS) {
+ switch_buffer_lock(ep->buffer);
+ switch_buffer_zwrite(ep->buffer, frame.data, frame.datalen);
+ switch_buffer_unlock(ep->buffer);
+ }
+ } else {
+ return SWITCH_FALSE;
+ }
+ break;
+ case SWITCH_ABC_TYPE_READ:
+ break;
+
+ case SWITCH_ABC_TYPE_READ_REPLACE:
+ {
+ if (switch_test_flag(ep, ED_MUX_READ)) {
+ switch_frame_t *frame = switch_core_media_bug_get_read_replace_frame(bug);
+
+ if (switch_buffer_inuse(ep->r_buffer) >= frame->datalen) {
+ uint32_t bytes;
+ switch_buffer_lock(ep->r_buffer);
+ bytes = (uint32_t) switch_buffer_read(ep->r_buffer, data, frame->datalen);
+
+ frame->datalen = switch_merge_sln(frame->data, frame->samples, (int16_t *)data, bytes / 2) * 2;
+ frame->samples = frame->datalen / 2;
+
+ switch_buffer_unlock(ep->r_buffer);
+ switch_core_media_bug_set_read_replace_frame(bug, frame);
+ }
+ }
+ }
+ break;
+
+ case SWITCH_ABC_TYPE_WRITE_REPLACE:
+ {
+ if (switch_test_flag(ep, ED_MUX_WRITE)) {
+ switch_frame_t *frame = switch_core_media_bug_get_write_replace_frame(bug);
+
+ if (switch_buffer_inuse(ep->w_buffer) >= frame->datalen) {
+ uint32_t bytes;
+ switch_buffer_lock(ep->w_buffer);
+ bytes = (uint32_t) switch_buffer_read(ep->w_buffer, data, frame->datalen);
+
+ frame->datalen = switch_merge_sln(frame->data, frame->samples, (int16_t *)data, bytes / 2) * 2;
+ frame->samples = frame->datalen / 2;
+
+ switch_buffer_unlock(ep->w_buffer);
+ switch_core_media_bug_set_write_replace_frame(bug, frame);
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return SWITCH_TRUE;
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session_t *session, const char *uuid, switch_eavesdrop_flag_t flags)
+{
+ switch_core_session_t *tsession;
+ switch_status_t status = SWITCH_STATUS_FALSE;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
+
+ if ((tsession = switch_core_session_locate(uuid))) {
+ struct eavesdrop_pvt ep = { 0 };
+ switch_media_bug_t *bug = NULL;
+ switch_channel_t *tchannel = switch_core_session_get_channel(tsession);
+ switch_frame_t *read_frame, write_frame = { 0 };
+ switch_codec_t codec = {0};
+ int16_t buf[1024];
+ switch_codec_t *tread_codec = switch_core_session_get_read_codec(tsession);
+
+
+ switch_channel_pre_answer(channel);
+
+ if (switch_core_codec_init(&codec,
+ "L16",
+ NULL,
+ tread_codec->implementation->actual_samples_per_second,
+ tread_codec->implementation->microseconds_per_frame / 1000,
+ tread_codec->implementation->number_of_channels,
+ SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+ NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot init codec\n");
+ return status;
+ }
+
+ switch_core_session_set_read_codec(session, &codec);
+ write_frame.codec = &codec;
+ write_frame.data = buf;
+ write_frame.buflen = sizeof(buf);
+ write_frame.rate = read_codec->implementation->actual_samples_per_second;
+
+ ep.flags = flags;
+ switch_mutex_init(&ep.mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(tsession));
+ switch_buffer_create_dynamic(&ep.buffer, 1024, 2048, 2048);
+ switch_buffer_add_mutex(ep.buffer, ep.mutex);
+
+ switch_mutex_init(&ep.w_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(tsession));
+ switch_buffer_create_dynamic(&ep.w_buffer, 1024, 2048, 2048);
+ switch_buffer_add_mutex(ep.w_buffer, ep.w_mutex);
+
+ switch_mutex_init(&ep.r_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(tsession));
+ switch_buffer_create_dynamic(&ep.r_buffer, 1024, 2048, 2048);
+ switch_buffer_add_mutex(ep.r_buffer, ep.r_mutex);
+
+
+ if (switch_core_media_bug_add(tsession, eavesdrop_callback, &ep, 0,
+ SMBF_READ_STREAM | SMBF_WRITE_STREAM | SMBF_READ_REPLACE | SMBF_WRITE_REPLACE,
+ &bug) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot attach bug\n");
+ goto end;
+ }
+
+ while(switch_channel_ready(tchannel) && switch_channel_ready(channel)) {
+ uint32_t len = sizeof(buf);
+ switch_event_t *event = NULL;
+ char *fcommand = NULL;
+
+ status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
+
+ if (!SWITCH_READ_ACCEPTABLE(status)) {
+ goto end;
+ }
+
+ if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+ char *command = switch_event_get_header(event, "eavesdrop-command");
+ if (command) {
+ fcommand = command;
+ }
+ switch_event_destroy(&event);
+ }
+
+ if ((flags & ED_DTMF) && switch_channel_has_dtmf(channel)) {
+ char dtmf[128] = "";
+ switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
+ fcommand = dtmf;
+ }
+
+ if (fcommand) {
+ char *d;
+ for(d = fcommand; *d; d++) {
+ int z = 1;
+
+ switch (*d) {
+ case '1':
+ switch_set_flag((&ep), ED_MUX_READ);
+ switch_clear_flag((&ep), ED_MUX_WRITE);
+ break;
+ case '2':
+ switch_set_flag((&ep), ED_MUX_WRITE);
+ switch_clear_flag((&ep), ED_MUX_READ);
+ break;
+ case '3':
+ switch_set_flag((&ep), ED_MUX_READ);
+ switch_set_flag((&ep), ED_MUX_WRITE);
+ break;
+ case '0':
+ switch_clear_flag((&ep), ED_MUX_READ);
+ switch_clear_flag((&ep), ED_MUX_WRITE);
+ break;
+ default:
+ z = 0;
+ break;
+
+ }
+
+ if (z) {
+ switch_buffer_lock(ep.r_buffer);
+ switch_buffer_zero(ep.r_buffer);
+ switch_buffer_unlock(ep.r_buffer);
+
+ switch_buffer_lock(ep.w_buffer);
+ switch_buffer_zero(ep.w_buffer);
+ switch_buffer_unlock(ep.w_buffer);
+ }
+ }
+ }
+
+ if (!switch_test_flag(read_frame, SFF_CNG)) {
+ switch_buffer_lock(ep.r_buffer);
+ switch_buffer_zwrite(ep.r_buffer, read_frame->data, read_frame->datalen);
+ switch_buffer_unlock(ep.r_buffer);
+
+ switch_buffer_lock(ep.w_buffer);
+ switch_buffer_zwrite(ep.w_buffer, read_frame->data, read_frame->datalen);
+ switch_buffer_unlock(ep.w_buffer);
+ }
+
+
+ if (len > tread_codec->implementation->samples_per_frame * 2) {
+ len = tread_codec->implementation->samples_per_frame * 2;
+ }
+
+ if (switch_buffer_inuse(ep.buffer) >= len) {
+ switch_buffer_lock(ep.buffer);
+ write_frame.datalen = switch_buffer_read(ep.buffer, buf, len);
+ write_frame.samples = write_frame.datalen / 2;
+ if (switch_core_session_write_frame(session, &write_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
+ goto end;
+ }
+ switch_buffer_unlock(ep.buffer);
+ }
+ }
+
+
+ end:
+
+ switch_core_codec_destroy(&codec);
+
+ if (bug) {
+ switch_core_media_bug_remove(tsession, &bug);
+ }
+
+ if (ep.buffer) {
+ switch_buffer_destroy(&ep.buffer);
+ }
+
+ if (ep.r_buffer) {
+ switch_buffer_destroy(&ep.r_buffer);
+ }
+
+ if (ep.w_buffer) {
+ switch_buffer_destroy(&ep.w_buffer);
+ }
+
+ switch_core_session_rwunlock(tsession);
+ status = SWITCH_STATUS_SUCCESS;
+
+ switch_core_session_set_read_codec(session, read_codec);
+ switch_core_session_reset(session);
+ }
+
+ return status;
+}
+
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh)
{
switch_channel_t *channel;
Modified: freeswitch/trunk/src/switch_resample.c
==============================================================================
--- freeswitch/trunk/src/switch_resample.c (original)
+++ freeswitch/trunk/src/switch_resample.c Fri Nov 30 17:56:01 2007
@@ -215,6 +215,27 @@
}
}
+SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples)
+{
+ int i;
+ int32_t x, z;
+
+ if (samples > other_samples) {
+ x = other_samples;
+ } else {
+ x = samples;
+ }
+
+ for(i = 0; i < x; i++) {
+ z = data[i] + other_data[i];
+ switch_normalize_to_16bit(z);
+ data[i] = (int16_t) z;
+ }
+
+ return x;
+
+}
+
SWITCH_DECLARE(void) switch_change_sln_volume(int16_t *data, uint32_t samples, int32_t vol)
{
1
0
Author: anthm
Date: Fri Nov 30 16:57:49 2007
New Revision: 6452
Modified:
freeswitch/trunk/src/switch_event.c
Log:
add hostname and ip to every event
Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c (original)
+++ freeswitch/trunk/src/switch_event.c Fri Nov 30 16:57:49 2007
@@ -34,6 +34,9 @@
#include <switch.h>
#include <switch_event.h>
+static char hostname[128] = "";
+static char guess_ip_v4[80] = "";
+static char guess_ip_v6[80] = "";
static switch_event_node_t *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL };
static switch_mutex_t *BLOCK = NULL;
static switch_mutex_t *POOL_LOCK = NULL;
@@ -433,12 +436,17 @@
return SWITCH_STATUS_SUCCESS;
}
+
+
SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr;;
switch_threadattr_create(&thd_attr, pool);
switch_threadattr_detach_set(thd_attr, 1);
+ gethostname(hostname, sizeof(hostname));
+ switch_find_local_ip(guess_ip_v4, sizeof(guess_ip_v4), AF_INET);
+ switch_find_local_ip(guess_ip_v6, sizeof(guess_ip_v6), AF_INET6);
assert(pool != NULL);
THRUNTIME_POOL = RUNTIME_POOL = pool;
@@ -906,6 +914,11 @@
switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Name", "%s", switch_event_name((*event)->event_id));
switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Core-UUID", "%s", switch_core_get_uuid());
+ switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Hostname", "%s", hostname);
+ switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "FreeSWITCH-IPv4", "%s", guess_ip_v4);
+ switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "FreeSWITCH-IPv6", "%s", guess_ip_v6);
+
+
switch_time_exp_lt(&tm, ts);
switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Date-Local", "%s", date);
1
0
[Freeswitch-svn] [commit] r6451 - freeswitch/trunk/src/mod/endpoints/mod_sofia
by Freeswitch SVN 30 Nov '07
by Freeswitch SVN 30 Nov '07
30 Nov '07
Author: anthm
Date: Fri Nov 30 16:02:41 2007
New Revision: 6451
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
Log:
add some vars
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Fri Nov 30 16:02:41 2007
@@ -1526,7 +1526,7 @@
*host++ = '\0';
if (sofia_reg_find_reg_url(profile, dest, host, buf, sizeof(buf))) {
tech_pvt->dest = switch_core_session_strdup(nsession, buf);
-
+ tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, host);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, host);
cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
@@ -1539,7 +1539,7 @@
tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
if (sofia_reg_find_reg_url(profile, dest, profile_name, buf, sizeof(buf))) {
tech_pvt->dest = switch_core_session_strdup(nsession, buf);
-
+ tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, profile_name);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, profile_name);
cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
@@ -1558,8 +1558,13 @@
}
sofia_glue_attach_private(nsession, profile, tech_pvt, dest);
-
+
nchannel = switch_core_session_get_channel(nsession);
+ if (tech_pvt->local_url) {
+ switch_channel_set_variable(nchannel, "sip_local_url", tech_pvt->local_url);
+ }
+ switch_channel_set_variable(nchannel, "sip_destination_url", tech_pvt->dest);
+
caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
switch_channel_set_caller_profile(nchannel, caller_profile);
switch_channel_set_flag(nchannel, CF_OUTBOUND);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Fri Nov 30 16:02:41 2007
@@ -317,6 +317,7 @@
char *e_dest;
char *call_id;
char *invite_contact;
+ char *local_url;
unsigned long rm_rate;
switch_payload_t pt;
switch_mutex_t *flag_mutex;
1
0
[Freeswitch-svn] [commit] r6450 - freeswitch/trunk/src/mod/languages/mod_spidermonkey
by Freeswitch SVN 30 Nov '07
by Freeswitch SVN 30 Nov '07
30 Nov '07
Author: anthm
Date: Fri Nov 30 10:39:55 2007
New Revision: 6450
Modified:
freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
Log:
some tweaks to address reports of crash
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Fri Nov 30 10:39:55 2007
@@ -115,8 +115,6 @@
typedef enum {
S_HUP = (1 << 0),
- S_FREE = (1 << 1),
- S_RDLOCK = (1 << 2)
} session_flag_t;
struct input_callback_state {
@@ -2545,19 +2543,29 @@
};
-static JSObject *new_js_session(JSContext * cx, JSObject * obj, switch_core_session_t *session, struct js_session *jss, char *name, int flags)
+static JSObject *new_js_session(JSContext * cx, JSObject * obj, switch_core_session_t *session, struct js_session **jss, char *name, int flags)
{
JSObject *session_obj;
if ((session_obj = JS_DefineObject(cx, obj, name, &session_class, NULL, 0))) {
- memset(jss, 0, sizeof(struct js_session));
- jss->session = session;
- jss->flags = flags;
- jss->cx = cx;
- jss->obj = session_obj;
- jss->stack_depth = 0;
- if ((JS_SetPrivate(cx, session_obj, jss) &&
+ *jss = malloc(sizeof(**jss));
+ assert(*jss);
+ memset(*jss, 0, sizeof(**jss));
+
+ (*jss)->session = session;
+ (*jss)->flags = flags;
+ (*jss)->cx = cx;
+ (*jss)->obj = session_obj;
+ (*jss)->stack_depth = 0;
+ if ((JS_SetPrivate(cx, session_obj, *jss) &&
JS_DefineProperties(cx, session_obj, session_props) && JS_DefineFunctions(cx, session_obj, session_methods))) {
+ if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Read Lock Failure.\n");
+ free(*jss);
+ return NULL;
+ }
return session_obj;
+ } else {
+ free(*jss);
}
}
@@ -2576,8 +2584,6 @@
memset(jss, 0, sizeof(*jss));
jss->cx = cx;
jss->obj = obj;
- switch_set_flag(jss, S_FREE);
-
JS_SetPrivate(cx, obj, jss);
return JS_TRUE;
@@ -2708,8 +2714,6 @@
}
jss->session = peer_session;
- jss->flags = S_RDLOCK;
-
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
} else {
@@ -2720,31 +2724,28 @@
return JS_TRUE;
}
-
-
-
static void session_destroy(JSContext * cx, JSObject * obj)
{
struct js_session *jss;
- switch_channel_t *channel = NULL;
-
+
if (cx && obj) {
if ((jss = JS_GetPrivate(cx, obj))) {
- destroy_speech_engine(jss);
+ JS_SetPrivate(cx, obj, NULL);
+ if (jss->speech && *jss->speech->sh.name) {
+ destroy_speech_engine(jss);
+ }
if (jss->session) {
- channel = switch_core_session_get_channel(jss->session);
+ switch_core_session_t *session = jss->session;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+
switch_channel_set_private(channel, "jss", NULL);
- switch_core_event_hook_remove_state_change(jss->session, hanguphook);
+ switch_core_event_hook_remove_state_change(session, hanguphook);
if (switch_test_flag(jss, S_HUP)) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
- if (switch_test_flag(jss, S_RDLOCK)) {
- switch_core_session_rwunlock(jss->session);
- }
-
switch_safe_free(jss->dialplan);
switch_safe_free(jss->username);
switch_safe_free(jss->caller_id_name);
@@ -2755,11 +2756,11 @@
switch_safe_free(jss->rdnis);
switch_safe_free(jss->destination_number);
switch_safe_free(jss->context);
+ switch_core_session_rwunlock(session);
}
- if (switch_test_flag(jss, S_FREE)) {
- free(jss);
- }
+ free(jss);
+
}
}
@@ -3253,7 +3254,7 @@
const char *script;
int argc = 0, x = 0, y = 0;
unsigned int flags = 0;
- struct js_session jss;
+ struct js_session *jss;
JSContext *cx = NULL;
jsval rval;
@@ -3266,9 +3267,7 @@
JS_SetGlobalObject(cx, javascript_global_object);
/* Emaculent conception of session object into the script if one is available */
- if (session && new_js_session(cx, javascript_global_object, session, &jss, "session", flags)) {
- JS_SetPrivate(cx, javascript_global_object, session);
- } else {
+ if (!(session && new_js_session(cx, javascript_global_object, session, &jss, "session", flags))) {
snprintf(buf, sizeof(buf), "~var session = false;");
eval_some_js(buf, cx, javascript_global_object, &rval);
}
1
0
30 Nov '07
Author: cypromis
Date: Fri Nov 30 09:46:25 2007
New Revision: 6449
Added:
freeswitch/trunk/freeswitch.spec
- copied unchanged from r6448, /freeswitch/trunk/build/freeswitch.spec
Removed:
freeswitch/trunk/build/freeswitch.spec
Log:
Moved freeswitch.spec to root directory to allow rpmbuild -ta to work correctly
1
0
Author: cypromis
Date: Fri Nov 30 09:45:45 2007
New Revision: 6448
Modified:
freeswitch/trunk/build/freeswitch.spec
Log:
OK, this is V1 of the new type specfile
Builds on:
Centos5 32bit
Centos5 64bit
OpenSuse 10.3 32bit
OpenSuse 10.3 64bit
OpenSuse 10.2 32bit
OpenSuse 10.2 64bit
Suse 10.1 32bit
Suse 10.1 64bit
Fedora 7 32bit
Fedora 6 64bit
Fedora8 32bit
Fedora8 64bit
Fedora Extras 6 32bit
Not checked for running and currently I am working on having all premissions and ownerships correctly in there.
Also need to add an examples part for things like monit file etc ..
Modified: freeswitch/trunk/build/freeswitch.spec
==============================================================================
--- freeswitch/trunk/build/freeswitch.spec (original)
+++ freeswitch/trunk/build/freeswitch.spec Fri Nov 30 09:45:45 2007
@@ -1,35 +1,36 @@
-Name: freeswitch-snapshot
+Name: freeswitch
Summary: FreeSWITCH open source telephony platform
License: MPL
Group: Productivity/Telephony/Servers
-Version: 6382
-Release: 0
+Version: 1.0.beta3
+Release: 1
URL: http://www.freeswitch.org/
-Packager: Peter Nixon
-Vendor: http://peternixon.net/
+Packager: Michal Bielicki
+Vendor: http://www.voiceworks.pl/
Source0: %{name}-%{version}.tar.bz2
-Source1: modules.conf
#AutoReqProv: no
+%if 0%{?suse_version} > 100
BuildRequires: alsa-devel
+#BuildRequires: openldap2-devel
+BuildRequires: lzo-devel
+%else
+BuildRequires: alsa-lib-devel
+BuildRequires: openldap-devel
+%endif
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: curl-devel
BuildRequires: gcc-c++
BuildRequires: gnutls-devel
BuildRequires: libtool >= 1.5.14
-BuildRequires: lzo-devel
-BuildRequires: freeradius-client-snapshot-devel
-BuildRequires: mysql-devel
BuildRequires: ncurses-devel
-BuildRequires: openldap2-devel
BuildRequires: openssl-devel
BuildRequires: perl
BuildRequires: pkgconfig
-BuildRequires: python-devel
BuildRequires: termcap
-#BuildRequires: unixODBC-devel
+BuildRequires: unixODBC-devel
%if %{?suse_version:1}0
%if 0%{?suse_version} > 910
@@ -60,7 +61,10 @@
Our developers are heavily involved in open source and have donated code and other resources to other telephony projects including sipX, Asterisk and OpenPBX.
+%if 0%{?suse_version} > 100
%debug_package
+%endif
+
%package devel
Summary: Development package for FreeSWITCH open source telephony platform
Group: System/Libraries
@@ -96,35 +100,66 @@
%description codec-passthru-g729
Pass-through g729 Codec support for FreeSWITCH open source telephony platform
+%package spidermonkey
+Summary: JavaScript support for the FreeSWITCH open source telephony platform
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description spidermonkey
+
%prep
%setup -q
%build
#export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED -fPIC -DPIC"
-export CFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC"
+#export CFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC"
%if 0%{?suse_version} > 1000 && 0%{?suse_version} < 1030
export CFLAGS="$CFLAGS -fstack-protector"
%endif
-
+PASSTHRU_CODEC_MODULES="codecs/mod_g729 codecs/mod_g723_1 codecs/mod_amr"
+SPIDERMONKEY_MODULES="languages/mod_spidermonkey languages/mod_spidermonkey_core_db languages/mod_spidermonkey_odbc languages/mod_spidermonkey_socket languages/mod_spidermonkey_teletone"
+APPLICATIONS_MODULES="applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit applications/mod_rss applications/mod_voicemail"
+ASR_TTS_MODULES="asr_tts/mod_openmrcp"
+CODECS_MODULES="codecs/mod_g711 codecs/mod_g722 codecs/mod_g726 codecs/mod_gsm codecs/mod_ilbc codecs/mod_h26x codecs/mod_l16 codecs/mod_speex"
+DIALPLANS_MODULES="dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml"
+DIRECTORIES_MODULES=
+DOTNET_MODULES=
+ENDPOINTS_MODULES="endpoints/mod_dingaling endpoints/mod_iax endpoints/mod_portaudio endpoints/mod_sofia endpoints/mod_woomera ../../libs/openzap/mod_openzap"
+EVENT_HANDLERS_MODULES="event_handlers/mod_event_multicast event_handlers/mod_event_socket"
+FORMATS_MODULES="formats/mod_local_stream formats/mod_native_file formats/mod_sndfile"
+LANGUAGES_MODULES=
+LOGGERS_MODULES="loggers/mod_console loggers/mod_logfile loggers/mod_syslog"
+SAY_MODULES="say/mod_say_de say/mod_say_en say/mod_say_fr say/mod_say_es say/mod_say_it say/mod_say_nl"
+TIMERS_MODULES=
+DISABLED_MODULES="applications/mod_sountouch directories/mod_ldap languages/mod_java languages/mod_python languages/mod_spidermonkey_skel ast_tts/mod_cepstral asr_tts/mod_lumenvox endpoints/mod_wanpipe event_handlers/mod_event_test event_handlers/mod_radius_cdr event_handlers/mod_zeroconf formats/mod_shout"
+XML_INT_MODULES="xml_int/mod_xml_rpc xml_int/mod_xml_curl xml_int/mod_xml_cdr"
+MYMODULES="$PASSTHRU_CODEC_MODULES $SPIDERMONKEY_MODULES $APPLICATIONS_MODULES $ASR_TTS_MODULES $CODECS_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES $DOTNET_MODULES $ENDPOINTS_MODULES $EVENT_HANDLERS_MODULES $FORMATS_MODULES $LANGUAGES_MODULES $LOGGERS_MODULES $SAY_MODULES $TIMERS_MODULES $XML_INT_MODULES"
+
+export MODULES=$MYMODULES
+touch modules.conf
+for i in $MODULES; do echo $i >> modules.conf; done
export VERBOSE=yes
export DESTDIR=$RPM_BUILD_ROOT/
export PKG_CONFIG_PATH=/usr/bin/pkg-config:$PKG_CONFIG_PATH
export ACLOCAL_FLAGS="-I /usr/share/aclocal"
+
./bootstrap.sh
%configure -C \
--prefix=/opt/freeswitch \
+ --bindir=/opt/freeswitch/bin \
+ --libdir=/opt/freeswitch/lib \
--sysconfdir=%{_sysconfdir} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
- --enable-core-libedit-support
-# --enable-core-odbc-support
+ --enable-core-libedit-support \
+ --enable-core-odbc-support \
+ --with-openssl \
+ --with-libcurl
#Create the version header file here
cat src/include/switch_version.h.in | sed "s/@SVN_VERSION@/%{version}/g" > src/include/switch_version.h
touch .noversion
-cp %{SOURCE1} .
-
make
%install
@@ -137,14 +172,19 @@
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
cp build/freeswitch.ld.so.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d/
+# Install init files
install -D -m 744 build/freeswitch.init $RPM_BUILD_ROOT/etc/init.d/freeswitch
+
+# Make /usr/sbin/rcfreeswitch a link to /etc/init,d/freeswitch
mkdir -p $RPM_BUILD_ROOT/usr/sbin
ln -sf /etc/init.d/freeswitch $RPM_BUILD_ROOT/usr/sbin/rcfreeswitch
+
+# Add the sysconfiguration file
install -D -m 744 build/freeswitch.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/freeswitch
+# Add a freeswitch user with group daemon
%pre
-/usr/sbin/groupadd -r freeswitch 2> /dev/null || :
-/usr/sbin/useradd -r -g freeswitch -s /bin/false -c "Freeswitch daemon" -d /opt/freeswitch/var freeswitch 2> /dev/null || :
+/usr/sbin/useradd -r -g daemon -s /bin/false -c "The FreeSWITCH Open Source Voice Platform" -d /opt/freeswitch/var freeswitch 2> /dev/null || :
%post
%{?run_ldconfig:%run_ldconfig}
@@ -156,71 +196,142 @@
rm -rf $RPM_BUILD_ROOT
%files
-%defattr(-,root,root)
-%dir %attr(750,root,root) /opt/freeswitch/db
-%dir %attr(750,root,root) /opt/freeswitch/log
-%dir %attr(750,root,root) /opt/freeswitch/log/xml_cdr
-%dir %attr(750,root,root) /opt/freeswitch/htdocs
-%dir %attr(750,root,root) /opt/freeswitch/scripts
-#%dir %attr(750,root,root) /opt/freeswitch/grammer
-%dir %attr(750,root,root) /opt/freeswitch/conf
-%dir %attr(750,root,root) /opt/freeswitch/conf/autoload_configs
-%dir %attr(750,root,root) /opt/freeswitch/conf/dialplan
-%dir %attr(750,root,root) /opt/freeswitch/conf/directory
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/en
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/en/demo
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/en/vm
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/de
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/de/demo
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/de/vm
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/fr
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/fr/demo
-%dir %attr(750,root,root) /opt/freeswitch/conf/lang/fr/vm
-%dir %attr(750,root,root) /opt/freeswitch/conf/sip_profiles
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/*.conf
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/autoload_configs/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/dialplan/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/directory/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/en/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/en/demo/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/en/vm/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/de/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/de/demo/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/de/vm/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/fr/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/fr/demo/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/lang/fr/vm/*.xml
-%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/sip_profiles/*.xml
+%defattr(-,freeswitch,daemon)
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/db
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/log
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/log/xml_cdr
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/htdocs
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/scripts
+#%dir %attr(750,freeswitch,daemon) /opt/freeswitch/grammer
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/autoload_configs
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/dialplan
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/directory
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en/vm
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de/vm
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/vm
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/sip_profiles
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/mime.types
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/*.tpl
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/*.conf
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/autoload_configs/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/dialplan/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/directory/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/vm/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/vm/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/vm/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/sip_profiles/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/htdocs/*
/etc/ld.so.conf.d/*
-%{_bindir}/freeswitch
-#/opt/freeswitch/bin/freeswitch
+/opt/freeswitch/bin/freeswitch
/etc/init.d/freeswitch
/etc/sysconfig/freeswitch
/usr/sbin/rcfreeswitch
-#/opt/freeswitch/lib/*.so*
-%{_libdir}/*.so*
-/opt/freeswitch/mod/*.so*
+/opt/freeswitch/lib/libfreeswitch*.so*
+/opt/freeswitch/mod/mod_console.so*
+/opt/freeswitch/mod/mod_logfile.so*
+/opt/freeswitch/mod/mod_syslog.so*
+/opt/freeswitch/mod/mod_commands.so*
+/opt/freeswitch/mod/mod_conference.so*
+/opt/freeswitch/mod/mod_dptools.so*
+/opt/freeswitch/mod/mod_enum.so*
+/opt/freeswitch/mod/mod_esf.so*
+/opt/freeswitch/mod/mod_expr.so*
+/opt/freeswitch/mod/mod_fifo.so*
+/opt/freeswitch/mod/mod_limit.so*
+/opt/freeswitch/mod/mod_rss.so*
+#/opt/freeswitch/mod/mod_soundtouch.so*
+/opt/freeswitch/mod/mod_voicemail.so*
+/opt/freeswitch/mod/mod_openmrcp.so*
+/opt/freeswitch/mod/mod_g711.so*
+/opt/freeswitch/mod/mod_g722.so*
+/opt/freeswitch/mod/mod_g726.so*
+/opt/freeswitch/mod/mod_gsm.so*
+/opt/freeswitch/mod/mod_ilbc.so*
+/opt/freeswitch/mod/mod_h26x.so*
+/opt/freeswitch/mod/mod_l16.so*
+/opt/freeswitch/mod/mod_speex.so*
+/opt/freeswitch/mod/mod_dialplan_directory.so*
+/opt/freeswitch/mod/mod_dialplan_xml.so*
+/opt/freeswitch/mod/mod_dialplan_asterisk.so*
+/opt/freeswitch/mod/mod_dingaling.so*
+/opt/freeswitch/mod/mod_iax.so*
+/opt/freeswitch/mod/mod_portaudio.so*
+/opt/freeswitch/mod/mod_sofia.so*
+/opt/freeswitch/mod/mod_woomera.so*
+/opt/freeswitch/mod/mod_openzap.so*
+/opt/freeswitch/mod/mod_event_multicast.so*
+/opt/freeswitch/mod/mod_event_socket.so*
+/opt/freeswitch/mod/mod_native_file.so*
+/opt/freeswitch/mod/mod_sndfile.so*
+/opt/freeswitch/mod/mod_local_stream.so*
+/opt/freeswitch/mod/mod_xml_rpc.so*
+/opt/freeswitch/mod/mod_xml_curl.so*
+/opt/freeswitch/mod/mod_xml_cdr.so*
+/opt/freeswitch/mod/mod_say_en.so*
+/opt/freeswitch/mod/mod_say_fr.so*
+/opt/freeswitch/mod/mod_say_de.so*
+/opt/freeswitch/mod/mod_say_es.so*
+/opt/freeswitch/mod/mod_say_it.so*
+/opt/freeswitch/mod/mod_say_nl.so*
%files codec-passthru-amr
+%defattr(-,freeswitch,daemon)
/opt/freeswitch/mod/mod_amr.so*
%files codec-passthru-g723_1
+%defattr(-,freeswitch,daemon)
/opt/freeswitch/mod/mod_g723_1.so*
%files codec-passthru-g729
+%defattr(-,freeswitch,daemon)
/opt/freeswitch/mod/mod_g729.so*
+%files spidermonkey
+%defattr(-,freeswitch,daemon)
+/opt/freeswitch/mod/mod_spidermonkey*.so*
+/opt/freeswitch/lib/libjs.so*
+/opt/freeswitch/lib/libnspr4.so
+/opt/freeswitch/lib/libplds4.so
+/opt/freeswitch/lib/libplc4.so
+
%files devel
-%defattr(-,root,root)
-%{_libdir}/*.a
-%{_libdir}/*.la
+%defattr(-,freeswitch,daemon)
+/opt/freeswitch/lib/*.a
+/opt/freeswitch/lib/*.la
/opt/freeswitch/mod/*.a
/opt/freeswitch/mod/*.la
/opt/freeswitch/include/*.h
%changelog
+* Thu Nov 29 2007 - michal.bielicki+rpmspam(a)voiceworks.pl
+- Added ifdefs for susealities
+- Added specifics for centos/redhat
+- Added specifics for fedora
+- Preparing to use it for adding it to SFE packaging for solaris
+- Added odbc stuff back in
+- made curl default
+- Separate package for mod_spidermonkey
+- got rid of modules.conf and stuffed everything in MODULES env var
+- got rid of handmade Cflags peter added ;)
+- fixed bin and libpaths
+- fixed locationof nspr and js libs
+- fixed odbc requirements
+- added all buildable modules
* Tue Apr 24 2007 - peter+rpmspam(a)suntel.com.tr
- Added a debug package
- Split the passthrough codecs into separate packages
1
0
Author: cypromis
Date: Fri Nov 30 09:13:00 2007
New Revision: 6447
Added:
freeswitch/trunk/debian/dirs
- copied unchanged from r6446, /freeswitch/trunk/debian/freeswitch.dirs
Removed:
freeswitch/trunk/debian/freeswitch.dirs
Log:
reorg of .deb packaging
1
0
[Freeswitch-svn] [commit] r6446 - in freeswitch/trunk/debian: . man man/man1 monit
by Freeswitch SVN 30 Nov '07
by Freeswitch SVN 30 Nov '07
30 Nov '07
Author: cypromis
Date: Fri Nov 30 09:12:23 2007
New Revision: 6446
Added:
freeswitch/trunk/debian/freeswitch-codec-passthru-amr.install
freeswitch/trunk/debian/freeswitch-codec-passthru-g723_1.install
freeswitch/trunk/debian/freeswitch-codec-passthru-g729.install
freeswitch/trunk/debian/freeswitch-dev.install
freeswitch/trunk/debian/freeswitch-spidermonkey.install
freeswitch/trunk/debian/freeswitch.conffiles
- copied unchanged from r6434, /freeswitch/trunk/debian/conffiles
freeswitch/trunk/debian/freeswitch.dirs
- copied unchanged from r6443, /freeswitch/trunk/debian/dirs
freeswitch/trunk/debian/freeswitch.install
freeswitch/trunk/debian/man/
freeswitch/trunk/debian/man/man1/
freeswitch/trunk/debian/man/man1/freeswitch.1
freeswitch/trunk/debian/monit/
freeswitch/trunk/debian/monit/freeswitch.monitrc
Removed:
freeswitch/trunk/debian/conffiles
freeswitch/trunk/debian/dirs
freeswitch/trunk/debian/freeswitch.1
freeswitch/trunk/debian/freeswitch.monitrc
Modified:
freeswitch/trunk/debian/changelog
freeswitch/trunk/debian/control
freeswitch/trunk/debian/rules
Log:
Half ready multipackage debianisation commit
Just a test, please don't use yet
Modified: freeswitch/trunk/debian/changelog
==============================================================================
--- freeswitch/trunk/debian/changelog (original)
+++ freeswitch/trunk/debian/changelog Fri Nov 30 09:12:23 2007
@@ -1,4 +1,4 @@
-freeswitch (1.0~beta2-2) unstable; urgency=low
+freeswitch (1.0~beta3-1) unstable; urgency=low
* Additional scripts for changing the user to freeswitch
Added Startup Scripts
@@ -7,6 +7,9 @@
init.d file
added user freeswitch to own and run all off freeswitch
cleaned up config file control
+ new upstream release
+ split off codec pakcages
+ split off spidermonkey packages
-- Michal Bielicki <michal.bielicki(a)voiceworks.pl> Tue, 27 Nov 2007 13:20:21 +0100
Modified: freeswitch/trunk/debian/control
==============================================================================
--- freeswitch/trunk/debian/control (original)
+++ freeswitch/trunk/debian/control Fri Nov 30 09:12:23 2007
@@ -7,7 +7,7 @@
Package: freeswitch
Architecture: any
-Depends: ${shlibs:Depends}, unixodbc, libasound2, libcurl3, openssl, libncurses5
+Depends: ${shlibs:Depends}, ${misc:Depends}, unixodbc, libasound2, libcurl3, openssl, libncurses5
Suggests: monit
Description: A telephony platform that really kicks some ass...
FreeSWITCH is an open source telephony platform designed to facilitate the
@@ -16,4 +16,34 @@
or a media server to host IVR applications using simple scripts or XML to
control the callflow.
.
- Homepage: http://some-project.some-place.org/
+Homepage: http://www.freeswitch.org/
+
+Package: freeswitch-spidermonkey
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: A Javascript engine for freeswitch
+Homepage: http://www.freeswitch.org/
+
+Package: freeswitch-dev
+Architecture: any
+Depends: ${shlibs:Depends} freswitch
+Description: Development Package for the FreeSwitch open source telephony platform
+Homepage: http://www.freeswitch.org/
+
+Package: freeswitch-codec-passthru-g723_1
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Pass through g723.1 Codec support for the FreeSWITCH open source telephony platform
+Homepage: http://www.freeswitch.org/
+
+Package: freeswitch-codec-passthru-amr
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Pass through AMR Codec support for the FreeSWITCH open source telephony platform
+Homepage: http://www.freeswitch.org/
+
+Package: freeswitch-codec-passthru-g729
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Pass through g729 Codec support for the FreeSWITCH open source telephony platform
+Homepage: http://www.freeswitch.org/
Added: freeswitch/trunk/debian/freeswitch-codec-passthru-amr.install
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/freeswitch-codec-passthru-amr.install Fri Nov 30 09:12:23 2007
@@ -0,0 +1 @@
+opt/freeswitch/mod/mod_amr.so*
Added: freeswitch/trunk/debian/freeswitch-codec-passthru-g723_1.install
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/freeswitch-codec-passthru-g723_1.install Fri Nov 30 09:12:23 2007
@@ -0,0 +1 @@
+opt/freeswitch/od/mod_g723_1.so*
Added: freeswitch/trunk/debian/freeswitch-codec-passthru-g729.install
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/freeswitch-codec-passthru-g729.install Fri Nov 30 09:12:23 2007
@@ -0,0 +1 @@
+opt/freeswitch/mod/mod_g729.so*
Added: freeswitch/trunk/debian/freeswitch-dev.install
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/freeswitch-dev.install Fri Nov 30 09:12:23 2007
@@ -0,0 +1,5 @@
+opt/freeswitch/lib/*.a
+opt/freeswitch/lib/*.la
+opt/freeswitch/mod/*.a
+opt/freeswitch/mod/*.la
+opt/freeswitch/include/*.h
Added: freeswitch/trunk/debian/freeswitch-spidermonkey.install
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/freeswitch-spidermonkey.install Fri Nov 30 09:12:23 2007
@@ -0,0 +1,5 @@
+opt/freeswitch/mod/mod_spidermonkey*so*
+opt/freeswitch/lib/libnspr4.so*
+opt/freeswitch/lib/libjs.so*
+opt/freeswitch/lib/libplds4.so*
+opt/freeswitch/lib/libplc4.so*
Added: freeswitch/trunk/debian/freeswitch.install
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/freeswitch.install Fri Nov 30 09:12:23 2007
@@ -0,0 +1,36 @@
+opt/freeswitch/htdocs/*
+opt/freeswitch/bin/freeswitch
+opt/freeswitch/lib/libfreeswitch*.so*
+etc/init.d/freeswitch
+etc/monit/freeswitch.monitrc
+etc/default/freeswitch
+opt/freeswitch/man/man1/freeswitch.1
+opt/freeswitch/mod/mod_console.so*
+opt/freeswitch/mod/mod_syslog.so*
+opt/freeswitch/mod/mod_commands.so*
+opt/freeswitch/mod/mod_conference.so*
+opt/freeswitch/mod/mod_dptools.so*
+opt/freeswitch/mod/mod_enum.so*
+opt/freeswitch/mod/mod_fifo.so*
+opt/freeswitch/mod/mod_openmrcp.so*
+# Codecs
+opt/freeswitch/mod/mod_g711.so*
+opt/freeswitch/mod/mod_g722.so*
+opt/freeswitch/mod/mod_g726.so*
+opt/freeswutch/mod/mod_speex.so*
+# Dialplan
+opt/freeswitch/mod/mod_dialplan*.so*
+# Endpoints
+opt/freeswitch/mod/mod_dingaling.so*
+opt/freeswitch/mod/mod_iax.so*
+opt/freeswitch/mod/mod_portaudio.so*
+opt/freeswitch/mod/mod_sofia.so*
+opt/freeswitch/mod/mod_woomera.so*
+opt/freeswitch/mod/mod_openzap.so
+# event engines
+opt/freeswitch/mod/mod_event_*.so*
+opt/freeswitch/mod/mod_native_file.so*
+opt/freeswitch/mod/mod_sndfile.so*
+opt/freeswitch/mod/mod_local_stream.so*
+opt/freeswitch/mod/mod_xml_*.so*
+opt/freeswitch/mod/mod_say_*.so*
Added: freeswitch/trunk/debian/man/man1/freeswitch.1
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/man/man1/freeswitch.1 Fri Nov 30 09:12:23 2007
@@ -0,0 +1,22 @@
+.TH "FREESWITCH" "1" "October 10, 2007" "" ""
+.nh
+.ad l
+.SH "NAME"
+freeswitch \- Open Source telephony platform
+.SH "SYNOPSIS"
+.HP 7
+\fBfreeswitch\fR [\fIoption\fR...]
+.SH "DESCRIPTION"
+.PP
+This manual page documents briefly the
+\fBfreeswitch\fR
+command.
+.PP
+This manual page was written for the
+Debian
+distribution because we're too lame to write a real manual page. But we have a superb website over here:
+.UR http://www.freeswitch.org/
+.BR http://www.freeswitch.org/
+.SH "SEE ALSO"
+.PP
+\fBundocumented\fR(7).
Added: freeswitch/trunk/debian/monit/freeswitch.monitrc
==============================================================================
--- (empty file)
+++ freeswitch/trunk/debian/monit/freeswitch.monitrc Fri Nov 30 09:12:23 2007
@@ -0,0 +1,22 @@
+ check process freeswitch with pidfile /opt/freeswitch/log/freeswitch.pid
+ group voice
+ start program = "/etc/init.d/freeswitch start"
+ stop program = "/etc/init.d/freeswitch stop"
+ if failed port 5060 type UDP then restart
+ if 5 restarts within 5 cycles then timeout
+ depends on freeswitch_bin
+ depends on freeswitch_rc
+
+ check file freeswitch_bin with path /opt/freeswitch/bin/freeswitch
+ group voice
+ if failed checksum then unmonitor
+ if failed permission 755 then unmonitor
+ if failed uid freeswitch then unmonitor
+ if failed gid daemon then unmonitor
+
+ check file freeswitch_rc with path /etc/init.d/freeswitch
+ group voice
+ if failed checksum then unmonitor
+ if failed permission 755 then unmonitor
+ if failed uid root then unmonitor
+ if failed gid root then unmonitor
Modified: freeswitch/trunk/debian/rules
==============================================================================
--- freeswitch/trunk/debian/rules (original)
+++ freeswitch/trunk/debian/rules Fri Nov 30 09:12:23 2007
@@ -3,7 +3,7 @@
# This file is public domain software, originally written by Joey Hess.
# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
export MODULES ?= mod_console mod_syslog mod_commands mod_conference mod_dptools mod_enum mod_fifo mod_openmrcp mod_amr mod_g711 mod_g722 mod_g723_1 mod_g726 mod_g729 mod_gsm mod_ilbc mod_l16 mod_speex mod_dialplan_directory mod_dialplan_xml mod_dialplan_asterisk mod_dingaling mod_iax mod_portaudio mod_sofia mod_woomera mod_openzap mod_event_multicast mod_event_socket mod_native_file mod_sndfile mod_local_stream mod_spidermonkey mod_spidermonkey_teletone mod_spidermonkey_core_db mod_spidermonkey_odbc mod_xml_rpc mod_xml_curl mod_xml_cdr mod_say_en mod_say_fr mod_say_de
ifndef AUTOCONF
@@ -67,7 +67,7 @@
dh_clean -k
dh_installdirs
- $(MAKE) DESTDIR=$(CURDIR)/debian/freeswitch install
+ $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
# Build architecture-independent files here.
@@ -94,10 +94,11 @@
# dh_installinfo
# dh_undocumented
# dh_installman
- dh_install debian/freeswitch.monitrc etc/monit
- dh_install debian/default/freeswitch etc/default
- dh_install debian/freeswitch.1 opt/man
- dh_link opt/freeswitch/conf etc/opt/freeswitch
+ dh_install --sourcedir=debian/tmp --autodest debian/monit/freeswitch.monitrc
+ dh_install --sourcedir=debian/tmp --autodest debian/default/freeswitch
+ dh_install --sourcedir=/debian/tmp --autodest debian/man/man1/freeswitch.1
+ dh_link --sourcedir=debian/tmp opt/freeswitch/conf etc/opt/freeswitch
+ dh_install --sourcedir=debian/tmp
dh_strip
dh_compress
dh_fixperms --exclude /opt/freeswitch/conf
1
0