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
January 2008
- 7 participants
- 386 discussions
Author: anthm
Date: Wed Jan 9 19:57:06 2008
New Revision: 7161
Modified:
freeswitch/trunk/src/switch_ivr_bridge.c
Log:
update
Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c (original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c Wed Jan 9 19:57:06 2008
@@ -311,9 +311,8 @@
switch_channel_clear_flag(channel, CF_TRANSFER);
if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
- printf("XXXXXXXXXXXXXXXXXXXOK\n");
switch_channel_set_state(channel, CS_TRANSMIT);
- } else printf("XXXXXXXXXXXXXXXXXXXWTF\n");
+ }
return SWITCH_STATUS_SUCCESS;
}
@@ -386,7 +385,7 @@
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
switch_event_fire(&event);
}
- printf("XXXXXXXXXXXXXXXXXXXBLAH\n");
+
switch_ivr_multi_threaded_bridge(session, other_session, NULL, NULL, NULL);
switch_core_session_rwunlock(other_session);
} else {
1
0
[commit] r7160 - in freeswitch/trunk/src: . include mod/applications/mod_dptools
by Freeswitch SVN 10 Jan '08
by Freeswitch SVN 10 Jan '08
10 Jan '08
Author: anthm
Date: Wed Jan 9 19:45:28 2008
New Revision: 7160
Modified:
freeswitch/trunk/src/include/switch_channel.h
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/switch_ivr_bridge.c
Log:
minor changes
Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h (original)
+++ freeswitch/trunk/src/include/switch_channel.h Wed Jan 9 19:45:28 2008
@@ -470,7 +470,7 @@
SWITCH_DECLARE(char *) switch_channel_build_param_string(switch_channel_t *channel, switch_caller_profile_t *caller_profile, const char *prefix);
SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *channel);
-#define switch_channel_stop_broadcast(_channel) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST)
+#define switch_channel_stop_broadcast(_channel) if (switch_channel_test_flag(_channel, CF_BROADCAST)) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST)
/** @} */
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Wed Jan 9 19:45:28 2008
@@ -95,6 +95,17 @@
}
}
+
+#define eavesdrop_SYNTAX "<uuid>"
+SWITCH_STANDARD_APP(three_way_function)
+{
+ if (switch_strlen_zero(data)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
+ } else {
+ switch_ivr_eavesdrop_session(session, data, ED_MUX_READ | ED_MUX_WRITE);
+ }
+}
+
#define SET_USER_SYNTAX "<user>@<domain>"
SWITCH_STANDARD_APP(set_user_function)
{
@@ -1578,6 +1589,7 @@
SWITCH_ADD_APP(app_interface, "execute_extension", "Execute an extension", "Execute an extension", exe_function, EXE_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "intercept", "intercept", "intercept", intercept_function, INTERCEPT_SYNTAX, SAF_NONE);
SWITCH_ADD_APP(app_interface, "eavesdrop", "eavesdrop on a uuid", "eavesdrop on a uuid", eavesdrop_function, eavesdrop_SYNTAX, SAF_NONE);
+ SWITCH_ADD_APP(app_interface, "three_way", "three way call with a uuid", "three way call with a uuid", three_way_function, eavesdrop_SYNTAX, SAF_NONE);
SWITCH_ADD_APP(app_interface, "set_user", "Set a User", "Set a User", set_user_function, SET_USER_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_NONE);
Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c (original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c Wed Jan 9 19:45:28 2008
@@ -311,8 +311,9 @@
switch_channel_clear_flag(channel, CF_TRANSFER);
if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
+ printf("XXXXXXXXXXXXXXXXXXXOK\n");
switch_channel_set_state(channel, CS_TRANSMIT);
- }
+ } else printf("XXXXXXXXXXXXXXXXXXXWTF\n");
return SWITCH_STATUS_SUCCESS;
}
@@ -322,7 +323,7 @@
switch_channel_t *channel = NULL;
switch_core_session_t *other_session;
const char *other_uuid = NULL;
-
+
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
@@ -385,7 +386,7 @@
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
switch_event_fire(&event);
}
-
+ printf("XXXXXXXXXXXXXXXXXXXBLAH\n");
switch_ivr_multi_threaded_bridge(session, other_session, NULL, NULL, NULL);
switch_core_session_rwunlock(other_session);
} else {
@@ -810,8 +811,8 @@
switch_channel_set_caller_profile(originator_channel, cp);
switch_channel_set_originatee_caller_profile(originator_channel, switch_caller_profile_clone(originator_session, originatee_cp));
- switch_channel_set_flag(originator_channel, CF_BREAK);
- switch_channel_set_flag(originatee_channel, CF_BREAK);
+ switch_channel_stop_broadcast(originator_channel);
+ switch_channel_stop_broadcast(originatee_channel);
switch_channel_set_flag(originator_channel, CF_TRANSFER);
switch_channel_set_flag(originatee_channel, CF_TRANSFER);
1
0
[commit] r7159 - freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql
by Freeswitch SVN 09 Jan '08
by Freeswitch SVN 09 Jan '08
09 Jan '08
Author: intralanman
Date: Wed Jan 9 18:30:25 2008
New Revision: 7159
Added:
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-4.0.sql
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql
Log:
mysql schema to go along with my last commit.... it's not perfect, by far.... need to add some unique keys on some tables, etc
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-4.0.sql
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-4.0.sql Wed Jan 9 18:30:25 2008
@@ -0,0 +1,524 @@
+-- MySQL dump 10.11
+--
+-- Host: localhost Database: freeswitch
+-- ------------------------------------------------------
+-- Server version 5.0.45-community-nt
+/*!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,MYSQL40' */;
+/*!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`)
+) TYPE=InnoDB AUTO_INCREMENT=8;
+
+--
+-- 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` (`conf_group`,`action`)
+) TYPE=InnoDB AUTO_INCREMENT=25;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=13;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=MyISAM AUTO_INCREMENT=112;
+
+--
+-- 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
+) TYPE=InnoDB AUTO_INCREMENT=5;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=3;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=3;
+
+--
+-- 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`)
+) TYPE=MyISAM AUTO_INCREMENT=5;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=10;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=4;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=6;
+
+--
+-- 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`)
+) TYPE=MyISAM AUTO_INCREMENT=6;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=4;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=43;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=4;
+
+--
+-- 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` (`ivr_id`,`digits`)
+) TYPE=InnoDB AUTO_INCREMENT=11;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=MyISAM AUTO_INCREMENT=2;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=52;
+
+--
+-- 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`)
+) TYPE=MyISAM AUTO_INCREMENT=15;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=5;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=3;
+
+--
+-- 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`)
+) TYPE=InnoDB;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=15;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=35;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=3;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=4;
+
+--
+-- 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
+) TYPE=MyISAM;
+
+--
+-- 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`)
+) TYPE=InnoDB AUTO_INCREMENT=31;
+/*!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 */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2008-01-09 23:26:19
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0.sql Wed Jan 9 18:30:25 2008
@@ -0,0 +1,532 @@
+-- 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
1
0
[commit] r7158 - in freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl: . configuration
by Freeswitch SVN 09 Jan '08
by Freeswitch SVN 09 Jan '08
09 Jan '08
Author: intralanman
Date: Wed Jan 9 18:15:19 2008
New Revision: 7158
Added:
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/conference.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/console.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/dingaling.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/iax.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/ivr.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/limit.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/local_stream.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/rss.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/sofia.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/spidermonkey.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php
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/fs_directory.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php
freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php
Log:
Initial check-in of fs_curl stuff.... this will pull configurations for the modules, directory, dialplan, and eventually take xml_cdr POSTs
the dialplan_importer will take a current xml file and import it to the db so that it's correctly returned as xml in the webpage exactly the same way it went in [ideally]
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/conference.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/conference.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,185 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * conference.conf.php
+ */
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Write XML for conference.conf
+*/
+class conference_conf extends fs_configuration {
+ /**
+ * Initializer method
+ * This method calls fs_configuration to initialize all of the
+ * objects and variables that we want to inherit
+ * @return void
+ */
+ public function conference_conf() {
+ $this -> fs_configuration();
+ }
+
+ /**
+ * Main sub-routine
+ * This method will call all of the other methods necessary
+ * to write out the XML for the conference.conf
+ * @return void
+ */
+ public function main() {
+ $this -> write_advertises();
+ $this -> write_controls();
+ $this -> write_profiles();
+ }
+
+ /**
+ * Write XML for <advertises>
+ * This method will write the elements and attributes for the
+ * conferences that are to be advertised
+ * @return void
+ */
+ private function write_advertises() {
+ $query = "SELECT * FROM conference_advertise ORDER BY room";
+ $advertises = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ if (MDB2::isError($advertises)) {
+ $this -> comment($query);
+ $this -> comment($advertises -> getMessage());
+ return ;
+ }
+ $advertise_count = count($advertises);
+ if ($advertise_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('advertise');
+ for ($i=0; $i<$advertise_count; $i++) {
+ //$this -> comment_array($advertises[$i]);
+ $this -> xmlw -> startElement('room');
+ $this -> xmlw -> writeAttribute('name', $advertises[$i]['room']);
+ $this -> xmlw -> writeAttribute('status', $advertises[$i]['status']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+
+
+ /**
+ * Pull conference profiles from the database
+ * This method will pull the conference profiles
+ * from the database using the PEAR MDB2 extension
+ * @return array
+ */
+ private function get_profiles_array() {
+ $query = sprintf('%s %s;'
+ , "SELECT * FROM conference_profiles"
+ , "ORDER BY profile_name"
+ );
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ return array();
+ }
+ while ($row = $res -> fetchRow()) {
+ $pn = $row['profile_name'];
+ $profiles[$pn][] = $row;
+ }
+ return $profiles;
+ }
+
+ /**
+ * Write XML for <profiles>
+ * This method will write the XML of the array
+ * from get_profiles_array
+ * @return void
+ */
+ private function write_profiles() {
+ $profiles_array = $this -> get_profiles_array();
+ $profiles_count = count($profiles_array);
+ if ($profiles_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('profiles');
+
+ foreach ($profiles_array as $profile_name => $profile_data) {
+ $this -> xmlw -> startElement('profile');
+ $this -> xmlw -> writeAttribute('name', $profile_name);
+ foreach ($profile_data as $params) {
+ //$this -> comment_array($profiles_array[$i]);
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $params['param_name']);
+ $this -> xmlw -> writeAttribute('value', $params['param_value']);
+ $this -> xmlw -> endElement();//</param>
+
+ }
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Pull caller-controls from database via MDB2
+ * This method will pull the conference caller-controls from
+ * the database using the PEAR MDB2 extension
+ * @return array
+ */
+ private function get_controls_array() {
+ $query = sprintf(
+ "SELECT * FROM conference_controls ORDER BY conf_group"
+ );
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ return array();
+ }
+ while ($row = $res -> fetchRow()) {
+ $cg = $row['conf_group'];
+ $profiles[$cg][] = $row;
+ }
+ return $profiles;
+ }
+
+ /**
+ * Write XML for <caller-controls>
+ * This method will write the XML of the array
+ * from get_controls_array
+ * @return void
+ */
+ private function write_controls() {
+ $controls_array = $this -> get_controls_array();
+ $controls_count = count($controls_array);
+ if (MDB2::isError($controls_array)) {
+ $this -> comment($query);
+ $this -> comment($controls_array -> getMessage());
+ return ;
+ }
+ if ($controls_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('caller-controls');
+
+ foreach ($controls_array as $group_name => $control_data) {
+ $this -> xmlw -> startElement('group');
+ $this -> xmlw -> writeAttribute('name', $group_name);
+ foreach ($control_data as $controls) {
+
+ //$this -> comment_array($controls_array[$i]);
+ $this -> xmlw -> startElement('control');
+ $this -> xmlw -> writeAttribute('action', $controls['action']);
+ $this -> xmlw -> writeAttribute('digits', $controls['digits']);
+ $this -> xmlw -> endElement();
+
+ }
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/console.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/console.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * console.conf.php
+ */
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * @todo make this configurable via db rather than hardcoded.
+ * File containing the base class for all curl XML output
+*/
+class console_conf extends fs_configuration {
+ function console_conf() {
+ $this -> fs_configuration();
+ }
+
+ /**
+ * Currently this method does pretty much everything
+ */
+ function main() {
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'Console configuration');
+
+ $this -> xmlw -> startElement('settings');
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', 'colorize');
+ $this -> xmlw -> writeAttribute('value', 'true');
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+
+ $this -> xmlw -> startElement('mappings');
+ $this -> xmlw -> startElement('map');
+ $this -> xmlw -> writeAttribute('name', 'all');
+ $this -> xmlw -> writeAttribute('value', 'notice,warning,error,crit,alert');
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+
+ $this -> xmlw -> endElement();
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/dingaling.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/dingaling.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,142 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * dingaling.conf.php
+ */
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Write XML for dingaling.conf
+*/
+class dingaling_conf extends fs_configuration {
+ /**
+ * Initializer method
+ * This method calls fs_configuration to initialize all of the
+ * objects and variables that we want to inherit
+ * @return void
+ */
+ public function dingaling_conf() {
+ $this -> fs_configuration();
+ }
+
+ /**
+ * Main sub-routine
+ * This method will call all of the other methods necessary
+ * to write out the XML for the dingaling.conf
+ * @return void
+ */
+ public function main() {
+ $this -> write_settings();
+ $this -> write_profiles();
+ }
+
+ /**
+ * Pull dingaling profiles from the database
+ * @return array
+ */
+ private function get_params_array() {
+ $query = sprintf('%s %s;'
+ , "SELECT * FROM dingaling_profile_params"
+ , "ORDER BY dingaling_id"
+ );
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ return array();
+ }
+ while ($row = $res -> fetchRow()) {
+ $id = $row['dingaling_id'];
+ $profiles[$id][] = $row;
+ }
+ return $profiles;
+ }
+
+ /**
+ * get dingaling profile names, types, and ids
+ * @return array
+ */
+ private function get_profile_array() {
+ $query = sprintf('SELECT * FROM dingaling_profiles');
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ while ($row = $res -> fetchRow()) {
+ $id = $row['id'];
+ $profiles[$id] = $row['type'];
+ }
+ return $profiles;
+ }
+
+
+ /**
+ * Write XML for <profile>s
+ * This method will write the XML of the array
+ * from get_profiles_array
+ * @return void
+ */
+ private function write_profiles() {
+ $profile_array = $this -> get_profile_array();
+ $params_array = $this -> get_params_array();
+ $params_count = count($params_array);
+ if ($params_count < 1) {
+ return ;
+ }
+ while (list($id, $type) = each($profile_array)) {
+ $this -> xmlw -> startElement('profile');
+ $this -> xmlw -> writeAttribute('type', $type);
+ if (!empty($params_array[$id])) {
+ $this_param_count = count($params_array[$id]);
+ for ($i=0; $i<$this_param_count; $i++) {
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute(
+ 'name', $params_array[$id][$i]['param_name']
+ );
+ $this -> xmlw -> writeAttribute(
+ 'value', $params_array[$id][$i]['param_value']
+ );
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> xmlw -> endElement();
+ }
+ }
+ }
+
+
+ /**
+ * Write out the XML for the dingaling <settings>
+ *@return void
+ */
+ private function write_settings() {
+ $query = sprintf('SELECT * FROM dingaling_settings');
+ $res = $this -> db -> queryAll($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ $setting_count = count($res);
+ if ($setting_count > 0) {
+ $this -> xmlw -> startElement('settings');
+ for ($i=0; $i<$setting_count; $i++) {
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $res[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $res[$i]['param_value']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/iax.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/iax.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,172 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * iax.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * @todo add gateways, aliases, etc when support is added into FS
+ * Class to write XML for iax.conf
+*/
+class iax_conf extends fs_configuration {
+ public function iax_conf() {
+ $this -> fs_configuration();
+ }
+
+ public function main() {
+ $profiles = $this -> get_profiles();
+ $this -> write_config($profiles);
+ }
+
+ private function get_profiles() {
+ $query = "SELECT * FROM iax_conf ORDER BY id LIMIT 1";
+ $profiles = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ return $profiles;
+ }
+
+ private function write_aliases($profile_id) {
+ $query = "SELECT * FROM iax_aliases WHERE iax_id=$profile_id ";
+ $aliases_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $aliases_count = count($aliases_array);
+ if (MDB2::isError($aliases_array)) {
+ $this -> comment($query);
+ $this -> comment($aliases_array -> getMessage());
+ return ;
+ }
+ if ($aliases_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('aliases');
+
+ for ($i=0; $i<$aliases_count; $i++) {
+ //$this -> comment_array($aliases_array[$i]);
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $aliases_array[$i]['alias_name']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ private function write_settings($profile_id) {
+ $query = "SELECT * FROM iax_settings WHERE iax_id=$profile_id "
+ . "ORDER BY iax_id, param_name";
+ $settings_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $settings_count = count($settings_array);
+ if (MDB2::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($settings_array -> getMessage());
+ return ;
+ }
+ if ($settings_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('settings');
+
+ for ($i=0; $i<$settings_count; $i++) {
+ //$this -> comment_array($settings_array[$i]);
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ private function write_gateways($profile_id) {
+ $query = "SELECT * FROM iax_gateways WHERE iax_id=$profile_id "
+ . "ORDER BY gateway_name, gateway_param";
+ $gateway_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $gateway_count = count($gateway_array);
+ //$this -> comment_array($gateway_array);
+ if (MDB2::isError($gateway_array)) {
+ $this -> comment($query);
+ $this -> comment($gateway_array -> getMessage());
+ return ;
+ }
+ if ($gateway_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('gateways');
+ for ($i=0; $i<$gateway_count; $i++) {
+ $this_gateway = $gateway_array[$i]['gateway_name'];
+ if ($this_gateway != $gateway_array[$i-1]['gateway_name']) {
+ $this -> xmlw -> startElement('gateway');
+ $this -> xmlw -> writeAttribute('name', $this_gateway);
+ }
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $gateway_array[$i]['gateway_param']);
+ $this -> xmlw -> writeAttribute('value', $gateway_array[$i]['gateway_value']);
+ $this -> xmlw -> endElement();
+ if (!array_key_exists($i+1, $gateway_array)
+ || $this_gateway != $gateway_array[$i+1]['gateway_name']) {
+ $this -> xmlw -> endElement();
+ }
+ $last_gateway = $this_gateway;
+ }
+ $this -> xmlw -> endElement(); //</gateways>
+ }
+
+ private function write_domains($profile_id) {
+ $query = "SELECT * FROM iax_domains WHERE iax_id=$profile_id";
+ $domain_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $domain_count = count($domain_array);
+ if (MDB2::isError($domain_array)) {
+ $this -> comment($query);
+ $this -> comment($domain_array -> getMessage());
+ return ;
+ }
+ if ($domain_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('domains');
+ for ($i=0; $i<$domain_count; $i++) {
+ $this -> xmlw -> startElement('domain');
+ $this -> xmlw -> writeAttribute('name', $domain_array[$i]['domain_name']);
+ $this -> xmlw -> writeAttribute(
+ 'parse', ($domain_array[$i]['parse'] == 1 ? 'true' : 'false')
+ );
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ private function write_single_profile($profile) {
+ /* //reserved for multi-profile
+ $this -> xmlw -> startElement('profile');
+ $this -> xmlw -> writeAttribute('name', $profile['profile_name']);
+ */
+ //$this -> write_aliases($profile['id']);
+ //$this -> write_domains($profile['id']);
+ //$this -> write_gateways($profile['id']);
+ $this -> write_settings($profile['id']);
+ //$this -> xmlw -> endElement(); //reserved for multi-profile
+ }
+
+ /**
+ * Write XML for iax.conf profiles
+ *
+ * @param unknown_type $profiles
+ */
+ private function write_config($profiles) {
+ $profile_count = count($profiles);
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'IAX Endpoint');
+ /*
+ $this -> xmlw -> startElement('profiles');
+ //we'll add this back if ever multiple iax profiles are supported
+ */
+ for ($i=0; $i<$profile_count; $i++) {
+ $this -> write_single_profile($profiles[$i]);
+ }
+ //$this -> xmlw -> endElement(); //this too
+ $this -> xmlw -> endElement();
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/ivr.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/ivr.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,117 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * ivr.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Write XML for ivr.conf
+*/
+class ivr_conf extends fs_configuration {
+ public function ivr_conf() {
+ $this -> fs_configuration();
+ }
+
+ /**
+ * This method will run all of the methods necessary to return
+ * the XML for the ivr.conf
+ * @return void
+ */
+ public function main() {
+ $ivrs = $this -> get_ivr_array();
+ $this -> write_config($ivrs);
+ }
+
+ /**
+ * This method will fetch all of the ivr menus from the database
+ * using the MDB2 pear class
+ * @return array
+ */
+ private function get_ivr_array() {
+ $query = "SELECT * FROM ivr_conf";
+ $menus = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ return $menus;
+ }
+
+ /**
+ * This method will write all of the entry elements with
+ * their corresponding attributes
+ * @return void
+ */
+ private function write_entries($ivr_id) {
+ $query = sprintf(
+ "SELECT * FROM ivr_entries WHERE ivr_id=$ivr_id ORDER BY digits"
+ );
+ $entries_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ if (MDB2::isError($entries_array)) {
+ $this -> comment($query);
+ $this -> comment($entries_array -> getMessage());
+ return ;
+ }
+ $entries_count = count($entries_array);
+ if ($entries_count < 1) {
+ return ;
+ }
+ $entries_count = count($entries_array);
+ for ($i=0; $i<$entries_count; $i++) {
+ //$this -> comment_array($entries_array[$i]);
+ $this -> xmlw -> startElement('entry');
+ $this -> xmlw -> writeAttribute('action', $entries_array[$i]['action']);
+ $this -> xmlw -> writeAttribute('digits', $entries_array[$i]['digits']);
+ if (!empty($entries_array[$i]['params'])) {
+ $this -> xmlw -> writeAttribute('params', $entries_array[$i]['params']);
+ }
+ $this -> xmlw -> endElement();//</param>
+ }
+ }
+
+ /**
+ * This method will evaluate the data from the db and
+ * write attributes that need written
+ * @return void
+ */
+ private function write_menu_attributes($menu_data) {
+ $this -> xmlw -> writeAttribute('name', $menu_data['name']);
+ $this -> xmlw -> writeAttribute('greet-long', $menu_data['greet_long']);
+ $this -> xmlw -> writeAttribute('greet-short', $menu_data['greet_short']);
+ $this -> xmlw -> writeAttribute('invalid-sound', $menu_data['invalid_sound']);
+ $this -> xmlw -> writeAttribute('exit-sound', $menu_data['exit_sound']);
+ $this -> xmlw -> writeAttribute('timeout', $menu_data['timeout']);
+ $this -> xmlw -> writeAttribute('max-failures', $menu_data['max_failures']);
+ if (!empty($menu_data['tts_engine'])) {
+ $this -> xmlw -> writeAttribute('tts-engine', $menu_data['tts_engine']);
+ }
+ if (!empty($menu_data['tts_voice'])) {
+ $this -> xmlw -> writeAttribute('tts-voice', $menu_data['tts_voice']);
+ }
+ //$this -> xmlw -> writeAttribute('', $menu_data['']);
+ }
+
+ /**
+ * This method will do the writing of the "menu" elements
+ * and call the write_entries method to do the writing of
+ * individual menu's "entry" elements
+ * @return void
+ */
+ private function write_config($menus) {
+ $menu_count = count($menus);
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'Sofia SIP Endpoint');
+ $this -> xmlw -> startElement('menus');
+ for ($i=0; $i<$menu_count; $i++) {
+ $this -> xmlw -> startElement('menu');
+ $this -> write_menu_attributes($menus[$i]);
+ $this -> write_entries($menus[$i]['id']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/limit.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/limit.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,74 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * limit.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Write XML for limit.conf
+*/
+class limit_conf extends fs_configuration {
+
+ public function limit_conf() {
+ $this -> fs_configuration();
+ }
+
+ public function main() {
+ $params = $this -> get_params_array($this -> db);
+ $this -> write_params_array($params);
+ $this -> output_xml();
+
+ }
+
+ /**
+ * Pull limit params from the db
+ * @return array
+ */
+ private function get_params_array() {
+ $query = sprintf('SELECT * FROM limit_conf;');
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ return array();
+ }
+ $this -> comment($res -> numRows() . 'rows');
+ if ($res -> numRows() == 0) {
+ return array();
+ }
+ while ($row = $res -> fetchRow(MDB2_FETCHMODE_ASSOC)) {
+ $feeds_array[] = $row;
+ }
+ return $feeds_array;
+ }
+
+ /**
+ * Write out the XML of params retreived from get_params_array
+ * @see get_params_array
+ * @param unknown_type $params
+ */
+ private function write_params_array($params) {
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'Call Limiter');
+ $this -> xmlw -> startElement('settings');
+
+ $param_count = count($params);
+ for ($i=0; $i<$param_count; $i++) {
+ $this -> comment("$param_count/$i");
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $params[$i]['name']);
+ $this -> xmlw -> writeAttribute('value', $params[$i]['value']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+
+}
+?>
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/local_stream.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/local_stream.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * local_stream.conf.php
+ */
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Class to write the XML for local_stream.conf
+ */
+class local_stream_conf extends fs_configuration {
+
+ public function local_stream_conf() {
+ $this -> fs_configuration();
+ }
+
+ public function main() {
+ $directories = $this -> get_directories();
+ $this -> write_directories($directories);
+ }
+
+ private function write_settings($profile_id) {
+ $query = sprintf('%s %s %s;'
+ , "SELECT * FROM local_stream_settings "
+ , "WHERE stream_id=$profile_id "
+ , "ORDER BY stream_id, param_name"
+ );
+ $settings_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $settings_count = count($settings_array);
+ if (MDB2::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($settings_array -> getMessage());
+ return ;
+ }
+ if ($settings_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('settings');
+
+ for ($i=0; $i<$settings_count; $i++) {
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> write_email($profile_id);
+ $this -> xmlw -> endElement();
+ }
+
+ private function get_directories() {
+ $query = sprintf('SELECT * FROM local_stream_conf;');
+ $profiles = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ if (MDB2::isError($profiles)) {
+ $this -> comment($query);
+ $this -> comment($profiles -> getMessage());
+ return array();
+ }
+ return $profiles;
+ }
+
+ private function write_directories($directories) {
+ $directory_count = count($directories);
+ for ($i=0; $i<$directory_count; $i++) {
+ $this -> write_settings($directories[$i]);
+ }
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,77 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * post_load_modules.conf.php
+ */
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Class to write the post_load_modules.conf XML for FreeSWITCH
+*/
+class post_load_modules_conf extends fs_configuration {
+
+ public function post_load_modules_conf() {
+ $this -> fs_configuration();
+ }
+
+ public function main() {
+ $params = $this -> get_modules_array($this -> db);
+ $this -> write_modules_array($params);
+ $this -> output_xml();
+
+ }
+
+ /**
+ * This method will pull the postloaded modules from the database
+ * @return array
+ */
+ function get_modules_array() {
+ $query = sprintf(
+ 'SELECT * FROM post_load_modules_conf WHERE load_module=1 ORDER BY priority;'
+ );
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ return array();
+ }
+ $this -> comment($res -> numRows() . 'rows');
+ if ($res -> numRows() == 0) {
+ return array();
+ }
+ while ($row = $res -> fetchRow(MDB2_FETCHMODE_ASSOC)) {
+ $feeds_array[] = $row;
+ }
+ return $feeds_array;
+ }
+
+ /**
+ * This method will write the XML from the array returned by get_modules_array
+ * @see post_load_modules_conf::get_modules_array
+ * @param array $params array of modules to load
+ */
+ function write_modules_array($params) {
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute(
+ 'description', 'Load All External Modules'
+ );
+ $this -> xmlw -> startElement('modules');
+
+ $param_count = count($params);
+ for ($i=0; $i<$param_count; $i++) {
+ $this -> xmlw -> startElement('load');
+ $this -> xmlw -> writeAttribute('module', $params[$i]['module_name']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+
+}
+?>
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/rss.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/rss.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,70 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ *
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * class to write XML for rss.conf
+*/
+class rss_conf extends fs_configuration {
+
+ function rss_conf() {
+ $this -> fs_configuration();
+ }
+
+ function main() {
+ $feeds_array = $this -> get_feeds_array();
+ $this -> xmlw -> startElement('feeds');
+ $this -> xmlw -> endElement();
+ $this -> write_xml($feeds_array);
+ }
+
+ /**
+ * Get RSS feed info from DB
+ *
+ * @return array
+ */
+ function get_feeds_array() {
+ $query = sprintf(
+ 'SELECT * FROM rss_conf ORDER BY priority, local_file;'
+ );
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ return false;
+ }
+ while ($row = $res -> fetchRow(MDB2_FETCHMODE_ASSOC)) {
+ $feeds_array[] = $row;
+ }
+ return $feeds_array;
+ }
+
+ /**
+ * Write XML for RSS feeds that were pulled by get_feeds_arrray
+ * @see get_feeds_array
+ * @param unknown_type $feeds_in
+ */
+ function write_xml($feeds_in) {
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'RSS Parser');
+ $this -> xmlw -> startElement('feeds');
+ $feed_count = count($feeds_in);
+ for ($i=0; $i<$feed_count; $i++) {
+ $this -> xmlw -> startElement('feed');
+ $this -> xmlw -> writeAttribute(
+ 'name', $feeds_in[$i]['description']
+ );
+ $this -> xmlw -> text($feeds_in[$i]['local_file']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/sofia.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/sofia.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,196 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * sofia.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Write XML for sofia.conf
+*/
+class sofia_conf extends fs_configuration {
+ public function sofia_conf() {
+ $this -> fs_configuration();
+ }
+
+ public function main() {
+ $profiles = $this -> get_profiles();
+ $this -> write_config($profiles);
+ }
+
+ /**
+ * Pull the sofia profiles from the db
+ * @return array
+ */
+ private function get_profiles() {
+ $query = "SELECT * FROM sofia_conf";
+ $profiles = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ if (MDB2::isError($profiles)) {
+ $this -> comment($query);
+ $this -> comment($profiles -> getMessage());
+ $this -> file_not_found();
+ }
+ return $profiles;
+ }
+
+ /**
+ * Write aliases for current sofia <profile>
+ * @param integer $profile_id id of the sofia profile in sofia_conf
+ */
+ private function write_aliases($profile_id) {
+ $query = "SELECT * FROM sofia_aliases WHERE sofia_id=$profile_id ";
+ $aliases_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $aliases_count = count($aliases_array);
+ if (MDB2::isError($aliases_array)) {
+ $this -> comment($query);
+ $this -> comment($aliases_array -> getMessage());
+ return ;
+ }
+ if ($aliases_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('aliases');
+
+ for ($i=0; $i<$aliases_count; $i++) {
+ //$this -> comment_array($aliases_array[$i]);
+ $this -> xmlw -> startElement('alias');
+ $this -> xmlw -> writeAttribute('name', $aliases_array[$i]['alias_name']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Write the <settings> for the current profile
+ * @param integer $profile_id id of the sofia profile in sofia_conf
+ */
+ private function write_settings($profile_id) {
+ $query = "SELECT * FROM sofia_settings WHERE sofia_id=$profile_id "
+ . "ORDER BY sofia_id, param_name";
+ $settings_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $settings_count = count($settings_array);
+ if (MDB2::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($settings_array -> getMessage());
+ return ;
+ }
+ if ($settings_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('settings');
+
+ for ($i=0; $i<$settings_count; $i++) {
+ //$this -> comment_array($settings_array[$i]);
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Write <gateways> XML for current profile
+ * @param integer $profile_id id of the sofia profile in sofia_conf
+ */
+ private function write_gateways($profile_id) {
+ $query = "SELECT * FROM sofia_gateways WHERE sofia_id=$profile_id "
+ . "ORDER BY gateway_name, gateway_param";
+ $gateway_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $gateway_count = count($gateway_array);
+ //$this -> comment_array($gateway_array);
+ if (MDB2::isError($gateway_array)) {
+ $this -> comment($query);
+ $this -> comment($gateway_array -> getMessage());
+ return ;
+ }
+ if ($gateway_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('gateways');
+ for ($i=0; $i<$gateway_count; $i++) {
+ $this_gateway = $gateway_array[$i]['gateway_name'];
+ if ($this_gateway != $gateway_array[$i-1]['gateway_name']) {
+ $this -> xmlw -> startElement('gateway');
+ $this -> xmlw -> writeAttribute('name', $this_gateway);
+ }
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $gateway_array[$i]['gateway_param']);
+ $this -> xmlw -> writeAttribute('value', $gateway_array[$i]['gateway_value']);
+ $this -> xmlw -> endElement();
+ if (!array_key_exists($i+1, $gateway_array)
+ || $this_gateway != $gateway_array[$i+1]['gateway_name']) {
+ $this -> xmlw -> endElement();
+ }
+ $last_gateway = $this_gateway;
+ }
+ $this -> xmlw -> endElement(); //</gateways>
+ }
+
+ /**
+ * Write <domains> XML for current sofia profile
+ * @param integer $profile_id id of sofia profile in sofia_conf
+ */
+ private function write_domains($profile_id) {
+ $query = "SELECT * FROM sofia_domains WHERE sofia_id=$profile_id";
+ $domain_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $domain_count = count($domain_array);
+ if (MDB2::isError($domain_array)) {
+ $this -> comment($query);
+ $this -> comment($domain_array -> getMessage());
+ return ;
+ }
+ if ($domain_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('domains');
+ for ($i=0; $i<$domain_count; $i++) {
+ $this -> xmlw -> startElement('domain');
+ $this -> xmlw -> writeAttribute('name', $domain_array[$i]['domain_name']);
+ $this -> xmlw -> writeAttribute(
+ 'parse', ($domain_array[$i]['parse'] == 1 ? 'true' : 'false')
+ );
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Write XML for single sofia profile (including all subsections)
+ * This method opens and closes the <profile> as well as calling
+ * other methods to complete the other subsections of the XML
+ * @param array $profile array of the current profile
+ */
+ private function write_single_profile($profile) {
+ $this -> xmlw -> startElement('profile');
+ $this -> xmlw -> writeAttribute('name', $profile['profile_name']);
+ $this -> write_aliases($profile['id']);
+ $this -> write_domains($profile['id']);
+ $this -> write_gateways($profile['id']);
+ $this -> write_settings($profile['id']);
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Iterate over the profiles and write the corresponding XML via other methods
+ * @param array $profiles multi-dimentional array from get_profiles
+ */
+ private function write_config($profiles) {
+ $profile_count = count($profiles);
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'Sofia SIP Endpoint');
+ $this -> xmlw -> startElement('profiles');
+ for ($i=0; $i<$profile_count; $i++) {
+ $this -> write_single_profile($profiles[$i]);
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/spidermonkey.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/spidermonkey.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,51 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * spidermonkey.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * @todo make configuration get pulled from db? maybe just use defines if there's not evern gonna be too many options
+ * Class for writing spidermonkey.conf XML
+*/
+class spidermonkey_conf extends fs_configuration {
+
+ function spidermonkey_conf() {
+ $this -> fs_configuration();
+ }
+
+ function main() {
+ $params = $this -> get_params();
+ $this -> write_params($params);
+ }
+
+ private function get_params() {
+ return array(
+ 'mod_spidermonkey_teleone',
+ 'mod_spidermonkey_odbc',
+ 'mod_spidermonkey_core_db'
+ );
+ }
+
+ private function write_params($modules) {
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'JavaScript Plug-In Configuration');
+ $this -> xmlw -> startElement('modules');
+ $module_count = count($modules);
+ for ($i=0; $i<$module_count; $i++) {
+ $this -> xmlw -> startElement('load');
+ $this -> xmlw -> writeAttribute('module', $modules[$i]);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * voicemail.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Writes out voicemail.conf XML
+ * @see fs_configuration
+*/
+class voicemail_conf extends fs_configuration {
+
+ public function voicemail_conf() {
+ $this -> fs_configuration();
+ }
+
+ public function main() {
+ $profiles = $this -> get_profiles();
+ $this -> write_config($profiles);
+ }
+
+ /**
+ * Get voicemail profiles from db
+ * @return array
+ */
+ private function get_profiles() {
+ $query = "SELECT * FROM voicemail_conf ORDER BY id";
+ $profiles = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ return $profiles;
+ }
+
+ /**
+ * Write XML for voicemail <settings>
+ * @return void
+ */
+ private function write_settings($profile_id) {
+ $query = sprintf('%s %s %s;'
+ , "SELECT * FROM voicemail_settings "
+ , "WHERE voicemail_id=$profile_id "
+ , "ORDER BY voicemail_id, param_name"
+ );
+ $settings_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $settings_count = count($settings_array);
+ if (MDB2::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($settings_array -> getMessage());
+ return ;
+ }
+ if ($settings_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('settings');
+
+ for ($i=0; $i<$settings_count; $i++) {
+ //$this -> comment_array($settings_array[$i]);
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> write_email($profile_id);
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Write XML for voicemail email settings
+ * @return void
+ */
+ private function write_email($profile_id) {
+ $query = sprintf('%s %s %s;'
+ , "SELECT * FROM voicemail_email "
+ , "WHERE voicemail_id=$profile_id "
+ , "ORDER BY voicemail_id, param_name"
+ );
+ $settings_array = $this -> db -> queryAll($query, null, MDB2_FETCHMODE_ASSOC);
+ $settings_count = count($settings_array);
+ if (MDB2::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($settings_array -> getMessage());
+ return ;
+ }
+ if ($settings_count < 1) {
+ return ;
+ }
+ $this -> xmlw -> startElement('email');
+
+ for ($i=0; $i<$settings_count; $i++) {
+ //$this -> comment_array($settings_array[$i]);
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
+ $this -> xmlw -> endElement();//</param>
+ }
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Write the XML for the current profile in write_profiles
+ * @return void
+ */
+ private function write_single_profile($profile) {
+ $this -> xmlw -> startElement('profile');
+ $this -> xmlw -> writeAttribute('name', $profile['vm_profile']);
+ $this -> write_settings($profile['id']);
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Write the entire XML config for the voicemail module
+ * Write XML by calling other methods to do specific areas of config
+ * @return void
+ */
+ private function write_config($profiles) {
+ $profile_count = count($profiles);
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'voicemail Endpoint');
+ $this -> xmlw -> startElement('profiles');
+ for ($i=0; $i<$profile_count; $i++) {
+ $this -> write_single_profile($profiles[$i]);
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,49 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * xml_cdr.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Class for writing xml_cdr.conf XML
+*/
+class xml_cdr_conf extends fs_configuration {
+ function xml_cdr_conf() {
+ $this -> fs_configuration();
+ }
+
+ function main() {
+ $params = $this -> get_settings();
+ $this -> write_settings($params);
+ }
+
+ function get_settings() {
+ return array('url'=>'http://localhost/fs_curl/index_test.php', 'encode'=>'true');
+ return array(
+ 'url'=>'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']
+ , 'encode'=>'true'
+ );
+ }
+
+ function write_settings($params) {
+ $this -> xmlw -> startElement('configuration');
+ $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
+ $this -> xmlw -> writeAttribute('description', 'CDRs via XML Post');
+ $this -> xmlw -> startElement('settings');
+ while (list($name, $value) = each($params)) {
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $name);
+ $this -> xmlw -> writeAttribute('value', $value);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,147 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Dialplan
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+*/
+
+/**
+ * include MDB2 PEAR Extension
+ */
+require_once('MDB2.php');
+/**
+ * require global definitions for FS_CURL
+ */
+require_once('global_defines.php');
+
+/**
+ * Output the upload form
+ * echo out the HTML for the upload form.
+ * @return null
+*/
+function upload_form() {
+ echo '<html>';
+ echo '<h1>Select A File To Import</h1>';
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data">';
+ echo '<input type="file" name="file">';
+ echo '<input type="submit" name="confirmed">';
+ echo '</form>';
+ echo '</html>';
+}
+
+/**
+ * Perform Insert Query
+ * take MDB2 object and query as params and
+ * perform query, setting error flag in the event
+ * of a db error.
+ * @return null
+*/
+function run_query($db, $query) {
+ $affected = $db -> exec($query);
+ if (MDB2::isError($affected)) {
+ if (!defined('UNSUCCESSFUL_QUERY')) {
+ define('UNSUCCESSFUL_QUERY', true);
+ }
+ echo "$query\n";
+ echo $affected -> getMessage() . "\n";
+ }
+}
+
+/**
+ * Check uploaded file for obvious problems
+ * This function checks the uploaded file's
+ * size, type, length, etc to make sure it's
+ * worth continuing with processing
+ * @return bool
+*/
+function check_uploaded_file($file_array) {
+ if (!is_uploaded_file($file_array['tmp_name'])) {
+ echo "File NOT uploaded OK<br>";
+ die(upload_form());
+ } elseif ($file_array['size'] < 1) {
+ echo "File was empty";
+ die(upload_form());
+ } elseif ($file_array['error'] > 0) {
+ echo "Uploading file encountered error #" . $file_array['error'];
+ die(upload_form());
+ } elseif ($file_array['type'] != 'text/xml') {
+ echo "Expected file of type 'text/xml', but got " . $file_array['type'];
+ die(upload_form());
+ } else {
+ //echo "File seems uploaded OK<br>";
+ return true;
+ }
+}
+
+
+if (!array_key_exists('confirmed', $_REQUEST)) {
+ die(upload_form());
+}
+
+/*
+foreach ($_REQUEST as $key => $val) {
+echo "$key => $val <br>\n";
+}
+if (is_array($_FILES) && count($_FILES)>0) {
+echo "<h2>FILES is an array</h2>";
+print_r($_FILES);
+}
+*/
+
+
+// no need to do anything till we check that the file's ok
+if (check_uploaded_file($_FILES['file'])) {
+ $xml_file = $_FILES['file']['tmp_name'];
+ move_uploaded_file($tmp_file, $xml_file);
+ //echo $xml_file . "\n<br>";
+ $xml_str = sprintf('<?xml version="1.0" encoding="UTF-8" standalone="no"?>%s', file_get_contents($xml_file));
+ //echo $xml_str;
+}
+
+$db = MDB2::connect(DEFAULT_DSN);
+if (MDB2::isError($db)) {
+ echo $db -> getMessage() . "\n";
+}
+
+$xml_obj = new SimpleXMLElement($xml_str);
+foreach ($xml_obj -> context as $context) {
+ $cn = $context['name'];
+ $global_weight = 100;
+ foreach ($context -> extension as $extension) {
+ $en = $extension['name'];
+ $ec = is_numeric($extension['continue']) ? $extension['continue'] : '0';
+ $global_weight+=100;
+ foreach ($extension -> condition as $condition) {
+ //print_r($condition);
+ $cf = $condition['field'];
+ $ce = $condition['expression'];
+ $cc = $condition['continue'];
+ $weight = 0;
+ foreach ($condition as $type => $action) {
+ //echo "-------------------$type-----------------------------\n";
+ $app_name = $action['application'];
+ $app_data = $action['data'];
+ $weight++;
+ //echo "$cn\t$en\t$cf\t$ce\t$cc\t$app_name\t$app_data\t$ec\t$global_weight\t$weight\n";
+ $query = sprintf('%s %s %s %s %s %s;',
+ "INSERT INTO curl_dialplan SET",
+ "context='$cn', extension='$en', condition_field='$cf',",
+ "condition_expression='$ce', application_name='$app_name',",
+ "application_data='$app_data', weight='$weight', type='$type',",
+ "ext_continue='$ec', global_weight='$global_weight',",
+ "condition_continue='$cc'"
+ );
+ run_query($db, $query);
+ }
+ }
+ }
+}
+if (defined(UNSUCCESSFUL_QUERY) && UNSUCCESSFUL_QUERY == true) {
+ echo "<h2>Some Queries Were Not Successful</h2>";
+} else {
+ echo "<h2>File Successfully Imported</h2>";
+}
+upload_form();
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,72 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * fs_configuration.php
+ */
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Class for all module configurations
+ * @return object
+*/
+class fs_configuration extends fs_curl {
+ /**
+ * Class Instantiation
+ * This method will instantiate all other objects upon which it relies.
+ * @return void
+ */
+ function fs_configuration() {
+ $this -> fs_curl();
+ $mod_name = sprintf('mod_%s', str_replace('.conf', '', $this -> request['key_value']));
+ $this -> comment("module name is $mod_name");
+ if (!$this -> is_mod_enabled($mod_name)) {
+ $this -> comment('module not enabled');
+ $this -> file_not_found();
+ }
+ $this -> xmlw -> startElement('section');
+ $this -> xmlw -> writeAttribute('name', 'configuration');
+ $this -> xmlw -> writeAttribute(
+ 'description', 'FreeSWITCH Configuration'
+ );
+ }
+
+ /**
+ * Enabled module checker
+ * This method will check if a module is enabled before
+ * returning the XML for the module. If the module's not
+ * enabled, the file_not_found method will be called.
+ * @param string $mod_name name of module to check
+ * @return bool
+ */
+ function is_mod_enabled($mod_name) {
+ if ($mod_name == 'mod_post_load_modules') {
+ return true;
+ }
+ $query = sprintf('%s %s'
+ , "SELECT * FROM post_load_modules_conf"
+ , "WHERE module_name='$mod_name' AND load_module=1"
+ );
+ $res = $this -> db -> query($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ return true; //default allow policy
+ return false; //comment previous line to default deny
+ $this -> file_not_found();
+ } elseif ($res -> numRows() == 1) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,290 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * fs_curl.php
+ */
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * FreeSWITCH CURL base class
+ * Base class for all curl XML output, contains methods for XML output and
+ * connecting to a database
+ * @return void
+*/
+class fs_curl {
+ /**
+ * MDB2 Object
+ * @link http://pear.php.net/MDB2
+ * @var $db MDB2
+ */
+ public $db;
+ /**
+ * Array of _REQUEST parameters passed
+ *
+ * @var array
+ */
+ public $request;
+ /**
+ * XMLWriter object
+ * @link http://php.net/XMLWriter
+ * @var object
+ */
+ public $xmlw;
+ /**
+ * Array of comments to be output in the XML
+ * @see fs_curl::comment
+ * @var array
+ */
+ private $comments;
+
+ /**
+ * Instantiation of XMLWriter and MDB2
+ * This method will instantiate the MDB2 and XMLWriter classes for use
+ * in child classes
+ * @return void
+ */
+ public function fs_curl() {
+ header('Content-Type: text/xml');
+ $this -> open_xml();
+ $this -> generate_request_array();
+ $inc = array('required'=>'MDB2.php');
+ $this -> include_files($inc);
+ $this -> connect_db(DEFAULT_DSN);
+ set_error_handler(array($this, 'error_handler'));
+ //trigger_error('blah', E_USER_ERROR);
+ }
+
+ /**
+ * Connect to a database via MDB2
+ * @param mixed $dsn data source for database connection (array or string)
+ * @return void
+ */
+ public function connect_db($dsn) {
+ $this -> db = MDB2::connect($dsn);
+ if (MDB2::isError($this -> db)) {
+ $this -> comment($this -> db -> getMessage());
+ $this -> file_not_found();
+ }
+ $this -> db -> setFetchMode(MDB2_FETCHMODE_ASSOC);
+ }
+
+ /**
+ * Method to add comments to XML
+ * Adds a comment to be displayed in the final XML
+ * @param string $comment comment string to be output in XML
+ * @return void
+ */
+ public function comment($comment) {
+ $this -> comments[] = $comment;
+ }
+
+ /**
+ * Generate a globally accesible array of the _REQUEST parameters passed
+ * Generates an array from the _REQUEST parameters that were passed, keeping
+ * all key => value combinations intact
+ * @return void
+ */
+ private function generate_request_array() {
+ while (list($req_key, $req_val) = each($_REQUEST)) {
+ //$this -> comment("$req_key => $req_val");
+ $this -> request[$req_key] = $req_val;
+ }
+ }
+
+ /**
+ * Actual Instantiation of XMLWriter Object
+ * This method creates an XMLWriter Object and sets some needed options
+ * @return void
+ */
+ private function open_xml() {
+ $this -> xmlw = new XMLWriter();
+ $this -> xmlw -> openMemory();
+ $this -> xmlw -> setIndent(true);
+ $this -> xmlw -> setIndentString(' ');
+ $this -> xmlw -> startDocument('1.0', 'UTF-8', 'no');
+ //set the freeswitch document type
+ $this -> xmlw -> startElement('document');
+ $this -> xmlw -> writeAttribute('type', 'freeswitch/xml');
+ }
+
+ /**
+ * Method to call on any error that can not be revovered from
+ * This method was written to return a valid XML response to FreeSWITCH
+ * in the event that we are unable to generate a valid configuration file
+ * from the passed information
+ * @return void
+ */
+ public function file_not_found() {
+ $this -> comment('Include Path = ' . ini_get('include_path'));
+ $not_found = new XMLWriter();
+ $not_found -> openMemory();
+ $not_found -> setIndent(true);
+ $not_found -> setIndentString(' ');
+ $not_found -> startDocument('1.0', 'UTF-8', 'no');
+ //set the freeswitch document type
+ $not_found -> startElement('document');
+ $not_found -> writeAttribute('type', 'freeswitch/xml');
+ $not_found -> startElement('section');
+ $not_found -> writeAttribute('name', 'result');
+ $not_found -> startElement('result');
+ $not_found -> writeAttribute('status', 'not found');
+ $not_found -> endElement();
+ $not_found -> endElement();
+ $not_found -> endElement();
+ $this -> comments2xml($not_found, $this -> comments);
+ echo $not_found -> outputMemory();
+ exit();
+ }
+
+ /**
+ * Generate XML comments from comments array
+ * This [recursive] method will iterate over the passed array, writing XML
+ * comments and calling itself in the event that the "comment" is an array
+ * @param object $xml_obj Already instantiated XMLWriter object
+ * @param array $comments [Multi-dementional] Array of comments to be added
+ * @param integer $space_pad Number of spaces to indent the comments
+ * @return void
+ */
+ private function comments2xml($xml_obj, $comments, $space_pad=0) {
+ $comment_count = count($comments);
+ for ($i = 0; $i < $comment_count; $i++) {
+ if (!is_array($comments[$i])) {
+ $xml_obj -> writeComment($comments[$i]);
+ } else {
+ $this -> comments2xml($xml_obj, $comments[$i], $space_pad + 2);
+ }
+ }
+ }
+
+ /**
+ * End open XML elments in XMLWriter object
+ * @return void
+ */
+ private function close_xml() {
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+
+ /**
+ * Close and Output XML and stop script execution
+ * @return void
+ */
+ public function output_xml() {
+ $this -> close_xml();
+ $comment_count = count($this -> comments);
+ for ($i = 0; $i < $comment_count; $i++) {
+ $this -> xmlw -> writeComment($this -> comments[$i]);
+ }
+ echo $this -> xmlw -> outputMemory();
+ exit();
+ }
+
+ /**
+ * Recursive method to add an array of comments
+ * @return void
+ */
+ public function comment_array($array, $spacepad=0) {
+ $spaces = str_repeat(' ', $spacepad);
+ foreach ($array as $key => $val) {
+ if (is_array($val)) {
+ $this -> comment("$spaces$key => Array");
+ $this -> comment_array($val, $spacepad+2);
+ } else {
+ $this -> comment("$spaces$key => $val");
+ }
+ }
+ }
+
+ /**
+ * Include files for child classes
+ * This method will include the files needed by child classes.
+ * Expects an associative array of type => path
+ * where type = [required|any other string]
+ * @param array $file_array associative array of files to include
+ * @return void
+ * @todo add other types for different levels of errors
+ */
+ public function include_files($file_array) {
+ $return = FS_CURL_SUCCESS;
+ while (list($type, $file) = each($file_array)) {
+ $inc = @include_once($file);
+ if (!$inc) {
+ $comment = sprintf(
+ 'Unable To Include %s File %s', $type, $file
+ );
+ $this -> comment($comment);
+ if ($type == 'required') {
+ $return = FS_CURL_CRITICAL;
+ } else {
+ if ($return != FS_CURL_CRITICAL) {
+ $return = FS_CURL_WARNING;
+ }
+ }
+ }
+ }
+ if ($return == FS_CURL_CRITICAL) {
+ $this -> file_not_found();
+ }
+ return $return;
+ }
+
+ /**
+ * Class-wide error handler
+ * This method should be called whenever there is an error in any child
+ * classes, script execution and returning is pariatlly determined by
+ * defines
+ * @see RETURN_ON_WARN
+ * @return void
+ * @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");
+
+ switch ($no) {
+ case E_USER_NOTICE:
+ case E_NOTICE:
+ break;
+ case E_USER_WARNING:
+ case E_WARNING:
+ if (defined('RETURN_ON_WARN') && RETURN_ON_WARN == true) {
+ break;
+ }
+ case E_ERROR:
+ case E_USER_ERROR:
+ default:
+ $this -> file_not_found();
+ }
+ return true;
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,127 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Dialplan
+ * @todo i should probably add a condition_weight to order the conditions inside a given extension
+ * fs_dialplan.php
+ */
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Dialplan
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Class for XML dialplan
+*/
+class fs_dialplan extends fs_curl {
+ public function fs_dialplan() {
+ $this -> fs_curl();
+ }
+
+ public function main() {
+ $this -> comment($this -> request);
+ $context = $this -> request['context'];
+ $dp_array = $this -> get_dialplan($context);
+ $this -> writeDialplan($dp_array);
+ $this -> output_xml();
+ }
+
+ /**
+ * This method will pull dialplan from database
+ *
+ * @param string $context context name for XML dialplan
+ * @return array
+ */
+ private function get_dialplan($context) {
+ $dp_array = array();
+ $dpQuery = sprintf("%s %s;"
+ , "SELECT * FROM dialplan WHERE context='$context' ORDER BY"
+ , "global_weight, context, extension, weight"
+ );
+ $res = $this -> db -> query($dpQuery);
+ if (MDB2::isError($res)) {
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ $condition_number = 0;
+ while ($row = $res -> fetchRow()) {
+ $ct = $row['context'];
+ $et = $row['extension'];
+ $ec = $row['ext_continue'];
+ $app = $row['application_name'];
+ $data = $row['application_data'];
+ $type = $row['type'];
+ $cf = $row['condition_field'];
+ $ce = $row['condition_expression'];
+ $cc = empty($row['condition_continue']) ? '0' : $row['condition_continue'];
+ $dp_array[$ct]["$et;$ec"]["$cf;$ce;$cc"][] = array(
+ 'type'=>$type,
+ 'application'=>$app,
+ 'data'=>$data
+ );
+ }
+ return $dp_array;
+ }
+
+ /**
+ * 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
+ */
+ private function writeDialplan($dpArray) {
+ //print_r($dpArray);
+ if (is_array($dpArray)) {
+ //$this -> comment('dpArray is an array');
+ foreach ($dpArray as $context => $extensions_array) {
+ //$this -> comment($context);
+ //start the context
+ $this -> xmlw -> startElement('context');
+ $this -> xmlw -> writeAttribute('name', $context);
+ if (is_array($extensions_array)) {
+ foreach ($extensions_array as $extension => $conditions) {
+ //start an extension
+ $ex_split = split(';', $extension);
+ $this -> xmlw -> startElement('extension');
+ $this -> xmlw -> writeAttribute('name', $ex_split[0]);
+ if ($ex_split[1] > 0) {
+ $this -> xmlw -> writeAttribute('continue', $ex_split[1]);
+ }
+ foreach ($conditions as $condition => $app_array) {
+ $c_split = split(';', $condition);
+ $this -> xmlw -> startElement('condition');
+ if (!empty($c_split[0])) {
+ $this -> xmlw -> writeAttribute('field', $c_split[0]);
+ }
+ if (!empty($c_split[1])) {
+ $this -> xmlw -> writeAttribute('expression', $c_split[1]);
+ }
+ //$this -> comment($c_split[2]);
+ if ($c_split[2] != '0') {
+ $this -> xmlw -> writeAttribute('continue', $c_split[2]);
+ }
+ foreach ($app_array as $app) {
+ $this -> xmlw -> startElement($app['type']);
+ $this -> xmlw -> writeAttribute('application', $app['application']);
+ if (!empty($app['data'])) {
+ $this -> xmlw -> writeAttribute('data', $app['data']);
+ }
+ $this -> xmlw -> endElement();
+ }
+ //</condition>
+ $this -> xmlw -> endElement();
+ }
+ // </extension>
+ $this -> xmlw -> endElement();
+ }
+ }
+ // </context>
+ $this -> xmlw -> endElement();
+ }
+ }
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_directory.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/fs_directory.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,214 @@
+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * fs_directory.php
+*/
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Directory
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * Class for XML directory
+*/
+class fs_directory extends fs_curl {
+ public function fs_directory() {
+ $this -> fs_curl();
+ }
+
+ public function main() {
+ $this -> comment($this -> request);
+ $directory_array = $this -> get_directory();
+ $this -> writedirectory($directory_array);
+ $this -> output_xml();
+ }
+
+ /**
+ * This method will pull directory from database
+ * @return array
+ * @todo add GROUP BY to query to make sure we don't get duplicate users
+ */
+ private function get_directory() {
+ $directory_array = array();
+ if (!array_key_exists('domain', $this -> request)) {
+ $this -> comment('domain not passed');
+ $this -> file_not_found();
+ }
+ if (GLOBAL_USERS != true) {
+ $where_array[] = sprintf("domain='%s'", $this -> request['domain']);
+ }
+ if (array_key_exists('user', $this -> request)) {
+ $where_array[] = sprintf("username='%s'", $this -> request['user']);
+ }
+ if (!empty($where_array)) {
+ $this -> comment('where array has contents');
+ if (count($where_array) > 1) {
+ $where_clause = sprintf('WHERE ', implode(' AND ', $where_array));
+ } else {
+ $where_clause = sprintf('WHERE %s', $where_array[0]);
+ }
+ } else {
+ $where_clause = '';
+ }
+ $query = sprintf(
+ "SELECT * FROM directory %s ORDER BY username"
+ , $where_clause
+ );
+ $res = $this -> db -> queryAll($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ return $res;
+ }
+
+ /**
+ * Writes XML for directory user's <params>
+ * This method will pull all of the user params based on the passed user_id
+ * @param integer $user_id
+ * @return void
+ */
+ private function write_params($user_id) {
+ $query = sprintf(
+ "SELECT * FROM directory_params WHERE directory_id='$user_id';"
+ );
+ $res = $this -> db -> queryAll($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($query);
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ $param_count = count($res);
+ if ($param_count > 0) {
+ $this -> xmlw -> startElement('params');
+ for ($i=0; $i<$param_count; $i++) {
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $res[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $res[$i]['param_value']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+ }
+
+ /**
+ * Write all the <variables> for a given user
+ *
+ * @param integer $user_id
+ * @return void
+ */
+ private function write_variables($user_id) {
+ $query = sprintf(
+ "SELECT * FROM directory_vars WHERE directory_id='$user_id';"
+ );
+ $res = $this -> db -> queryAll($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ $var_count = count($res);
+ if ($var_count > 0) {
+ $this -> xmlw -> startElement('variables');
+ for ($i=0; $i<$var_count; $i++) {
+ $this -> xmlw -> startElement('variable');
+ $this -> xmlw -> writeAttribute('name', $res[$i]['var_name']);
+ $this -> xmlw -> writeAttribute('value', $res[$i]['var_value']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+ }
+
+ /**
+ * Write all of the XML for the user's <gateways>
+ * This method takes the id of the user from the directory table and pulls
+ * all of the user's gateways. It then calls write_single_gateway for
+ * each of them to write out all of the params
+ * @param integer $user_id
+ * @return void
+ */
+ private function write_gateways($user_id) {
+ $query = sprintf(
+ "SELECT * FROM directory_gateways WHERE directory_id='$user_id';"
+ );
+ $res = $this -> db -> queryAll($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ $gw_count = count($res);
+ if ($gw_count > 0) {
+ $this -> xmlw -> startElement('gateways');
+ for ($i=0; $i<$gw_count; $i++) {
+ $this -> xmlw -> startElement('gateway');
+ $this -> xmlw -> writeAttribute('name', $res[$i]['gateway_name']);
+ $this -> write_single_gateway($res[$i]['id']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ }
+ }
+
+ /**
+ * Write out the <params> XML for each user-specific gateway
+ *
+ * @param integer $d_gw_id id from directory_gateways
+ * @return void
+ */
+ private function write_single_gateway($d_gw_id) {
+ $query = sprintf(
+ "SELECT * FROM directory_gateway_params WHERE d_gw_id='%s';", $d_gw_id
+ );
+ $res = $this -> db -> queryAll($query);
+ if (MDB2::isError($res)) {
+ $this -> comment($res -> getMessage());
+ $this -> file_not_found();
+ }
+ $param_count = count($res);
+ if ($param_count > 0) {
+ for ($i=0; $i<$param_count; $i++) {
+ $this -> xmlw -> startElement('param');
+ $this -> xmlw -> writeAttribute('name', $res[$i]['param_name']);
+ $this -> xmlw -> writeAttribute('value', $res[$i]['param_value']);
+ $this -> xmlw -> endElement();
+ }
+ }
+ }
+
+ /**
+ * Write XML directory from the array returned by get_directory
+ * @see fs_directory::get_directory
+ * @param array $directory Multi-dimentional array from which we write the XML
+ * @return void
+ */
+ private function writedirectory($directory) {
+ if (empty($directory)) {
+ $this -> comment('no users found');
+ $this -> file_not_found();
+ }
+ $directory_count = count($directory);
+ $this -> xmlw -> startElement('section');
+ $this -> xmlw -> writeAttribute('name', 'directory');
+ $this -> xmlw -> writeAttribute('description', 'FreeSWITCH Dialplan');
+ $this -> xmlw -> startElement('domain');
+ $this -> xmlw -> writeAttribute('name', $this -> request['domain']);
+ for ($i=0; $i<$directory_count; $i++) {
+ $this -> xmlw -> startElement('user');
+ $this -> xmlw -> writeAttribute('id', $directory[$i]['username']);
+ $this -> write_params($directory[$i]['id']);
+ $this -> write_variables($directory[$i]['id']);
+ $this -> write_gateways($directory[$i]['id']);
+ $this -> xmlw -> endElement();
+ }
+ $this -> xmlw -> endElement();
+ $this -> xmlw -> endElement();
+ }
+}
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @package FS_CURL
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ */
+
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+ header('Location: index.php');
+}
+
+/**
+ * Defines the default dsn for the MDB2 PEAR class
+ */
+define('DEFAULT_DSN', 'mysql://freeswitch:Fr33Sw1tch@localhost/freeswitch');
+/**
+ * Generic return success
+ */
+define('FS_CURL_SUCCESS', 0);
+/**
+ * Generic return warning
+ */
+define('FS_CURL_WARNING', 1);
+/**
+ * Generic return critical
+ */
+define('FS_CURL_CRITICAL', 2);
+
+/**
+ * determines how the error handler handles warnings
+ */
+define('RETURN_ON_WARN', true);
+
+/**
+ * Determines whether or not users should be domain specific
+ * If GLOBAL_USERS is true, user info will be returned for whatever
+ * domain is passed.....
+ * NOTE: using a1 hashes will NOT work with this setting
+ */
+define('GLOBAL_USERS', true);
+
+
+
+//define('', '');
+?>
\ No newline at end of file
Added: freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/PHP/fs_curl/index.php Wed Jan 9 18:15:19 2008
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @package FS_CURL
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman(a)gmail.com>
+ * @version 0.1
+ * initial page hit in all curl requests
+ */
+
+/**
+ * Pre-Class initialization die function
+ * This function should be called on any
+ * critical error condition before the fs_curl
+ * class is successfully instantiated.
+ * @return void
+*/
+function file_not_found($no=false, $str=false, $file=false, $line=false) {
+ header('Content-Type: text/xml');
+ $xmlw = new XMLWriter();
+ $xmlw -> openMemory();
+ $xmlw -> setIndent(true);
+ $xmlw -> setIndentString(' ');
+ $xmlw -> startDocument('1.0', 'UTF-8', 'no');
+ //set the freeswitch document type
+ $xmlw -> startElement('document');
+ $xmlw -> writeAttribute('type', 'freeswitch/xml');
+ $xmlw -> startElement('section');
+ $xmlw -> writeAttribute('name', 'result');
+ $xmlw -> startElement('result');
+ $xmlw -> writeAttribute('status', 'not found');
+ $xmlw -> endElement();
+ $xmlw -> endElement();
+ $xmlw -> endElement();
+ echo $xmlw -> outputMemory();
+ exit();
+}
+
+if (!(@include_once('fs_curl.php'))
+|| !(@include_once('global_defines.php'))) {
+ file_not_found();
+}
+$section = $_REQUEST['section'];
+$section_file = sprintf('fs_%s.php', $section);
+/**
+ * this include will differ based on the section that's passed
+ */
+if (!(@include_once($section_file))) {
+ file_not_found();
+}
+switch ($section) {
+ case 'configuration':
+ $config = $_REQUEST['key_value'];
+ $processor = sprintf('configuration/%s.php', $config);
+ $class = str_replace('.', '_', $config);
+ if (!(@include_once($processor))) {
+ file_not_found();
+ exit();
+ }
+ $conf = new $class;
+ $conf -> comment("class name is $class");
+ break;
+ case 'dialplan':
+ $conf = new fs_dialplan();
+ break;
+ case 'directory':
+ $conf = new fs_directory();
+ break;
+}
+$conf -> main();
+$conf -> output_xml();
+?>
\ No newline at end of file
1
0
Author: mikej
Date: Wed Jan 9 15:18:33 2008
New Revision: 7157
Modified:
freeswitch/trunk/src/switch_rtp.c
Log:
fix timestamp base in 2833 when not re-writing timestamps (partial fix for FSCORE-83)
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Wed Jan 9 15:18:33 2008
@@ -848,15 +848,8 @@
rtp_session->dtmf_data.out_digit_packet[0] = (unsigned char) switch_char_to_rfc2833(rdigit->digit);
rtp_session->dtmf_data.out_digit_packet[1] = 7;
- if (rtp_session->timer.timer_interface) {
- rtp_session->dtmf_data.timestamp_dtmf = rtp_session->timer.samplecount + samples;
- } else {
- rtp_session->dtmf_data.timestamp_dtmf = rtp_session->last_write_ts + samples;
- }
-
-
+ rtp_session->dtmf_data.timestamp_dtmf = rtp_session->last_write_ts + samples;
-
rtp_session->seq++;
switch_rtp_write_manual(rtp_session,
rtp_session->dtmf_data.out_digit_packet,
1
0
09 Jan '08
Author: brian
Date: Wed Jan 9 14:40:43 2008
New Revision: 7156
Modified:
freeswitch/trunk/conf/autoload_configs/conference.conf.xml
freeswitch/trunk/conf/lang/en/vm/sounds.xml
Log:
tweak a few things
Modified: freeswitch/trunk/conf/autoload_configs/conference.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/conference.conf.xml (original)
+++ freeswitch/trunk/conf/autoload_configs/conference.conf.xml Wed Jan 9 14:40:43 2008
@@ -52,37 +52,37 @@
<!-- If TTS is enabled all audio-file params beginning with -->
<!-- 'say:' will be considered text to say with TTS -->
<!-- Set a default path here so you can use relative paths in the other sound params-->
- <!--<param name="sound-prefix" value="/soundfiles"/>-->
+ <param name="sound-prefix" value="${base_dir}/en/us/callie"/>
<!-- File to play to acknowledge succees -->
<!--<param name="ack-sound" value="beep.wav"/>-->
<!-- File to play to acknowledge failure -->
<!--<param name="nack-sound" value="beeperr.wav"/>-->
<!-- File to play to acknowledge muted -->
- <!--<param name="muted-sound" value="muted.wav"/>-->
+ <param name="muted-sound" value="conference/conf-muted.wav"/>
<!-- File to play to acknowledge unmuted -->
- <!--<param name="unmuted-sound" value="unmuted.wav"/>-->
+ <param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<!-- File to play if you are alone in the conference -->
- <!--<param name="alone-sound" value="yactopitc.wav"/>-->
+ <param name="alone-sound" value="conference/conf-alone.wav"/>
<!-- File to play endlessly (nobody will ever be able to talk) -->
<!--<param name="perpetual-sound" value="perpetual.wav"/>-->
<!-- File to play when you're alone (music on hold)-->
<param name="moh-sound" value="$${moh_uri}"/>
<!-- File to play when you join the conference -->
- <param name="enter-sound" value="tone_stream://%(1000,0,500)"/>
+ <param name="enter-sound" value="tone_stream://%(500,0,500,600)"/>
<!-- File to play when you leave the conference -->
- <!--<param name="exit-sound" value="exit.wav"/>-->
+ <param name="exit-sound" value="tone_stream://%(500,0,300,200)"/>
<!-- File to play when you ae ejected from the conference -->
- <!--<param name="kicked-sound" value="kicked.wav"/>-->
+ <param name="kicked-sound" value="conference/conf-kicked.wav"/>
<!-- File to play when the conference is locked -->
- <!--<param name="locked-sound" value="locked.wav"/>-->
+ <param name="locked-sound" value="conference/conf-locked.wav"/>
<!-- File to play when the conference is locked during the call-->
- <!--<param name="is-locked-sound" value="is-locked.wav"/>-->
+ <param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<!-- File to play when the conference is unlocked during the call-->
- <!--<param name="is-unlocked-sound" value="is-unlocked.wav"/>-->
+ <param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<!-- File to play to prompt for a pin -->
- <!--<param name="pin-sound" value="pin.wav"/>-->
+ <param name="pin-sound" value="conference/conf-pin.wav"/>
<!-- File to play to when the pin is invalid -->
- <!--<param name="bad-pin-sound" value="invalid-pin.wav"/>-->
+ <param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
<!-- Conference pin -->
<!--<param name="pin" value="12345"/>-->
<!-- Default Caller ID Name for outbound calls -->
Modified: freeswitch/trunk/conf/lang/en/vm/sounds.xml
==============================================================================
--- freeswitch/trunk/conf/lang/en/vm/sounds.xml (original)
+++ freeswitch/trunk/conf/lang/en/vm/sounds.xml Wed Jan 9 14:40:43 2008
@@ -137,7 +137,7 @@
<macro name="voicemail_record_urgent_check">
<input pattern="^([0-9#*]):([0-9#*])$">
<match>
- <action function="play-file" data="voicemail/vm-mark_urgent.wav"/>
+ <action function="play-file" data="voicemail/vm-mark-urgent.wav"/>
<action function="play-file" data="voicemail/vm-press.wav"/>
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
<action function="play-file" data="voicemail/vm-continue.wav"/>
@@ -270,13 +270,13 @@
<input pattern="^(emailed)$">
<match>
<action function="play-file" data="voicemail/vm-message.wav"/>
- <action function="play-file" data="voicemail/vm-saved.wav"/>
+ <action function="play-file" data="voicemail/vm-$1.wav"/>
</match>
</input>
<input pattern="^(marked-urgent)$">
<match>
<action function="play-file" data="voicemail/vm-message.wav"/>
- <action function="play-file" data="voicemail/vm-saved.wav"/>
+ <action function="play-file" data="voicemail/vm-$1.wav"/>
</match>
</input>
</macro>
1
0
Author: brian
Date: Wed Jan 9 14:23:10 2008
New Revision: 7153
Modified:
freeswitch/trunk/conf/autoload_configs/cdr_csv.conf.xml
Log:
log record file for the snom profile this way you know the filename from the CDR that goes with that call
Modified: freeswitch/trunk/conf/autoload_configs/cdr_csv.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/cdr_csv.conf.xml (original)
+++ freeswitch/trunk/conf/autoload_configs/cdr_csv.conf.xml Wed Jan 9 14:23:10 2008
@@ -10,7 +10,7 @@
<templates>
<template name="sql">INSERT INTO cdr VALUES ("${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}");</template>
<template name="example">"${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}","${read_codec}","${write_codec}"</template>
- <template name="snom">"${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}","${read_codec}","${write_codec},"${sip_user_agent}","${call_clientcode}","${sip_rtp_rxstat}","${sip_rtp_txstat}"</template>
+ <template name="snom">"${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}","${read_codec}","${write_codec},"${sip_user_agent}","${call_clientcode}","${sip_rtp_rxstat}","${sip_rtp_txstat}","${sofia_record_file}"</template>
<template name="asterisk">"${accountcode}","${caller_id_number}","${destination_number}","${context}","${caller_id}","${channel_name}","${bridge_channel}","${last_app}","${last_arg}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${amaflags}","${uuid}","${userfield}"</template>
</templates>
</configuration>
1
0
Author: anthm
Date: Wed Jan 9 12:20:05 2008
New Revision: 7150
Modified:
freeswitch/trunk/src/switch_rtp.c
Log:
update
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Wed Jan 9 12:20:05 2008
@@ -839,6 +839,8 @@
if (switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) {
switch_dtmf_t *rdigit = pop;
+ rtp_session->sending_dtmf = 1;
+
memset(rtp_session->dtmf_data.out_digit_packet, 0, 4);
rtp_session->dtmf_data.out_digit_sofar = samples;
rtp_session->dtmf_data.out_digit_dur = rdigit->duration;
@@ -847,12 +849,12 @@
rtp_session->dtmf_data.out_digit_packet[1] = 7;
if (rtp_session->timer.timer_interface) {
- rtp_session->dtmf_data.timestamp_dtmf = rtp_session->timer.samplecount;
+ rtp_session->dtmf_data.timestamp_dtmf = rtp_session->timer.samplecount + samples;
} else {
rtp_session->dtmf_data.timestamp_dtmf = rtp_session->last_write_ts + samples;
}
- rtp_session->sending_dtmf = 1;
+
rtp_session->seq++;
1
0
09 Jan '08
Author: mikej
Date: Wed Jan 9 01:44:16 2008
New Revision: 7149
Modified:
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
Log:
add conference pin/nopin api commands (MODAPP-71)
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Wed Jan 9 01:44:16 2008
@@ -3350,6 +3350,25 @@
return ret_status;
}
+static switch_status_t conf_api_sub_pin(conference_obj_t * conference, switch_stream_handle_t *stream, int argc, char **argv)
+{
+ switch_assert(conference != NULL);
+ switch_assert(stream != NULL);
+
+ if ((argc == 3) && (!strcmp(argv[1], "pin"))) {
+ conference->pin = switch_core_strdup(conference->pool, argv[2]);
+ stream->write_function(stream, "Pin for conference %s set: %s\n", argv[0], conference->pin);
+ return SWITCH_STATUS_SUCCESS;
+ } else if (argc == 2 && (!strcmp(argv[1], "nopin"))) {
+ conference->pin = NULL;
+ stream->write_function(stream, "Pin for conference %s deleted\n", argv[0]);
+ return SWITCH_STATUS_SUCCESS;
+ } else {
+ stream->write_function(stream, "Invalid parameters:\n");
+ return SWITCH_STATUS_GENERR;
+ }
+}
+
typedef enum {
CONF_API_COMMAND_LIST = 0,
CONF_API_COMMAND_ENERGY,
@@ -3412,6 +3431,8 @@
"<confname> transfer <conference_name> <member id> [...<member id>]"},
{"record", (void_fn_t) & conf_api_sub_record, CONF_API_SUB_ARGS_SPLIT, "<confname> record <filename>"},
{"norecord", (void_fn_t) & conf_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, "<confname> norecord <[filename|all]>"},
+ {"pin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "<confname> pin <pin#>"},
+ {"nopin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "<confname> nopin"},
};
#define CONFFUNCAPISIZE (sizeof(conf_api_sub_commands)/sizeof(conf_api_sub_commands[0]))
1
0
Author: anthm
Date: Tue Jan 8 17:30:52 2008
New Revision: 7148
Modified:
freeswitch/trunk/src/switch_rtp.c
Log:
refactor
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Tue Jan 8 17:30:52 2008
@@ -795,7 +795,7 @@
uint32_t samples = rtp_session->samples_per_interval;
if (rtp_session->dtmf_data.out_digit_dur > 0) {
- int x, loops = 1, duration;
+ int x, loops = 1;
rtp_session->dtmf_data.out_digit_sofar += samples;
if (rtp_session->dtmf_data.out_digit_sofar > 0xFFFF) {
@@ -804,16 +804,13 @@
}
if (rtp_session->dtmf_data.out_digit_sofar >= rtp_session->dtmf_data.out_digit_dur) {
- duration = rtp_session->dtmf_data.out_digit_dur;
rtp_session->dtmf_data.out_digit_packet[1] |= 0x80;
rtp_session->dtmf_data.out_digit_dur = 0;
loops = 3;
- } else {
- duration = rtp_session->dtmf_data.out_digit_sofar;
}
-
- rtp_session->dtmf_data.out_digit_packet[2] = (unsigned char) (duration >> 8);
- rtp_session->dtmf_data.out_digit_packet[3] = (unsigned char) duration;
+
+ rtp_session->dtmf_data.out_digit_packet[2] = (unsigned char) (rtp_session->dtmf_data.out_digit_sofar >> 8);
+ rtp_session->dtmf_data.out_digit_packet[3] = (unsigned char) rtp_session->dtmf_data.out_digit_sofar;
for (x = 0; x < loops; x++) {
@@ -826,9 +823,9 @@
rtp_session->te,
rtp_session->dtmf_data.timestamp_dtmf, rtp_session->seq, rtp_session->dtmf_data.out_digit_ssrc,
&flags);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%d sofar=%u dur=%d seq=%d\n",
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%d dur=%d seq=%d\n",
loops == 1 ? "middle" : "end", rtp_session->dtmf_data.out_digit, rtp_session->dtmf_data.timestamp_dtmf,
- rtp_session->dtmf_data.out_digit_sofar, duration, rtp_session->seq);
+ rtp_session->dtmf_data.out_digit_sofar, rtp_session->seq);
}
if (loops != 1) {
@@ -870,11 +867,10 @@
switch_log_printf(SWITCH_CHANNEL_LOG,
SWITCH_LOG_DEBUG,
- "Send start packet for [%c] ts=%d sofar=%u dur=%d seq=%d\n",
+ "Send start packet for [%c] ts=%d dur=%d seq=%d\n",
rtp_session->dtmf_data.out_digit,
rtp_session->dtmf_data.timestamp_dtmf,
rtp_session->dtmf_data.out_digit_sofar,
- 0,
rtp_session->seq);
free(rdigit);
1
0