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
February 2009
- 20 participants
- 764 discussions
Author: brian
Date: Fri Feb 20 02:39:08 2009
New Revision: 12176
Log:
fix events.pl
Modified:
freeswitch/trunk/libs/esl/perl/events.pl
Modified: freeswitch/trunk/libs/esl/perl/events.pl
==============================================================================
--- freeswitch/trunk/libs/esl/perl/events.pl (original)
+++ freeswitch/trunk/libs/esl/perl/events.pl Fri Feb 20 02:39:08 2009
@@ -1,6 +1,6 @@
require ESL;
-my $con = new ESL::eslConnection("localhost", "8021", "ClueCon");
+my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon");
$con->events("plain", "all");
1
0
Author: mrene
Date: Thu Feb 19 22:38:54 2009
New Revision: 12175
Log:
fix getlib.sh's curl/wget detection
Modified:
freeswitch/trunk/build/getlib.sh.in
Modified: freeswitch/trunk/build/getlib.sh.in
==============================================================================
--- freeswitch/trunk/build/getlib.sh.in (original)
+++ freeswitch/trunk/build/getlib.sh.in Thu Feb 19 22:38:54 2009
@@ -5,10 +5,10 @@
WGET=@WGET@
CURL=@CURL@
-if [ -f $WGET ] ; then
+if [ -f "$WGET" ] ; then
DOWNLOAD_CMD=$WGET
else
- if [ -f $CURL ] ; then
+ if [ -f "$CURL" ] ; then
DOWNLOAD_CMD="$CURL -O"
fi
fi
1
0
[commit] r12174 - in freeswitch/trunk/src/mod/endpoints/mod_skypiax: . asterisk
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: gmaruzz
Date: Thu Feb 19 19:26:20 2009
New Revision: 12174
Log:
skypiax: ringback is ok now, early media in early stage (eg: not yet early media :-) )
Modified:
freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/chan_skypiax.c
freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/skypiax.h
freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c
freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h
freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/chan_skypiax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/chan_skypiax.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/chan_skypiax.c Thu Feb 19 19:26:20 2009
@@ -1880,40 +1880,31 @@
#endif
return 0;
}
-
-int outbound_channel_answered(private_t * p)
+int remote_party_is_ringing(private_t * p)
{
-#ifdef NOTDEF
- switch_core_session_t *session = NULL;
- switch_channel_t *channel = NULL;
-
- if (strlen(tech_pvt->session_uuid_str)) {
- session = switch_core_session_locate(tech_pvt->session_uuid_str);
- } else {
- ERRORA("No session???\n", SKYPIAX_P_LOG);
- }
- if (session) {
- channel = switch_core_session_get_channel(session);
- } else {
- ERRORA("No session???\n", SKYPIAX_P_LOG);
+ if (p->owner) {
+ ast_queue_control(p->owner, AST_CONTROL_RINGING);
}
- if (channel) {
- switch_channel_mark_answered(channel);
- //DEBUGA_SKYPE("skype_call: %s, answered\n", SKYPIAX_P_LOG, id);
- } else {
- ERRORA("No channel???\n", SKYPIAX_P_LOG);
+
+ return 0;
+}
+int remote_party_is_early_media(private_t * p)
+{
+ if (p->owner) {
+ ast_queue_control(p->owner, AST_CONTROL_RINGING);
}
- switch_core_session_rwunlock(session);
+ return 0;
+}
+
-#endif
+int outbound_channel_answered(private_t * p)
+{
if (p->owner) {
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
}
- NOTICA("HERE!\n", SKYPIAX_P_LOG);
-
return 0;
}
void *skypiax_do_tcp_srv_thread(void *obj)
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/skypiax.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/skypiax.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/asterisk/skypiax.h Thu Feb 19 19:26:20 2009
@@ -414,6 +414,8 @@
#endif /* WIN32 */
int skypiax_close_socket(unsigned int fd);
private_t *find_available_skypiax_interface(void);
+int remote_party_is_ringing(private_t * tech_pvt);
+int remote_party_is_early_media(private_t * tech_pvt);
#define SKYPIAX_STATE_DOWN AST_STATE_DOWN
#define SKYPIAX_STATE_RING AST_STATE_RING
#define SKYPIAX_STATE_DIALING AST_STATE_DIALING
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Feb 19 19:26:20 2009
@@ -1169,6 +1169,62 @@
return 0;
}
+int remote_party_is_ringing(private_t * tech_pvt)
+{
+ switch_core_session_t *session = NULL;
+ switch_channel_t *channel = NULL;
+
+ if (strlen(tech_pvt->session_uuid_str)) {
+ session = switch_core_session_locate(tech_pvt->session_uuid_str);
+ } else {
+ ERRORA("No session???\n", SKYPIAX_P_LOG);
+ }
+ if (session) {
+ channel = switch_core_session_get_channel(session);
+ } else {
+ ERRORA("No session???\n", SKYPIAX_P_LOG);
+ }
+ if (channel) {
+ switch_channel_mark_ring_ready(channel);
+ DEBUGA_SKYPE("skype_call: REMOTE PARTY RINGING\n", SKYPIAX_P_LOG);
+ } else {
+ ERRORA("No channel???\n", SKYPIAX_P_LOG);
+ }
+
+ switch_core_session_rwunlock(session);
+
+ return 0;
+}
+
+
+int remote_party_is_early_media(private_t * tech_pvt)
+{
+ switch_core_session_t *session = NULL;
+ switch_channel_t *channel = NULL;
+
+ if (strlen(tech_pvt->session_uuid_str)) {
+ session = switch_core_session_locate(tech_pvt->session_uuid_str);
+ } else {
+ ERRORA("No session???\n", SKYPIAX_P_LOG);
+ }
+ if (session) {
+ channel = switch_core_session_get_channel(session);
+ switch_core_session_add_stream(session, NULL);
+ } else {
+ ERRORA("No session???\n", SKYPIAX_P_LOG);
+ }
+ if (channel) {
+ //switch_channel_mark_pre_answered(channel);
+ NOTICA("skype_call: REMOTE PARTY EARLY MEDIA, we will pass you the audio, just the code is not yet written :-)\n", SKYPIAX_P_LOG);
+ } else {
+ ERRORA("No channel???\n", SKYPIAX_P_LOG);
+ }
+
+ switch_core_session_rwunlock(session);
+
+ return 0;
+}
+
int outbound_channel_answered(private_t * tech_pvt)
{
switch_core_session_t *session = NULL;
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h Thu Feb 19 19:26:20 2009
@@ -268,3 +268,5 @@
#endif /* WIN32 */
int skypiax_close_socket(unsigned int fd);
private_t *find_available_skypiax_interface(void);
+int remote_party_is_ringing(private_t * tech_pvt);
+int remote_party_is_early_media(private_t * tech_pvt);
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Thu Feb 19 19:26:20 2009
@@ -267,12 +267,14 @@
strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n",
SKYPIAX_P_LOG, id);
+ remote_party_is_ringing(tech_pvt);
}
} else if (!strcasecmp(value, "EARLYMEDIA")) {
tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
- DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n",
+ NOTICA("Our remote party in skype_call %s is EARLYMEDIA\n",
SKYPIAX_P_LOG, id);
+ remote_party_is_early_media(tech_pvt);
} else if (!strcasecmp(value, "MISSED")) {
DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id);
} else if (!strcasecmp(value, "FINISHED")) {
1
0
[commit] r12173 - in freeswitch/trunk: libs/esl/src libs/esl/src/include src src/include src/mod/applications/mod_commands src/mod/event_handlers/mod_event_socket src/mod/formats/mod_local_stream
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: anthm
Date: Thu Feb 19 19:10:59 2009
New Revision: 12173
Log:
FSCORE-297
Modified:
freeswitch/trunk/libs/esl/src/esl.c
freeswitch/trunk/libs/esl/src/include/esl.h
freeswitch/trunk/src/include/switch_apr.h
freeswitch/trunk/src/include/switch_core.h
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
freeswitch/trunk/src/switch_apr.c
freeswitch/trunk/src/switch_core.c
freeswitch/trunk/src/switch_core_session.c
freeswitch/trunk/src/switch_event.c
freeswitch/trunk/src/switch_loadable_module.c
freeswitch/trunk/src/switch_log.c
Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c (original)
+++ freeswitch/trunk/libs/esl/src/esl.c Thu Feb 19 19:10:59 2009
@@ -643,7 +643,7 @@
hval = esl_event_get_header(handle->last_event, "content-type");
- if (strcasecmp(hval, "auth/request")) {
+ if (esl_safe_strcasecmp(hval, "auth/request")) {
snprintf(handle->err, sizeof(handle->err), "Connection Error");
goto fail;
}
@@ -660,7 +660,7 @@
hval = esl_event_get_header(handle->last_event, "reply-text");
- if (strcasecmp(hval, "+OK accepted")) {
+ if (esl_safe_strcasecmp(hval, "+OK accepted")) {
snprintf(handle->err, sizeof(handle->err), "Authentication Error");
goto fail;
}
@@ -876,7 +876,7 @@
hval = esl_event_get_header(revent, "content-type");
- if (!esl_strlen_zero(hval) && !strcasecmp(hval, "text/event-plain") && revent->body) {
+ if (!esl_strlen_zero(hval) && !esl_safe_strcasecmp(hval, "text/event-plain") && revent->body) {
const char *en;
esl_event_types_t et = ESL_EVENT_COMMAND;
char *body = strdup(revent->body);
Modified: freeswitch/trunk/libs/esl/src/include/esl.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl.h (original)
+++ freeswitch/trunk/libs/esl/src/include/esl.h Thu Feb 19 19:10:59 2009
@@ -341,7 +341,7 @@
#define esl_recv(_h) esl_recv_event(_h, NULL)
#define esl_recv_timed(_h, _ms) esl_recv_event_timed(_h, _ms, NULL)
-
+#define esl_safe_strcasecmp(_s1, _s2) ((_s1) && (_s2)) ? strcasecmp((_s1), (_s2)) : 1
#ifdef __cplusplus
}
Modified: freeswitch/trunk/src/include/switch_apr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_apr.h (original)
+++ freeswitch/trunk/src/include/switch_apr.h Thu Feb 19 19:10:59 2009
@@ -620,6 +620,8 @@
*/
SWITCH_DECLARE(switch_status_t) switch_queue_trypop(switch_queue_t *queue, void **data);
+SWITCH_DECLARE(switch_status_t) switch_queue_interrupt_all(switch_queue_t *queue);
+
/**
* push/add a object to the queue, returning immediatly if the queue is full
*
Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h (original)
+++ freeswitch/trunk/src/include/switch_core.h Thu Feb 19 19:10:59 2009
@@ -1671,7 +1671,8 @@
/*!
\brief Launch a thread
*/
-SWITCH_DECLARE(void) switch_core_launch_thread(void *(SWITCH_THREAD_FUNC *func) (switch_thread_t *, void *), void *obj, switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_thread_t *) switch_core_launch_thread(void *(SWITCH_THREAD_FUNC *func) (switch_thread_t *, void *),
+ void *obj, switch_memory_pool_t *pool);
#endif
/*!
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 Thu Feb 19 19:10:59 2009
@@ -40,7 +40,9 @@
#include <switch_version.h>
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load);
-SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, NULL, NULL);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_commands_shutdown);
+SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, mod_commands_shutdown, NULL);
+
SWITCH_STANDARD_API(time_test_function)
{
@@ -2289,6 +2291,8 @@
return SWITCH_STATUS_SUCCESS;
}
+static switch_thread_rwlock_t *bgapi_rwlock = NULL;
+
struct bg_job {
char *cmd;
char *arg;
@@ -2309,6 +2313,8 @@
if (!job)
return NULL;
+ switch_thread_rwlock_rdlock(bgapi_rwlock);
+
pool = job->pool;
SWITCH_STANDARD_STREAM(stream);
@@ -2345,6 +2351,9 @@
job = NULL;
switch_core_destroy_memory_pool(&pool);
pool = NULL;
+
+ switch_thread_rwlock_unlock(bgapi_rwlock);
+
return NULL;
}
@@ -3183,11 +3192,37 @@
return SWITCH_STATUS_SUCCESS;
}
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_commands_shutdown)
+{
+ int x;
+
+
+ for (x = 30; x > 0; x--) {
+ if (switch_thread_rwlock_trywrlock(bgapi_rwlock) == SWITCH_STATUS_SUCCESS) {
+ switch_thread_rwlock_unlock(bgapi_rwlock);
+ break;
+ }
+ if (x == 30) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for bgapi threads.\n");
+ }
+ switch_yield(1000000);
+ }
+
+ if (!x) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Giving up waiting for bgapi threads.\n");
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
{
switch_api_interface_t *commands_api_interface;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ switch_thread_rwlock_create(&bgapi_rwlock, pool);
+
SWITCH_ADD_API(commands_api_interface, "group_call", "Generate a dial string to call a group", group_call_function, "<group>[@<domain>]");
SWITCH_ADD_API(commands_api_interface, "in_group", "determine if a user is in a group", in_group_function, "<user>[@<domain>] <group_name>");
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 Thu Feb 19 19:10:59 2009
@@ -116,6 +116,7 @@
static void remove_listener(listener_t *listener);
+static void kill_all_listeners(void);
static uint32_t next_id(void)
{
@@ -452,31 +453,24 @@
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown)
{
- listener_t *l;
int sanity = 0;
prefs.done = 1;
+ kill_all_listeners();
switch_log_unbind_logger(socket_logger);
close_socket(&listen_list.sock);
while (prefs.threads) {
- switch_yield(10000);
- if (++sanity == 1000) {
+ switch_yield(100000);
+ kill_all_listeners();
+ if (++sanity >= 200) {
break;
}
}
- switch_event_unbind(&globals.node);
-
- switch_mutex_lock(globals.listener_mutex);
- for (l = listen_list.listeners; l; l = l->next) {
- close_socket(&l->sock);
- }
- switch_mutex_unlock(globals.listener_mutex);
-
- switch_yield(1000000);
+ switch_event_unbind(&globals.node);
return SWITCH_STATUS_SUCCESS;
}
@@ -509,6 +503,22 @@
}
+static void kill_all_listeners(void)
+{
+ listener_t *l;
+
+ switch_mutex_lock(globals.listener_mutex);
+ for (l = listen_list.listeners; l; l = l->next) {
+ switch_clear_flag(l, LFLAG_RUNNING);
+ if (l->sock) {
+ switch_socket_shutdown(l->sock, SWITCH_SHUTDOWN_READWRITE);
+ switch_socket_close(l->sock);
+ }
+ }
+ switch_mutex_unlock(globals.listener_mutex);
+}
+
+
static listener_t *find_listener(uint32_t id)
{
listener_t *l, *r = NULL;
@@ -961,12 +971,16 @@
uint32_t max_len = sizeof(mbuf);
switch_channel_t *channel = NULL;
int clen = 0;
-
+
*event = NULL;
+
+ if (prefs.done) {
+ return SWITCH_STATUS_FALSE;
+ }
+
start = switch_epoch_time_now(NULL);
ptr = mbuf;
-
if (listener->session) {
channel = switch_core_session_get_channel(listener->session);
}
@@ -976,7 +990,7 @@
mlen = 1;
status = switch_socket_recv(listener->sock, ptr, &mlen);
- if (!SWITCH_STATUS_IS_BREAK(status) && status != SWITCH_STATUS_SUCCESS) {
+ if (prefs.done || (!SWITCH_STATUS_IS_BREAK(status) && status != SWITCH_STATUS_SUCCESS)) {
return SWITCH_STATUS_FALSE;
}
@@ -1044,7 +1058,7 @@
status = switch_socket_recv(listener->sock, p, &mlen);
- if (!SWITCH_STATUS_IS_BREAK(status) && status != SWITCH_STATUS_SUCCESS) {
+ if (prefs.done || (!SWITCH_STATUS_IS_BREAK(status) && status != SWITCH_STATUS_SUCCESS)) {
return SWITCH_STATUS_FALSE;
}
@@ -1211,10 +1225,15 @@
switch_stream_handle_t stream = { 0 };
char *reply, *freply = NULL;
switch_status_t status;
+
+ switch_mutex_lock(globals.listener_mutex);
+ prefs.threads++;
+ switch_mutex_unlock(globals.listener_mutex);
+
if (!acs) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Internal error.\n");
- return NULL;
+ goto cleanup;
}
if (!acs->listener || !switch_test_flag(acs->listener, LFLAG_RUNNING) ||
@@ -1291,6 +1310,11 @@
}
+ cleanup:
+ switch_mutex_lock(globals.listener_mutex);
+ prefs.threads--;
+ switch_mutex_unlock(globals.listener_mutex);
+
return NULL;
}
@@ -1934,7 +1958,7 @@
}
}
- while (switch_test_flag(listener, LFLAG_RUNNING) && listen_list.ready) {
+ while (!prefs.done && switch_test_flag(listener, LFLAG_RUNNING) && listen_list.ready) {
len = sizeof(buf);
memset(buf, 0, len);
status = read_packet(listener, &revent, 0);
@@ -2106,7 +2130,7 @@
config();
- for (;;) {
+ while(!prefs.done) {
rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_INET, prefs.port, 0, pool);
if (rv)
goto fail;
@@ -2132,7 +2156,7 @@
listen_list.ready = 1;
- for (;;) {
+ while(!prefs.done) {
if (switch_core_new_memory_pool(&listener_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH no pool\n");
goto fail;
Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Thu Feb 19 19:10:59 2009
@@ -222,13 +222,13 @@
if (!used && !is_open) {
break;
}
-
+
if (!is_open || used >= source->prebuf || (source->total && used > source->samples * 2)) {
used = switch_buffer_read(audio_buffer, dist_buf, source->samples * 2);
if (source->total) {
switch_mutex_lock(source->mutex);
- for (cp = source->context_list; cp; cp = cp->next) {
+ for (cp = source->context_list; cp && RUNNING; cp = cp->next) {
if (switch_test_flag(cp->handle, SWITCH_FILE_CALLBACK)) {
continue;
}
Modified: freeswitch/trunk/src/switch_apr.c
==============================================================================
--- freeswitch/trunk/src/switch_apr.c (original)
+++ freeswitch/trunk/src/switch_apr.c Thu Feb 19 19:10:59 2009
@@ -895,6 +895,11 @@
return apr_queue_trypop(queue, data);
}
+SWITCH_DECLARE(switch_status_t) switch_queue_interrupt_all(switch_queue_t *queue)
+{
+ return apr_queue_interrupt_all(queue);
+}
+
SWITCH_DECLARE(switch_status_t) switch_queue_trypush(switch_queue_t *queue, void *data)
{
apr_status_t s;
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Thu Feb 19 19:10:59 2009
@@ -345,9 +345,9 @@
*/
-SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void *obj, switch_memory_pool_t *pool)
+SWITCH_DECLARE(switch_thread_t *) switch_core_launch_thread(switch_thread_start_t func, void *obj, switch_memory_pool_t *pool)
{
- switch_thread_t *thread;
+ switch_thread_t *thread = NULL;
switch_threadattr_t *thd_attr = NULL;
switch_core_thread_session_t *ts;
int mypool;
@@ -356,11 +356,10 @@
if (!pool && switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
- return;
+ return NULL;
}
switch_threadattr_create(&thd_attr, pool);
- switch_threadattr_detach_set(thd_attr, 1);
if ((ts = switch_core_alloc(pool, sizeof(*ts))) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory\n");
@@ -369,10 +368,13 @@
ts->pool = pool;
}
ts->objs[0] = obj;
+ ts->objs[1] = thread;
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_threadattr_priority_increase(thd_attr);
switch_thread_create(&thread, thd_attr, func, ts, pool);
}
+
+ return thread;
}
SWITCH_DECLARE(void) switch_core_set_globals(void)
@@ -1457,6 +1459,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
{
switch_event_t *event;
+
if (switch_event_create(&event, SWITCH_EVENT_SHUTDOWN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Info", "System Shutting Down");
switch_event_fire(&event);
@@ -1464,26 +1467,29 @@
switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
switch_set_flag((&runtime), SCF_SHUTTING_DOWN);
-
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "End existing sessions\n");
switch_core_session_hupall(SWITCH_CAUSE_SYSTEM_SHUTDOWN);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Clean up modules.\n");
- switch_core_memory_stop();
- switch_loadable_module_shutdown();
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Closing Event Engine.\n");
- switch_event_shutdown();
+ switch_loadable_module_shutdown();
+
if (switch_test_flag((&runtime), SCF_USE_SQL)) {
switch_core_sqldb_stop();
}
switch_scheduler_task_thread_stop();
-
+
switch_rtp_shutdown();
switch_xml_destroy();
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Closing Event Engine.\n");
+ switch_event_shutdown();
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n");
switch_log_shutdown();
+ switch_core_memory_stop();
+
if (runtime.console && runtime.console != stdout && runtime.console != stderr) {
fclose(runtime.console);
runtime.console = NULL;
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Thu Feb 19 19:10:59 2009
@@ -58,6 +58,9 @@
/* Acquire a read lock on the session */
#ifdef SWITCH_DEBUG_RWLOCKS
if (switch_core_session_perform_read_lock(session, file, func, line) != SWITCH_STATUS_SUCCESS) {
+#if EMACS_CC_MODE_IS_BUGGY
+ }
+#endif
#else
if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
#endif
@@ -127,21 +130,20 @@
void *val;
switch_core_session_t *session;
uint32_t loops = 0;
-
- switch_mutex_lock(runtime.throttle_mutex);
- for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
- switch_hash_this(hi, NULL, NULL, &val);
- if (val) {
- session = (switch_core_session_t *) val;
- if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
- switch_channel_hangup(switch_core_session_get_channel(session), cause);
- switch_core_session_rwunlock(session);
+
+ while (session_manager.session_count > 0) {
+ switch_mutex_lock(runtime.throttle_mutex);
+ for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
+ switch_hash_this(hi, NULL, NULL, &val);
+ if (val) {
+ session = (switch_core_session_t *) val;
+ if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_hangup(switch_core_session_get_channel(session), cause);
+ switch_core_session_rwunlock(session);
+ }
}
}
- }
- switch_mutex_unlock(runtime.throttle_mutex);
-
- while (session_manager.session_count > 0) {
+ switch_mutex_unlock(runtime.throttle_mutex);
switch_yield(1000000);
if (++loops == 30) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Giving up with %d session%s remaining\n",
@@ -151,6 +153,7 @@
}
}
+
SWITCH_DECLARE(switch_status_t) switch_core_session_message_send(const char *uuid_str, switch_core_session_message_t *message)
{
switch_core_session_t *session = NULL;
Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c (original)
+++ freeswitch/trunk/src/switch_event.c Thu Feb 19 19:10:59 2009
@@ -74,7 +74,9 @@
static switch_memory_pool_t *RUNTIME_POOL = NULL;
static switch_memory_pool_t *THRUNTIME_POOL = NULL;
#define NUMBER_OF_QUEUES 3
+static switch_thread_t *EVENT_QUEUE_THREADS[NUMBER_OF_QUEUES] = { 0 };
static switch_queue_t *EVENT_QUEUE[NUMBER_OF_QUEUES] = { 0 };
+static switch_thread_t *EVENT_DISPATCH_QUEUE_THREADS[MAX_DISPATCH_VAL] = { 0 };
static switch_queue_t *EVENT_DISPATCH_QUEUE[MAX_DISPATCH_VAL] = { 0 };
static int POOL_COUNT_MAX = SWITCH_CORE_QUEUE_LEN;
static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL;
@@ -174,15 +176,15 @@
static int switch_events_match(switch_event_t *event, switch_event_node_t *node)
{
int match = 0;
-
+
if (node->event_id == SWITCH_EVENT_ALL) {
match++;
-
+
if (!node->subclass) {
return match;
}
}
-
+
if (match || event->event_id == node->event_id) {
if (event->subclass_name && node->subclass) {
@@ -227,6 +229,10 @@
void *pop = NULL;
switch_event_t *event = NULL;
+ if (!SYSTEM_RUNNING) {
+ break;
+ }
+
if (switch_queue_pop(queue, &pop) != SWITCH_STATUS_SUCCESS) {
break;
}
@@ -278,6 +284,10 @@
break;
}
+ if (!SYSTEM_RUNNING) {
+ break;
+ }
+
event = (switch_event_t *) pop;
while (event) {
@@ -313,20 +323,22 @@
switch_event_types_t e;
switch_event_node_t *node;
- switch_thread_rwlock_rdlock(RWLOCK);
- for (e = (*event)->event_id;; e = SWITCH_EVENT_ALL) {
- for (node = EVENT_NODES[e]; node; node = node->next) {
- if (switch_events_match(*event, node)) {
- (*event)->bind_user_data = node->user_data;
- node->callback(*event);
+ if (SYSTEM_RUNNING) {
+ switch_thread_rwlock_rdlock(RWLOCK);
+ for (e = (*event)->event_id;; e = SWITCH_EVENT_ALL) {
+ for (node = EVENT_NODES[e]; node; node = node->next) {
+ if (switch_events_match(*event, node)) {
+ (*event)->bind_user_data = node->user_data;
+ node->callback(*event);
+ }
+ }
+
+ if (e == SWITCH_EVENT_ALL) {
+ break;
}
}
-
- if (e == SWITCH_EVENT_ALL) {
- break;
- }
+ switch_thread_rwlock_unlock(RWLOCK);
}
- switch_thread_rwlock_unlock(RWLOCK);
switch_event_destroy(event);
}
@@ -416,10 +428,10 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled event header(s) %d bytes\n",
size, (int) sizeof(switch_event_header_t) * size);
- while (switch_queue_trypop(EVENT_HEADER_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
+ while (switch_queue_trypop(EVENT_HEADER_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS && pop) {
free(pop);
}
- while (switch_queue_trypop(EVENT_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
+ while (switch_queue_trypop(EVENT_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS && pop) {
free(pop);
}
}
@@ -438,12 +450,14 @@
for (x = 0; x < 3; x++) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping event queue %d\n", x);
- switch_queue_push(EVENT_QUEUE[x], NULL);
+ switch_queue_trypush(EVENT_QUEUE[x], NULL);
+ switch_queue_interrupt_all(EVENT_QUEUE[x]);
}
for (x = 0; x < SOFT_MAX_DISPATCH; x++) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch queue %d\n", x);
- switch_queue_push(EVENT_DISPATCH_QUEUE[x], NULL);
+ switch_queue_trypush(EVENT_DISPATCH_QUEUE[x], NULL);
+ switch_queue_interrupt_all(EVENT_DISPATCH_QUEUE[x]);
}
while (x < 10000 && THREAD_COUNT) {
@@ -453,7 +467,35 @@
}
last = THREAD_COUNT;
}
+
+ for (x = 0; x < SOFT_MAX_DISPATCH; x++) {
+ void *pop = NULL;
+ switch_event_t *event = NULL;
+ switch_status_t st;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch thread %d\n", x);
+ switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]);
+
+ while (switch_queue_trypop(EVENT_DISPATCH_QUEUE[x], &pop) == SWITCH_STATUS_SUCCESS && pop) {
+ event = (switch_event_t *) pop;
+ switch_event_destroy(&event);
+ }
+ }
+ for (x = 0; x < NUMBER_OF_QUEUES; x++) {
+ void *pop = NULL;
+ switch_event_t *event = NULL;
+ switch_status_t st;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping queue thread %d\n", x);
+ switch_thread_join(&st, EVENT_QUEUE_THREADS[x]);
+
+ while (switch_queue_trypop(EVENT_QUEUE[x], &pop) == SWITCH_STATUS_SUCCESS && pop) {
+ event = (switch_event_t *) pop;
+ switch_event_destroy(&event);
+ }
+ }
+
for (hi = switch_hash_first(NULL, CUSTOM_HASH); hi; hi = switch_hash_next(hi)) {
switch_event_subclass_t *subclass;
switch_hash_this(hi, &var, NULL, &val);
@@ -472,7 +514,6 @@
static void launch_dispatch_threads(uint32_t max, int len, switch_memory_pool_t *pool)
{
- switch_thread_t *thread;
switch_threadattr_t *thd_attr;
uint32_t index = 0;
@@ -492,8 +533,7 @@
switch_threadattr_create(&thd_attr, pool);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_threadattr_priority_increase(thd_attr);
- switch_threadattr_detach_set(thd_attr, 1);
- switch_thread_create(&thread, thd_attr, switch_event_dispatch_thread, EVENT_DISPATCH_QUEUE[index], pool);
+ switch_thread_create(&EVENT_DISPATCH_QUEUE_THREADS[index], thd_attr, switch_event_dispatch_thread, EVENT_DISPATCH_QUEUE[index], pool);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Create event dispatch thread %d\n", index);
}
@@ -502,18 +542,26 @@
SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
{
- switch_thread_t *thread;
switch_threadattr_t *thd_attr;;
switch_assert(pool != NULL);
+ THRUNTIME_POOL = RUNTIME_POOL = pool;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Eventing Engine.\n");
+ switch_thread_rwlock_create(&RWLOCK, RUNTIME_POOL);
+ switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
+ switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
+ switch_mutex_init(&EVENT_QUEUE_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
+ switch_core_hash_init(&CUSTOM_HASH, RUNTIME_POOL);
+
+ switch_mutex_lock(EVENT_QUEUE_MUTEX);
+ SYSTEM_RUNNING = -1;
+ switch_mutex_unlock(EVENT_QUEUE_MUTEX);
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);
- THRUNTIME_POOL = RUNTIME_POOL = pool;
switch_queue_create(&EVENT_QUEUE[0], POOL_COUNT_MAX + 10, THRUNTIME_POOL);
switch_queue_create(&EVENT_QUEUE[1], POOL_COUNT_MAX + 10, THRUNTIME_POOL);
@@ -521,21 +569,13 @@
switch_queue_create(&EVENT_RECYCLE_QUEUE, 250000, THRUNTIME_POOL);
switch_queue_create(&EVENT_HEADER_RECYCLE_QUEUE, 250000, THRUNTIME_POOL);
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Eventing Engine.\n");
- switch_thread_rwlock_create(&RWLOCK, RUNTIME_POOL);
- switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
- switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
- switch_mutex_init(&EVENT_QUEUE_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
- switch_core_hash_init(&CUSTOM_HASH, RUNTIME_POOL);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_threadattr_priority_increase(thd_attr);
- switch_threadattr_detach_set(thd_attr, 1);
launch_dispatch_threads(1, DISPATCH_QUEUE_LEN, RUNTIME_POOL);
- switch_thread_create(&thread, thd_attr, switch_event_thread, EVENT_QUEUE[0], RUNTIME_POOL);
- switch_thread_create(&thread, thd_attr, switch_event_thread, EVENT_QUEUE[1], RUNTIME_POOL);
- switch_thread_create(&thread, thd_attr, switch_event_thread, EVENT_QUEUE[2], RUNTIME_POOL);
+ switch_thread_create(&EVENT_QUEUE_THREADS[0], thd_attr, switch_event_thread, EVENT_QUEUE[0], RUNTIME_POOL);
+ switch_thread_create(&EVENT_QUEUE_THREADS[1], thd_attr, switch_event_thread, EVENT_QUEUE[1], RUNTIME_POOL);
+ switch_thread_create(&EVENT_QUEUE_THREADS[2], thd_attr, switch_event_thread, EVENT_QUEUE[2], RUNTIME_POOL);
while (!THREAD_COUNT) {
switch_cond_next();
@@ -1029,7 +1069,7 @@
if (SYSTEM_RUNNING <= 0) {
/* sorry we're closed */
switch_event_destroy(event);
- return SWITCH_STATUS_FALSE;
+ return SWITCH_STATUS_SUCCESS;
}
switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name((*event)->event_id));
Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c (original)
+++ freeswitch/trunk/src/switch_loadable_module.c Thu Feb 19 19:10:59 2009
@@ -52,6 +52,7 @@
switch_module_shutdown_t switch_module_shutdown;
switch_memory_pool_t *pool;
switch_status_t status;
+ switch_thread_t *thread;
};
struct switch_loadable_module_container {
@@ -117,7 +118,7 @@
if (module->switch_module_runtime) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Starting runtime thread for %s\n", module->module_interface->module_name);
- switch_core_launch_thread(switch_loadable_module_exec, module, loadable_modules.pool);
+ module->thread = switch_core_launch_thread(switch_loadable_module_exec, module, loadable_modules.pool);
}
}
switch_mutex_unlock(loadable_modules.mutex);
@@ -910,7 +911,7 @@
} else if ((status = switch_loadable_module_load_file(path, file, global, &new_module)) == SWITCH_STATUS_SUCCESS) {
if ((status = switch_loadable_module_process(file, new_module)) == SWITCH_STATUS_SUCCESS && runtime) {
if (new_module->switch_module_runtime) {
- switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool);
+ new_module->thread = switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool);
}
} else if (status != SWITCH_STATUS_SUCCESS) {
*err = "module load routine returned an error";
@@ -1053,7 +1054,7 @@
module->switch_module_runtime = switch_module_runtime;
}
if (runtime && module->switch_module_runtime) {
- switch_core_launch_thread(switch_loadable_module_exec, module, module->pool);
+ module->thread = switch_core_launch_thread(switch_loadable_module_exec, module, module->pool);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Successfully Loaded [%s]\n", module_interface->module_name);
return switch_loadable_module_process((char *) module->filename, module);
@@ -1241,6 +1242,13 @@
if (unload && module->status != SWITCH_STATUS_NOUNLOAD && !(flags & SCF_VG)) {
switch_memory_pool_t *pool;
+ switch_status_t st;
+
+ if (module->thread) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s stopping runtime thread.\n", module->module_interface->module_name);
+ switch_thread_join(&st, module->thread);
+ }
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s unloaded.\n", module->module_interface->module_name);
switch_dso_destroy(&module->lib);
if ((pool = module->pool)) {
Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c (original)
+++ freeswitch/trunk/src/switch_log.c Thu Feb 19 19:10:59 2009
@@ -193,6 +193,8 @@
return SWITCH_STATUS_SUCCESS;
}
+static switch_thread_t *thread;
+
static void *SWITCH_THREAD_FUNC log_thread(switch_thread_t *thread, void *obj)
{
@@ -382,7 +384,6 @@
SWITCH_DECLARE(switch_status_t) switch_log_init(switch_memory_pool_t *pool, switch_bool_t colorize)
{
- switch_thread_t *thread;
switch_threadattr_t *thd_attr;;
switch_assert(pool != NULL);
@@ -397,7 +398,6 @@
switch_queue_create(&LOG_RECYCLE_QUEUE, SWITCH_CORE_QUEUE_LEN, LOG_POOL);
switch_mutex_init(&BINDLOCK, SWITCH_MUTEX_NESTED, LOG_POOL);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
- switch_threadattr_detach_set(thd_attr, 1);
switch_thread_create(&thread, thd_attr, log_thread, NULL, LOG_POOL);
while (!THREAD_RUNNING) {
@@ -433,12 +433,16 @@
SWITCH_DECLARE(switch_status_t) switch_log_shutdown(void)
{
+ switch_status_t st;
THREAD_RUNNING = -1;
switch_queue_push(LOG_QUEUE, NULL);
while (THREAD_RUNNING) {
switch_cond_next();
}
+
+ switch_thread_join(&st, thread);
+
switch_core_memory_reclaim_logger();
return SWITCH_STATUS_SUCCESS;
1
0
[commit] r12172 - freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs
by FreeSWITCH SVN 19 Feb '09
by FreeSWITCH SVN 19 Feb '09
19 Feb '09
Author: gmaruzz
Date: Thu Feb 19 17:48:13 2009
New Revision: 12172
Log:
skypiax: updated default.xml dialplan with skypiax inside
Modified:
freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml Thu Feb 19 17:48:13 2009
@@ -15,33 +15,11 @@
<context name="default">
<extension name="unloop">
- <condition field="$${unroll_loops}" expression="^true$"/>
+ <condition field="${unroll_loops}" expression="^true$"/>
<condition field="${sip_looped_call}" expression="^true$">
<action application="deflect" data="${destination_number}"/>
</condition>
</extension>
-
- <!--
- Try to get the domain from the sip_auth_realm otherwise it will
- default domain in vars.xml for cases it can't figure it out.
-
- -->
- <extension name="set_domain" continue="true">
- <condition field="${domain_name}" expression="^$"/>
- <condition field="source" expression="mod_sofia"/>
- <condition field="${sip_auth_realm}" expression="^$">
- <action application="set" data="domain_name=$${domain}"/>
- <anti-action application="set" data="domain_name=${sip_auth_realm}"/>
- </condition>
- </extension>
-
- <!-- Set the domain -->
- <extension name="set_domain_openzap" continue="true">
- <condition field="${domain_name}" expression="^$"/>
- <condition field="source" expression="mod_openzap">
- <action application="set" data="domain_name=$${domain}"/>
- </condition>
- </extension>
<!-- Example of doing things based on time of day. -->
<extension name="tod_example" continue="true">
@@ -94,6 +72,15 @@
<condition field="${call_debug}" expression="^true$" break="never">
<action application="info"/>
</condition>
+ <!--
+ This is an example of how to auto detect if telephone-event is missing and activate inband detection
+ -->
+ <!--
+ <condition field="${switch_r_sdp}" expression="a=rtpmap:(\d+)\stelephone-event/8000" break="never">
+ <action application="set" data="rtp_payload_number=$1"/>
+ <anti-action application="start_dtmf"/>
+ </condition>
+ -->
<condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$" break="never">
<action application="set" data="sip_secure_media=true"/>
<!-- Offer SRTP on outbound legs if we have it on inbound. -->
@@ -188,13 +175,8 @@
</extension>
<extension name="extension-intercom">
- <!-- <condition field="${sip_to_params}" expression="intercom\=true"/> -->
<condition field="destination_number" expression="^8(10[01][0-9])$">
<action application="set" data="dialed_extension=$1"/>
- <!-- This Alert-Info seems to be a case for Intercom for Polycom which sip_auto_answer=true covers already. -->
- <!--<action application="export"><![CDATA[alert_info=<sip:${domain_name}>;Ring;Answer]]></action>-->
- <action application="export"><![CDATA[sip_h_Call-Info=<sip:${domain_name}>;answer-after=0]]></action>
- <action application="export" data="sip_invite_params=intercom=true"/>
<action application="export" data="sip_auto_answer=true"/>
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
</condition>
@@ -211,32 +193,44 @@
<condition field="destination_number" expression="^(10[01][0-9])$">
<action application="set" data="dialed_extension=$1"/>
<action application="export" data="dialed_extension=$1"/>
- </condition>
- <condition field="destination_number" expression="^${caller_id_number}$">
- <action application="set" data="voicemail_authorized=${sip_authorized}"/>
+ <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
+ <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
+ <action application="bind_meta_app" data="2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
+ <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
+ <action application="set" data="ringback=${us-ring}"/>
+ <action application="set" data="transfer_ringback=$${hold_music}"/>
+ <action application="set" data="call_timeout=30"/>
+ <!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
+ <action application="set" data="hangup_after_bridge=true"/>
+ <!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
+ <action application="set" data="continue_on_fail=true"/>
+ <action application="db" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
+ <action application="db" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
+ <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
+ <!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
+ <action application="db" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
+ <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
<action application="answer"/>
<action application="sleep" data="1000"/>
- <action application="voicemail" data="check default ${domain_name} ${dialed_extension}"/>
- <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
- <anti-action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
- <anti-action application="bind_meta_app" data="2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
- <anti-action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
- <anti-action application="set" data="ringback=${us-ring}"/>
- <anti-action application="set" data="transfer_ringback=$${hold_music}"/>
- <anti-action application="set" data="call_timeout=30"/>
- <!-- <anti-action application="set" data="sip_exclude_contact=${network_addr}"/> -->
- <anti-action application="set" data="hangup_after_bridge=true"/>
- <!--<anti-action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
- <anti-action application="set" data="continue_on_fail=true"/>
- <anti-action application="db" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
- <anti-action application="db" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
- <anti-action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
- <!--<anti-action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
- <anti-action application="db" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
- <anti-action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
- <anti-action application="answer"/>
- <anti-action application="sleep" data="1000"/>
- <anti-action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
+ <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
+ </condition>
+ </extension>
+
+ <extension name="group_dial_sales">
+ <condition field="destination_number" expression="^2000$">
+ <action application="bridge" data="${group_call(sales@${domain_name})}"/>
+ </condition>
+ </extension>
+
+ <extension name="group_dial_support">
+ <condition field="destination_number" expression="^2001$">
+ <action application="bridge" data="group/support@${domain_name}"/>
+ </condition>
+ </extension>
+
+ <extension name="group_dial_billing">
+ <condition field="destination_number" expression="^2002$">
+ <action application="bridge" data="group/billing@${domain_name}"/>
</condition>
</extension>
@@ -250,7 +244,7 @@
<!-- voicemail main extension -->
<extension name="vmain">
- <condition field="destination_number" expression="^vmain|4000$">
+ <condition field="destination_number" expression="^vmain|4000|\*98$">
<action application="answer"/>
<action application="sleep" data="1000"/>
<action application="voicemail" data="check default ${domain_name}"/>
@@ -285,7 +279,6 @@
</extension>
-
<!--
start a dynamic conference with the settings of the "default" conference profile in conference.conf.xml
-->
@@ -309,30 +302,70 @@
<action application="conference" data="$1-${domain_name}@ultrawideband"/>
</condition>
</extension>
+ <!-- MONO 48kHz conferences -->
+ <extension name="cdquality_conferences">
+ <condition field="destination_number" expression="^(33\d{2})$">
+ <action application="answer"/>
+ <action application="conference" data="$1-${domain_name}@cdquality"/>
+ </condition>
+ </extension>
<!-- dial the freeswitch conference via SIP-->
<extension name="freeswitch_public_conf_via_sip">
- <condition field="destination_number" expression="^9(888|1616)$">
+ <condition field="destination_number" expression="^9(888|1616|3232)$">
+ <action application="export" data="hold_music=silence"/>
<action application="bridge" data="sofia/${use_profile}/$1(a)conference.freeswitch.org"/>
</condition>
</extension>
- <!--This extension will start a conference and invite several people upon entering -->
- <extension name="mad_boss">
+ <!--
+ This extension will start a conference and invite a group.
+ At anytime the participant can dial *2 to bridge directly to the boss.
+ All other callers are then hung up on.
+ -->
+ <extension name="mad_boss_intercom">
<condition field="destination_number" expression="^0911$">
+ <action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss1"/>
+ <action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
+ <action application="set" data="conference_auto_outcall_timeout=60"/>
+ <action application="set" data="conference_auto_outcall_flags=mute"/>
+ <action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 transfer::intercept:${uuid} inline'}"/>
+ <action application="set" data="sip_exclude_contact=${network_addr}"/>
+ <action application="conference_set_auto_outcall" data="${group_call(sales)}"/>
+ <action application="conference" data="madboss_intercom1@default+flags{endconf|deaf}"/>
+ </condition>
+ </extension>
+
+ <!--
+ This extension will start a conference and invite a few of people.
+ At anytime the participant can dial *2 to bridge directly to the boss.
+ All other callers are then hung up on.
+ -->
+ <extension name="mad_boss_intercom">
+ <condition field="destination_number" expression="^0912$">
+ <action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss2"/>
+ <action application="set" data="conference_auto_outcall_caller_id_number=0912"/>
+ <action application="set" data="conference_auto_outcall_timeout=60"/>
+ <action application="set" data="conference_auto_outcall_flags=mute"/>
+ <action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 transfer::intercept:${uuid} inline'}"/>
+ <action application="set" data="sip_exclude_contact=${network_addr}"/>
+ <action application="conference_set_auto_outcall" data="loopback/9999"/>
+ <action application="conference" data="madboss_intercom2@default+flags{endconf|deaf}"/>
+ </condition>
+ </extension>
+ <!--This extension will start a conference and invite several people upon entering -->
+ <extension name="mad_boss">
+ <condition field="destination_number" expression="^0913$">
<!--These params effect the outcalls made once you join-->
<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss"/>
<action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
<action application="set" data="conference_auto_outcall_timeout=60"/>
<action application="set" data="conference_auto_outcall_flags=none"/>
<!--<action application="set" data="conference_auto_outcall_announce=say:You have been called into an emergency conference"/>-->
-
<!--Add as many of these as you need, These are the people you are going to call-->
- <action application="conference_set_auto_outcall" data="sofia/gateway/$${default_provider}/19184238080"/>
- <action application="conference_set_auto_outcall" data="sofia/default/888(a)conference.freeswitch.org"/>
-
- <action application="conference" data="cool@default"/>
+ <action application="conference_set_auto_outcall" data="loopback/9999"/>
+ <action application="conference" data="madboss3@default"/>
</condition>
</extension>
@@ -458,6 +491,22 @@
</condition>
</extension>
+ <extension name="fax_receive">
+ <condition field="destination_number" expression="^9978$">
+ <action application="answer" />
+ <action application="playback" data="silence_stream://2000"/>
+ <action application="rxfax" data="/tmp/rxfax.tif"/>
+ <action application="hangup"/>
+ </condition>
+ </extension>
+
+ <extension name="fax_transmit">
+ <condition field="destination_number" expression="^9979$">
+ <action application="txfax" data="/tmp/txfax.tif"/>
+ <action application="hangup"/>
+ </condition>
+ </extension>
+
<!-- Send a 180 and let the far end generate ringback. -->
<extension name="ringback_180">
<condition field="destination_number" expression="^9980$">
@@ -586,9 +635,6 @@
-->
<!--
- This is an example of how to override the RURI on an outgoing invite to a registered contact.
- -->
- <!--
<extension name="refer">
<condition field="${sip_refer_to}">
<expression><![CDATA[<sip:${destination_number}@${domain_name}>]]></expression>
@@ -601,7 +647,11 @@
<action application="bridge" data="sofia/${use_profile}/${refer_user}@${refer_domain}"/>
</condition>
</extension>
-
+ -->
+ <!--
+ This is an example of how to override the RURI on an outgoing invite to a registered contact.
+ -->
+ <!--
<extension name="ruri">
<condition field="destination_number" expression="^ruri$">
<action application="bridge" data="sofia/${ruri_profile}/${ruri_user}${regex(${sofia_contact(${ruri_contact})}|^[^\(a)]+(.*)|%1)}"/>
1
0
19 Feb '09
Author: brian
Date: Thu Feb 19 15:43:51 2009
New Revision: 12171
Log:
use -latest for this so it doesn't conflict with 1.0.3 release
Modified:
freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile
Modified: freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile (original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_flite/Makefile Thu Feb 19 15:43:51 2009
@@ -14,7 +14,7 @@
include $(BASE)/build/modmake.rules
$(FLITE_DIR):
- $(GETLIB) $(FLITE).tar.gz
+ $(GETLIB) $(FLITE)-latest.tar.gz
$(FLITE_DIR)/Makefile: $(FLITE_DIR)
cd $(FLITE_DIR) && CFLAGS="-fPIC" ./configure
1
0
Author: gmaruzz
Date: Thu Feb 19 15:41:17 2009
New Revision: 12170
Log:
skypiax: Yay, on trunk! modified README
Added:
freeswitch/branches/gmaruzz/mod_skypiax/
freeswitch/branches/gmaruzz/mod_skypiax/README
Added: freeswitch/branches/gmaruzz/mod_skypiax/README
==============================================================================
--- (empty file)
+++ freeswitch/branches/gmaruzz/mod_skypiax/README Thu Feb 19 15:41:17 2009
@@ -0,0 +1,6 @@
+You can find skypiax in the mainline FreeSWITCH svn:
+
+svn co http://svn.freeswitch.org/svn/freeswitch/trunk/src/mod/endpoints/mod_skypiax \
+ mod_skypiax
+
+
1
0
19 Feb '09
Author: gmaruzz
Date: Thu Feb 19 15:25:50 2009
New Revision: 12169
Log:
skypiax: Yay, on trunk! modified README
Modified:
freeswitch/trunk/src/mod/endpoints/mod_skypiax/README
Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/README
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/README (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/README Thu Feb 19 15:25:50 2009
@@ -1,59 +1,313 @@
-#########################################################
-#########################################################
-#########################################################
+Skypiax
+From FreeSWITCH Wiki
+The original, authoritative, and updated page is at:
+http://wiki.freeswitch.org/wiki/Skypiax
+go fetch it!
+
+========================================================
+Contents
+ * 1 Breaking News!
+ * 2 WHAT IS SKYPIAX
+ * 3 Skype Contacts, Messages, Buddy List, etc
+ * 4 Dialplan, what to add to default.xml for use with Skypiax
+ * 5 Dialplan, how to use Skypiax
+ * 6 The "ANY" interface, poor man interface grouping
+ * 7 Multiple concurrent incoming calls on the same Skype username
+ * 8 Libraries needed to build Skypiax on Linux
+ * 9 An example of Skypiax and FreeSWITCH installation on CentOS 5.2, from scratch
+ * 10 An example of Skypiax and FreeSWITCH installation on Ubuntu 8.04, from scratch
+ * 11 How to prepare the configuration directory of Skype clients on Linux
+ * 12 Cloning configuration directory on Linux
+ * 13 Skypiax on Windows
+ * 14 Running Skypiax on Windows as a Service
+ * 15 Performance and Resource Usage
+ * 16 TO DO
+ * 17 BUGS and Feature Requests
+
+[edit]
+Breaking News!
+
+Starting with svn 12168, Feb 19 2009, skypiax is part of the mainline FreeSWITCH trunk.
+
+So if you have already downloaded its sources in the past, you'll have to go into the FreeSWITCH svn directory, remove the old skypiax sources, and download the new ones:
+
+cd freeswitch
+rm -rf src/mod/endpoints/mod_skypiax
+svn up
+
+[edit]
WHAT IS SKYPIAX
-This software (Skypiax) uses the Skype API but is not endorsed,
- certified or otherwise approved in any way by Skype.
+This software (Skypiax) uses the Skype API but is not endorsed, certified or otherwise approved in any way by Skype.
+
+Skypiax is an endpoint (channel driver) that uses the Skype client as an interface to the Skype network, and allows incoming and outgoing Skype calls to/from FreeSWITCH (that can be bridged, originated, answered, etc. as in all other endpoints, e.g. sofia/SIP).
+
+Skypiax works in FreeSWITCH (FS) on both Linux and Windows, at both 8khz and 16khz (Skype client has 16khz audio I/O). Skypiax works on Asterisk too, at 8khz, on Linux and Windows (through CygWin).
+
+Think of Skypiax as similar to OpenZAP for analog lines. For each channel you need an interface (a Skype client). So, for example, two concurrent calls would need two channels, and therefor two Skype clients running on your FreeSWITCH server.
+
+If your Skype client(s) have Skype credits, then Skypiax works for SkypeOut calls as well.
+
+On Linux the Skype client uses a lot of CPU. To lower its CPU consumption, you can use the Xvfb "fake" X server and (more importantly) the snd-dummy ALSA "fake" sound driver. Scripts are provided for this, though for a low number of channels it should work just fine with normal X servers and ALSA drivers.
+
+On a Linux machine with 3GB ram and a quad core intel6600, we had no problem with 20 concurrent calls, and plenty of head room for perhaps 100 more, (not tested).
+
+On Windows, no need to do anything special the Skype client is lighter on the CPU.
+
+Skypiax is now beta, usable for testing and finding bugs :-).
+
+Skypiax has been contributed to the community by: Giovanni Maruzzelli (gmaruzz at gmail dot com)
+
+From the FreeSWITCH mailing list:
+
+Hello FreeSWITCHers,
+
+mod_skypiax is available for testing, feature requests, bug hunting.
+
+I would like to ask the help of you all to make Skypiax robust and
+feature full on FreeSWITCH, and particularly of Massimo Cetra (CtRiX
+on IRC), that has developed mod_airpe (another Skype endpoint).
+
+I've written a first documentation on Skypiax installation and usage
+at: http://wiki.freeswitch.org/wiki/Skypiax
+and there is a Jira module at:
+http://jira.freeswitch.org/browse/MODSKYPIAX
+
+So, please, test the software, edit the wiki page both for style and
+content, file bug reports and feature requests.
+
+FreeSWITCH is now the platform of first development for me, so the
+FreeSWITCH part of Skypiax is more tested (if any) and the code is
+more readable compared to the Asterisk part where lot of legacy from
+my other projects clutter the code.
+
+But Skypiax strive to be available as a Skype compatible endpoint for
+all the opensource telephony community, and in the near time the
+Asterisk part will be cleaned much more, and documented.
+
+As you will see, the code is made by skypiax_protocol.c (the
+interaction with Skype client), mod_skypiax.c (the interaction with
+FreeSWITCH), chan_skypiax.c (the interaction with Asterisk).
+
+Please consider me available for all infos, clarifications, discussions, etc.
-#########################################################
-#########################################################
-#########################################################
+I would like to thanks all the peoples that helped me via mail and IRC
+(so bad to have different timezones, isn't?), the *very early
+adopters*, the testers, the patchers, and you all.
+Particularly Anthony Minessale, Michael Jerris, Brian West, Michael
+Collins, Ken Rice, Seven Du, Clif Cox, Hristo Trendev, Rehan Allah
+Wala, Jason Garland and Antonio Gallo.
-Skypiax is an endpoint (channel driver) that use the Skype client as an interface to the Skype network, and allows incoming and outgoing Skype calls from/to FreeSWITCH (that can be bridged, originated, answered, etc. as in all other endpoints, eg sofia/SIP).
+[edit]
+Skype Contacts, Messages, Buddy List, etc
-Think at Skypiax as similar to OpenZAP for analog lines: for each channel you need an interface (a Skype client). So, for eg, for two concurrent calls, you will need two channels, two Skype clients running on server.
+Skypiax automatically directs the Skype client instance to agree to a request of being added to the Contact List and to make known its "status" (online, offline, etc), and will add the requester to the Contact List of the Skype client instance.
-If your server's Skype client(s) has got the Skype credits, Skypiax works for SkypeOut calls too.
+Skypiax automatically directs the Skype client instance to flag as "Seen" all received messages.
+[edit]
+Dialplan, what to add to default.xml for use with Skypiax
-You can use it from the dialplan, eg with the provided modified "default.xml" dialplan, you can call a "skype uri" that's the word 'skype' followed by a slash and a destination: "skype/remote_skypename__OR__skypeout_phonenumber" for calling via the Skype network. Eg "skype/echo123" or "skype/+18007844444".
+ONLY if you have FS svn version before 12064 or before 1.0.3RC2: for having skypiax to work correctly with internal extensions (eg: calling the 1000 ext), you have to add:
-You can use the "skype uri" of the provided dialplan also directly for a SIP softphone, eg X-Lite.
+ <!-- Set the domain for skypiax -->
+ <extension name="set_domain_skypiax" continue="true">
+ <condition field="${domain_name}" expression="^$"/>
+ <condition field="source" expression="mod_skypiax">
+ <action application="set" data="domain_name=$${domain}"/>
+ </condition>
+ </extension>
+
+to the standard default.xml dialplan, just under "set_domain_openzap" (thx BBHoss)
+[edit]
+Dialplan, how to use Skypiax
+
+Like other endpoints it's easy to build up useful dialplans using Skypiax. There are a few simple examples given in the "default.xml" dialplan located in mod_skypiax/configs/
+
+You can use the standard format with the interface name:
+
+skypiax/skypiax1/echo123
+
+to call "echo123" using the skypiax interface named "skypiax1"
+
+If you modify your dialplan, you'll be able to call "skype uri"s for terminating calls via the Skype network.
+
+A "Skype URI" is composed by the word 'skype' followed by a slash and a destination: "skype/remote_skypename" or "skype/skypeout_phonenumber"
+
+E.g. "skype/echo123" or "skype/+18007844444".
+
+You can use the "skype uri" of the provided dialplan directly from a SIP softphone, e.g. X-Lite.
+
+And you can call the "2909" extension in the provided dialplan from any kind of phone to be bridged to the Skype Test Call.
+
+Dialplan snippet:
+
+ <!-- dial echo123 via skypiax using skypiax1 interface to go out -->
+ <extension name="skypiax">
+ <condition field="destination_number" expression="^2909$">
+ <action application="bridge" data="skypiax/skypiax1/echo123"/>
+ </condition>
+ </extension>
+
+ <!-- dial via SKYPE uri using skypiax1 interface to go out -->
+ <extension name="skype_uri">
+ <condition field="destination_number" expression="^skype/(.*)$">
+ <action application="bridge" data="skypiax/skypiax1/$1"/>
+ </condition>
+ </extension>
With the provided skypiax.conf.xml all incoming Skype calls will be routed to the "5000" extension, the IVR in default FreeSWITCH installation.
+[edit]
+The "ANY" interface, poor man interface grouping
+
+You can also use the "ANY" interface
+
+skypiax/ANY/echo123
+
+to call "echo123" using the first available (idle, not in a call) skypiax interface, automatically selected (thx Seven Du).
+
+It's the same for the "Skype URI". If you use it with the "ANY" interface, the first idle interface will be used to make the call.
+
+Note: Currently it uses a sequential search, perhaps use round robin is more desired. Not sure if their are race conditions on concurrent calls. Anyone want to use that on high traffic?
+
+Dialplan snippets:
+
+ <!-- dial echo123 via skypiax ANY interface -->
+ <extension name="skypiax">
+ <condition field="destination_number" expression="^2908$">
+ <action application="bridge" data="skypiax/ANY/echo123"/>
+ </condition>
+ </extension>
-On Linux the Skype client uses a lot of CPU. To lower its CPU consumption, you can use the Xvfb "fake" X server and (more important) the snd-dummy ALSA "fake" sound driver. Scripts are provided for this. But for a low number of channels it would works with regular X servers and ALSA drivers.
+ <!-- dial via SKYPE uri with skypiax ANY interface-->
+ <extension name="skype_uri">
+ <condition field="destination_number" expression="^skype/(.*)$">
+ <action application="bridge" data="skypiax/ANY/$1"/>
+ </condition>
+ </extension>
-On a Linux machine with 3GB ram and a quad core intel6600, we got no problem with 20 concurrent calls, and plenty of room for adding more Skypiax channels (100? not tested).
+[edit]
+Multiple concurrent incoming calls on the same Skype username
-On Windows, no need to do anything special, the Skype client is lighter on CPU.
+Let's say you want to be able to serve multiple concurrent incoming calls to the Skype username "skypiax1" (as in: Alice uses Skype to call the Skype user "skypiax1", concurrently Bob uses Skype to call the Skype user "skypiax1", both Alice and Bob are concurrently served by FS).
+You setup multiple skypiax interfaces on FS, as many interfaces as the max number of concurrent incoming calls you want to serve.
-''Skypiax is now pre-beta, but usable for testing and finding bugs :-).''
+Each skypiax interface will have its own Skype client running, each one with its own Skype user login.
+Let's say you want to serve a max of 3 concurrent incoming calls, you'll setup three skypiax interface (100 concurrent calls, 100 skypiax interfaces). One of those three interfaces will be logged into the Skype network using the Skype username you want to use to answer all the incoming calls.
-'''You can download Skypiax source code with subversion with the command:'''
+So, one interface will be logged into Skype network as "skypiax1". Let's say that the other two interfaces will be logged into the Skype network as "skypiax2" and "skypiax3", but they could be logged as any other Skype username, as long as they are all different and different from "skypiax1" (it's not possible to have more than one Skype client instance using the same Skype username on the same machine, at least on Linux).
-svn co http://svn.freeswitch.org/svn/freeswitch/branches/gmaruzz/src/mod/endpoints… mod_skypiax
-then, follow the README file in the mod_skypiax directory.
+When the first incoming call to the Skype username "skypiax1" is received, is served as you would expect by the interface logged as "skypiax1".
-More info on skypiax:
-http://wiki.freeswitch.org/wiki/Skypiax
-http://www.celliax.org
+If another call for "skypiax1" is incoming while that interface is busy into a call (incoming or outbound), the "skypiax1" interface will *transfer* the incoming call to the first other idle skypiax interface it finds (eg: skypiax2 or skypiax3). The calling user will not have to do nothing for this, and this is completely transparent for Windows and Linux users, while MacOSX users will see into their client that the called party is changed from "skypiax1" to, say, "skypiax3", but they too do not have to do nothing.
-Skypiax has been contributed to the community by:
-Giovanni Maruzzelli (gmaruzz at gmail dot com)
+And so on until all the skypiax interfaces available are busy. At that point, further incoming calls will be rejected until one skypiax interface exit from the call it is into, and will be available to answer.
-#########################################################
-#########################################################
-#########################################################
+Basically, you don't have to do anything to be able to answer multiple incoming calls to the
+same Skype username. Just set up enough interfaces for the maximum concurrent calls you want.
- An example of Skypiax installation on FreeSWITCH Linux
+[edit]
+Libraries needed to build Skypiax on Linux
-#########################################################
-#########################################################
-#########################################################
+If you are on Ubuntu, Debian, or derivative:
+
+apt-get install libX11-dev
+
+if you are on CentOS, RedHat, or derivative:
+
+yum -y install libX11-devel
+
+for other distros, please add here
+[edit]
+An example of Skypiax and FreeSWITCH installation on CentOS 5.2, from scratch
+
+begin with CentOS-5.2-i386-netinstall.iso (or with the first installation disk)
+
+choose language
+choose keyboard
+choose installation method = HTTP
+
+default Tcp-Ip configuration
+
+HTTP setup:
+insert the name of the mirror = mi.mirror.garr.it
+insert the directory name = mirrors/CentOS/5.2/os/i386
+
+At the package selection:
+
+select nothing from the "additional tasks", nothing for "additional repositories"
+select "customize now" on the bottom
+select "base system" then de-select dialup Networking support, and leave only "base" checked
+
+After the machine installed,
+
+from setup agent:
+FIREWALL
+firewall disabled
+SElinux disabled
+
+
+Login to the local console, and reboot it:
+
+shutdown -r now
+
+Login to the local console, and update the entire OS installation:
+
+yum update -y
+shutdown -r now
+
+now login from ssh, the following is cut and paste ready
+
+yum install -y subversion autoconf automake libtool gcc-c++ ncurses-devel make
+yum install -y libX11-devel
+cd /usr/src
+svn co http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch
+cd freeswitch
+./bootstrap.sh
+./configure
+vi modules.conf
+
+uncomment mod_skypiax in modules.conf, then:
+
+make && make install && make hd-sounds-install && make hd-moh-install && make samples
+wget -c http://gd.tuwien.ac.at/infosys/phone/skype/rpm-public-key.asc
+rpm --import rpm-public-key.asc
+yum install -y Xvfb
+yum install -y alsa-utils
+yum install -y xorg-x11-fonts*
+wget http://www.skype.com/go/getskype-linux-centos
+yum localinstall skype-2.0.0.72-centos.i586.rpm
+
+Copy and install the Skype clients configuration directory you previously prepared (see below for how to prepare it):
+
+cd /root
+mount /dev/hda5 /mnt
+cp /mnt/root/skypeconfig2.tgz ./
+tar xzf skypeconfig2.tgz
+chown -R root.root .Skype
+
+Install the skypiax configuration files, edit and execute the script that starts the Skype client instances:
+
+cd /usr/src
+cd freeswitch/src/mod/endpoints/mod_skypiax/
+cd configs/
+cp skypiax.conf.xml /usr/local/freeswitch/conf/autoload_configs/
+vi /usr/local/freeswitch/conf/autoload_configs/skypiax.conf.xml
+cp skypiax.X.conf /usr/local/freeswitch/conf/autoload_configs/
+cp startskype.sh 2startskype.sh
+vi 2startskype.sh
+sh ./2startskype.sh
+
+start FS and load skypiax!
+
+/usr/local/freeswitch/bin/freeswitch
+load mod_skypiax
+
+thx to Kulwinder Singh (IRC: Daejeo) for how to install Skype client on CentOS!
+[edit]
+An example of Skypiax and FreeSWITCH installation on Ubuntu 8.04, from scratch
Install ubuntu 8.04 LTS server (Released April 2008 and maintained until April 2013) with *only* OpenSSH Server. (we used the 64bit edition)
@@ -63,98 +317,268 @@
Logout
-===============================
-Login via ssh as the user you choose during install
+Login via ssh as the user you choose during install, become root with "sudo su", and choose a root password. Then, update the OS installation.
-maruzz@8-04-srv:~$
-maruzz@8-04-srv:~$ sudo su
-[sudo] password for maruzz:
-root@8-04-srv:/home/maruzz# passwd
-Enter new UNIX password:
-Retype new UNIX password:
-passwd: password updated successfully
-root@8-04-srv:/home/maruzz#
-root@8-04-srv:/home/maruzz# apt-get update && apt-get -y upgrade
-root@8-04-srv:/home/maruzz# apt-get update && apt-get -y dist-upgrade
-root@8-04-srv:/home/maruzz# reboot
-
-===============================
-Login as root via ssh
-
-root@8-04-srv:~# apt-get update && apt-get -y dist-upgrade
-root@8-04-srv:/home/maruzz# reboot
-
-===============================
-
-Now, let's begin the real installation
-
-root@8-04-srv:~# apt-get -y install build-essential subversion automake autoconf wget libtool libncurses5-dev xvfb libx11-dev libasound2-dev
-root@8-04-srv:~# svn co http://svn.freeswitch.org/svn/freeswitch/branches/gmaruzz freeswitch_gmaruzz
-root@8-04-srv:~# cd freeswitch_gmaruzz/
-root@8-04-srv:~/freeswitch_gmaruzz# ./bootstrap.sh
-root@8-04-srv:~/freeswitch_gmaruzz# ./configure
-root@8-04-srv:~/freeswitch_gmaruzz# make && make install && make hd-sounds-install && make hd-moh-install && make samples
-
-*** go to have something to drink-eat-read-whatever
-*** test that FS can be started
-
-root@8-04-srv:~/freeswitch_gmaruzz# /usr/local/freeswitch/bin/freeswitch
-freeswitch@8-04-srv> ...
+sudo su
+passwd
-*** copy the skypiax configuration file
-root@8-04-srv:~/freeswitch_gmaruzz# cp src/mod/endpoints/mod_skypiax/configs/skypiax.conf.xml /usr/local/freeswitch/conf/autoload_configs/
+apt-get update && apt-get -y upgrade
+apt-get update && apt-get -y dist-upgrade
+reboot
-*** optionally, copy the dialplan configuration file that contains the "skypiax" modifications (eg: you can call "sip:skype/remote_skypename__OR__skypeout_phonenumber" for calling via the Skype network from a SIP softphone to remote_skypename or to a phone number via SkypeOut, or you can call the "2908" extension from any phone to be bridged to the Skype Test Call)
-root@8-04-srv:~/freeswitch_gmaruzz# cp src/mod/endpoints/mod_skypiax/configs/default.xml /usr/local/freeswitch/conf/dialplan/
-*** now, let's get and install the Skype client
-root@8-04-srv:~/freeswitch_gmaruzz# cd ..
-root@8-04-srv:~#
-root@8-04-srv:~# apt-get -y install ia32-libs lib32asound2 libc6-i386 lib32gcc1 lib32stdc++6 lib32ncurses5 lib32z1 libasound2-plugins
-root@8-04-srv:~# wget -c http://www.skype.com/go/getskype-linux-ubuntu-amd64
-root@8-04-srv:~# dpkg -i skype_ubuntu-2.0.0.72-1_amd64.deb
-
-*** now, let's get the skype configuration directory we prepared on another (desktop) machine
-*** on "How to prepare the configuration directory of Skype clients on Linux", see configs/README.skypiax_auth
-root@8-04-srv:~# cp /mnt/root/configskypenew.tgz ./
-root@8-04-srv:~# tar xzf configskypenew.tgz
-root@8-04-srv:~# chown root.root .Skype
-root@8-04-srv:~#
+Login again as root via ssh
+
+apt-get update && apt-get -y dist-upgrade
+reboot
+
+
+Now, let's begin the real installation. Starting here, following is cut and paste ready:
+
+apt-get -y install build-essential subversion automake autoconf wget \
+libtool libncurses5-dev xvfb libx11-dev libasound2-dev
+svn co http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch
+cd freeswitch
+./bootstrap.sh
+./configure
+
+Uncomment the line "endpoints/mod_skypiax" in modules.conf.
+
+vi modules.conf
+make && make install && make hd-sounds-install && make hd-moh-install && make samples
+
+go to have something to drink-eat-read-whatever, takes time
+
+then, test that FS can be started
+
+/usr/local/freeswitch/bin/freeswitch
+...
-**** almost ready!
+copy the skypiax configuration file
-**** let's edit the skypiax config
-root@8-04-srv:~/freeswitch_gmaruzz# vi /usr/local/freeswitch/conf/autoload_configs/skypiax.conf.xml
+cp src/mod/endpoints/mod_skypiax/configs/skypiax.conf.xml /usr/local/freeswitch/conf/autoload_configs/
-**** let's edit the startskype script
-**** remember to add the removing of all the installed snd-* modules
-root@8-04-srv:~/freeswitch_gmaruzz# cp src/mod/endpoints/mod_skypiax/configs/startskype.sh ./
-root@8-04-srv:~/freeswitch_gmaruzz# vi startskype.sh
+optionally, copy the dialplan configuration file that contains the "skypiax" modifications (eg: you can call "sip:skype/remote_skypename__OR__skypeout_phonenumber" for calling via the Skype network from a SIP softphone to remote_skypename or to a phone number via SkypeOut, or you can call the "2908" extension from any phone to be bridged to the Skype Test Call)
-**** let's copy the X servers' auth config file
-root@8-04-srv:~/freeswitch_gmaruzz#cp src/mod/endpoints/mod_skypiax/configs/skypiax.X.conf /usr/local/freeswitch/conf/autoload_configs/skypiax.X.conf
+cp src/mod/endpoints/mod_skypiax/configs/default.xml /usr/local/freeswitch/conf/dialplan/
-**** start the X servers and the Skype clients
-root@8-04-srv:~/freeswitch_gmaruzz# sh ./startskype.sh
+now, let's get and install the Skype client
+NOTE: Visit this page to find the Linux client for your distro: http://www.skype.com/download/skype/linux/choose/
-**** this is the situation you want after startskype.sh
-root@8-04-srv:~/freeswitch_gmaruzz# lsmod | grep snd
+cd ..
+apt-get -y install ia32-libs lib32asound2 libc6-i386 lib32gcc1 \
+lib32stdc++6 lib32ncurses5 lib32z1 libasound2-plugins
+wget -c http://www.skype.com/go/getskype-linux-ubuntu-amd64
+dpkg -i skype_ubuntu-2.0.0.72-1_amd64.deb
+
+now, let's get the skype configuration directory we prepared on another (desktop) machine
+
+on "How to prepare the configuration directory of Skype clients on Linux", see below
+
+cp /mnt/root/configskypenew.tgz ./
+tar xzf configskypenew.tgz
+chown root.root .Skype
+
+almost ready!
+
+let's edit the skypiax config
+
+vi /usr/local/freeswitch/conf/autoload_configs/skypiax.conf.xml
+
+let's edit the startskype script
+
+remember to add the removing of all the installed snd-* modules
+
+cp freeswitch/src/mod/endpoints/mod_skypiax/configs/startskype.sh ./
+vi startskype.sh
+
+let's copy the Xservers auth config file
+
+cp freeswitch/src/mod/endpoints/mod_skypiax/configs/skypiax.X.conf \
+/usr/local/freeswitch/conf/autoload_configs/skypiax.X.conf
+
+start the X servers and the Skype clients
+
+sh ./startskype.sh
+
+this is the situation you want after startskype.sh
+
+root@8-04-srv:~# lsmod | grep snd
snd_dummy 22016 0
snd_pcm 99336 1 snd_dummy
snd_timer 35080 1 snd_pcm
snd 78024 3 snd_dummy,snd_pcm,snd_timer
snd_page_alloc 20368 1 snd_pcm
soundcore 17568 1 snd
-root@8-04-srv:~/freeswitch_gmaruzz#
+root@8-04-srv:~#
+
+
+start FS and load skypiax!
+
+/usr/local/freeswitch/bin/freeswitch
+load mod_skypiax
+
+[edit]
+How to prepare the configuration directory of Skype clients on Linux
+
+You will use configs/skypiax_auth to force the Skype client to ask you to authorize "skypiax" to connect to it.
+
+Then you copy the .Skype configuration directory of the user that has launched Skype (eg: /home/maruzz/.Skype if you are maruzz) on the home directory of the user that will start Skype on the server (eg: root).
+
+Compile skypiax_auth:
+
+$ gcc -Wall -ggdb skypiax_auth.c -o skypiax_auth -lX11
+
+Then:
+
+1) on a Linux desktop machine, rmmod all the snd* modules
+
+2) on the desktop machine, modprobe snd-dummy
+
+3) on the desktop machine, logout from your autologin username if any, launch the Skype client and login as the username you'll use on server
+
+4) on the desktop machine, set the desktop client to use the "hw:dummy" audio device, to not update, to not make "events", etc etc... Make and receive a couple of test calls. Please note that you (and the remote party) will hear nothing (you're using the snd-dummy "fake" audio driver), that's ok.
+
+3) on the desktop machine, when satisfied of the Skype client setup, use skypiax_auth (that simulates FS-skypiax connecting to the Skype client). The Skype client will ask you to be authorized to let "skypiax" connect.
+
+4) Give the authorization and check the "not ask me again" option.
+
+5) Close (Quit) the Skype client from the tray icon, so it saves its config.
+
+6) Then, relaunch the Skype client and use skypiax_auth again, just to be sure it now succeed.
+
+7) Close (Quit) the Skype client from the tray icon, so it saves its config.
+
+Do the steps 1-7 for all Skype usernames you will want to use on the server (eg: one Skype username per channel). NB: if you use the same password for all Skype usernames, you can setup just one client and then "clone" it. See below for "Cloning configuration directory on Linux".
+
+When finished with all the Skype usernames: Copy or targzip the .Skype directory and all its content on the home directory of the server user that will launch the Skype client(s).
+
+
+first time you use skypiax_auth
+
+$ ./skypiax_auth
+Skype instance found with id #27263062
+RECEIVED==> ERROR 68
+RECEIVED==> OK
+Give the auth to the Skype client, and tell him not to ask again Then Ctrl-C to exit from skypiax_auth
-**** start FS and the load skypiax!
-root@8-04-srv:~/freeswitch_gmaruzz# /usr/local/freeswitch/bin/freeswitch
-freeswitch@8-04-srv> load mod_skypiax
+Close (Quit) the Skype client from the tray icon, so it saves its config. Then, relaunch the Skype client
+you use skypiax_auth again
+
+$ ./skypiax_auth
+Skype instance found with id #27263062
+RECEIVED==> OK
+RECEIVED==> PROTOCOL 6
+RECEIVED==> CONNSTATUS ONLINE
+RECEIVED==> CURRENTUSERHANDLE gmaruzz3
+RECEIVED==> USERSTATUS INVISIBLE
+
+[edit]
+Cloning configuration directory on Linux
+
+After you have launched the Skype client and logged yourself into the Skype network as "skypiax1", and you have given the auth to be connected by Skypiax, and you setup all the otions in the client, exit from the client, right click on the icon and choose "Quit". The Skype client has saved its configuration.
+
+You'll find the subdir "skypiax1" underneath the ~/.Skypiax directory in your home.
+
+If you have registered multiple accounts with Skype ***with the same password*** as the "skypiax1" account, you can just clone the skypiax1 directory and give it the names of the other accounts, and end up as (if you just cloned them, the dates will be closer):
+
+ls -l .Skype/
+
+drwxr-xr-x 5 root root 4096 2009-02-12 22:33 skypiax1
+drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax10
+drwxr-xr-x 5 root root 4096 2009-02-08 08:30 skypiax11
+drwxr-xr-x 5 root root 4096 2009-02-08 08:42 skypiax12
+drwxr-xr-x 5 root root 4096 2009-02-08 08:50 skypiax13
+drwxr-xr-x 5 root root 4096 2009-02-08 08:48 skypiax14
+drwxr-xr-x 5 root root 4096 2009-02-08 09:31 skypiax15
+drwxr-xr-x 5 root root 4096 2009-02-08 09:31 skypiax16
+drwxr-xr-x 5 root root 4096 2009-02-08 08:53 skypiax17
+drwxr-xr-x 5 root root 4096 2009-02-08 08:46 skypiax18
+drwxr-xr-x 5 root root 4096 2009-02-08 08:31 skypiax19
+drwxr-xr-x 5 root root 4096 2009-02-12 22:33 skypiax2
+drwxr-xr-x 5 root root 4096 2009-02-08 09:23 skypiax20
+drwxr-xr-x 5 root root 4096 2009-02-12 22:03 skypiax3
+drwxr-xr-x 5 root root 4096 2009-02-12 21:10 skypiax4
+drwxr-xr-x 5 root root 4096 2009-02-12 21:10 skypiax5
+drwxr-xr-x 5 root root 4096 2009-02-12 22:07 skypiax6
+drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax7
+drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax8
+drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax9
+
+Inside each one of the subdirs, you'll find the file "config.xml".
+
+After a while you'll get a grip on the format. Anyway, the most important item are:
+
+<config>
+...
+...
+...
+ <UI>
+...
+...
+...
+ <CaptureDevice>4</CaptureDevice>
+ <RingDevice>4</RingDevice>
+ <SoundDevice>4</SoundDevice>
+ </UI>
+</config>
+
+Those values determine the audio devices used by the Skype client. You want to use the hw:snd-dummy ALSA device, because it will be really light on your CPU.
+
+So, if you edited the startskype.sh script to rmmod all the snd-* modules from kernel, and then modprobe snd-dummy with the params in the same script, you will edit the config.xml inside the directory of the first 8 interfaces, and put the values at "2".
+
+Next 8 interfaces, values at "4".
+
+Next 8 interfaces, values at "6".
+
+That's it. It works.
+[edit]
+Skypiax on Windows
+
+Skypiax has been designed to work well on windows since the beginning, like FS itself.
+
+After having downloaded the FS sources from svn or the packaged FS source release, follow the instruction on how to build FS on Windows. Using Visual C (Express or not):
+
+ * Open Freeswitch.sln
+ * Right click the main solution node at the top of the Solution Explorer
+ * Right click and select Build
+
+Then, download and install the 16khz sounds, needed by Skypiax:
+
+ * Right click on "Download 16khzsound" and select Build
+ * Right click on "16khz" (just under the top) and select Build
+
+Test if FS works at all: http://wiki.freeswitch.org/wiki/Installation_Guide#Windows_quick_start
+
+Then, from Visual C (Express or not Express):
+
+ * Open again Freeswitch.sln
+ * Right click the main solution node at the top of the Solution Explorer
+ * Right click and select "Add" => "Existing Project" => "src\mod\endpoints\mod_skypiax" => select the mod_skypiax project
+ * Right click on "mod_skypiax" that you have just added to the "Solution Explorer", eg: scroll down from where you added the project
+ * and select "Build"
+
+You'll probably build the "Debug" version. So, go and copy src\mod\endpoints\mod_skypiax\configs/skypiax.conf.xml to Debug\conf\autoload_configs. Edit it to reflect your configuration.
+
+Then, go into src\mod\endpoints\mod_skypiax\configs/ and edit startskype.bat to suit your configuration. Remember that startskype.bat needs wait.bat to be in its same directory (wait.bat is in the "configs" dir too).
+
+Eventually, launch the Skype client instances using startskype.bat, then launch FS, and from the FS command line:
+
+load mod_skypiax
+
+The Skype instances will ask you for permission to be connected by Skypiax. Give the auth.
+
+You're all set.
+[edit]
+Running Skypiax on Windows as a Service
+
+Not yet written
+[edit]
+Performance and Resource Usage
-=============================================
20 idle skypiax channels:
top - 18:14:26 up 2:02, 2 users, load average: 0.03, 0.08, 0.04
@@ -202,9 +626,9 @@
7992 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.31 Xvfb
8008 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.31 Xvfb
8056 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.30 Xvfb
-...some more Xvfb
+ ...some more Xvfb
-=============================================
+Since this server has 3GB of RAM you can see that each skype process is useing about 30MB, and the Xvfbs are useing about 10MB each.
20 incoming concurrent skype calls listening to moh at 16khz:
@@ -255,4 +679,87 @@
8676 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.55 Xvfb
...some more Xvfb
+Here we see that the Ram usage hasn't changed but now each skype process is useing about 6% CPU. Which amounts to about 1.5% of this quad core system.
+
+
+The one below is another ascii screenshot, but using the current svn revision at Feb 10, 2009 (one month later than the screenshot before), taken after one hour run of 19 channels on music on hold, and 1 channel intermittent usage (for testing). 20 concurrent channels on moh.
+
+top - 11:37:20 up 14:59, 3 users, load average: 0.04, 0.06, 0.08
+Tasks: 114 total, 1 running, 113 sleeping, 0 stopped, 0 zombie
+Cpu(s): 12.8%us, 3.1%sy, 0.0%ni, 83.5%id, 0.0%wa, 0.0%hi, 0.6%si, 0.0%st
+Mem: 3096688k total, 1568860k used, 1527828k free, 135244k buffers
+Swap: 248968k total, 0k used, 248968k free, 752224k cached
+
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
+10473 root 20 0 338m 37m 5264 S 6 1.3 2:43.37 freeswitch
+10460 root 20 0 83364 28m 10m S 6 0.9 0:39.05 skype
+10316 root 20 0 82844 28m 10m S 6 0.9 2:33.71 skype
+10444 root 20 0 83276 27m 10m S 7 0.9 2:26.89 skype
+10187 root 20 0 83064 27m 10m S 6 0.9 2:39.78 skype
+10364 root 20 0 83308 27m 10m S 6 0.9 2:33.55 skype
+10284 root 20 0 83620 27m 10m S 6 0.9 2:39.07 skype
+10412 root 20 0 82920 27m 10m S 6 0.9 2:32.86 skype
+10300 root 20 0 82792 27m 10m S 6 0.9 2:35.97 skype
+10268 root 20 0 83308 27m 10m S 6 0.9 2:37.24 skype
+10332 root 20 0 83364 27m 10m S 5 0.9 2:35.97 skype
+10171 root 20 0 83164 27m 10m S 5 0.9 2:40.55 skype
+10236 root 20 0 83104 27m 10m S 6 0.9 2:38.06 skype
+10252 root 20 0 83240 27m 10m S 6 0.9 2:37.91 skype
+10428 root 20 0 83124 27m 10m S 6 0.9 2:27.67 skype
+10155 root 20 0 83260 27m 10m S 6 0.9 2:43.62 skype
+10203 root 20 0 83780 27m 10m S 6 0.9 2:38.93 skype
+10396 root 20 0 83300 27m 10m S 6 0.9 2:30.62 skype
+10220 root 20 0 83176 27m 10m S 7 0.9 2:45.98 skype
+10380 root 20 0 82852 27m 10m S 5 0.9 2:32.23 skype
+10348 root 20 0 83356 27m 10m S 6 0.9 2:31.23 skype
+10182 root 20 0 41536 9404 2212 S 0 0.3 0:03.33 Xvfb
+10166 root 20 0 41536 9392 2200 S 0 0.3 0:03.35 Xvfb
+10455 root 20 0 41500 9392 2200 S 0 0.3 0:02.11 Xvfb
+10311 root 20 0 41524 9388 2212 S 0 0.3 0:03.24 Xvfb
+10231 root 20 0 41512 9376 2212 S 0 0.3 0:03.30 Xvfb
+10279 root 20 0 41524 9376 2200 S 0 0.3 0:03.30 Xvfb
+10373 root 20 0 41512 9376 2212 S 0 0.3 0:03.20 Xvfb
+10343 root 20 0 41512 9372 2200 S 0 0.3 0:03.22 Xvfb
+10215 root 20 0 41512 9368 2200 S 0 0.3 0:03.30 Xvfb
+10439 root 20 0 41512 9368 2200 S 0 0.3 0:03.20 Xvfb
+10295 root 20 0 41512 9364 2200 S 0 0.3 0:03.31 Xvfb
+10150 root 20 0 41500 9360 2200 S 0 0.3 0:03.33 Xvfb
+10247 root 20 0 41500 9356 2200 S 0 0.3 0:03.27 Xvfb
+10263 root 20 0 41500 9356 2200 S 0 0.3 0:03.30 Xvfb
+10327 root 20 0 41500 9356 2200 S 0 0.3 0:03.25 Xvfb
+10359 root 20 0 41500 9356 2200 S 0 0.3 0:03.22 Xvfb
+10407 root 20 0 41500 9356 2200 S 0 0.3 0:03.19 Xvfb
+10391 root 20 0 41500 9352 2200 S 0 0.3 0:03.24 Xvfb
+10423 root 20 0 41500 9352 2200 S 0 0.3 0:03.20 Xvfb
+10198 root 20 0 41464 9320 2200 S 0 0.3 0:03.30 Xvfb
+ 9948 maruzz 20 0 19384 3380 1348 S 0 0.1 0:00.06 bash
+ 4991 klog 20 0 6288 2976 432 S 0 0.1 0:00.09 klogd
+10675 root 20 0 68112 2928 2296 S 0 0.1 0:00.11 sshd
+
+[edit]
+TO DO
+
+Requests, suggestions, ideas (feel free to add here, but best is to add on Jira - see below 'BUGS and Feature Requests'):
+
+ * Interact with the presence system, known Skype users as subscriptions, eg: SIP
+ * Interact with messaging and chat, eg: SIMPLE
+ * Revamp and standardize configuration file structure, names, values, etc
+ * Audio volumes (In and Out) adjustments
+ * Revamp and standardize the debugging output
+ * Add CLI commands to list interfaces, adjust audio volumes, send commands to the Skype client, etc (coming soon on FS, works on *)
+ * Check for sending "early media", so to hear ringing when making outbound calls
+ * Check for changing the Skype Caller ID when doing SkypeOut calls
+ * originate skypiax/wrong_skype_name won't cause core dump
+ * What will happen if a skype client crash? can it automatically disable the channel and reset the channel after the skype client recovered?
+ * Is it possible using Skypiax and add users on the fly? Say we have a box that could support 20 channels, and we have ten active, can we configure and add the 11th channel without having to take down the other active channels?
+
+[edit]
+BUGS and Feature Requests
+
+You can file bug reports, hints, suggestions, feature requests, improvements, patches, etc to http://jira.freeswitch.org/browse/MODSKYPIAX open an account there if you don't have it (it's free ;-) ).
+
+You can also write to the FS users' and developers' mailing lists: http://lists.freeswitch.org/mailman/listinfo
+
+And you can drop in the IRC channels #freeswitch and #freeswitch-dev on irc.freenode.org to ask questions and discuss issues. The original developer of Skypiax is called "gmaruzz" in the IRC channel.
+As a last resort, not the preferred way, you can write email to Giovanni Maruzzelli - gmaruzz @ gmail dot com
1
0
Author: brian
Date: Thu Feb 19 14:58:35 2009
New Revision: 12168
Log:
add skypiax to modules.conf.in
Modified:
freeswitch/trunk/build/modules.conf.in
Modified: freeswitch/trunk/build/modules.conf.in
==============================================================================
--- freeswitch/trunk/build/modules.conf.in (original)
+++ freeswitch/trunk/build/modules.conf.in Thu Feb 19 14:58:35 2009
@@ -43,6 +43,7 @@
endpoints/mod_loopback
#endpoints/mod_alsa
#endpoints/mod_opal
+#endpoints/mod_skypiax
#../../libs/openzap/mod_openzap
#event_handlers/mod_event_multicast
event_handlers/mod_event_socket
1
0
[commit] r12167 - in freeswitch: branches/gmaruzz/mod_skypiax trunk/src/mod/endpoints/mod_skypiax
by FreeSWITCH SVN 19 Feb '09
by FreeSWITCH SVN 19 Feb '09
19 Feb '09
Author: brian
Date: Thu Feb 19 14:57:36 2009
New Revision: 12167
Log:
Move Skypiax into svn Trunk
Added:
freeswitch/trunk/src/mod/endpoints/mod_skypiax/
- copied from r12166, /freeswitch/branches/gmaruzz/mod_skypiax/
Changes in other areas also in this revision:
Removed:
freeswitch/branches/gmaruzz/mod_skypiax/
1
0