Freeswitch-trunk
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
March 2008
- 7 participants
- 222 discussions
Author: anthm
Date: Wed Mar 5 22:11:20 2008
New Revision: 7800
Modified:
freeswitch/trunk/src/include/switch_core.h
freeswitch/trunk/src/include/switch_core_event_hook.h
freeswitch/trunk/src/include/switch_module_interfaces.h
freeswitch/trunk/src/switch_core_event_hook.c
freeswitch/trunk/src/switch_core_session.c
Log:
update
Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h (original)
+++ freeswitch/trunk/src/include/switch_core.h Wed Mar 5 22:11:20 2008
@@ -728,6 +728,11 @@
_Inout_ switch_memory_pool_t **pool,
_In_ switch_originate_flag_t flags);
+SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(_In_z_ const char *endpoint_name,
+ _Inout_ switch_core_session_t **new_session,
+ _Inout_ switch_memory_pool_t **pool,
+ _In_ void *data);
+
/*!
\brief Receive a message on a given session
\param session the session to receive the message from
Modified: freeswitch/trunk/src/include/switch_core_event_hook.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core_event_hook.h (original)
+++ freeswitch/trunk/src/include/switch_core_event_hook.h Wed Mar 5 22:11:20 2008
@@ -48,6 +48,7 @@
typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf_t;
typedef struct switch_io_event_hook_recv_dtmf switch_io_event_hook_recv_dtmf_t;
typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
+typedef struct switch_io_event_hook_resurrect_session switch_io_event_hook_resurrect_session_t;
typedef switch_status_t (*switch_outgoing_channel_hook_t)
(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *, switch_originate_flag_t);
typedef switch_status_t (*switch_receive_message_hook_t) (switch_core_session_t *, switch_core_session_message_t *);
@@ -62,7 +63,7 @@
typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, const switch_dtmf_t *);
typedef switch_status_t (*switch_recv_dtmf_hook_t) (switch_core_session_t *, const switch_dtmf_t *);
typedef switch_status_t (*switch_state_change_hook_t) (switch_core_session_t *);
-
+typedef switch_call_cause_t (*switch_resurrect_session_hook_t)(switch_core_session_t **, switch_memory_pool_t **, void *);
/*! \brief Node in which to store custom receive message callback hooks */
struct switch_io_event_hook_outgoing_channel {
@@ -154,6 +155,12 @@
struct switch_io_event_hook_state_change *next;
};
+
+struct switch_io_event_hook_resurrect_session {
+ switch_resurrect_session_hook_t resurrect_session;
+ struct switch_io_event_hook_resurrect_session *next;
+};
+
/*! \brief A table of lists of io_event_hooks to store the event hooks associated with a session */
struct switch_io_event_hooks {
/*! a list of outgoing channel hooks */
@@ -182,6 +189,7 @@
switch_io_event_hook_recv_dtmf_t *recv_dtmf;
/*! a list of state change hooks */
switch_io_event_hook_state_change_t *state_change;
+ switch_io_event_hook_resurrect_session_t *resurrect_session;
};
extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_session_t *session);
@@ -240,6 +248,7 @@
NEW_HOOK_DECL_ADD_P(waitfor_write);
NEW_HOOK_DECL_ADD_P(send_dtmf);
NEW_HOOK_DECL_ADD_P(recv_dtmf);
+NEW_HOOK_DECL_ADD_P(resurrect_session);
NEW_HOOK_DECL_REM_P(outgoing_channel);
NEW_HOOK_DECL_REM_P(receive_message);
@@ -254,6 +263,7 @@
NEW_HOOK_DECL_REM_P(waitfor_write);
NEW_HOOK_DECL_REM_P(send_dtmf);
NEW_HOOK_DECL_REM_P(recv_dtmf);
+NEW_HOOK_DECL_REM_P(resurrect_session);
///\}
SWITCH_END_EXTERN_C
Modified: freeswitch/trunk/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/trunk/src/include/switch_module_interfaces.h (original)
+++ freeswitch/trunk/src/include/switch_module_interfaces.h Wed Mar 5 22:11:20 2008
@@ -98,6 +98,7 @@
struct switch_io_event_hooks;
+
typedef switch_call_cause_t (*switch_io_outgoing_channel_t)
(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t);
typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
@@ -111,6 +112,7 @@
typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+typedef switch_call_cause_t (*switch_io_resurrect_session_t)(switch_core_session_t **, switch_memory_pool_t **, void *);
typedef enum {
SWITCH_IO_OUTGOING_CHANNEL,
@@ -124,7 +126,8 @@
SWITCH_IO_RECEIVE_EVENT,
SWITCH_IO_STATE_CHANGE,
SWITCH_IO_READ_VIDEO_FRAME,
- SWITCH_IO_WRITE_VIDEO_FRAME
+ SWITCH_IO_WRITE_VIDEO_FRAME,
+ SWITCH_IO_RESURRECT_SESSION
} switch_io_routine_name_t;
/*! \brief A table of i/o routines that an endpoint interface can implement */
@@ -153,6 +156,8 @@
switch_io_read_video_frame_t read_video_frame;
/*! write a video frame to a session */
switch_io_write_video_frame_t write_video_frame;
+ /*! resurrect a session */
+ switch_io_resurrect_session_t resurrect_session;
void *padding[10];
};
Modified: freeswitch/trunk/src/switch_core_event_hook.c
==============================================================================
--- freeswitch/trunk/src/switch_core_event_hook.c (original)
+++ freeswitch/trunk/src/switch_core_event_hook.c Wed Mar 5 22:11:20 2008
@@ -44,6 +44,7 @@
NEW_HOOK_DECL(waitfor_write)
NEW_HOOK_DECL(send_dtmf)
NEW_HOOK_DECL(recv_dtmf)
+NEW_HOOK_DECL(resurrect_session)
/* For Emacs:
* Local Variables:
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Wed Mar 5 22:11:20 2008
@@ -173,6 +173,21 @@
return session->stream_count;
}
+SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(const char *endpoint_name,
+ switch_core_session_t **new_session,
+ switch_memory_pool_t **pool,
+ void *data)
+{
+ const switch_endpoint_interface_t *endpoint_interface;
+
+ if ((endpoint_interface = switch_loadable_module_get_endpoint_interface(endpoint_name)) == 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not locate channel type %s\n", endpoint_name);
+ return SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED;
+ }
+
+ return endpoint_interface->io_routines->resurrect_session(new_session, pool, data);
+}
+
SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_core_session_t *session,
const char *endpoint_name,
switch_caller_profile_t *caller_profile,
1
0
[commit] r7799 - in freeswitch/trunk: libs/sofia-sip libs/sofia-sip/libsofia-sip-ua/sdp src/mod/endpoints/mod_sofia
by Freeswitch SVN 05 Mar '08
by Freeswitch SVN 05 Mar '08
05 Mar '08
Author: mikej
Date: Wed Mar 5 17:39:22 2008
New Revision: 7799
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
Log:
tweak sdp handling
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Mar 5 17:39:22 2008
@@ -1 +1 @@
-Fri Feb 15 10:57:26 EST 2008
+Wed Mar 5 17:21:10 EST 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Wed Mar 5 17:39:22 2008
@@ -565,7 +565,6 @@
{
char const *media, *proto;
sdp_rtpmap_t *rm;
- int print_rejected = 0;
sdp_mode_t session_mode = sdp_sendrecv;
@@ -594,13 +593,11 @@
default: proto = m->m_proto_name; break;
}
- if (print_rejected || m->m_rtpmaps || m->m_format) {
if (m->m_number_of_ports <= 1)
sdp_printf(p, "m=%s %u %s", media, m->m_port, proto);
else
sdp_printf(p, "m=%s %u/%u %s",
media, m->m_port, m->m_number_of_ports, proto);
- }
if (m->m_rtpmaps) {
for (rm = m->m_rtpmaps; rm; rm = rm->rm_next) {
@@ -615,13 +612,13 @@
for (; l; l = l->l_next)
sdp_printf(p, " %s", l->l_text);
}
- else if (print_rejected) {
+ else {
sdp_printf(p, " 19"); /* SDP syntax requires at least one format.
19 is used by nobody, right?. */
}
- if (print_rejected || m->m_rtpmaps || m->m_format) sdp_printf(p, CRLF);
+ sdp_printf(p, CRLF);
if (m->m_information)
print_information(p, m->m_information);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Mar 5 17:39:22 2008
@@ -394,6 +394,8 @@
NUTAG_SESSION_TIMER(session_timeout),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_AUDIO_AUX("cn telephone-event"),
NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_END());
@@ -750,6 +752,8 @@
nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_AUDIO_AUX("cn telephone-event"),
NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_END());
@@ -990,6 +994,8 @@
}
nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_AUDIO_AUX("cn telephone-event"),
NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_END());
@@ -1066,6 +1072,8 @@
SIP_183_SESSION_PROGRESS,
NUTAG_AUTOANSWER(0),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), TAG_END());
}
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Wed Mar 5 17:39:22 2008
@@ -1735,6 +1735,8 @@
nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_AUDIO_AUX("cn telephone-event"),
NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_END());
@@ -1802,6 +1804,8 @@
nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_AUDIO_AUX("cn telephone-event"),
NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_END());
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Mar 5 17:39:22 2008
@@ -1072,6 +1072,8 @@
TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END());
@@ -1108,6 +1110,8 @@
nua_invite(tech_pvt->nh2,
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_REUSE_REJECTED(1),
+ SOATAG_ORDERED_USER(1),
SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), TAG_END());
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
1
0
Author: anthm
Date: Wed Mar 5 17:01:45 2008
New Revision: 7798
Modified:
freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
Log:
fix MODFORM-6
Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Wed Mar 5 17:01:45 2008
@@ -272,12 +272,13 @@
}
if (decode_status == MP3_ERR) {
- if (++context->mp3err >= 20) {
+ if (++context->mp3err >= 5) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Decoder Error!\n");
+ goto error;
}
+
dlen = 0;
- //continue;
- goto error;
+ continue;
}
context->mp3err = 0;
@@ -586,10 +587,11 @@
}
+ lame_set_brate(context->gfp, 24 * (handle->samplerate / 8000) * handle->channels);
lame_set_num_channels(context->gfp, handle->channels);
lame_set_in_samplerate(context->gfp, handle->samplerate);
- lame_set_brate(context->gfp, 64);
lame_set_out_samplerate(context->gfp, handle->samplerate);
+
if (handle->channels == 2) {
lame_set_mode(context->gfp, STEREO);
} else {
1
0
[commit] r7797 - in freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl: . sql
by Freeswitch SVN 05 Mar '08
by Freeswitch SVN 05 Mar '08
05 Mar '08
Author: intralanman
Date: Wed Mar 5 16:33:42 2008
New Revision: 7797
Modified:
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql
Log:
Added some stuff to debug to file, syslog, and xml via comments
also added some stuff to try and add support for using CDATA in expression condition and application data
Modified: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php (original)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php Wed Mar 5 16:33:42 2008
@@ -183,7 +183,11 @@
for ($i = 0; $i < $comment_count; $i++) {
$this -> xmlw -> writeComment($this -> comments[$i]);
}
- echo $this -> xmlw -> outputMemory();
+ $xml_out = $this -> xmlw -> outputMemory();
+ $this -> debug('---- Start XML Output ----');
+ $this -> debug($xml_out);
+ $this -> debug('---- End XML Output ----');
+ echo $xml_out;
exit();
}
@@ -198,7 +202,7 @@
$this -> comment("$spaces$key => Array");
$this -> comment_array($val, $spacepad+2);
} else {
- $this -> comment("$spaces$key => $val");
+ $this -> comment("$spaces$key => $val");
}
}
}
@@ -246,27 +250,9 @@
* @todo add other defines that control what, if any, comments gets output
*/
public function error_handler($no, $str, $file, $line) {
- /*
- $this -> comment("USER_ERROR " . E_USER_ERROR);
- $this -> comment("USER_NOTICE " . E_USER_NOTICE);
- $this -> comment("USER_WARNING " . E_USER_WARNING);
- $this -> comment("ALL " . E_ALL);
- $this -> comment("COMPILE_ERROR " . E_COMPILE_ERROR);
- $this -> comment("COMPILE_WARNING " . E_COMPILE_WARNING);
- $this -> comment("CORE_ERROR " . E_CORE_ERROR);
- $this -> comment("CORE_WARNING " . E_CORE_WARNING);
- $this -> comment("ERROR " . E_ERROR);
- $this -> comment("NOTICE " . E_NOTICE);
- $this -> comment("WARNING " . E_WARNING);
- $this -> comment("PARSE " . E_PARSE);
- $this -> comment("RECOVERABLE_ERROR " . E_RECOVERABLE_ERROR);
- $this -> comment("STRICT " . E_STRICT);
- //$this -> comment(E);
- */
if ($no == E_STRICT) {
return true;
}
-
$file = ereg_replace('\.(inc|php)$', '', $file);
$this -> comment(basename($file) . ":$line - $no:$str");
@@ -286,5 +272,50 @@
}
return true;
}
+
+ /**
+ * Function to print out debugging info
+ * This method will recieve arbitrary data and send it using your method of
+ * choice.... enable/disable by defining FS_CURL_DEBUG to and arbitrary integer
+ * @param mixed $input what to debug, arrays and strings tested, objects MAY work
+ * @param integer $debug_level debug if $debug_level <= FS_CURL_DEBUG
+ * @param integer $spaces
+ */
+ public function debug($input, $debug_level=0, $spaces=0) {
+ if (defined('FS_CURL_DEBUG') && $debug_level <= FS_CURL_DEBUG ) {
+ if (is_array($input)) {
+ $this -> debug('Array (', $debug_level, $spaces);
+ foreach ($input as $key=>$val) {
+ if (is_array($val) || is_object($val)) {
+ $this -> debug("[$key] => $val", $debug_level, $spaces+4);
+ $this -> debug('(', $debug_level, $spaces + 8);
+ $this -> debug($val, $debug_level, $spaces + 8);
+ } else {
+ $this -> debug("[$key] => '$val'", $debug_level, $spaces + 4);
+ }
+ }
+ $this -> debug(")", $debug_level, $spaces);
+ } else {
+ $debug_str = sprintf("%s%s"
+ , str_repeat(' ', $spaces), $input
+ );
+ switch (FS_DEBUG_TYPE) {
+ case 0:
+ syslog(LOG_NOTICE, $debug_str);
+ break;
+ case 1:
+ $this -> comment($debug_str);
+ break;
+ case 2:
+ $ptr = fopen(FS_DEBUG_FILE, 'a');
+ fputs($ptr, "$debug_str\r\n");
+ fclose($ptr);
+ break;
+ default:
+ return;
+ }
+ }
+ }
+ }
}
?>
\ No newline at end of file
Modified: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php (original)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php Wed Mar 5 16:33:42 2008
@@ -54,14 +54,17 @@
$ec = $row['ext_continue'];
$app = $row['application_name'];
$data = $row['application_data'];
+ $app_cdata = $row['app_cdata'];
$type = $row['type'];
$cf = $row['condition_field'];
$ce = $row['condition_expression'];
+ $rcd = $row['re_cdata'];
$cc = empty($row['condition_continue']) ? '0' : $row['condition_continue'];
- $dp_array[$ct]["$et;$ec"]["$cf;$ce;$cc"][] = array(
+ $dp_array[$ct]["$et;$ec"]["$cf;$ce;$cc;$rcd"][] = array(
'type'=>$type,
'application'=>$app,
- 'data'=>$data
+ 'data'=>$data,
+ 'is_cdata'=>$app_cdata
);
}
return $dp_array;
@@ -71,6 +74,8 @@
* Write XML dialplan from the array returned by get_dialplan
* @see fs_dialplan::get_dialplan
* @param array $dpArray Multi-dimentional array from which we write the XML
+ * @todo this method should REALLY be broken down into several smaller methods
+ *
*/
private function writeDialplan($dpArray) {
//print_r($dpArray);
@@ -93,6 +98,7 @@
if ($ex_split[1] > 0) {
$this -> xmlw -> writeAttribute('continue', $ex_split[1]);
}
+ $this -> debug($conditions);
foreach ($conditions as $condition => $app_array) {
$c_split = split(';', $condition);
$this -> xmlw -> startElement('condition');
@@ -100,17 +106,40 @@
$this -> xmlw -> writeAttribute('field', $c_split[0]);
}
if (!empty($c_split[1])) {
- $this -> xmlw -> writeAttribute('expression', $c_split[1]);
+ if (array_key_exists(3, $c_split)
+ && $c_split[3] == true) {
+ $this -> xmlw -> startElement('expression');
+ $this -> xmlw -> writeCdata($c_split[1]);
+ $this -> xmlw -> endElement();
+ } else {
+ $this -> xmlw -> writeAttribute(
+ 'expression', $c_split[1]
+ );
+ }
}
- //$this -> comment($c_split[2]);
+ //$this -> debug($c_split[2]);
if ($c_split[2] != '0') {
- $this -> xmlw -> writeAttribute('continue', $c_split[2]);
+ $this -> xmlw -> writeAttribute(
+ 'continue', $c_split[2]
+ );
}
+ //$this -> debug($app_array);
foreach ($app_array as $app) {
$this -> xmlw -> startElement($app['type']);
- $this -> xmlw -> writeAttribute('application', $app['application']);
+ $this -> xmlw -> writeAttribute(
+ 'application', $app['application']
+ );
if (!empty($app['data'])) {
- $this -> xmlw -> writeAttribute('data', $app['data']);
+ if (array_key_exists('is_cdata', $app)
+ && $app['is_cdata'] == true) {
+ $this -> xmlw -> startElement('data');
+ $this -> xmlw -> writeCdata($app['data']);
+ $this -> xmlw -> endElement();
+ } else {
+ $this -> xmlw -> writeAttribute(
+ 'data', $app['data']
+ );
+ }
}
$this -> xmlw -> endElement();
}
Modified: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php (original)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php Wed Mar 5 16:33:42 2008
@@ -40,6 +40,25 @@
*/
define('GLOBAL_USERS', true);
+/**
+ * Define debug level... should not be used in production for performance reasons
+ */
+define('FS_CURL_DEBUG', 0);
+
+/**
+ * define how debugging should be done (depends on FS_CURL_DEBUG)
+ * 0 syslog
+ * 1 xml comment
+ * 2 file (named in FS_DEBUG_FILE), take care when using this option as there's currently nothing to watch the file's size
+ */
+define('FS_DEBUG_TYPE', 0);
+
+/**
+ * File to use for debugging to file
+ */
+define('FS_DEBUG_FILE', '/tmp/fs_curl.debug');
+
+
//define('', '');
Modified: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php (original)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php Wed Mar 5 16:33:42 2008
@@ -80,6 +80,11 @@
$conf = new fs_directory();
break;
}
+
+$conf -> debug('---- Start _REQUEST ----');
+$conf -> debug($_REQUEST);
+$conf -> debug('---- End _REQUEST ----');
$conf -> main();
$conf -> output_xml();
+
?>
\ No newline at end of file
Modified: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql
==============================================================================
--- freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql (original)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql Wed Mar 5 16:33:42 2008
@@ -1,532 +1,556 @@
--- MySQL dump 10.11
---
--- Host: localhost Database: freeswitch
--- ------------------------------------------------------
--- Server version 5.0.45-community-nt
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
-/*!40103 SET TIME_ZONE='+00:00' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
---
--- Table structure for table `conference_advertise`
---
-
-DROP TABLE IF EXISTS `conference_advertise`;
-CREATE TABLE `conference_advertise` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `room` varchar(64) NOT NULL,
- `status` varchar(128) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_room` (`room`)
-) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `conference_controls`
---
-
-DROP TABLE IF EXISTS `conference_controls`;
-CREATE TABLE `conference_controls` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `conf_group` varchar(64) NOT NULL,
- `action` varchar(64) NOT NULL,
- `digits` varchar(16) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_group_action` USING BTREE (`conf_group`,`action`)
-) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `conference_profiles`
---
-
-DROP TABLE IF EXISTS `conference_profiles`;
-CREATE TABLE `conference_profiles` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `profile_name` varchar(64) NOT NULL,
- `param_name` varchar(64) NOT NULL,
- `param_value` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `unique_profile_param` (`profile_name`,`param_name`)
-) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `db_data`
---
-
-DROP TABLE IF EXISTS `db_data`;
-CREATE TABLE `db_data` (
- `hostname` varchar(255) default NULL,
- `realm` varchar(255) default NULL,
- `data_key` varchar(255) default NULL,
- `data` varchar(255) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `dialplan`
---
-
-DROP TABLE IF EXISTS `dialplan`;
-CREATE TABLE `dialplan` (
- `id` int(11) NOT NULL auto_increment,
- `context` varchar(64) NOT NULL,
- `extension` varchar(64) NOT NULL,
- `condition_field` varchar(64) NOT NULL,
- `condition_expression` varchar(64) NOT NULL,
- `application_name` varchar(64) NOT NULL,
- `application_data` text,
- `weight` int(11) NOT NULL,
- `type` varchar(16) NOT NULL default 'action',
- `ext_continue` smallint(1) NOT NULL default '0',
- `global_weight` int(11) NOT NULL default '10000',
- `condition_continue` varchar(8) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=112 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `dingaling_profile_params`
---
-
-DROP TABLE IF EXISTS `dingaling_profile_params`;
-CREATE TABLE `dingaling_profile_params` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `dingaling_id` int(10) unsigned NOT NULL,
- `param_name` varchar(64) NOT NULL,
- `param_value` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_type_name` (`dingaling_id`,`param_name`),
- CONSTRAINT `dingaling_profile` FOREIGN KEY (`dingaling_id`) REFERENCES `dingaling_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `dingaling_profiles`
---
-
-DROP TABLE IF EXISTS `dingaling_profiles`;
-CREATE TABLE `dingaling_profiles` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `profile_name` varchar(64) NOT NULL,
- `type` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_name` (`profile_name`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `dingaling_settings`
---
-
-DROP TABLE IF EXISTS `dingaling_settings`;
-CREATE TABLE `dingaling_settings` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `param_name` varchar(64) NOT NULL,
- `param_value` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_param` (`param_name`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `directory`
---
-
-DROP TABLE IF EXISTS `directory`;
-CREATE TABLE `directory` (
- `id` int(11) NOT NULL auto_increment,
- `username` varchar(255) NOT NULL,
- `domain` varchar(255) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `directory_gateway_params`
---
-
-DROP TABLE IF EXISTS `directory_gateway_params`;
-CREATE TABLE `directory_gateway_params` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `d_gw_id` int(10) unsigned NOT NULL,
- `param_name` varchar(64) NOT NULL,
- `param_value` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_gw_param` (`d_gw_id`,`param_name`)
-) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `directory_gateways`
---
-
-DROP TABLE IF EXISTS `directory_gateways`;
-CREATE TABLE `directory_gateways` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `directory_id` int(10) unsigned NOT NULL,
- `gateway_name` varchar(128) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `directory_params`
---
-
-DROP TABLE IF EXISTS `directory_params`;
-CREATE TABLE `directory_params` (
- `id` int(11) NOT NULL auto_increment,
- `directory_id` int(11) default NULL,
- `param_name` varchar(255) default NULL,
- `param_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `directory_vars`
---
-
-DROP TABLE IF EXISTS `directory_vars`;
-CREATE TABLE `directory_vars` (
- `id` int(11) NOT NULL auto_increment,
- `directory_id` int(11) default NULL,
- `var_name` varchar(255) default NULL,
- `var_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `group_data`
---
-
-DROP TABLE IF EXISTS `group_data`;
-CREATE TABLE `group_data` (
- `hostname` varchar(255) default NULL,
- `groupname` varchar(255) default NULL,
- `url` varchar(255) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `iax_conf`
---
-
-DROP TABLE IF EXISTS `iax_conf`;
-CREATE TABLE `iax_conf` (
- `id` int(11) NOT NULL auto_increment,
- `profile_name` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `iax_settings`
---
-
-DROP TABLE IF EXISTS `iax_settings`;
-CREATE TABLE `iax_settings` (
- `id` int(11) NOT NULL auto_increment,
- `iax_id` int(11) default NULL,
- `param_name` varchar(255) default NULL,
- `param_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `ivr_conf`
---
-
-DROP TABLE IF EXISTS `ivr_conf`;
-CREATE TABLE `ivr_conf` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name` varchar(64) NOT NULL,
- `greet_long` varchar(255) NOT NULL,
- `greet_short` varchar(255) NOT NULL,
- `invalid_sound` varchar(255) NOT NULL,
- `exit_sound` varchar(255) NOT NULL,
- `max_failures` int(10) unsigned NOT NULL default '3',
- `timeout` int(11) NOT NULL default '5',
- `tts_engine` varchar(64) default NULL,
- `tts_voice` varchar(64) default NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_name` (`name`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `ivr_entries`
---
-
-DROP TABLE IF EXISTS `ivr_entries`;
-CREATE TABLE `ivr_entries` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `ivr_id` int(10) unsigned NOT NULL,
- `action` varchar(64) NOT NULL,
- `digits` varchar(16) NOT NULL,
- `params` varchar(255) default NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_ivr_digits` USING BTREE (`ivr_id`,`digits`)
-) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `jabber_subscriptions`
---
-
-DROP TABLE IF EXISTS `jabber_subscriptions`;
-CREATE TABLE `jabber_subscriptions` (
- `sub_from` varchar(255) default NULL,
- `sub_to` varchar(255) default NULL,
- `show_pres` varchar(255) default NULL,
- `status` varchar(255) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `limit_conf`
---
-
-DROP TABLE IF EXISTS `limit_conf`;
-CREATE TABLE `limit_conf` (
- `id` int(11) NOT NULL auto_increment,
- `name` varchar(255) default NULL,
- `value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `limit_data`
---
-
-DROP TABLE IF EXISTS `limit_data`;
-CREATE TABLE `limit_data` (
- `hostname` varchar(255) default NULL,
- `realm` varchar(255) default NULL,
- `id` varchar(255) default NULL,
- `uuid` varchar(255) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `local_stream_conf`
---
-
-DROP TABLE IF EXISTS `local_stream_conf`;
-CREATE TABLE `local_stream_conf` (
- `id` int(11) NOT NULL auto_increment,
- `directory_name` varchar(255) default NULL,
- `directory_path` text,
- `param_name` varchar(255) default NULL,
- `param_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `post_load_modules_conf`
---
-
-DROP TABLE IF EXISTS `post_load_modules_conf`;
-CREATE TABLE `post_load_modules_conf` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `module_name` varchar(64) NOT NULL,
- `load_module` tinyint(1) NOT NULL default '1',
- `priority` int(10) unsigned NOT NULL default '1000',
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_mod` (`module_name`)
-) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `rss_conf`
---
-
-DROP TABLE IF EXISTS `rss_conf`;
-CREATE TABLE `rss_conf` (
- `id` int(11) NOT NULL auto_increment,
- `directory_id` int(11) NOT NULL,
- `feed` text NOT NULL,
- `local_file` text NOT NULL,
- `description` text,
- `priority` int(11) NOT NULL default '1000',
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `sip_authentication`
---
-
-DROP TABLE IF EXISTS `sip_authentication`;
-CREATE TABLE `sip_authentication` (
- `nonce` varchar(255) default NULL,
- `expires` int(8) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `sip_registrations`
---
-
-DROP TABLE IF EXISTS `sip_registrations`;
-CREATE TABLE `sip_registrations` (
- `call_id` varchar(255) default NULL,
- `sip_user` varchar(255) default NULL,
- `sip_host` varchar(255) default NULL,
- `contact` varchar(1024) default NULL,
- `status` varchar(255) default NULL,
- `rpid` varchar(255) default NULL,
- `expires` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `sip_subscriptions`
---
-
-DROP TABLE IF EXISTS `sip_subscriptions`;
-CREATE TABLE `sip_subscriptions` (
- `proto` varchar(255) default NULL,
- `sip_user` varchar(255) default NULL,
- `sip_host` varchar(255) default NULL,
- `sub_to_user` varchar(255) default NULL,
- `sub_to_host` varchar(255) default NULL,
- `event` varchar(255) default NULL,
- `contact` varchar(1024) default NULL,
- `call_id` varchar(255) default NULL,
- `full_from` varchar(255) default NULL,
- `full_via` varchar(255) default NULL,
- `expires` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `sofia_aliases`
---
-
-DROP TABLE IF EXISTS `sofia_aliases`;
-CREATE TABLE `sofia_aliases` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `sofia_id` int(10) unsigned NOT NULL,
- `alias_name` varchar(255) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `sofia_conf`
---
-
-DROP TABLE IF EXISTS `sofia_conf`;
-CREATE TABLE `sofia_conf` (
- `id` int(11) NOT NULL auto_increment,
- `profile_name` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `sofia_domains`
---
-
-DROP TABLE IF EXISTS `sofia_domains`;
-CREATE TABLE `sofia_domains` (
- `id` int(11) NOT NULL auto_increment,
- `sofia_id` int(11) default NULL,
- `domain_name` varchar(255) default NULL,
- `parse` tinyint(1) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `sofia_gateways`
---
-
-DROP TABLE IF EXISTS `sofia_gateways`;
-CREATE TABLE `sofia_gateways` (
- `id` int(11) NOT NULL auto_increment,
- `sofia_id` int(11) default NULL,
- `gateway_name` varchar(255) default NULL,
- `gateway_param` varchar(255) default NULL,
- `gateway_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `sofia_settings`
---
-
-DROP TABLE IF EXISTS `sofia_settings`;
-CREATE TABLE `sofia_settings` (
- `id` int(11) NOT NULL auto_increment,
- `sofia_id` int(11) default NULL,
- `param_name` varchar(255) default NULL,
- `param_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `voicemail_conf`
---
-
-DROP TABLE IF EXISTS `voicemail_conf`;
-CREATE TABLE `voicemail_conf` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `vm_profile` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_profile` (`vm_profile`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `voicemail_data`
---
-
-DROP TABLE IF EXISTS `voicemail_data`;
-CREATE TABLE `voicemail_data` (
- `created_epoch` int(8) default NULL,
- `read_epoch` int(8) default NULL,
- `user` varchar(255) default NULL,
- `domain` varchar(255) default NULL,
- `uuid` varchar(255) default NULL,
- `cid_name` varchar(255) default NULL,
- `cid_number` varchar(255) default NULL,
- `in_folder` varchar(255) default NULL,
- `file_path` varchar(255) default NULL,
- `flags` varchar(255) default NULL,
- `read_flags` varchar(255) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `voicemail_email`
---
-
-DROP TABLE IF EXISTS `voicemail_email`;
-CREATE TABLE `voicemail_email` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `voicemail_id` int(10) unsigned NOT NULL,
- `param_name` varchar(64) NOT NULL,
- `param_value` varchar(64) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique_profile_param` (`param_name`,`voicemail_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-
---
--- Table structure for table `voicemail_prefs`
---
-
-DROP TABLE IF EXISTS `voicemail_prefs`;
-CREATE TABLE `voicemail_prefs` (
- `user` varchar(255) default NULL,
- `domain` varchar(255) default NULL,
- `name_path` varchar(255) default NULL,
- `greeting_path` varchar(255) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `voicemail_settings`
---
-
-DROP TABLE IF EXISTS `voicemail_settings`;
-CREATE TABLE `voicemail_settings` (
- `id` int(11) NOT NULL auto_increment,
- `voicemail_id` int(11) default NULL,
- `param_name` varchar(255) default NULL,
- `param_value` varchar(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=latin1;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
--- Dump completed on 2008-01-09 23:18:24
+-- MySQL dump 10.11
+--
+-- Host: localhost Database: freeswitch
+-- ------------------------------------------------------
+-- Server version 5.0.32-Debian_7etch5-log
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `conference_advertise`
+--
+
+DROP TABLE IF EXISTS `conference_advertise`;
+CREATE TABLE `conference_advertise` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `room` varchar(64) NOT NULL,
+ `status` varchar(128) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_room` (`room`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `conference_controls`
+--
+
+DROP TABLE IF EXISTS `conference_controls`;
+CREATE TABLE `conference_controls` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `conf_group` varchar(64) NOT NULL,
+ `action` varchar(64) NOT NULL,
+ `digits` varchar(16) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_group_action` USING BTREE (`conf_group`,`action`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `conference_profiles`
+--
+
+DROP TABLE IF EXISTS `conference_profiles`;
+CREATE TABLE `conference_profiles` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `profile_name` varchar(64) NOT NULL,
+ `param_name` varchar(64) NOT NULL,
+ `param_value` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `unique_profile_param` (`profile_name`,`param_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `db_data`
+--
+
+DROP TABLE IF EXISTS `db_data`;
+CREATE TABLE `db_data` (
+ `hostname` varchar(255) default NULL,
+ `realm` varchar(255) default NULL,
+ `data_key` varchar(255) default NULL,
+ `data` varchar(255) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `dialplan`
+--
+
+DROP TABLE IF EXISTS `dialplan`;
+CREATE TABLE `dialplan` (
+ `id` int(11) NOT NULL auto_increment,
+ `context` varchar(64) NOT NULL,
+ `extension` varchar(64) NOT NULL,
+ `condition_field` varchar(64) NOT NULL,
+ `condition_expression` varchar(64) NOT NULL,
+ `application_name` varchar(64) NOT NULL,
+ `application_data` text,
+ `weight` int(11) NOT NULL,
+ `type` varchar(16) NOT NULL default 'action',
+ `ext_continue` smallint(1) NOT NULL default '0',
+ `global_weight` int(11) NOT NULL default '10000',
+ `condition_continue` varchar(8) default NULL,
+ `app_cdata` tinyint(1) NOT NULL default '0',
+ `re_cdata` tinyint(1) NOT NULL default '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=386 DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `dingaling_profile_params`
+--
+
+DROP TABLE IF EXISTS `dingaling_profile_params`;
+CREATE TABLE `dingaling_profile_params` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `dingaling_id` int(10) unsigned NOT NULL,
+ `param_name` varchar(64) NOT NULL,
+ `param_value` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_type_name` (`dingaling_id`,`param_name`),
+ CONSTRAINT `dingaling_profile` FOREIGN KEY (`dingaling_id`) REFERENCES `dingaling_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `dingaling_profiles`
+--
+
+DROP TABLE IF EXISTS `dingaling_profiles`;
+CREATE TABLE `dingaling_profiles` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `profile_name` varchar(64) NOT NULL,
+ `type` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_name` (`profile_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `dingaling_settings`
+--
+
+DROP TABLE IF EXISTS `dingaling_settings`;
+CREATE TABLE `dingaling_settings` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `param_name` varchar(64) NOT NULL,
+ `param_value` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_param` (`param_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `directory`
+--
+
+DROP TABLE IF EXISTS `directory`;
+CREATE TABLE `directory` (
+ `id` int(11) NOT NULL auto_increment,
+ `username` varchar(255) NOT NULL,
+ `domain` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `directory_gateway_params`
+--
+
+DROP TABLE IF EXISTS `directory_gateway_params`;
+CREATE TABLE `directory_gateway_params` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `d_gw_id` int(10) unsigned NOT NULL,
+ `param_name` varchar(64) NOT NULL,
+ `param_value` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_gw_param` (`d_gw_id`,`param_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `directory_gateways`
+--
+
+DROP TABLE IF EXISTS `directory_gateways`;
+CREATE TABLE `directory_gateways` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `directory_id` int(10) unsigned NOT NULL,
+ `gateway_name` varchar(128) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `directory_params`
+--
+
+DROP TABLE IF EXISTS `directory_params`;
+CREATE TABLE `directory_params` (
+ `id` int(11) NOT NULL auto_increment,
+ `directory_id` int(11) default NULL,
+ `param_name` varchar(255) default NULL,
+ `param_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `directory_vars`
+--
+
+DROP TABLE IF EXISTS `directory_vars`;
+CREATE TABLE `directory_vars` (
+ `id` int(11) NOT NULL auto_increment,
+ `directory_id` int(11) default NULL,
+ `var_name` varchar(255) default NULL,
+ `var_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `group_data`
+--
+
+DROP TABLE IF EXISTS `group_data`;
+CREATE TABLE `group_data` (
+ `hostname` varchar(255) default NULL,
+ `groupname` varchar(255) default NULL,
+ `url` varchar(255) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `iax_conf`
+--
+
+DROP TABLE IF EXISTS `iax_conf`;
+CREATE TABLE `iax_conf` (
+ `id` int(11) NOT NULL auto_increment,
+ `profile_name` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `iax_settings`
+--
+
+DROP TABLE IF EXISTS `iax_settings`;
+CREATE TABLE `iax_settings` (
+ `id` int(11) NOT NULL auto_increment,
+ `iax_id` int(11) default NULL,
+ `param_name` varchar(255) default NULL,
+ `param_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `ivr_conf`
+--
+
+DROP TABLE IF EXISTS `ivr_conf`;
+CREATE TABLE `ivr_conf` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `name` varchar(64) NOT NULL,
+ `greet_long` varchar(255) NOT NULL,
+ `greet_short` varchar(255) NOT NULL,
+ `invalid_sound` varchar(255) NOT NULL,
+ `exit_sound` varchar(255) NOT NULL,
+ `max_failures` int(10) unsigned NOT NULL default '3',
+ `timeout` int(11) NOT NULL default '5',
+ `tts_engine` varchar(64) default NULL,
+ `tts_voice` varchar(64) default NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_name` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `ivr_entries`
+--
+
+DROP TABLE IF EXISTS `ivr_entries`;
+CREATE TABLE `ivr_entries` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `ivr_id` int(10) unsigned NOT NULL,
+ `action` varchar(64) NOT NULL,
+ `digits` varchar(16) NOT NULL,
+ `params` varchar(255) default NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_ivr_digits` USING BTREE (`ivr_id`,`digits`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `jabber_subscriptions`
+--
+
+DROP TABLE IF EXISTS `jabber_subscriptions`;
+CREATE TABLE `jabber_subscriptions` (
+ `sub_from` varchar(255) default NULL,
+ `sub_to` varchar(255) default NULL,
+ `show_pres` varchar(255) default NULL,
+ `status` varchar(255) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `limit_conf`
+--
+
+DROP TABLE IF EXISTS `limit_conf`;
+CREATE TABLE `limit_conf` (
+ `id` int(11) NOT NULL auto_increment,
+ `name` varchar(255) default NULL,
+ `value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `limit_data`
+--
+
+DROP TABLE IF EXISTS `limit_data`;
+CREATE TABLE `limit_data` (
+ `hostname` varchar(255) default NULL,
+ `realm` varchar(255) default NULL,
+ `id` varchar(255) default NULL,
+ `uuid` varchar(255) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `local_stream_conf`
+--
+
+DROP TABLE IF EXISTS `local_stream_conf`;
+CREATE TABLE `local_stream_conf` (
+ `id` int(11) NOT NULL auto_increment,
+ `directory_name` varchar(255) default NULL,
+ `directory_path` text,
+ `param_name` varchar(255) default NULL,
+ `param_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `post_load_modules_conf`
+--
+
+DROP TABLE IF EXISTS `post_load_modules_conf`;
+CREATE TABLE `post_load_modules_conf` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `module_name` varchar(64) NOT NULL,
+ `load_module` tinyint(1) NOT NULL default '1',
+ `priority` int(10) unsigned NOT NULL default '1000',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_mod` (`module_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `rss_conf`
+--
+
+DROP TABLE IF EXISTS `rss_conf`;
+CREATE TABLE `rss_conf` (
+ `id` int(11) NOT NULL auto_increment,
+ `directory_id` int(11) NOT NULL,
+ `feed` text NOT NULL,
+ `local_file` text NOT NULL,
+ `description` text,
+ `priority` int(11) NOT NULL default '1000',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `sip_authentication`
+--
+
+DROP TABLE IF EXISTS `sip_authentication`;
+CREATE TABLE `sip_authentication` (
+ `nonce` varchar(255) default NULL,
+ `expires` int(8) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `sip_dialogs`
+--
+
+DROP TABLE IF EXISTS `sip_dialogs`;
+CREATE TABLE `sip_dialogs` (
+ `call_id` varchar(255) default NULL,
+ `uuid` varchar(255) default NULL,
+ `sip_to_user` varchar(255) default NULL,
+ `sip_to_host` varchar(255) default NULL,
+ `sip_from_user` varchar(255) default NULL,
+ `sip_from_host` varchar(255) default NULL,
+ `contact_user` varchar(255) default NULL,
+ `contact_host` varchar(255) default NULL,
+ `state` varchar(255) default NULL,
+ `direction` varchar(255) default NULL,
+ `user_agent` varchar(255) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sip_registrations`
+--
+
+DROP TABLE IF EXISTS `sip_registrations`;
+CREATE TABLE `sip_registrations` (
+ `call_id` varchar(255) default NULL,
+ `sip_user` varchar(255) default NULL,
+ `sip_host` varchar(255) default NULL,
+ `contact` varchar(1024) default NULL,
+ `status` varchar(255) default NULL,
+ `rpid` varchar(255) default NULL,
+ `expires` int(11) default NULL,
+ `user_agent` varchar(255) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sip_subscriptions`
+--
+
+DROP TABLE IF EXISTS `sip_subscriptions`;
+CREATE TABLE `sip_subscriptions` (
+ `proto` varchar(255) default NULL,
+ `sip_user` varchar(255) default NULL,
+ `sip_host` varchar(255) default NULL,
+ `sub_to_user` varchar(255) default NULL,
+ `sub_to_host` varchar(255) default NULL,
+ `event` varchar(255) default NULL,
+ `contact` varchar(1024) default NULL,
+ `call_id` varchar(255) default NULL,
+ `full_from` varchar(255) default NULL,
+ `full_via` varchar(255) default NULL,
+ `expires` int(11) default NULL,
+ `user_agent` varchar(255) default NULL,
+ `accept` varchar(255) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sofia_aliases`
+--
+
+DROP TABLE IF EXISTS `sofia_aliases`;
+CREATE TABLE `sofia_aliases` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `sofia_id` int(10) unsigned NOT NULL,
+ `alias_name` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sofia_conf`
+--
+
+DROP TABLE IF EXISTS `sofia_conf`;
+CREATE TABLE `sofia_conf` (
+ `id` int(11) NOT NULL auto_increment,
+ `profile_name` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sofia_domains`
+--
+
+DROP TABLE IF EXISTS `sofia_domains`;
+CREATE TABLE `sofia_domains` (
+ `id` int(11) NOT NULL auto_increment,
+ `sofia_id` int(11) default NULL,
+ `domain_name` varchar(255) default NULL,
+ `parse` tinyint(1) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sofia_gateways`
+--
+
+DROP TABLE IF EXISTS `sofia_gateways`;
+CREATE TABLE `sofia_gateways` (
+ `id` int(11) NOT NULL auto_increment,
+ `sofia_id` int(11) default NULL,
+ `gateway_name` varchar(255) default NULL,
+ `gateway_param` varchar(255) default NULL,
+ `gateway_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `sofia_settings`
+--
+
+DROP TABLE IF EXISTS `sofia_settings`;
+CREATE TABLE `sofia_settings` (
+ `id` int(11) NOT NULL auto_increment,
+ `sofia_id` int(11) default NULL,
+ `param_name` varchar(255) default NULL,
+ `param_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `voicemail_conf`
+--
+
+DROP TABLE IF EXISTS `voicemail_conf`;
+CREATE TABLE `voicemail_conf` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `vm_profile` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_profile` (`vm_profile`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `voicemail_data`
+--
+
+DROP TABLE IF EXISTS `voicemail_data`;
+CREATE TABLE `voicemail_data` (
+ `created_epoch` int(8) default NULL,
+ `read_epoch` int(8) default NULL,
+ `user` varchar(255) default NULL,
+ `domain` varchar(255) default NULL,
+ `uuid` varchar(255) default NULL,
+ `cid_name` varchar(255) default NULL,
+ `cid_number` varchar(255) default NULL,
+ `in_folder` varchar(255) default NULL,
+ `file_path` varchar(255) default NULL,
+ `flags` varchar(255) default NULL,
+ `read_flags` varchar(255) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `voicemail_email`
+--
+
+DROP TABLE IF EXISTS `voicemail_email`;
+CREATE TABLE `voicemail_email` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `voicemail_id` int(10) unsigned NOT NULL,
+ `param_name` varchar(64) NOT NULL,
+ `param_value` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_profile_param` (`param_name`,`voicemail_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `voicemail_prefs`
+--
+
+DROP TABLE IF EXISTS `voicemail_prefs`;
+CREATE TABLE `voicemail_prefs` (
+ `user` varchar(255) default NULL,
+ `domain` varchar(255) default NULL,
+ `name_path` varchar(255) default NULL,
+ `greeting_path` varchar(255) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `voicemail_settings`
+--
+
+DROP TABLE IF EXISTS `voicemail_settings`;
+CREATE TABLE `voicemail_settings` (
+ `id` int(11) NOT NULL auto_increment,
+ `voicemail_id` int(11) default NULL,
+ `param_name` varchar(255) default NULL,
+ `param_value` varchar(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2008-03-05 1:16:13
1
0
05 Mar '08
Author: mikej
Date: Wed Mar 5 16:12:12 2008
New Revision: 7796
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c
Log:
Wed Mar 5 05:54:15 EST 2008 Pekka.Pessi(a)nokia.com
* soa_static.c: fixed initial SOATAG_ORDERED_USER(1)
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c Wed Mar 5 16:12:12 2008
@@ -822,13 +822,14 @@
continue;
for (i = 0; i < size - 1; i++) {
- if (s_media[i] != NULL)
- continue;
- s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE;
- u2s[j] = i, s2u[i] = j;
+ if (s_media[i] == NULL) {
+ s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE;
+ u2s[j] = i, s2u[i] = j;
+ break;
+ }
}
- assert(i != size);
+ assert(i != size - 1);
}
}
else {
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c Wed Mar 5 16:12:12 2008
@@ -478,7 +478,7 @@
TEST(soa_get_local_sdp(b, NULL, &offer, &offerlen), 1);
TEST_1(offer != NULL && offer != NONE);
TEST_1(!strstr(offer, "a=inactive"));
- printf("offer:\n%s", offer);
+ /* printf("offer:\n%s", offer); */
TEST(soa_set_remote_sdp(a, 0, offer, offerlen), 1);
TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV);
TEST(soa_generate_answer(a, test_completed), 0);
@@ -489,7 +489,7 @@
TEST(soa_get_local_sdp(a, NULL, &answer, &answerlen), 1);
TEST_1(answer != NULL && answer != NONE);
TEST_1(strstr(answer, "a=inactive"));
- printf("answer:\n%s", answer);
+ /* printf("answer:\n%s", answer); */
TEST(soa_set_remote_sdp(b, 0, answer, -1), 1);
TEST(soa_process_answer(b, test_completed), 0);
TEST(soa_activate(b, NULL), 0);
@@ -1372,6 +1372,159 @@
}
+int test_media_replace2(struct context *ctx)
+{
+ BEGIN();
+ int n;
+
+ soa_session_t *a, *b;
+
+ char const *offer = NONE, *answer = NONE;
+ isize_t offerlen = (isize_t)-1, answerlen = (isize_t)-1;
+
+ sdp_session_t const *a_sdp, *b_sdp;
+ sdp_media_t const *m;
+
+ char const a_caps[] =
+ "v=0\r\n"
+ "o=a 432432423423 2 IN IP4 127.0.0.2\r\n"
+ "c=IN IP4 127.0.0.2\r\n"
+ "m=audio 5004 RTP/AVP 0 8\n"
+ "a=rtpmap:96 G7231/8000\n"
+ "a=rtpmap:97 G729/8000\n"
+ "m=image 5556 UDPTL t38\r\n"
+ "a=T38FaxVersion:0\r\n"
+ "a=T38MaxBitRate:9600\r\n"
+ "a=T38FaxFillBitRemoval:0\r\n"
+ "a=T38FaxTranscodingMMR:0\r\n"
+ "a=T38FaxTranscodingJBIG:0\r\n"
+ "a=T38FaxRateManagement:transferredTCF\r\n"
+ "a=T38FaxMaxDatagram:400\r\n";
+
+ char const a_caps2[] =
+ "v=0\r\n"
+ "o=a 432432423423 2 IN IP4 127.0.0.2\r\n"
+ "c=IN IP4 127.0.0.2\r\n"
+ "m=image 5004 UDPTL t38\r\n"
+ "a=T38FaxVersion:0\r\n"
+ "a=T38MaxBitRate:9600\r\n"
+ "a=T38FaxFillBitRemoval:0\r\n"
+ "a=T38FaxTranscodingMMR:0\r\n"
+ "a=T38FaxTranscodingJBIG:0\r\n"
+ "a=T38FaxRateManagement:transferredTCF\r\n"
+ "a=T38FaxMaxDatagram:400\r\n";
+
+ char const b_caps[] =
+ "v=0\r\n"
+ "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
+ "c=IN IP4 127.0.0.2\r\n"
+ "m=audio 5008 RTP/AVP 0 8\r\n"
+ ;
+
+ char const b_caps2[] =
+ "v=0\r\n"
+ "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
+ "c=IN IP4 127.0.0.2\r\n"
+ "m=image 5008 UDPTL t38\r\n"
+ ;
+
+ TEST_1(a = soa_create("static", ctx->root, ctx));
+ TEST_1(b = soa_create("static", ctx->root, ctx));
+
+ TEST_1(soa_set_params(a, SOATAG_ORDERED_USER(1),
+ SOATAG_REUSE_REJECTED(1),
+ TAG_END()) > 0);
+ TEST_1(soa_set_params(b, SOATAG_ORDERED_USER(1),
+ SOATAG_REUSE_REJECTED(1),
+ TAG_END()) > 0);
+
+ TEST(soa_set_user_sdp(a, 0, a_caps, strlen(a_caps)), 1);
+ TEST(soa_set_user_sdp(b, 0, b_caps, strlen(b_caps)), 1);
+
+ n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(a, NULL, &offer, &offerlen); TEST(n, 1);
+ TEST_1(offer != NULL && offer != NONE);
+ n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1);
+ n = soa_get_local_sdp(b, NULL, &answer, &answerlen); TEST(n, 0);
+ n = soa_generate_answer(b, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1);
+ TEST_1(answer != NULL && answer != NONE);
+ n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1);
+ n = soa_process_answer(a, test_completed); TEST(n, 0);
+
+ n = soa_get_local_sdp(a, &a_sdp, NULL, NULL); TEST(n, 1);
+
+ TEST_1(soa_is_complete(b));
+ TEST(soa_activate(b, NULL), 0);
+
+ TEST_1(soa_is_complete(a));
+ TEST(soa_activate(a, NULL), 0);
+
+ TEST(soa_is_audio_active(a), SOA_ACTIVE_SENDRECV);
+ TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV);
+
+ TEST_1(a_sdp->sdp_media);
+ TEST_1(a_sdp->sdp_media->m_type == sdp_media_audio);
+ TEST_1(a_sdp->sdp_media->m_next);
+ TEST_1(a_sdp->sdp_media->m_next->m_type == sdp_media_image);
+
+ /* ---------------------------------------------------------------------- */
+
+ /* Re-O/A: replace media stream */
+
+ /* Accept media without common codecs */
+ TEST_1(soa_set_params(b, SOATAG_RTP_MISMATCH(0),
+ SOATAG_USER_SDP_STR(b_caps2),
+ TAG_END()) > 0);
+
+ n = soa_generate_offer(b, 1, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(b, &b_sdp, &offer, &offerlen); TEST(n, 1);
+ TEST_1(offer != NULL && offer != NONE);
+ n = soa_set_remote_sdp(a, 0, offer, offerlen); TEST(n, 1);
+ /*printf("offer 2:\n%s", offer);*/
+ TEST_1(soa_set_params(a, SOATAG_RTP_MISMATCH(0),
+ SOATAG_USER_SDP_STR(a_caps2),
+ TAG_END()) > 0);
+
+ n = soa_generate_answer(a, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(a, &a_sdp, &answer, &answerlen); TEST(n, 1);
+ TEST_1(answer != NULL && answer != NONE);
+ /*printf("answer 2:\n%s", answer);*/
+ n = soa_set_remote_sdp(b, 0, answer, -1); TEST(n, 1);
+ n = soa_process_answer(b, test_completed); TEST(n, 0);
+ n = soa_get_local_sdp(b, &b_sdp, NULL, NULL); TEST(n, 1);
+
+ TEST_1(soa_is_complete(a));
+ TEST(soa_activate(a, NULL), 0);
+
+ TEST_1(soa_is_complete(b));
+ TEST(soa_activate(b, NULL), 0);
+
+ TEST_1(m = a_sdp->sdp_media); TEST_1(!m->m_rejected);
+ TEST(m->m_type, sdp_media_image);
+ TEST(m->m_proto, sdp_proto_udptl);
+ TEST_1(m->m_format);
+ TEST_S(m->m_format->l_text, "t38");
+
+ TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
+ TEST(m->m_type, sdp_media_image);
+ TEST(m->m_proto, sdp_proto_udptl);
+ TEST_1(m->m_format);
+ TEST_S(m->m_format->l_text, "t38");
+
+ TEST(soa_is_audio_active(a), SOA_ACTIVE_DISABLED);
+ TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_DISABLED);
+
+ TEST_VOID(soa_terminate(a, NULL));
+ TEST_VOID(soa_terminate(b, NULL));
+
+ TEST_VOID(soa_destroy(a));
+ TEST_VOID(soa_destroy(b));
+
+ END();
+}
+
+
int test_asynch_offer_answer(struct context *ctx)
{
BEGIN();
@@ -1568,6 +1721,8 @@
retval |= test_soa_tags(ctx); SINGLE_FAILURE_CHECK();
retval |= test_init(ctx, argv + i); SINGLE_FAILURE_CHECK();
if (retval == 0) {
+ retval |= test_media_replace2(ctx); SINGLE_FAILURE_CHECK();
+
retval |= test_params(ctx); SINGLE_FAILURE_CHECK();
retval |= test_static_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_codec_selection(ctx); SINGLE_FAILURE_CHECK();
1
0
Author: brian
Date: Wed Mar 5 15:57:16 2008
New Revision: 7795
Modified:
freeswitch/trunk/conf/autoload_configs/switch.conf.xml
Log:
add cli bindings
Modified: freeswitch/trunk/conf/autoload_configs/switch.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/switch.conf.xml (original)
+++ freeswitch/trunk/conf/autoload_configs/switch.conf.xml Wed Mar 5 15:57:16 2008
@@ -1,4 +1,20 @@
-<configuration name="switch.conf" description="Modules">
+<configuration name="switch.conf" description="Core Configuration">
+
+ <cli-keybindings>
+ <key name="1" value="help"/>
+ <key name="2" value="status"/>
+ <key name="3" value="show channels"/>
+ <key name="4" value="show calls"/>
+ <key name="5" value="sofia status"/>
+ <key name="6" value="reloadxml"/>
+ <key name="7" value="console loglevel 0"/>
+ <key name="8" value="console loglevel 7"/>
+ <key name="9" value="sofia status profile default"/>
+ <key name="10" value="fsctl pause"/>
+ <key name="11" value="fsctl resume"/>
+ <key name="12" value="version"/>
+ </cli-keybindings>
+
<settings>
<!--Most channels to allow at once -->
<param name="max-sessions" value="1000"/>
1
0
Author: brian
Date: Wed Mar 5 15:46:21 2008
New Revision: 7794
Modified:
freeswitch/trunk/src/switch_console.c
Log:
fix sillyness
Modified: freeswitch/trunk/src/switch_console.c
==============================================================================
--- freeswitch/trunk/src/switch_console.c (original)
+++ freeswitch/trunk/src/switch_console.c Wed Mar 5 15:46:21 2008
@@ -252,7 +252,7 @@
* If a fnkey is configured then process the command
*/
static unsigned char console_fnkey_pressed(int i) {
- char *c;
+ char *c, *cmd;
assert((i > 0) && (i <= 12));
@@ -265,8 +265,10 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "FUNCTION KEY F%d IS NOT BOUND, please edit switch.conf XML file\n", i);
return CC_REDISPLAY;
}
-
- switch_console_process(c);
+
+ cmd = strdup(c);
+ switch_console_process(cmd);
+ free(cmd);
return CC_REDISPLAY;
}
1
0
05 Mar '08
Author: brian
Date: Wed Mar 5 15:31:18 2008
New Revision: 7793
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
Log:
support multiple subscriptions for sla goodies
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Mar 5 15:31:18 2008
@@ -265,8 +265,7 @@
if (session && (tech_pvt->profile->pflags & PFLAG_PRESENCE)) {
char *sql = switch_mprintf("delete from sip_dialogs where call_id='%q'", tech_pvt->call_id);
switch_assert(sql);
- sofia_glue_execute_sql(tech_pvt->profile, SWITCH_FALSE, sql, tech_pvt->profile->ireg_mutex);
- free(sql);
+ sofia_glue_execute_sql(tech_pvt->profile, &sql, SWITCH_TRUE);
}
if (tech_pvt->kick && (a_session = switch_core_session_locate(tech_pvt->kick))) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Wed Mar 5 15:31:18 2008
@@ -88,12 +88,6 @@
#include <sofia-sip/nea.h>
#include <sofia-sip/msg_addr.h>
-typedef struct {
- switch_bool_t master;
- char *sql;
-} sofia_sql_job_t;
-
-
typedef enum {
DTMF_2833,
DTMF_INFO,
@@ -509,7 +503,7 @@
char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]);
-void sofia_glue_execute_sql(sofia_profile_t *profile, switch_bool_t master, char *sql, switch_mutex_t *mutex);
+void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t dyn);
void sofia_glue_actually_execute_sql(sofia_profile_t *profile, switch_bool_t master, char *sql, switch_mutex_t *mutex);
void sofia_reg_check_expire(sofia_profile_t *profile, time_t now);
void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Wed Mar 5 15:31:18 2008
@@ -73,8 +73,7 @@
sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id);
switch_assert(sql != NULL);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
nua_handle_destroy(nh);
}
}
@@ -169,8 +168,7 @@
sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", user, host);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Deleting registration for %s@%s\n", user, host);
- sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
- switch_safe_free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
}
@@ -398,16 +396,13 @@
}
switch_mutex_lock(profile->ireg_mutex);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- switch_safe_free(sql);
-
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
+
sql = switch_mprintf("insert into sip_registrations values ('%q', '%q','%q','%q','Registered', '%q', %ld, '%q')",
call_id, from_user, from_host, contact_str, rpid, expires, user_agent);
if (sql) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- switch_safe_free(sql);
- sql = NULL;
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Propagating registration for %s@%s->%s\n", from_user, from_host, contact_str);
}
switch_mutex_unlock(profile->ireg_mutex);
@@ -424,9 +419,8 @@
sofia_profile_t *profile = (sofia_profile_t *) obj;
uint32_t ireg_loops = 0;
uint32_t gateway_loops = 0;
- void *pop;
- sofia_sql_job_t *job;
int loops = 0;
+ uint32_t qsize;
ireg_loops = IREG_SECONDS;
gateway_loops = GATEWAY_SECONDS;
@@ -435,15 +429,19 @@
switch_queue_create(&profile->sql_queue, 500000, profile->pool);
- while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || switch_queue_size(profile->sql_queue)) {
- while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
- job = (sofia_sql_job_t *) pop;
- sofia_glue_actually_execute_sql(profile, job->master, job->sql, NULL);
- free(job->sql);
- free(job);
- job = NULL;
+ qsize = switch_queue_size(profile->sql_queue);
+
+ while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || qsize) {
+ if (qsize) {
+ void *pop;
+ switch_mutex_lock(profile->ireg_mutex);
+ while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+ sofia_glue_actually_execute_sql(profile, SWITCH_TRUE, (char *) pop, NULL);
+ free(pop);
+ }
+ switch_mutex_unlock(profile->ireg_mutex);
}
-
+
if (++loops >= 100) {
if (++ireg_loops >= IREG_SECONDS) {
sofia_reg_check_expire(profile, switch_timestamp(NULL));
@@ -458,6 +456,7 @@
}
switch_yield(10000);
+ qsize = switch_queue_size(profile->sql_queue);
}
sofia_clear_pflag_locked(profile, PFLAG_WORKER_RUNNING);
@@ -470,13 +469,20 @@
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL;
+ int x = 0;
switch_threadattr_create(&thd_attr, profile->pool);
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_threadattr_priority_increase(thd_attr);
switch_thread_create(&thread, thd_attr, sofia_profile_worker_thread_run, profile, profile->pool);
- switch_yield(1000000);
+
+ while(!sofia_test_pflag(profile, PFLAG_WORKER_RUNNING)) {
+ switch_yield(100000);
+ if (++x >= 100) {
+ break;
+ }
+ }
}
void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj)
@@ -544,6 +550,8 @@
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("dialog")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("call-info")),
+ TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("sla")),
+ TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("include-session-description")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence.winfo")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("message-summary")),
SIPTAG_SUPPORTED_STR("100rel, precondition, timer"), SIPTAG_USER_AGENT_STR(profile->user_agent), TAG_END());
@@ -599,11 +607,12 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Starting thread for %s\n", profile->name);
profile->started = switch_timestamp(NULL);
- switch_yield(1000000);
sofia_set_pflag_locked(profile, PFLAG_RUNNING);
launch_sofia_worker_thread(profile);
+ switch_yield(1000000);
+
while (mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING) && sofia_test_pflag(profile, PFLAG_WORKER_RUNNING)) {
su_root_step(profile->s_root, 1000);
}
@@ -1489,15 +1498,13 @@
switch_assert(sql);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
} else if (status == 200 && (profile->pflags & PFLAG_PRESENCE)) {
char *sql = NULL;
sql = switch_mprintf("update sip_dialogs set state='%s' where uuid='%s';\n", astate, switch_core_session_get_uuid(session));
switch_assert(sql);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
}
}
@@ -2873,8 +2880,7 @@
);
switch_assert(sql);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
return;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Mar 5 15:31:18 2008
@@ -2443,27 +2443,34 @@
}
-void sofia_glue_execute_sql(sofia_profile_t *profile, switch_bool_t master, char *sql, switch_mutex_t *mutex)
+void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t dyn)
{
switch_status_t status = SWITCH_STATUS_FALSE;
- sofia_sql_job_t *job = NULL;
+ char *d_sql = NULL, *sql;
+
+ switch_assert(sqlp && *sqlp);
+ sql = *sqlp;
if (profile->sql_queue) {
- switch_zmalloc(job, sizeof(*job));
+ if (dyn) {
+ d_sql = sql;
+ } else {
+ d_sql = strdup(sql);
+ }
- job->sql = strdup(sql);
- switch_assert(job->sql);
- job->master = master;
-
- status = switch_queue_trypush(profile->sql_queue, job);
+ switch_assert(d_sql);
+ status = switch_queue_trypush(profile->sql_queue, d_sql);
}
- if (status != SWITCH_STATUS_SUCCESS) {
- if (job) {
- free(job->sql);
- free(job);
+ if (status == SWITCH_STATUS_SUCCESS) {
+ if (dyn) {
+ *sqlp = NULL;
+ }
+ } else {
+ if (!dyn) {
+ switch_safe_free(d_sql);
}
- sofia_glue_actually_execute_sql(profile, master, sql, mutex);
+ sofia_glue_actually_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
}
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Wed Mar 5 15:31:18 2008
@@ -461,9 +461,10 @@
if (!switch_strlen_zero((char *)helper.stream.data)) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, helper.stream.data, profile->ireg_mutex);
+ char *ssql = (char *)helper.stream.data;
+ sofia_glue_execute_sql(profile, &ssql, SWITCH_TRUE);
+ helper.stream.data = NULL;
}
- switch_safe_free(helper.stream.data);
}
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
@@ -781,7 +782,7 @@
ct = "application/dialog-info+xml";
}
- if (astate && uuid && helper && helper->stream.data) {
+ if (!switch_strlen_zero(astate) && !switch_strlen_zero(uuid) && helper && helper->stream.data) {
helper->stream.write_function(&helper->stream, "update sip_dialogs set state='%s' where uuid='%s';\n", astate, uuid);
}
@@ -1131,20 +1132,23 @@
exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 3600);
exp = (long) switch_timestamp(NULL) + exp_raw;
- switch_mutex_lock(profile->ireg_mutex);
+ if (sofia_test_pflag(profile, PFLAG_MULTIREG)) {
+ sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id);
+ } else {
+ sql = switch_mprintf("delete from sip_subscriptions where "
+ "proto='%q' and sip_user='%q' and sip_host='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q'",
+ proto,
+ from_user,
+ from_host,
+ to_user,
+ to_host, event
+ );
+ }
- sql = switch_mprintf("delete from sip_subscriptions where "
- "proto='%q' and sip_user='%q' and sip_host='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q'",
- proto,
- from_user,
- from_host,
- to_user,
- to_host, event
- );
+ switch_mutex_lock(profile->ireg_mutex);
switch_assert(sql != NULL);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
if (sub_state == nua_substate_terminated) {
sstr = switch_mprintf("terminated");
@@ -1162,8 +1166,7 @@
contact_str, call_id, full_from, full_via, exp, full_agent, accept);
switch_assert(sql != NULL);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
sstr = switch_mprintf("active;expires=%ld", exp_raw);
if (status < 200) {
@@ -1295,8 +1298,7 @@
if ((sql =
switch_mprintf("update sip_registrations set status='%q',rpid='%q' where sip_user='%q' and sip_host='%q'",
note_txt, rpid, from_user, from_host))) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- switch_safe_free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
event_type = sip_header_as_string(profile->home, (void *) sip->sip_event);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Wed Mar 5 15:31:18 2008
@@ -210,6 +210,7 @@
void sofia_reg_check_expire(sofia_profile_t *profile, time_t now)
{
char sql[1024];
+ char *psql = sql;
#ifdef SWITCH_HAVE_ODBC
if (profile->odbc_dsn) {
@@ -245,19 +246,19 @@
} else {
switch_snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0");
}
- sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
+ sofia_glue_execute_sql(profile, &psql, SWITCH_FALSE);
if (now) {
switch_snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0 and expires <= %ld", (long) now);
} else {
switch_snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0");
}
- sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
+ sofia_glue_execute_sql(profile, &psql, SWITCH_FALSE);
if (now) {
switch_snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0 and expires <= %ld", (long) now);
} else {
switch_snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0");
}
- sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
+ sofia_glue_execute_sql(profile, &psql, SWITCH_FALSE);
if (now) {
switch_snprintf(sql, sizeof(sql), "select * from sip_registrations where status like '%%NATHACK%%'");
@@ -317,13 +318,10 @@
switch_uuid_get(&uuid);
switch_uuid_format(uuid_str, &uuid);
- switch_mutex_lock(profile->ireg_mutex);
sql = switch_mprintf("insert into sip_authentication (nonce, expires) values('%q', %ld)",
uuid_str, switch_timestamp(NULL) + profile->nonce_ttl);
switch_assert(sql != NULL);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- switch_safe_free(sql);
- switch_mutex_unlock(profile->ireg_mutex);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
auth_str =
switch_mprintf("Digest realm=\"%q\", nonce=\"%q\",%s algorithm=MD5, qop=\"auth\"", realm, uuid_str, stale ? " stale=\"true\"," : "");
@@ -521,8 +519,7 @@
sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, to_host);
}
switch_mutex_lock(profile->ireg_mutex);
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- switch_safe_free(sql);
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
sql = switch_mprintf("insert into sip_registrations values ('%q', '%q','%q','%q','%q', '%q', %ld, '%q')", call_id,
to_user, to_host, contact_str, reg_desc,
@@ -530,9 +527,7 @@
if (sql) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
- switch_safe_free(sql);
- sql = NULL;
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
switch_mutex_unlock(profile->ireg_mutex);
@@ -573,29 +568,21 @@
if ((p = strchr(icontact + 4, ':'))) {
*p = '\0';
}
- if ((sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q' and contact like '%%%q%%'", to_user, to_host, icontact))) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- switch_safe_free(sql);
- sql = NULL;
+ if ((sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id))) {
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
if ((sql = switch_mprintf("delete from sip_registrations where call_id='%q'", call_id))) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- switch_safe_free(sql);
- sql = NULL;
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
switch_safe_free(icontact);
} else {
if ((sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, to_host))) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- switch_safe_free(sql);
- sql = NULL;
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
if ((sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, to_host))) {
- sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
- switch_safe_free(sql);
- sql = NULL;
+ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
}
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
@@ -654,19 +641,25 @@
if (!sip || !sip->sip_request || !sip->sip_request->rq_method_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received an invalid packet!\n");
nua_respond(nh, SIP_500_INTERNAL_SERVER_ERROR, TAG_END());
- return;
+ goto end;
}
if (!(sip->sip_contact && sip->sip_contact->m_url)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO CONTACT!\n");
nua_respond(nh, 400, "Missing Contact Header", TAG_END());
- return;
+ goto end;
}
sofia_reg_handle_register(nua, profile, nh, sip, REG_REGISTER, key, sizeof(key), &v_event);
+
if (v_event) {
switch_event_fire(&v_event);
}
+
+ end:
+
+ nua_handle_destroy(nh);
+
}
1
0
[commit] r7792 - freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr
by Freeswitch SVN 05 Mar '08
by Freeswitch SVN 05 Mar '08
05 Mar '08
Author: cparker
Date: Wed Mar 5 11:18:11 2008
New Revision: 7792
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml
Log:
Updated module to handle new radius_deadtime option in radiusclient
Modified: freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c Wed Mar 5 11:18:11 2008
@@ -40,6 +40,7 @@
static char cf[] = "mod_radius_cdr.conf";
static char my_dictionary[PATH_MAX];
+static char * my_deadtime; /* 0 */
static char * my_timeout; /* 5 */
static char * my_retries; /* 3 */
static char my_servers[SERVER_MAX][255];
@@ -58,7 +59,7 @@
rad_config = rc_config_init(rad_config);
if (rad_config == NULL) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "[mod_radius_cdr] Error initializing radius config!\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error initializing radius config!\n");
rc_destroy(rad_config);
return NULL;
}
@@ -66,14 +67,14 @@
/* Some hardcoded ( for now ) defaults needed to initialize radius */
if (rc_add_config(rad_config, "auth_order", "radius", "mod_radius_cdr.c", 0) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "[mod_radius_cdr] failed setting auth_order = radius\n");
+ "setting auth_order = radius failed\n");
rc_destroy(rad_config);
return NULL;
}
if (rc_add_config(rad_config, "seqfile", "/var/run/radius.seq", "mod_radius_cdr.c", 0) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "failed setting seqfile = /var/run/radius.seq\n");
+ "setting seqfile = /var/run/radius.seq failed\n");
rc_destroy(rad_config);
return NULL;
}
@@ -96,16 +97,23 @@
return NULL;
}
+ if (rc_add_config(rad_config, "radius_deadtime", my_deadtime, cf, 0) != 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+ "setting radius_deadtime = %s failed\n", my_deadtime);
+ rc_destroy(rad_config);
+ return NULL;
+ }
+
if (rc_add_config(rad_config, "radius_timeout", my_timeout, cf, 0) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "failed setting radius_timeout = %s failed\n", my_timeout);
+ "setting radius_timeout = %s failed\n", my_timeout);
rc_destroy(rad_config);
return NULL;
}
if (rc_add_config(rad_config, "radius_retries", my_retries, cf, 0) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "failed setting radius_retries = %s failed\n", my_retries);
+ "setting radius_retries = %s failed\n", my_retries);
rc_destroy(rad_config);
return NULL;
}
@@ -113,7 +121,7 @@
/* Read the dictionary file(s) */
if (rc_read_dictionary(rad_config, rc_conf_str(rad_config, "dictionary")) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "failed reading dictionary file(s): %s\n", my_dictionary);
+ "reading dictionary file(s): %s\n", my_dictionary);
rc_destroy(rad_config);
return NULL;
}
Modified: freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml Wed Mar 5 11:18:11 2008
@@ -6,6 +6,18 @@
<param name="radius_retries" value="3"/>
<!-- number of seconds to wait between retries -->
<param name="radius_timeout" value="5"/>
+
+ <!-- The length of time in seconds that we skip a nonresponsive RADIUS
+ server for transaction requests. Server(s) being in the "dead" state
+ are tried only after all other non-dead servers have been tried and
+ failed or timeouted. The deadtime interval starts when the server
+ does not respond to an authentication/accounting request transmissions.
+ When the interval expires, the "dead" server would be re-tried again,
+ and if it's still down then it will be considered "dead" for another
+ such interval and so on. This option is no-op if there is only one
+ server in the list. Set to 0 in order to disable the feature. -->
+ <param name="radius_deadtime" value="0"/>
+
<!-- accounting servers, up to 8 allowed -->
<!-- value is "host:port:secret", port is optional -->
<!-- use IP ADDRESSES, not hostnames -->
1
0
Author: brian
Date: Wed Mar 5 10:24:41 2008
New Revision: 7791
Modified:
freeswitch/trunk/conf/sip_profiles/default.xml
Log:
add supress cng to default config for doc.
Modified: freeswitch/trunk/conf/sip_profiles/default.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/default.xml (original)
+++ freeswitch/trunk/conf/sip_profiles/default.xml Wed Mar 5 10:24:41 2008
@@ -75,6 +75,9 @@
<!-- accept any authentication without actually checking (not a good feature for most people) -->
<!-- <param name="accept-blind-auth" value="true"/> -->
+ <!-- supress CNG on this profile or per call with the 'supress_cng' variable -->
+ <!-- <param name="supress-cng" value="true"/> -->
+
<!--TTL for nonce in sip auth-->
<param name="nonce-ttl" value="60"/>
<!--Uncomment if you want to force the outbound leg of a bridge to only offer the codec
1
0