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
July 2007
- 6 participants
- 55 discussions
[commit] r5527 - freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr
by Freeswitch SVN 11 Jul '07
by Freeswitch SVN 11 Jul '07
11 Jul '07
Author: cparker
Date: Wed Jul 11 14:04:56 2007
New Revision: 5527
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
Log:
UINT4 to uint32_t, so we can be C99 at least
Modified: freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c Wed Jul 11 14:04:56 2007
@@ -30,8 +30,6 @@
*
*/
-#define _BSD_SOURCE 1
-
#include <switch.h>
#include <sys/stat.h>
#include <freeradius-client.h>
@@ -130,8 +128,8 @@
rc_handle *rad_config;
int retval = 0;
VALUE_PAIR *send = NULL;
- UINT4 client_port = 0;
- UINT4 status_type = PW_STATUS_START;
+ uint32_t client_port = 0;
+ uint32_t status_type = PW_STATUS_START;
char *uuid_str;
@@ -249,14 +247,14 @@
rc_handle *rad_config;
int retval = 0;
VALUE_PAIR *send = NULL;
- UINT4 client_port = 0;
- UINT4 status_type = PW_STATUS_STOP;
+ uint32_t client_port = 0;
+ uint32_t status_type = PW_STATUS_STOP;
switch_time_t callstartdate = 0;
switch_time_t callanswerdate = 0;
switch_time_t callenddate = 0;
switch_time_t calltransferdate = 0;
switch_time_t billusec = 0;
- UINT4 billsec = 0;
+ uint32_t billsec = 0;
char *uuid_str;
@@ -375,7 +373,7 @@
}
if (rc_avpair_add(rad_config, &send, PW_FS_BILLUSEC, &billusec, -1, PW_FS_PEC) == NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "failed adding Freeswitch-Billusec: %u\n", (UINT4)billusec);
+ "failed adding Freeswitch-Billusec: %u\n", (uint32_t)billusec);
rc_destroy(rad_config);
return SWITCH_STATUS_TERM;
}
1
0
Author: anthm
Date: Wed Jul 11 12:15:26 2007
New Revision: 5526
Modified:
freeswitch/trunk/src/switch_ivr_originate.c
Log:
tweak
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Wed Jul 11 12:15:26 2007
@@ -373,7 +373,7 @@
fail_on_single_reject = 1;
}
- if (!switch_strlen_zero(file) && !strcmp(file, "undef")) {
+ if ((!switch_strlen_zero(file)) && (!strcmp(file, "undef"))) {
*file = '\0';
}
1
0
10 Jul '07
Author: trixter
Date: Tue Jul 10 05:05:41 2007
New Revision: 5524
Added:
freeswitch/trunk/scripts/contrib/trixter/vile/
freeswitch/trunk/scripts/contrib/trixter/vile/fsconsole.c
Log:
added for vile until he gets his own contrib dir
Added: freeswitch/trunk/scripts/contrib/trixter/vile/fsconsole.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/vile/fsconsole.c Tue Jul 10 05:05:41 2007
@@ -0,0 +1,496 @@
+/*
+ * FreeSWITCH Console
+ */
+
+#include <ctype.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#define closesocket close
+#endif
+
+#ifdef _MSC_VER
+#include <io.h>
+#define write _write
+#else
+#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/errno.h>
+#include <unistd.h>
+#endif
+
+
+#define buflen 4096
+#define NUL '\0'
+
+char *app = "fsconsole";
+
+/* Defaults according to current (12-06-06) freeswitch.xml */
+char *hostname = "localhost";
+char *secret = "ClueCon";
+u_short port = 8021;
+
+/* Debug Level */
+int debug = 0;
+
+char *intro = "Welcome to the FreeSWITCH Console.\n";
+
+char buffer[buflen], *command;
+#ifdef WIN32
+SOCKET sd;
+#else
+int sd;
+#endif
+int flag, prompt, display;
+
+char *trim(char *str);
+void print_tokens(char *line);
+
+
+#ifdef WIN32
+typedef SOCKET socket_t;
+#else
+typedef int socket_t;
+#endif
+
+typedef enum {
+ STATUS_SUCCESS
+} status_t;
+
+static int socket_set_nonblock(socket_t sd)
+{
+#ifdef WIN32
+ u_long argp = 1;
+ if (ioctlsocket(sd, FIONBIO, &argp) == SOCKET_ERROR) {
+ return ((WSAGetLastError() == 0) ? STATUS_SUCCESS : WSAGetLastError());
+ }
+#else
+ flag = fcntl(sd, F_GETFL, 0);
+ flag |= O_NONBLOCK;
+ if (fcntl(sd, F_SETFL, flag) == -1) {
+ return errno;
+ }
+#endif
+ return STATUS_SUCCESS;
+}
+
+unsigned long getaddr(char *host_name)
+{
+ struct hostent *host;
+ unsigned long addr = 0;
+ struct in_addr address;
+
+ if (isalpha(host_name[0])) { /* host address is a name */
+ host = gethostbyname(host_name);
+ if(!host) {
+ return 0;
+ } else {
+ address = *(struct in_addr*)host->h_addr_list[0];
+ addr = address.s_addr;
+ }
+ }
+ else {
+ addr = inet_addr(host_name);
+ }
+
+ return addr;
+}
+
+int main(int argc, char *argv[])
+{
+
+ int len;
+ char contents[4096];
+
+ char whitespace[] = "\r";
+ char *token, *token_split, *subtoken_split;
+ char token_key[32], token_val[32], token_contents[4096], subtoken_contents[4096];
+ char subtoken_key[32], subtoken_val[32];
+
+ struct sockaddr_in sin = {0};
+
+ char cmd[256];
+
+ if (argv[1] && !strcmp(argv[1], "--help")) {
+ fprintf(stderr,"usage %s hostname port secret\n", argv[0]);
+ exit(0);
+ }
+
+ /* Hostname, Port and Secret defined on command line */
+ if (argc > 1) {
+ hostname = argv[1];
+ } else if (argc > 2) {
+ port = (u_short)atoi(argv[2]);
+ } else if (argc > 3) {
+ secret = argv[3];
+ }
+
+ /* Init socket descriptor */
+ sd = socket(AF_INET, SOCK_STREAM, 0);
+
+ /* Put Data intoN sockaddr_in struct */
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ sin.sin_addr.s_addr = getaddr(hostname);
+
+ /* Connect Socket */
+ if (connect(sd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
+ {
+ perror("connecting");
+ exit(1);
+ }
+
+ /* Set Socket Descriptor to Non-Blocking */
+ socket_set_nonblock(sd);
+
+ /* Set the prompt to non-blocking */
+ socket_set_nonblock(0);
+
+ /* Print the Introduction */
+ printf(intro);
+
+ /* First Prompt = No, would show before authentication.... */
+ prompt = 0;
+
+ /* While Program is Running... */
+ for(;;)
+ {
+ /* If Authenticated -- print the current version */
+ if (command)
+ {
+ if(!strcmp(command,"authenticated"))
+ {
+ /* Print the version */
+ printf("\nRunning Version:\n");
+ sprintf(buffer, "api version\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+
+ /* Authentication Complete -- set current command to blank */
+ command = "";
+ }
+ }
+
+ /* Prompt */
+ if (prompt)
+ {
+ printf("\n%s@%s> ", app, hostname);
+ prompt = 0;
+ }
+
+ memset(contents, 0, sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
+ memset(cmd, 0, sizeof(cmd));
+
+ len = atoi(buffer);
+ if (len <= 0) len += buflen;
+ len = recv(sd, buffer, len, 0);
+
+ if (len > 0)
+ {
+ if (debug > 1)
+ printf("Received a response: len %d.\n", len);
+
+ if (debug > 2)
+ display = 1;
+
+ memset(contents, 0, sizeof(contents));
+ strncpy(contents, buffer, len);
+
+ /* Print Incoming input to screen if debug enabled or display is set */
+ if (debug > 0 || display == 1)
+ {
+ write(1,contents,len);
+
+ /* If not debugging, Prevent Display of Response */
+ if (debug < 2)
+ display = 0;
+
+ /* Response received -- Set the prompt */
+ prompt = 1;
+
+
+ }
+
+ /* print_tokens(contents); */
+ for (token=strtok(contents,whitespace); token !=NULL; token=strtok(NULL,whitespace))
+ {
+
+ /* Multiline requires \r, set back to \r
+ to properly execute the display of responses! UNF */
+ strcpy(whitespace, "\r");
+
+ sprintf(token_contents, "%s", token);
+
+ token_split = strtok(token_contents, ":");
+ sprintf(token_key, "%s", token_split);
+ token_split = strtok(NULL, "\n");
+ sprintf(token_val, "%s", token_split);
+ token_split = strtok(NULL, "\n");
+
+ token = strtok(NULL, "\n\n");
+
+ trim(token_val);
+
+ if (debug > 2)
+ printf("\nkey: '%s', val: '%s'\n", token_key, token_val);
+
+ if (strcmp(token_key, "Content-Type") == 0)
+ {
+ display = 1;
+
+ if (strcmp(token_val, "auth/request") == 0)
+ {
+
+ printf("\nAuthenticating...\n");
+
+ command = "auth";
+ sprintf(buffer, "auth %s\n\n", secret);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+
+ /* If not debugging, Prevent Display of Response */
+ if (debug < 2)
+ display = 0;
+
+ } else if (strcmp(token_val, "command/reply") == 0) {
+
+ /* Parse the reply */
+ sprintf(subtoken_contents, "%s", token_split);
+
+ subtoken_split = strtok(subtoken_contents, ":");
+ sprintf(subtoken_key, "%s", subtoken_split);
+ subtoken_split = strtok(NULL, "\n");
+ sprintf(subtoken_val, "%s", subtoken_split);
+ subtoken_split = strtok(NULL, "\n");
+
+ trim(subtoken_val);
+
+ if (debug > 2)
+ printf("subkey: '%s', subval: '%s'\n", subtoken_key, subtoken_val);
+
+ if (strcmp(subtoken_key, "Reply-Text") == 0)
+ {
+ if (strcmp(subtoken_val, "+OK accepted") == 0)
+ {
+ if (strcmp(command, "auth") == 0)
+ {
+ printf("Authentication Successful\n");
+ command = "authenticated";
+
+ /* Auth Command received -- Prompt and Display handled elsewhere */
+ prompt = 0;
+ display = 0;
+
+ /* Authentication required a \r, set back to \n
+ to properly execute the display of responses! */
+ strcpy(whitespace, "\n");
+
+ }
+ } else if (strncmp(subtoken_val, "-", 1) == 0) {
+ /* Received an error, print */
+
+ printf("\n%s\n", subtoken_val);
+ /* Since we received a response, set the prompt */
+ prompt = 1;
+
+ } else if (strncmp(subtoken_val, "+", 1) == 0) {
+ /* Received an uncoded OK, print */
+
+ printf("\n%s\n", subtoken_val);
+ /* Since we received a response, set the prompt */
+ prompt = 1;
+
+ }
+
+ /* || "ts" is a hack -- why? */
+ } else if (strcmp(subtoken_key, "") == 0 || strcmp(subtoken_key, "ts") == 0) {
+ printf("\n%s\n", subtoken_val);
+ /* Since we received a response, set the prompt */
+ prompt = 1;
+ }
+
+ } else if (strcmp(token_val, "api/response") == 0) {
+
+ /* Since we received an api response, display results */
+ if (command && strcmp(command,"authenticated"))
+ {
+ display = 1;
+ }
+
+ }
+ }
+
+ }
+
+ }
+
+ /* Get the command */
+ fgets(cmd, 254, stdin);
+
+ /* Received a Command */
+ if (strlen(cmd))
+ {
+
+ /* Received an Enter Only - Reset Prompt*/
+ if (strcmp(cmd, "\n") == 0) {
+ prompt = 1;
+ }
+
+ /* Drop the \n */
+ cmd[strlen(cmd) - 1] = 0;
+
+ /* If not debugging, Prevent Display of Response */
+ if (debug < 2)
+ display = 0;
+
+ if (strcmp(cmd, "exit") == 0 || strcmp(cmd, "quit") == 0) {
+ printf("Exiting.. goodbye.\n");
+ break;
+ } else if (strncmp(cmd, "event", 5) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strcmp(cmd, "noevents") == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strncmp(cmd, "log", 3) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strcmp(cmd, "nolog") == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strncmp(cmd, "api", 3) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strncmp(cmd, "bgapi", 5) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strncmp(cmd, "sendevent", 9) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strncmp(cmd, "sendmsg", 7) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ sprintf(buffer, "%s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else if (strncmp(cmd, "help", 4) == 0 || strncmp(cmd, "?", 1) == 0) {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+ printf("\n- Console -\n");
+ printf("Valid Commands:\n\n");
+ printf("event [xml|plain] <list of events to log or all for all> - enable or disable events by class or all\n");
+ printf("noevents - disable all events that were previously enabled w/ event\n");
+ printf("nixevent <some_event> - command to allow 'events all' followed by 'nixevent <some_event>' to do all but <some_event>\n");
+ printf("log <level> - enable log output. Levels same as the console.conf values\n");
+ printf("nolog - disable log output previously enabled by the log command\n");
+ printf("api <command> <arg> - send an api command (blocking mode)\n");
+ printf("bgapi <command> <arg> - send an api command (non-blocking mode) this will let you execute a job in the background\n");
+ printf("sendevent <event-name> - send an event into the event system (multi line input for headers)\n");
+ printf("exit - close the fsconsole\n");
+
+ printf("\n- API - ");
+
+ /* Print the additional api commands available from console... */
+ sprintf(buffer, "api help\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+ } else {
+ if (debug > 2)
+ printf("Received Command: %s\n", cmd);
+
+
+ sprintf(buffer, "api %s\n\n", cmd);
+ write((int)sd, buffer, (unsigned int)strlen(buffer));
+
+ printf("\n");
+
+ }
+
+ }
+
+ /* 100% CPU fix */
+ usleep(1);
+
+ }
+
+ closesocket(sd);
+}
+
+char *trim(char *str)
+{
+ char *ibuf = str, *obuf = str;
+ int i = 0, cnt = 0;
+
+ /*
+ ** Trap NULL
+ */
+
+ if (str)
+ {
+ /* Remove leading spaces */
+ for (ibuf = str; *ibuf && isspace(*ibuf); ++ibuf)
+ ;
+ if (str != ibuf)
+ memmove(str, ibuf, ibuf - str);
+
+ /* Collapse embedded spaces */
+
+ while (*ibuf)
+ {
+ if (isspace(*ibuf) && cnt) {
+ ibuf++;
+ } else {
+
+ if (!isspace(*ibuf)) {
+ cnt = 0;
+ } else {
+ *ibuf = ' ';
+ cnt = 1;
+ }
+
+ obuf[i++] = *ibuf++;
+ }
+ }
+
+ obuf[i] = NUL;
+
+ /* Remove trailing spaces */
+ while (--i >= 0)
+ {
+ if (!isspace(obuf[i]))
+ break;
+ }
+
+ obuf[++i] = NUL;
+ }
+
+ return str;
+
+}
+
+
1
0
Author: trixter
Date: Mon Jul 9 21:52:49 2007
New Revision: 5523
Added:
freeswitch/trunk/scripts/contrib/trixter/makecombinedfsxml.pl (contents, props changed)
Log:
makes a combined freeswitch.xml from the individual files to avoid the 'old' formats that are present in the current freeswitch_combined.xml sine that isnt maintained but the individual files are.
Added: freeswitch/trunk/scripts/contrib/trixter/makecombinedfsxml.pl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/makecombinedfsxml.pl Mon Jul 9 21:52:49 2007
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+# -*- mode:cperl; tab-width:4; c-basic-offset:4; c-indent-level:4; indent-tabs-mode:nil; -*-
+
+open (FSXML, "freeswitch.xml") or die "Unable to locate freeswitch.xml - run this in the directory with the conf files";
+
+while ($record = <FSXML>) {
+ if ($record =~ /<!--#include "(.*?)"-->/) {
+ open(CONF, "$1");
+ while (<CONF>) {
+ print $_;
+ }
+ close(CONF);
+ } else {
+ print $record;
+ }
+}
+
+close(FSXML);
1
0
Author: trixter
Date: Sun Jul 8 20:29:02 2007
New Revision: 5518
Modified:
freeswitch/trunk/scripts/contrib/trixter/calls.pl
Log:
reference using DBI instead
Modified: freeswitch/trunk/scripts/contrib/trixter/calls.pl
==============================================================================
--- freeswitch/trunk/scripts/contrib/trixter/calls.pl (original)
+++ freeswitch/trunk/scripts/contrib/trixter/calls.pl Sun Jul 8 20:29:02 2007
@@ -11,6 +11,9 @@
use FreeSWITCH::Client;
use POSIX ':signal_h'; # used for alarm to ensure we get heartbeats
use Data::Dumper; # used to print out myhash debug info
+
+# use DBI instead of these two for direct database inserts/deletes
+# which is likely to be more efficient, this is however just an example
use LWP::UserAgent; # for posting to the webserver
use URI::Escape ('uri_escape'); # to html encode values
1
0
Author: trixter
Date: Sun Jul 8 19:20:03 2007
New Revision: 5517
Added:
freeswitch/trunk/scripts/contrib/trixter/calls.pl (contents, props changed)
Log:
this will relay all call setup/teardown events and conference join/part events to a web server via a post method so you can keep track of who is where on your systems without a bunch of queries to XML-RPC which is wasteful if you have low activity.
Added: freeswitch/trunk/scripts/contrib/trixter/calls.pl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/calls.pl Sun Jul 8 19:20:03 2007
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+# -*- mode:cperl; tab-width:4; c-basic-offset:4; c-indent-level:4; indent-tabs-mode:nil; -*-
+
+#
+# this script will look for call setup/tear down events and conference join/part events and send them
+# to a webserver which can then update a database so you have realtime counts and all of active channels
+# across multiple switches. It also allows you to know who is in without making many XML-RPC calls so you
+# can use XML-RPC to hang up the calls or whatever
+#
+
+use FreeSWITCH::Client;
+use POSIX ':signal_h'; # used for alarm to ensure we get heartbeats
+use Data::Dumper; # used to print out myhash debug info
+use LWP::UserAgent; # for posting to the webserver
+use URI::Escape ('uri_escape'); # to html encode values
+
+
+# configure these
+my $password = "ClueCon"; # the password for event socket
+my $host = "localhost"; # the hostname to connect to
+my $port = 8021; # the port to connect to
+my $timeout = 30; # seconds to expect a heartbeat event or reconnect
+my $url = "http://localhost/activecalls.php"; # the url to post the data to use http://user:pass@host/script for auth credentials
+
+
+##
+# dont touch these
+##
+my $fs;
+my $lastheartbeat;
+my @uuids;
+my $ua = LWP::UserAgent->new;
+$ua->agent("FreeSWITCH/1.0");
+
+
+# this connects to the event socket
+sub es_connect()
+ {
+ print "Connecting to $host:$port\n";
+ eval {
+ $fs = init FreeSWITCH::Client {-password => $password, -host => $host, -port => $port};
+ if(defined $fs) {
+ # channel_create doesnt have the destination number so we wait for the codec event
+ $fs->sendmsg({'command' => 'event plain heartbeat channel_hangup codec CUSTOM conference::maintenence'});
+ $lastheartbeat = time;
+ }
+ } or do {
+ print "Error connecting - waiting for retry\n";
+ }
+
+ }
+
+
+sigaction SIGALRM, new POSIX::SigAction sub {
+ if ($lastheartbeat < (time - $timeout)) {
+ print "Did not receive a heartbeat in the specified timeout\n";
+ if (defined $fs) {
+ $fs->disconnect();
+ undef $fs;
+ }
+ es_connect();
+ }
+
+ # reset the alarm
+ alarm $timeout;
+} or die "Error setting SIGALRM handler: $!\n";
+
+
+
+es_connect();
+alarm $timeout;
+
+while (1) {
+ if(defined $fs) {
+ my $reply = $fs->readhash(undef);
+ if ($reply->{socketerror}) {
+ es_connect();
+ }
+
+ if ($reply->{body}) {
+ $myhash = $reply->{event};
+
+ if ($myhash->{'event-name'} eq "HEARTBEAT") { ## Deal with heartbeats
+ $lastheartbeat = time;
+ print "Got a heartbeat\n";
+
+ } elsif ($myhash->{'event-name'} eq "CODEC") { ## New call setup
+ if(!$uuids->{$myhash->{'unique-id'}}) {
+ print $myhash->{'unique-id'}." has called\n";
+ $uuids->{$myhash->{'unique-id'}}=1;
+ $urlstr="";
+ while ( my ($key, $value) = each(%$myhash) ) {
+ $urlstr .= "&$key=".uri_escape($value);
+ }
+
+ my $req = HTTP::Request->new(POST => $url);
+ $req->content_type('application/x-www-form-urlencoded');
+ $req->content($urlstr);
+ my $res = $ua->request($req);
+ if(!$res->is_success) {
+ print "Error posting NEWCALL to webserver got ".$res->status_line."\n";
+ }
+ }
+ elsif($uuids->{$myhash->{'unique-id'}}==2) {
+ delete $uuids->{$myhash->{'unique-id'}}; # we get a codec event after hangup
+ }
+
+
+
+ } elsif ($myhash->{'event-name'} eq "CHANNEL_HANGUP") { ## hangup event
+ print $myhash->{'unique-id'}." has hung up\n";
+ $uuids->{$myhash->{'unique-id'}}=2; # we do this so that the final codec event can delete it
+ $urlstr="";
+ while ( my ($key, $value) = each(%$myhash) ) {
+ $urlstr .= "&$key=".uri_escape($value);
+ }
+
+ my $req = HTTP::Request->new(POST => $url);
+ $req->content_type('application/x-www-form-urlencoded');
+ $req->content($urlstr);
+ my $res = $ua->request($req);
+ if(!$res->is_success) {
+ print "Error posting HANGUP to webserver got ".$res->status_line."\n";
+ }
+
+
+ } elsif ($myhash->{'event-subclass'} eq "conference::maintenence") { ## deal with Conference stuff
+ if(($myhash->{'action'} eq 'add-member') || ($myhash->{'action'} eq 'del-member')) { ## join/part
+ print $myhash->{'unique-id'} ." ". $myhash->{'action'}." in conference " . $myhash->{'conference-name'}."\n";
+ $urlstr="";
+ while ( my ($key, $value) = each(%$myhash) ) {
+ $urlstr .= "&$key=".uri_escape($value);
+ }
+
+ my $req = HTTP::Request->new(POST => $url);
+ $req->content_type('application/x-www-form-urlencoded');
+ $req->content($urlstr);
+ my $res = $ua->request($req);
+ if(!$res->is_success) {
+ print "Error posting ".$myhash->{'action'}." to webserver got ".$res->status_line."\n";
+ }
+
+ }
+ } else { ## Unknown event
+ print "EVENT NAME: " . $myhash->{'event-name'} . "\n";
+ print Dumper $myhash;
+ # print "$reply->{body}\n"; # print out what was sent, myhash is translated by Client.pm
+ }
+
+ }
+ }
+}
+
1
0
[commit] r5516 - in freeswitch/trunk/scripts/contrib/trixter/xml-curl: modules templates/switch1/dialplan
by Freeswitch SVN 08 Jul '07
by Freeswitch SVN 08 Jul '07
08 Jul '07
Author: trixter
Date: Sun Jul 8 16:03:23 2007
New Revision: 5516
Modified:
freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl
Log:
fxed a problem with the way the dialplans worked - now you can do the same command multiple times in a dialplan
Modified: freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php (original)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php Sun Jul 8 16:03:23 2007
@@ -15,13 +15,11 @@
// we might check a database for the route, but in this example we hardcode it
$template = 'frompstn.tpl'; // one can exist for each profile or channel type or ...
-
- $ACTION['answer']='';
-
- $ACTION['phrase']='spell,abcdef';
-
- $ACTION['javascript']="somethingcool.js";
- $ACTION['bridge']="sofia/external/".$_POST['destination_number']."@myprovider.tld";
+ // simulate a database query for the dialplan
+ $ACTION[]=Array('answer','');
+ $ACTION[]=Array('phrase','spell,abcdef');
+ $ACTION[]=Array('javascript','somethingcool.js');
+ $ACTION[]=Array('bridge','sofia/external/$_POST[destination_number](a)myprovider.tld');
$smarty->assign('ACTION',$ACTION);
} // end - they were logged in
Modified: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl
==============================================================================
--- freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl (original)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl Sun Jul 8 16:03:23 2007
@@ -5,7 +5,7 @@
<extension name="myextension">
<condition field="destination_number" expression="^.*$">
{foreach key=k item=v from=$ACTION}
- <action application="{$k}" data="{$v}"/>
+ <action application="{$v[0]}" data="{$v[1]}"/>
{/foreach}
</condition>
</extension>
1
0
[commit] r5515 - in freeswitch/trunk/scripts/contrib/trixter/xml-curl: . modules templates templates/switch1 templates/switch1/configuration templates/switch1/dialplan templates/switch1/directory templates/switch1/phrases
by Freeswitch SVN 08 Jul '07
by Freeswitch SVN 08 Jul '07
08 Jul '07
Author: trixter
Date: Sat Jul 7 21:59:59 2007
New Revision: 5515
Added:
freeswitch/trunk/scripts/contrib/trixter/xml-curl/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/.htaccess
freeswitch/trunk/scripts/contrib/trixter/xml-curl/.htpasswd
freeswitch/trunk/scripts/contrib/trixter/xml-curl/README
freeswitch/trunk/scripts/contrib/trixter/xml-curl/curlrouting.php
freeswitch/trunk/scripts/contrib/trixter/xml-curl/freeswitch.xml (contents, props changed)
freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/configuration.php
freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php
freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/directory.php
freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/phrases.php
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/alsa.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/conference.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/console.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/default_context.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/dialplan_directory.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/dingaling.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/directory.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/enum.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/event_multicast.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/event_socket.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/freeswitch.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/iax.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/ivr.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/mod_cdr.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/portaudio.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/post_load_modules.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/rss.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/sofia.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/spidermonkey.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/switch.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/syslog.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/wanpipe.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/woomera.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_cdr.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_curl.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_rpc.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xmpp_event.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/zeroconf.conf.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/fail.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/directory/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/directory/192.168.153.128.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/lang_en.tpl
freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/lang_fr.tpl
Log:
see README
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/.htaccess
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/.htaccess Sat Jul 7 21:59:59 2007
@@ -0,0 +1,6 @@
+<files "*">
+AuthUserFile /www/default/htdocs/xml-curl/.htpasswd
+AuthName "TRXTel"
+AuthType basic
+Require valid-user
+</files>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/.htpasswd
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/.htpasswd Sat Jul 7 21:59:59 2007
@@ -0,0 +1 @@
+switch1:X3ebVz1FFcmLc
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/README
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/README Sat Jul 7 21:59:59 2007
@@ -0,0 +1,56 @@
+This is an example that will respond to mod_xml_curl requests for information.
+It uses modules, which are contained in the modules subdirectory. If a module
+(any file ending in .php) is in the dir it will be loaded. If it registers
+to handle a specific type of xml_curl request, that will be passed to the
+function named. If you dont have a module for a specific type of data, for
+example directory, then a 404 will be returned to FreeSWITCH.
+
+The module nature allows you to more easily turn on/off different components.
+
+Its a template based system, which relies on someone authenticating, such as
+with .htaccess. Their username is used in this default example for their
+configuration files. This allows for multiple switches to identify themselves
+uniquely, as well as giving you the ability to have different templates for
+different switches.
+
+
+
+
+
+If you do configuration via mod_xml_curl you only need to load and configure
+mod_xml_curl from freeswitch.xml, all other modules and their configs do not
+need to be present. I do suggest that you load loggers before xml_curl though.
+
+If you load modules *before* loading xml_curl they will be loaded from the
+static xml file, only *after* loading xml_curl will stuff start to be pulled
+from the webserver. Seems logical but some people dont think about it and
+wonder why it doesnt work.
+
+
+
+freeswitch.xml in this repository is a minimal config file, which works as of
+r5500 with what is in this directory.
+
+
+DEFAULT PASSWORDS
+htaccess switch1:password (for webstuff)
+SIP/etc testacct:demopw
+
+you will most likely have to edit the path to .htpasswd in the .htaccess
+file or it wont work properly.
+
+
+PREREQUISITES
+You will need to get smarty from http://smarty.php.net to make this work
+
+If you install it globally, edit your php.ini to make the Smarty/libs dir as
+part of the search path, otherwise add the following to curlrouting.php near
+the other ini_set line. Adjust it to suit your particular setup.
+
+ini_set("include_path",".:/usr/local/lib/php:/usr/share/php:./Smarty-2.6.18/libs");
+
+
+
+You also must create a directory named templates_c where you install this, its
+a smarty requirement for caching templates. This directory *must* be writable
+by the webserver or Smarty will not properly operate.
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/curlrouting.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/curlrouting.php Sat Jul 7 21:59:59 2007
@@ -0,0 +1,31 @@
+<?php // -*- mode:c; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil; -*-
+Header("Content-type: text/plain");
+
+$callBacks = Array();
+ini_set("magic_quotes_gpc","Off");
+include_once('Smarty.class.php');
+
+// load the modules
+$dh = @opendir("./modules") or die("Unable to open modules dir");
+while ($file = readdir($dh)) {
+ if(preg_match("/.*\.php$/i",$file)) {
+ error_log("loading module $file");
+ include_once("modules/$file");
+ }
+}
+
+
+if(isset($_POST['section'])) {
+ error_log("processing $_POST[section]");
+ if(isset($callBacks[$_POST['section']])) {
+ if(call_user_func($callBacks[$_POST['section']])==TRUE) {
+ exit;
+ }
+ }
+}
+error_log("No module to process xml_curl for $_POST[section]");
+Header("HTTP/1.0 404 Not Found");
+echo "Not Found";
+exit;
+
+?>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/freeswitch.xml
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/freeswitch.xml Sat Jul 7 21:59:59 2007
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+
+ <section name="configuration" description="Various Configuration">
+
+ <configuration name="switch.conf" description="Modules">
+ <settings>
+ <!--Most channels to allow at once -->
+ <param name="max-sessions" value="1000"/>
+ <!--RTP port range -->
+ <!--<param name="rtp-start-port" value="16384"/>-->
+ <!--<param name="rtp-end-port" value="32768"/>-->
+ </settings>
+ <!--Any variables defined here will be available in every channel, in the dialplan etc -->
+ <variables>
+ <variable name="uk-ring" value="%(400,200,400,450);%(400,2200,400,450)"/>
+ <variable name="us-ring" value="%(2000, 4000, 440.0, 480.0)"/>
+ <variable name="bong-ring" value="v=4000;>=0;+=2;#(60,0);v=2000;%(940,0,350,440)"/>
+ </variables>
+ </configuration>
+
+ <configuration name="modules.conf" description="Modules">
+ <modules>
+ <!-- Loggers (I'd load these first) -->
+ <load module="mod_console"/>
+ <!-- <load module="mod_syslog"/> -->
+
+ <!-- you need to load this now and everything else comes from curl -->
+ <load module="mod_xml_curl"/>
+ </modules>
+ </configuration>
+
+ <configuration name="console.conf" description="Console Logger">
+ <!-- pick a file name, a function name or 'all' -->
+ <!-- map as many as you need for specific debugging -->
+ <mappings>
+ <!-- <param name="log_event" value="DEBUG"/> -->
+ <param name="all" value="DEBUG"/>
+ </mappings>
+ </configuration>
+
+ <configuration name="syslog.conf" description="Syslog Logger">
+ <!-- SYSLOG -->
+ <!-- emerg - system is unusable -->
+ <!-- alert - action must be taken immediately -->
+ <!-- crit - critical conditions -->
+ <!-- err - error conditions -->
+ <!-- warning - warning conditions -->
+ <!-- notice - normal, but significant, condition -->
+ <!-- info - informational message -->
+ <!-- debug - debug-level message -->
+ <settings>
+ <param name="ident" value="freeswitch"/>
+ <param name="facility" value="user"/>
+ <param name="format" value="${time} - ${message}"/>
+ <param name="level" value="debug,info,warning-alert"/>
+ </settings>
+ </configuration>
+
+ <configuration name="xml_curl.conf" description="cURL XML Gateway">
+ <bindings>
+ <binding name="example">
+ <!-- The url to a gateway cgi that can generate xml similar to
+ what's in this file only on-the-fly (leave it commented if you dont
+ need it) -->
+ <!-- one or more |-delim of configuration|directory|dialplan -->
+ <param name="gateway-url" value="http://localhost/xml-curl/curlrouting.php" bindings="dialplan|directory|configuration|phrases"/>
+ <!-- set this to provide authentication credentials to the server -->
+ <param name="gateway-credentials" value="switch1:password"/>-->
+ </binding>
+ </bindings>
+ </configuration>
+
+ </section>
+
+</document>
+
+
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/configuration.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/configuration.php Sat Jul 7 21:59:59 2007
@@ -0,0 +1,52 @@
+<?php // -*- mode:c; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil; -*-
+function configuration()
+{
+ global $_SERVER;
+ global $_POST;
+
+ $smarty = new Smarty();
+ $template = $_POST['key_value'].".tpl";
+
+ // only stuff that we dynamically set gets done here, if its not here the file is sent as is
+ switch($_POST['key_value']) {
+ case "conference.conf":
+ // simulate data from a database, perhaps a table with 3 columns did,value,args
+ $params['pin'] = '1234';
+ $params['anounce-count'] = '2';
+ $params['max-mmebers'] = '15';
+ $params['energy-level'] = '300';
+ $params['member-flags'] = 'waste';
+
+ $digits['0'] = 'event';
+ $digits['1'] = 'event';
+ $digits['2'] = 'event';
+ $digits['3'] = 'event';
+ $digits['4'] = 'event';
+ $digits['5'] = 'event';
+ $digits['6'] = 'event';
+ $digits['7'] = 'event';
+ $digits['8'] = 'event';
+ $digits['9'] = 'event';
+ $digits['#'] = 'event';
+ $digits['*'] = 'event';
+
+ $smarty->assign('CONFNAME',$_POST['conf_name']);
+ $smarty->assign('digits',$digits);
+ $smarty->assign('params',$params);
+ }
+
+ if($smarty->template_exists($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/configuration/".$template)) {
+ error_log("Issuing configuration $_POST[key_value]");
+ $smarty->display($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/configuration/".$template);
+ } else {
+ error_log("Unable to locate configuration file " . $_POST['key_value'] . " for " . $_SERVER['REMOTE_USER']);
+ error_log("template: " . $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/configuration/" . $template);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+// register the callback
+$callBacks['configuration']='configuration';
+
+?>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/dialplan.php Sat Jul 7 21:59:59 2007
@@ -0,0 +1,37 @@
+<?php // -*- mode:c; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil; -*-
+function dialplan()
+{
+ global $_SERVER;
+ global $_POST;
+
+
+ // create a new smarty object
+ $smarty = new Smarty();
+ $template = 'fail.tpl';
+
+
+ // see if they authenticated via .htaccess
+ if(isset($_SERVER['REMOTE_USER']) && $_SERVER['REMOTE_USER']!="") {
+ // we might check a database for the route, but in this example we hardcode it
+ $template = 'frompstn.tpl'; // one can exist for each profile or channel type or ...
+
+
+ $ACTION['answer']='';
+
+ $ACTION['phrase']='spell,abcdef';
+
+ $ACTION['javascript']="somethingcool.js";
+ $ACTION['bridge']="sofia/external/".$_POST['destination_number']."@myprovider.tld";
+ $smarty->assign('ACTION',$ACTION);
+
+ } // end - they were logged in
+ $smarty->display($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/dialplan/".$template);
+
+ return TRUE;
+}
+
+
+// register the callback
+$callBacks['dialplan']='dialplan';
+
+?>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/directory.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/directory.php Sat Jul 7 21:59:59 2007
@@ -0,0 +1,41 @@
+<?php // -*- mode:c; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil; -*-
+
+/* generally we get the following information
+
+ [section] => directory
+ [tag_name] => domain
+ [key_name] => name
+ [key_value] => 192.168.153.128
+ [user] => testacct
+ [domain] => 192.168.153.128
+ [ip] => 192.168.153.1
+
+*/
+
+function directory()
+{
+ global $_SERVER;
+ global $_POST;
+
+
+ // create a new smarty object
+ $smarty = new Smarty();
+ $template = $_POST['domain'] .'.tpl';
+
+ // simulate a database query
+ $smarty->assign('USER','testacct');
+ $smarty->assign('PASSWORD','demopw');
+ $smarty->assign('DOMAIN',$_POST['domain']);
+
+
+ $smarty->display($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/directory/".$template);
+ error_log($smarty->fetch($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/directory/".$template));
+ error_log(print_r($_POST,true));
+ return TRUE;
+}
+
+
+// register the callback
+$callBacks['directory']='directory';
+
+?>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/phrases.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/modules/phrases.php Sat Jul 7 21:59:59 2007
@@ -0,0 +1,20 @@
+<?php // -*- mode:c; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil; -*-
+function phrases()
+{
+ global $_SERVER;
+ global $_POST;
+
+
+ // create a new smarty object
+ $smarty = new Smarty();
+ $template = 'lang_'. $_POST['lang'] .'.tpl';
+
+ $smarty->display($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."/templates/".$_SERVER['REMOTE_USER']."/phrases/".$template);
+ return TRUE;
+}
+
+
+// register the callback
+$callBacks['phrases']='phrases';
+
+?>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/alsa.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/alsa.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="alsa.conf" description="Soundcard Endpoint">
+ <settings>
+ <!--Default dialplan and caller-id info -->
+ <param name="dialplan" value="XML"/>
+ <param name="cid-name" value="N800 Alsa"/>
+ <param name="cid-num" value="5555551212"/>
+
+ <!--audio sample rate and interval -->
+ <param name="sample-rate" value="8000"/>
+ <param name="codec-ms" value="20"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/conference.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/conference.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+ <configuration name="conference.conf" description="Audio Conference">
+ <!-- Profiles are collections of settings you can reference by name. -->
+ <profiles>
+ <profile name="default">
+ <!-- Domain (for presence) -->
+ <param name="domain" value="freeswitch.org"/>
+ <!-- Sample Rate-->
+ <param name="rate" value="8000"/>
+ <!-- Number of milliseconds per frame -->
+ <param name="interval" value="20"/>
+
+ <!-- TTS Engine to use -->
+ <param name="tts-engine" value="cepstral"/>
+ <!-- TTS Voice to use -->
+ <param name="tts-voice" value="david"/>
+
+ <!-- If TTS is enabled all audio-file params not beginning with -->
+ <!-- '/' or with drive: (i.e. c:) will be considered text to say with TTS -->
+
+ <!-- File to play to acknowledge succees -->
+ <param name="ack-sound" value="/sounds/{$CONFNAME}/beep.raw"/>
+ <!-- File to play to acknowledge failure -->
+ <param name="nack-sound" value="/sounds/{$CONFNAME}/beeperr.raw"/>
+ <!-- File to play to acknowledge muted -->
+ <param name="muted-sound" value="/sounds/{$CONFNAME}/conf-muted.raw"/>
+ <!-- File to play to acknowledge unmuted -->
+ <param name="unmuted-sound" value="/sounds/{$CONFNAME}/conf-unmuted.raw"/>
+ <!-- File to play if you are alone in the conference -->
+ <param name="alone-sound" value="/sounds/{$CONFNAME}/conf-onlyperson.raw"/>
+ <!-- File to play when you join the conference -->
+ <param name="enter-sound" value="/sounds/{$CONFNAME}/conf-enter.raw"/>-->
+ <!-- File to play when you leave the conference -->
+ <param name="exit-sound" value="/sounds/{$CONFNAME}/conf-exit.raw"/>-->
+ <!-- File to play when you ae ejected from the conference -->
+ <param name="kicked-sound" value="/sounds/{$CONFNAME}/conf-kicked.raw"/>
+ <!-- File to play when the conference is locked -->
+ <param name="locked-sound" value="/sounds/{$CONFNAME}/conf-locked.raw"/>
+ <!-- File to play to prompt for a pin -->
+ <param name="pin-sound" value="/sounds/{$CONFNAME}/conf-getpin.raw"/>
+ <!-- File to play to when the pin is invalid -->
+ <param name="bad-pin-sound" value="/sounds/{$CONFNAME}/conf-invalidpin.raw"/>
+ <param name="max-members-sound" value="/sounds/{$CONFNAME}/conf-full.raw"/>
+
+
+
+{foreach key=k item=v from=$params}
+ <param name="{$k}" value="{$v}"/>
+{/foreach}
+
+ <!-- Default Caller ID Name for outbound calls -->
+ <param name="caller-id-name" value="FreeSWITCH"/>
+ <!-- Default Caller ID Number for outbound calls -->
+ <param name="caller-id-number" value="1234567890"/>
+ <param name="caller-controls" value="mykeys"/>
+ </profile>
+ </profiles>
+ <caller-controls>
+ <group name="mykeys">
+{foreach key=k item=v from=$digits}
+ <control action="{$v}" digits="{$k}"/>
+{/foreach}
+ </group>
+ </caller-controls>
+
+ </configuration>
+ </section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/console.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/console.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="console.conf" description="Console Logger">
+ <!-- pick a file name, a function name or 'all' -->
+ <!-- map as many as you need for specific debugging -->
+ <mappings>
+ <!-- <param name="log_event" value="DEBUG"/> -->
+ <param name="all" value="DEBUG"/>
+ </mappings>
+ <settings>
+ <!-- uncomment for color logging (for debugging) -->
+ <!--<param name="colorize" value="true"/>-->
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/default_context.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/default_context.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,185 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<!-- Valid fields in conditions: -->
+<!-- "dialplan, caller_id_name, ani, ani2, caller_id_number, -->
+<!-- rdnis, destination_number, uuid, source, context, chan_name" -->
+
+<!-- *NOTE* The special context name 'any' will match any context -->
+<context name="default">
+ <extension name="556"> <!-- demo phrases -->
+ <condition field="destination_number" expression="^556$">
+ <action application="answer"/>
+ <action application="sleep" data="1000"/>
+ <action application="phrase" data="spell,${caller_id_name}"/>
+ <action application="phrase" data="spell-phonetic,${caller_id_name}"/>
+ <action application="phrase" data="timespec,12:45:15"/>
+ <action application="phrase" data="saydate,0"/>
+ <action application="phrase" data="msgcount,130"/>
+ <action application="phrase" data="ip-addr,66.250.68.194"/>
+ <action application="phrase" data="saydate,$strepoch(2006-03-23 7:23)"/>
+ <!--<action application="phrase" data="timeleft,3:30"/>-->
+ </condition>
+ </extension>
+
+ <extension name="9193">
+ <condition field="destination_number" expression="^9193$">
+ <action application="set" data="bridge_pre_execute_bleg_app=soundtouch"/>
+ <!-- send or recv indicates which direction the dtmf is parsed from
+ since this example is send and it's being called on the b leg
+ the application will intercept the dtmf from being sent to the b leg
+ a.k.a. by the dtmf of the A leg.
+ if it were 'recv' then it would be parsed when the dtmf was
+ received *from* the b leg so it could control itself.
+ The optional keywords "read" and "write" will also change the stream replaced
+ -->
+ <action application="set" data="bridge_pre_execute_bleg_data=send -4s"/>
+ <action application="bridge" data="sofia/$${domain}/foo"/>
+ </condition>
+ </extension>
+
+
+
+ <extension name="9192">
+ <condition field="destination_number" expression="^9192$">
+ <!-- Maintain Buffer of 128k of audio (default is 64k) -->
+ <action application="set" data="stream_prebuffer=131072"/>
+ <!-- Play a stream -->
+ <action application="playback" data="shout://mp3.ihets.org/wfyihd132"/>
+ </condition>
+ </extension>
+
+
+ <!-- Example extension for require auth per-call. -->
+ <extension name="9191">
+ <!-- Match the destination digits of 9191 -->
+ <condition field="destination_number" expression="^9191$"/>
+ <!-- Make sure the sip_authorized variable is set (set on all authed calls)
+ If it isn't, then send an auth challange.
+ -->
+ <condition field="${sip_authorized}" expression="true">
+ <anti-action application="reject" data="407"/>
+ </condition>
+
+ <!-- If you made it here all is well and the call is authed.
+ Do whatever you wish.
+ -->
+ <condition>
+ <action application="playback" data="/tmp/itworked.wav"/>
+ </condition>
+ </extension>
+
+ <extension name="tollfree">
+ <condition field="destination_number" expression="^(18(0{2}|8{2}|7{2}|6{2})\d{7})$">
+ <action application="enum" data="$1"/>
+ <action application="bridge" data="${enum_auto_route}"/>
+ </condition>
+ </extension>
+
+ <!-- Call the FreeSWITCH conference via SIP -->
+ <!--<extension name="FreeSWITCH Conference SIP">-->
+ <!--<condition field="destination_number" expression="^888$">-->
+ <!--<action application="bridge" data="sofia/$${sip_profile}/888(a)conference.freeswitch.org"/>-->
+ <!--</condition>-->
+ <!--</extension> -->
+
+ <!-- Call the FreeSWITCH conference via IAX -->
+ <!--<extension name="FreeSWITCH Conference IAX">-->
+ <!--<condition field="destination_number" expression="^8888$">-->
+ <!--<action application="bridge" data="iax/guest(a)conference.freeswitch.org/888"/>-->
+ <!--</condition>-->
+ <!--</extension>-->
+
+ <extension name="set_codec" continue="true">
+ <condition field="source" expression="mod_portaudio">
+ <action application="export" data="absolute_codec_string=$${global_codec_prefs}"/>
+ <action application="export" data="nolocal:jitterbuffer_msec=180"/>
+ </condition>
+ </extension>
+
+
+ <extension name="testmusic">
+ <condition field="destination_number" expression="^1234$">
+ <!-- Request a certain tone/file to be played while you wait for the call to be answered-->
+ <action application="set" data="ringback=${us-ring}"/>
+ <!--<action application="set" data="ringback=/home/ring.wav"/>-->
+ <!--<action application="set" data="jitterbuffer_msec=180"/>-->
+ <action application="bridge" data="sofia/$${sip_profile}/1234(a)conference.freeswitch.org"/>
+ </condition>
+ </extension>
+
+ <!-- Enter an existing conference -->
+ <extension name="1000">
+ <condition field="destination_number" expression="^1000$">
+ <action application="conference" data="freeswitch"/>
+ </condition>
+ </extension>
+
+ <!-- Start a dynamic conference and call someone at the same time -->
+ <extension name="2000">
+ <condition field="destination_number" expression="^2000$">
+ <action application="conference" data="bridge:mydynaconf:sofia/$${sip_profile}/1234@conference.freeswitch.org"/>
+ </condition>
+ </extension>
+
+ <!-- extensions starting with 4, all the numbers after 4 form a numeric filename -->
+ <!-- continue="true" means keep looking for more extensions to match -->
+ <!-- *NOTE* The entire dialplan is parsed ONCE when the call starts -->
+ <!-- so any call info acquired after the various actions cannot -->
+ <!-- be taken into consideration. -->
+
+ <!-- The first match will play a beep and the second one plays -->
+ <!-- the desired file. This is for demo purposes both actions -->
+ <!-- could have been under the same <extension> tag as well. -->
+ <extension name="playsound1" continue="true">
+ <condition field="source" expression="mod_sofia"/>
+ <condition field="destination_number" expression="^4(\d+)">
+ <action application="playback" data="/var/sounds/beep.gsm"/>
+ </condition>
+ </extension>
+
+ <extension name="playsound2">
+ <condition field="source" expression="mod_sofia"/>
+ <condition field="destination_number" expression="^4(\d+)">
+ <action application="playback" data="/root/$1.raw"/>
+ </condition>
+ </extension>
+
+ <!-- send everything with a certian RDNIS to Wanpipe ISDN -->
+ <extension name="To PRI">
+ <condition field="rdnis" expression="8881231234"/>
+ <condition field="destination_number" expression="(.*)">
+ <action application="bridge" data="wanpipe/pri/a/a/$1"/>
+ </condition>
+ </extension>
+
+ <!-- Call *MUST* originate from mod_iax and also be dialing ext 9999-->
+ <extension name="9999">
+ <condition field="source" expression="mod_iax"/>
+ <condition field="destination_number" expression="9999">
+ <action application="playback" data="/var/sounds/beep.gsm"/>
+ </condition>
+ </extension>
+
+ <!--This extension will start a conference and invite several people upon entering -->
+ <extension name="0911">
+ <condition field="destination_number" expression="0911">
+
+ <!--These params effect the outcalls made once you join-->
+ <action application="set" data="conference_auto_outcall_caller_id_name=pissed off boss"/>
+ <action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
+ <action application="set" data="conference_auto_outcall_timeout=60"/>
+ <action application="set" data="conference_auto_outcall_flags=none"/>
+ <action application="set" data="conference_auto_outcall_announce=say:You have been called into an emergency conference"/>
+
+ <!--Add as many of these as you need, These are the people you are going to call-->
+ <action application="conference_set_auto_outcall" data="sofia/gateway/mygateway/12121231234"/>
+ <action application="conference_set_auto_outcall" data="sofia/$${domain}/1234(a)somewhere.com"/>
+
+ <action application="conference" data="cool@default"/>
+ </condition>
+ </extension>
+
+</context>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/dialplan_directory.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/dialplan_directory.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="dialplan_directory.conf" description="Dialplan Directory">
+ <settings>
+ <param name="directory-name" value="ldap"/>
+ <param name="host" value="ldap.freeswitch.org"/>
+ <param name="dn" value="cn=Manager,dc=freeswitch,dc=org"/>
+ <param name="pass" value="test"/>
+ <param name="base" value="dc=freeswitch,dc=org"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/dingaling.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/dingaling.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="dingaling.conf" description="XMPP Jingle Endpoint">
+ <settings>
+ <param name="debug" value="0"/>
+ <param name="codec-prefs" value="PCMU"/>
+ </settings>
+
+ <!-- *NOTE* change <x-profile></x-profile> to <profile></profile> to enable -->
+
+ <!-- Client Profile (Original mode) -->
+ <x-profile type="client">
+ <param name="name" value="$${xmpp_client_profile}"/>
+ <param name="login" value="myjid(a)myserver.com/talk"/>
+ <param name="password" value="mypass"/>
+ <param name="dialplan" value="XML"/>
+ <param name="message" value="Jingle all the way"/>
+ <param name="rtp-ip" value="$${bind_server_ip}"/>
+ <!-- <param name="ext-rtp-ip" value="$${external_rtp_ip"/> -->
+ <param name="auto-login" value="true"/>
+ <!-- SASL "plain" or "md5" -->
+ <param name="sasl" value="plain"/>
+ <!-- if the server where the jabber is hosted is not the same as the one in the jid -->
+ <!--<param name="server" value="alternate.server.com"/>-->
+ <!-- Enable TLS or not -->
+ <param name="tls" value="true"/>
+ <!-- disable to trade async for more calls -->
+ <param name="use-rtp-timer" value="true"/>
+ <!-- default extension (if one cannot be determined) -->
+ <param name="exten" value="888"/>
+ <!-- VAD choose one -->
+ <!-- <param name="vad" value="in"/> -->
+ <!-- <param name="vad" value="out"/> -->
+ <param name="vad" value="both"/>
+ <!--<param name="avatar" value="/path/to/tiny.jpg"/>-->
+ </x-profile>
+
+ <!-- Component (Server to Server Login) -->
+ <x-profile type="component">
+ <param name="name" value="$${xmpp_server_profile}"/>
+ <param name="password" value="secret"/>
+ <param name="dialplan" value="XML"/>
+ <param name="rtp-ip" value="$${bind_server_ip}"/>
+ <param name="server" value="jabber.server.org:5347"/>
+ <!-- disable to trade async for more calls -->
+ <param name="use-rtp-timer" value="true"/>
+ <!-- "_auto_" means the extension will be automaticly set to the called jid -->
+ <param name="exten" value="_auto_"/>
+ <!--<param name="vad" value="both"/>-->
+ <!--<param name="avatar" value="/path/to/tiny.jpg"/>-->
+ <!--If you have ODBC support and a working dsn you can use it instead of SQLite-->
+ <!--<param name="odbc-dsn" value="dsn:user:pass"/>-->
+
+ </x-profile>
+
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/directory.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/directory.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<!--the domain or ip (the right hand side of the @ in the addr-->
+<domain name="$${domain}">
+ <!--the user id (the left hand side of the @ in the addr-->
+ <user id="stpeter">
+ <!-- Outbound Registrations Related to this user -->
+ <gateways>
+ <!--<gateway name="asterlink.com">-->
+ <!--/// account username *required* ///-->
+ <!--<param name="username" value="cluecon"/>-->
+ <!--/// auth realm: *optional* same as gateway name, if blank ///-->
+ <!--<param name="realm" value="asterlink.com"/>-->
+ <!--/// domain to use in from: *optional* same as realm, if blank ///-->
+ <!--<param name="from-domain" value="asterlink.com"/>-->
+ <!--/// account password *required* ///-->
+ <!--<param name="password" value="2007"/>-->
+ <!--/// replace the INVITE from user with the channel's caller-id ///-->
+ <!--<param name="caller-id-in-from" value="false"/>-->
+ <!--/// extension for inbound calls: *optional* same as username, if blank ///-->
+ <!--<param name="extension" value="cluecon"/>-->
+ <!--/// proxy host: *optional* same as realm, if blank ///-->
+ <!--<param name="proxy" value="asterlink.com"/>-->
+ <!--/// expire in seconds: *optional* 3600, if blank ///-->
+ <!--<param name="expire-seconds" value="60"/>-->
+ <!--/// do not register ///-->
+ <!--<param name="register" value="false"/>-->
+ <!--How many seconds before a retry when a failure or timeout occurs -->
+ <!--<param name="retry_seconds" value="30"/>-->
+ <!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
+ <!--<param name="caller-id-in-from" value="false"/>-->
+ <!--</gateway>-->
+ </gateways>
+ <params>
+ <!-- omit password for authless registration -->
+ <param name="password" value="mypass"/>
+ <!-- optionally use this instead if you want to store the hash of user:domain:pass-->
+ <!--<param name="a1-hash" value="c6440e5de50b403206989679159de89a"/>-->
+ </params>
+ <variables>
+ <!--all variables here will be set on all inbound calls that originate from this user -->
+ <variable name="testing" value="this"/>
+ <!--<variable name="force-contact" value="nat-connectile-dysfunction"/>-->
+ </variables>
+
+ <vcard>
+ <!-- insert optional compliant vcard xml here-->
+ </vcard>
+ </user>
+</domain>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/enum.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/enum.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,18 @@
+{literal}
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="enum.conf" description="ENUM Module">
+ <settings>
+ <param name="default-root" value="e164.org"/>
+ </settings>
+
+ <routes>
+ <route service="E2U+SIP" regex="sip:(.*)" replace="sofia/$${sip_profile}/$1"/>
+ <route service="E2U+IAX2" regex="iax2:(.*)" replace="iax/$1"/>
+ <route service="E2U+XMPP" regex="XMPP:(.*)" replace="dingaling/$${xmpp_server_profile}/$1"/>
+ </routes>
+</configuration>
+</section>
+</document>
+{/literal}
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/event_multicast.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/event_multicast.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="event_multicast.conf" description="Multicast Event">
+ <settings>
+ <param name="address" value="225.1.1.1"/>
+ <param name="port" value="4242"/>
+ <param name="bindings" value="all"/>
+ </settings>
+</configuration>
+
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/event_socket.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/event_socket.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="event_socket.conf" description="Socket Client">
+ <settings>
+ <param name="listen-ip" value="127.0.0.1"/>
+ <param name="listen-port" value="8021"/>
+ <param name="password" value="ClueCon"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/freeswitch.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/freeswitch.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <!--#comment
+ All comments starting with #command will be preprocessed and never sent to the xml parser
+ Valid instructions:
+ #include ==> Include another file to this exact point
+ (partial xml should be encased in <include></include> tags)
+ #set ==> Set a global variable (can be expanded during preprocessing with $$ variables)
+ (note the double $$ which denotes preprocessor variables)
+ #comment ==> A general comment such as this
+
+ The preprocessor will compile the full xml document to ${prefix}/log/freeswitch.registry
+ Don't modify it while freeswitch is running cos it is mem mapped in most cases =D
+ -->
+
+ <!-- Preprocessor Variables
+ These are introduced when configuration strings must be consistent across modules.
+ -->
+ <!-- sip_profile
+ Must be a domain name if you are being a registry server; otherwise
+ can be any string.
+ used by: sofia.conf.xml enum.conf.xml default_context.xml directory.xml
+ -->
+ <!--#set "sip_profile=mydomain.com"-->
+ <!-- xmpp_client_profile and xmpp_server_profile
+ xmpp_client_profile can be any string.
+ xmpp_server_profile is appended to "dingaling_" to form the database name
+ containing the "subscriptions" table.
+ used by: dingaling.conf.xml enum.conf.xml
+ -->
+ <!--#set "global_codec_prefs=PCMU@20i"-->
+ <!--#set "xmpp_client_profile=xmppc"-->
+ <!--#set "xmpp_server_profile=xmpps"-->
+ <!-- bind_server_ip
+ Can be an ip address, a dns name, or "auto".
+ This determines an ip address available on this host to bind.
+ If you are separating RTP and SIP traffic, you will want to have
+ use different addresses where this variable appears.
+ Used by: sofia.conf.xml dingaling.conf.xml
+ -->
+ <!--#set "bind_server_ip=auto"-->
+ <!-- external_rtp_ip
+ Used as the public IP address for SDP.
+ Can be an ip address or a string like "stun:stun.server.com"
+ If unspecified, the bind_server_ip value is used.
+ Used by: sofia.conf.xml dingaling.conf.xml
+ -->
+ <!--#set "external_rtp_ip=stun:stun.server.com"-->
+ <!-- server_name
+ A public ip address or DNS name that is used when advertising conference
+ presence or registering sip.
+ Used by: conference.conf.xml
+ -->
+ <!-- outbound_caller_id and outbound_caller_name
+ The caller ID telephone number we should use when calling out.
+ Used by: conference.conf.xml
+ -->
+ <!--#set "outbound_caller_name=FreeSWITCH"-->
+ <!--#set "outbound_caller_id=8777423583"-->
+
+ <section name="configuration" description="Various Configuration">
+ <!--#include "switch.conf.xml"-->
+ <!--#include "modules.conf.xml"-->
+
+ <!-- Order doesn't matter, but for clarity these are in same order as modules.conf.xml.
+ If they aren't loaded by modules.conf.xml, then they are ignored.
+ -->
+ <!-- Loggers -->
+ <!--#include "console.conf.xml"-->
+ <!--#include "syslog.conf.xml"-->
+
+ <!-- Multi-Faceted -->
+ <!--#include "enum.conf.xml"-->
+
+ <!-- XML Interfaces -->
+ <!--#include "xml_rpc.conf.xml"-->
+ <!--#include "xml_cdr.conf.xml"-->
+ <!--#include "xml_curl.conf.xml"-->
+ <!-- none for mod_xml_cdr -->
+
+ <!-- Event Handlers -->
+ <!--#include "cdr.conf.xml"-->
+ <!--#include "event_multicast.conf.xml"-->
+ <!--#include "event_socket.conf.xml"-->
+ <!--#include "xmpp_event.conf.xml"-->
+ <!--#include "zeroconf.conf.xml"-->
+
+ <!-- Directory Interfaces -->
+ <!-- none for mod_ldap; dialplan_directory.conf.xml has ldap connection info -->
+
+ <!-- Endpoints -->
+ <!--#include "dingaling.conf.xml"-->
+ <!--#include "iax.conf.xml"-->
+ <!--#include "portaudio.conf.xml"-->
+ <!--#include "alsa.conf.xml"-->
+ <!--#include "sofia.conf.xml"-->
+ <!--#include "wanpipe.conf.xml"-->
+ <!--#include "woomera.conf.xml"-->
+
+ <!-- Applications -->
+ <!-- none for mod_bridgecall, mod_commands, mod_echo, mod_park, mod_playback -->
+ <!--#include "conference.conf.xml"-->
+ <!-- ivr.conf is used by mod_dptools -->
+ <!--#include "ivr.conf.xml"-->
+
+ <!-- Dialplan Interfaces -->
+ <!--#include "dialplan_directory.conf.xml"-->
+ <!-- mod_dialplan_xml is configured in the separate "dialplan" section. -->
+
+ <!-- Codec Interfaces -->
+ <!-- no configuration needed -->
+ <!-- File Format Interfaces -->
+ <!-- no configuration needed -->
+ <!-- Timers -->
+ <!-- no configuration needed -->
+
+ <!-- Languages -->
+ <!--#include "spidermonkey.conf.xml"-->
+ <!-- none for mod_perl -->
+
+ <!-- ASR /TTS -->
+ <!-- none for mod_cepstral -->
+ <!--#include "rss.conf.xml"-->
+
+ <!-- Say -->
+ <!-- none for mod_say_en -->
+ <!--#include "mod_cdr.conf.xml"-->
+ <!--#include "mod_local_stream.conf.xml"-->
+ </section>
+
+ <section name="dialplan" description="Regex/XML Dialplan">
+ <!--#include "default_context.xml"-->
+ </section>
+
+ <!-- mod_dingaling is reliant on the vcard data in the "directory" section. -->
+ <!-- mod_sofia is reliant on the user data for authorization -->
+ <section name="directory" description="User Directory">
+ <!--#include "directory.xml"-->
+ </section>
+
+ <!-- phrases section (under development still) -->
+ <section name="phrases" description="Speech Phrase Management">
+ <macros>
+ <language name="en" sound_path="/snds" tts_engine="cepstral" tts_voice="david">
+ <!--#include "lang_en.xml"-->
+ </language>
+ <language name="fr" sound_path="/var/sounds/lang/fr/jean" tts_engine="cepstral" tts_voice="jean-pierre">
+ <!--#include "lang_fr.xml"-->
+ </language>
+ </macros>
+ </section>
+
+</document>
+
+
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/iax.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/iax.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="iax.conf" description="IAX Configuration">
+ <settings>
+ <param name="debug" value="0"/>
+ <!-- <param name="ip" value="1.2.3.4"/> -->
+ <param name="port" value="4569"/>
+ <param name="dialplan" value="XML"/>
+ <param name="codec-prefs" value="PCMU@20i,PCMA,speex,L16"/>
+ <param name="codec-master" value="us"/>
+ <param name="codec-rates" value="8"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/ivr.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/ivr.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="ivr.conf" description="IVR menus">
+ <menus>
+ <menu name="main"
+ greet-long="/soundfiles/greet-long.wav"
+ greet-short="/soundfiles/greet-short.wav"
+ invalid-sound="/soundfiles/invalid.wav"
+ exit-sound="/soundfiles/exit.wav" timeout ="15" max-failures="3">
+ <entry action="menu-exit" digits="*"/>
+ <entry action="menu-sub" digits="2" param="menu2"/>
+ <entry action="menu-exec-api" digits="3" param="api arg"/>
+ <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
+ <entry action="menu-back" digits="5"/>
+ <entry action="menu-call-transfer" digits="7" param="888"/>
+ <entry action="menu-sub" digits="8" param="menu8"/>
+ </menu>
+ <menu name="menu8"
+ greet-long="/soundfiles/greet-long.wav"
+ greet-short="/soundfiles/greet-short.wav"
+ invalid-sound="/soundfiles/invalid.wav"
+ exit-sound="/soundfiles/exit.wav"
+ timeout ="15"
+ max-failures="3">
+ <entry action="menu-back" digits="#"/>
+ <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
+ <entry action="menu-top" digits="*"/>
+ </menu>
+ <menu name="menu2"
+ greet-long="/soundfiles/greet-long.wav"
+ greet-short="/soundfiles/greet-short.wav"
+ invalid-sound="/soundfiles/invalid.wav"
+ exit-sound="/soundfiles/exit.wav"
+ timeout ="15"
+ max-failures="3">
+ <entry action="menu-back" digits="#"/>
+ <entry action="menu-play-sound" digits="4" param="/soundfiles/4.wav"/>
+ <entry action="menu-top" digits="*"/>
+ </menu>
+ </menus>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/mod_cdr.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/mod_cdr.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="mod_cdr.conf" description="CDR Configuration">
+ <pddcdr>
+ <param name="path" value="/work/temp/pddcdr"/>
+ <!-- <param name="chanvars" value="username,accountcode"/> -->
+ <!-- <param name="chanvars_fixed" value="foo"/> -->
+ </pddcdr>
+ <csvcdr>
+ <param name="path" value="/work/temp/csvcdr"/>
+ <param name="size_limit" value="25"/>
+ <!-- <param name="chanvars_fixed" value="username"/> -->
+ <!-- <param name="chanvars_supp" value="*"/> -->
+ <!-- <param name="repeat_fixed_in_supp" value="0"/> -->
+ </csvcdr>
+ <mysqlcdr>
+ <param name="hostname" value="10.0.0.1"/>
+ <param name="username" value="test"/>
+ <param name="password" value="test"/>
+ <param name="dbname" value="testing"/>
+ <!-- This following line logs username as a varchar, and The_Kow as a tiny -->
+ <!-- <param name="chanvars_fixed" value="username=s,The_Kow=t"/> -->
+ <!-- If you do not want to log any and all chanvars to the chanvar table, comment the next 2 lines out -->
+ <param name="chanvars_supp" value="*"/>
+ <param name="chanvars_supp_repeat_fixed" value="0"/>
+ </mysqlcdr>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/portaudio.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/portaudio.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="portaudio.conf" description="Soundcard Endpoint">
+ <settings>
+ <!-- indev, outdev, ringdev:
+ partial case sensitive string match on something in the name
+ or the device number prefixed with # eg "#1" (or blank for default) -->
+
+ <!-- device to use for input -->
+ <param name="indev" value=""/>
+ <!-- device to use for output -->
+ <param name="outdev" value=""/>
+
+ <!--device to use for inbound ring -->
+ <!--<param name="ringdev" value=""/>-->
+ <!--File to play as the ring sound -->
+ <!--<param name="ring-file" value="/sounds/ring.wav"/>-->
+ <!--Number of seconds to pause between rings -->
+ <!--<param name="ring-interval" value="5"/>-->
+
+ <!--file to play when calls are on hold-->
+ <!--<param name="hold-file" value="/sounds/holdmusic.wav"/>-->
+ <!--Timer to use for hold music (i'd leave this one commented)-->
+ <!--<param name="timer-name" value="soft"/>-->
+
+ <!--Default dialplan and caller-id info -->
+ <param name="dialplan" value="XML"/>
+ <param name="cid-name" value="FreeSwitch"/>
+ <param name="cid-num" value="5555551212"/>
+
+ <!--audio sample rate and interval -->
+ <param name="sample-rate" value="8000"/>
+ <param name="codec-ms" value="20"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/post_load_modules.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/post_load_modules.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="post_load_modules.conf" description="Modules">
+ <modules>
+ <!-- Multi-Faceted -->
+ <!-- mod_enum is a dialplan interface, an application interface and an api command interface -->
+ <load module="mod_enum"/>
+
+ <!-- XML Interfaces -->
+ <load module="mod_xml_rpc"/>
+ <load module="mod_xml_cdr"/>
+
+ <!-- Event Handlers -->
+ <!-- <load module="mod_cdr"/> -->
+ <!-- <load module="mod_event_multicast"/> -->
+ <load module="mod_event_socket"/>
+ <!-- <load module="mod_xmpp_event"/> -->
+ <!-- <load module="mod_zeroconf"/> -->
+
+ <!-- Directory Interfaces -->
+ <!-- <load module="mod_ldap"/> -->
+
+ <!-- Endpoints -->
+ <!-- <load module="mod_dingaling"/> -->
+ <!--<load module="mod_iax"/>-->
+ <load module="mod_portaudio"/>
+ <load module="mod_alsa"/>
+ <load module="mod_sofia"/>
+ <!-- <load module="mod_wanpipe"/> -->
+ <!-- <load module="mod_woomera"/> -->
+
+ <!-- Applications -->
+ <load module="mod_commands"/>
+ <load module="mod_conference"/>
+ <load module="mod_dptools"/>
+
+ <!-- Dialplan Interfaces -->
+ <!-- <load module="mod_dialplan_directory"/> -->
+ <load module="mod_dialplan_xml"/>
+
+ <!-- Codec Interfaces -->
+ <load module="mod_g711"/>
+ <load module="mod_gsm"/>
+ <!-- <load module="mod_ilbc"/> -->
+ <load module="mod_l16"/>
+ <!-- <load module="mod_speex"/> -->
+
+ <!-- File Format Interfaces -->
+ <load module="mod_sndfile"/>
+ <load module="mod_native_file"/>
+ <!--For icecast/mp3 streams/files-->
+ <!--<load module="mod_shout"/>-->
+ <!--For local streams (play all the files in a directory)-->
+ <!--<load module="mod_local_stream"/>-->
+
+ <!-- Timers -->
+ <load module="mod_softtimer"/>
+
+ <!-- Languages -->
+ <load module="mod_spidermonkey"/>
+ <!-- <load module="mod_perl"/> -->
+
+ <!-- ASR /TTS -->
+ <load module="mod_cepstral"/>
+ <!-- <load module="mod_rss"/> -->
+
+ <!-- Say -->
+ <load module="mod_say_en"/>
+ </modules>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/rss.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/rss.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="rss.conf" description="RSS Parser">
+ <feeds>
+ <!-- Just download the files to wherever and refer to them here -->
+ <!-- <feed name="Slash Dot">/home/rss/rss.rss</feed> -->
+ <!-- <feed name="News Forge">/home/rss/newsforge.rss</feed> -->
+ </feeds>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/sofia.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/sofia.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,101 @@
+{literal}
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="sofia.conf" description="sofia Endpoint">
+ <profiles>
+ <profile name="internal">
+ <!--aliases are other names that will work as a valid profile name for this profile-->
+ <aliases>
+ <alias name="default"/>
+ </aliases>
+ <!-- Outbound Registrations -->
+ <gateways>
+ <!--<gateway name="asterlink.com">-->
+ <!--/// account username *required* ///-->
+ <!--<param name="username" value="cluecon"/>-->
+ <!--/// auth realm: *optional* same as gateway name, if blank ///-->
+ <!--<param name="realm" value="asterlink.com"/>-->
+ <!--/// domain to use in from: *optional* same as realm, if blank ///-->
+ <!--<param name="from-domain" value="asterlink.com"/>-->
+ <!--/// account password *required* ///-->
+ <!--<param name="password" value="2007"/>-->
+ <!--/// replace the INVITE from user with the channel's caller-id ///-->
+ <!--<param name="caller-id-in-from" value="false"/>-->
+ <!--/// extension for inbound calls: *optional* same as username, if blank ///-->
+ <!--<param name="extension" value="cluecon"/>-->
+ <!--/// proxy host: *optional* same as realm, if blank ///-->
+ <!--<param name="proxy" value="asterlink.com"/>-->
+ <!--/// expire in seconds: *optional* 3600, if blank ///-->
+ <!--<param name="expire-seconds" value="60"/>-->
+ <!--/// do not register ///-->
+ <!--<param name="register" value="false"/>-->
+ <!--How many seconds before a retry when a failure or timeout occurs -->
+ <!--<param name="retry_seconds" value="30"/>-->
+ <!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
+ <!--<param name="caller-id-in-from" value="false"/>-->
+ <!--</gateway>-->
+ </gateways>
+
+ <domains>
+ <!-- indicator to parse the directory for domains with parse="true" to get gateways-->
+ <!--<domain name="trxtel.com" parse="true"/>-->
+ </domains>
+
+ <settings>
+ <param name="debug" value="1"/>
+ <param name="rfc2833-pt" value="101"/>
+ <param name="sip-port" value="5060"/>
+ <param name="dialplan" value="XML"/>
+ <param name="dtmf-duration" value="100"/>
+ <param name="codec-prefs" value="PCMU@20i"/>
+ <param name="codec-ms" value="20"/>
+ <param name="use-rtp-timer" value="true"/>
+ <param name="rtp-timer-name" value="soft"/>
+ <param name="rtp-ip" value="0.0.0.0"/>
+ <param name="sip-ip" value="0.0.0.0"/>
+ <!--set to 'greedy' if you want your codec list to take precedence -->
+ <param name="inbound-codec-negotiation" value="generous"/>
+ <!-- if you want to send any special bind params of your own -->
+ <!--<param name="bind-params" value="transport=udp"/>-->
+
+ <!--If you don't want to pass through timestampes from 1 RTP call to another (on a per call basis with rtp_rewrite_timestamps chanvar)-->
+ <!--<param name="rtp-rewrite-timestampes" value="true"/>-->
+
+ <!--If you have ODBC support and a working dsn you can use it instead of SQLite-->
+ <!--<param name="odbc-dsn" value="dsn:user:pass"/>-->
+
+ <!--Uncomment to set all inbound calls to no media mode-->
+ <!--<param name="inbound-no-media" value="true"/>-->
+
+ <!--Uncomment to let calls hit the dialplan *before* you decide if the codec is ok-->
+ <!--<param name="inbound-late-negotiation" value="true"/>-->
+
+ <!-- this lets anything register -->
+ <!-- comment the next line and uncomment one or both of the other 2 lines for call authentication -->
+<!-- <param name="accept-blind-reg" value="true"/> -->
+
+ <!--TTL for nonce in sip auth-->
+ <param name="nonce-ttl" value="60"/>
+ <!--Uncomment if you want to force the outbound leg of a bridge to only offer the codec
+ that the originator is using-->
+ <!--<param name="disable-transcoding" value="true"/>-->
+ <!--<param name="auth-calls" value="true"/>-->
+ <!-- on authed calls, authenticate *all* the packets not just invite -->
+ <!--<param name="auth-all-packets" value="true"/>-->
+
+ <!-- <param name="ext-rtp-ip" value="$${external_rtp_ip}"/>-->
+
+ <!-- <param name="ext-sip-ip" value="100.101.102.103"/> -->
+ <!-- VAD choose one (out is a good choice); -->
+ <!-- <param name="vad" value="in"/> -->
+ <!-- <param name="vad" value="out"/> -->
+ <!-- <param name="vad" value="both"/> -->
+ <!--<param name="alias" value="sip:10.0.1.251:5555"/>-->
+ </settings>
+ </profile>
+ </profiles>
+</configuration>
+</section>
+</document>
+{/literal}
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/spidermonkey.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/spidermonkey.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="spidermonkey.conf" description="Spider Monkey JavaScript Plug-Ins">
+ <modules>
+ <load module="mod_spidermonkey_teletone"/>
+ <load module="mod_spidermonkey_core_db"/>
+ <!--<load module="mod_spidermonkey_odbc"/>-->
+ </modules>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/switch.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/switch.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="switch.conf" description="Modules">
+ <settings>
+ <!--Most channels to allow at once -->
+ <param name="max-sessions" value="1000"/>
+ <!--Try to catch any crashes that can be recoverable (in the context of a call)-->
+ <param name="crash-protection" value="false"/>
+ <!--RTP port range -->
+ <!--<param name="rtp-start-port" value="16384"/>-->
+ <!--<param name="rtp-end-port" value="32768"/>-->
+ </settings>
+ <!--Any variables defined here will be available in every channel, in the dialplan etc -->
+ <variables>
+ <variable name="uk-ring" value="%(400,200,400,450);%(400,2200,400,450)"/>
+ <variable name="us-ring" value="%(2000, 4000, 440.0, 480.0)"/>
+ <variable name="bong-ring" value="v=4000;>=0;+=2;#(60,0);v=2000;%(940,0,350,440)"/>
+ </variables>
+</configuration>
+
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/syslog.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/syslog.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="syslog.conf" description="Syslog Logger">
+ <!-- SYSLOG -->
+ <!-- emerg - system is unusable -->
+ <!-- alert - action must be taken immediately -->
+ <!-- crit - critical conditions -->
+ <!-- err - error conditions -->
+ <!-- warning - warning conditions -->
+ <!-- notice - normal, but significant, condition -->
+ <!-- info - informational message -->
+ <!-- debug - debug-level message -->
+ <settings>
+ <param name="ident" value="freeswitch"/>
+ <param name="facility" value="user"/>
+ <param name="format" value="${time} - ${message}"/>
+ <param name="level" value="debug,info,warning-alert"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/wanpipe.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/wanpipe.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="wanpipe.conf" description="Sangoma Wanpipe Endpoint">
+ <settings>
+ <param name="debug" value="0"/>
+ <param name="dialplan" value="XML"/>
+ <param name="ms-per-frame" value="20"/>
+ <param name="dtmf-on" value="800"/>
+ <param name="dtmf-off" value="100"/>
+ <param name="supress-dtmf-tone" value="yes"/>
+ </settings>
+ <ss7boost_handles>
+<!--
+ <handle>
+ <param name="local-ip" value="127.0.0.65"/>
+ <param name="local-port" value="53000"/>
+ <param name="remote-ip" value="127.0.0.66"/>
+ <param name="remote-port" value="53000"/>
+ </handle>
+-->
+ </ss7boost_handles>
+ <pri_spans>
+ <!-- may be any single digit or a range of digits separated by a '-' e.g "1-4" -->
+ <span id="1">
+ <param name="node" value="cpe"/>
+ <param name="switch" value="ni2"/>
+ <!--<param name="switch" value="dms100"/>-->
+ <!-- <param name="switch" value="lucent5e"/> -->
+ <!-- <param name="switch" value="att4ess"/> -->
+ <!-- <param name="switch" value="euroisdn"/> -->
+ <!-- <param name="switch" value="gr303eoc"/> -->
+ <!-- <param name="switch" value="gr303tmc"/> -->
+ <param name="dp" value="national"/>
+ <!-- <param name="dp" value="international"/> -->
+ <!-- <param name="dp" value="local"/> -->
+ <!-- <param name="dp" value="private"/> -->
+ <!-- <param name="dp" value="unknown"/> -->
+ <param name="l1" value="ulaw"/>
+ <!-- <param name="l1" value="alaw"/> -->
+ <param name="bchan" value="1-23"/>
+ <param name="dchan" value="24"/>
+ <param name="dialplan" value="XML"/>
+ </span>
+ </pri_spans>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/woomera.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/woomera.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="woomera.conf" description="Woomera Endpoint">
+ <settings>
+ <param name="debug" value="0"/>
+ </settings>
+ <interface>
+ <param name="host" value="localhost"/>
+ <param name="port" value="42420"/>
+ <param name="audio-ip" value="127.0.0.1"/>
+ <param name="dialplan" value="XML"/>
+ </interface>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_cdr.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_cdr.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="xml_cdr.conf" description="XML CDR CURL logger">
+ <settings>
+ <!-- the url to post to if blank web posting is disabled -->
+ <!-- <param name="url" value="http://localhost/cdr_curl/post.php"/> -->
+
+ <!-- optional: credentials to send to web server -->
+ <!-- <param name="cred" value="user:pass"/> -->
+
+ <!-- the total number of retries (not counting the first 'try') to post to webserver incase of failure -->
+ <!-- <param name="retries" value="2"/> -->
+
+ <!-- delay between retries in seconds, default is 5 seconds -->
+ <!-- <param name="retries" value="1"/> -->
+
+ <!-- optional: full path to the error log dir for failed web posts if not specified its <freeswitch>/logs/xml_cdr_curl -->
+ <!-- <param name="errLogDir" value="/tmp"/> -->
+
+ <!-- optional: if not present we do not log every record to disk -->
+ <!-- per original code base /xml_cdr is appended to the directory name -->
+ <!-- defined but blank value will default to freeswitchdir/log -->
+ <param name="logDir" value=""/>
+
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_curl.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_curl.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="xml_curl.conf" description="cURL XML Gateway">
+ <bindings>
+ <binding name="example">
+ <!-- The url to a gateway cgi that can generate xml similar to
+ what's in this file only on-the-fly (leave it commented if you dont
+ need it) -->
+ <!-- one or more |-delim of configuration|directory|dialplan -->
+ <param name="gateway-url" value="http://www.mydomain.com/test.cgi" bindings="dialplan"/>
+ <!-- set this to provide authentication credentials to the server -->
+ <!--<param name="gateway-credentials" value="muser:mypass"/>-->
+ <!-- set to true to disable Expect: 100-continue lighttpd requires this setting -->
+ <!--<param name="disable-100-continue" value="true"/>-->
+ </binding>
+ </bindings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_rpc.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xml_rpc.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="xml_rpc.conf" description="XML RPC">
+ <settings>
+ <!-- The port where you want to run the http service (default 8080) -->
+ <param name="http-port" value="8080"/>
+ <!-- if all 3 of the following params exist all http traffic will require auth -->
+ <param name="auth-realm" value="freeswitch"/>
+ <param name="auth-user" value="freeswitch"/>
+ <param name="auth-pass" value="works"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xmpp_event.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/xmpp_event.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="xmpp_event.conf" description="XMPP Event Handler">
+ <settings>
+ <param name="#debug" value="1"/>
+ <param name="jid" value="freeswitch(a)my.jabber.com/me"/>
+ <param name="passwd" value="mypass"/>
+ <param name="target-jid" value="freeswitch(a)reader.org/him"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/zeroconf.conf.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/configuration/zeroconf.conf.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="configuration" description="Various Configuration">
+<configuration name="zeroconf.conf" description="Zeroconf Event Handler">
+ <settings>
+ <param name="publish" value="yes"/>
+ <param name="browse" value="_sip._udp"/>
+ </settings>
+</configuration>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/fail.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/fail.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="dialplan" description="Regex/XML Dialplan">
+ <context name="default">
+ <extension name="myextension">
+ <condition field="destination_number" expression=".*">
+ <action application="answer"/>
+ <action application="playback" data="/sounds/oops.wav"/>
+ </condition>
+ </extension>
+ </context>
+ </section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/dialplan/frompstn.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="dialplan" description="Regex/XML Dialplan">
+ <context name="default">
+ <extension name="myextension">
+ <condition field="destination_number" expression="^.*$">
+{foreach key=k item=v from=$ACTION}
+ <action application="{$k}" data="{$v}"/>
+{/foreach}
+ </condition>
+ </extension>
+ </context>
+ </section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/directory/192.168.153.128.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/directory/192.168.153.128.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="directory" description="User Directory">
+ <domain name="{$DOMAIN}">
+ <user id="{$USER}">
+ <params>
+ <param name="password" value="{$PASSWORD}"/>
+ </params>
+ </user>
+ </domain>
+
+ </section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/lang_en.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/lang_en.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="phrases" description="Speech Phrase Management">
+ <macros>
+ <language name="en" sound_path="/snds" tts_engine="cepstral" tts_voice="david">
+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+ <macro name="msgcount">
+ <input pattern="(.*)">
+ <match>
+ <action function="execute" data="sleep(1000)"/>
+ <action function="play-file" data="vm-youhave.wav"/>
+ <action function="say" data="$1" method="pronounced" type="items"/>
+ <action function="play-file" data="vm-messages.wav"/>
+ <!-- or -->
+ <!--<action function="speak-text" data="you have $1 messages"/>-->
+ </match>
+ </input>
+ </macro>
+ <macro name="saydate">
+ <input pattern="(.*)">
+ <match>
+ <action function="say" data="$1" method="pronounced" type="current_date_time"/>
+ </match>
+ </input>
+ </macro>
+ <macro name="timespec">
+ <input pattern="(.*)">
+ <match>
+ <action function="say" data="$1" method="pronounced" type="time_measurement"/>
+ </match>
+ </input>
+ </macro>
+ <macro name="ip-addr">
+ <input pattern="(.*)">
+ <match>
+ <action function="say" data="$1" method="iterated" type="ip_address"/>
+ <action function="say" data="$1" method="pronounced" type="ip_address"/>
+ </match>
+ </input>
+ </macro>
+ <macro name="spell">
+ <input pattern="(.*)">
+ <match>
+ <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+ </match>
+ </input>
+ </macro>
+ <macro name="spell-phonetic">
+ <input pattern="(.*)">
+ <match>
+ <action function="say" data="$1" method="pronounced" type="name_phonetic"/>
+ </match>
+ </input>
+ </macro>
+ <macro name="tts-timeleft">
+ <!-- The parser will visit each <input> tag and execute the actions in <match> or <nomatch> depending on the pattern param -->
+ <!-- If the function "break" is encountered all parsing will cease -->
+ <input pattern="(\d+):(\d+)">
+ <match>
+ <action function="speak-text" data="You have $1 minutes, $2 seconds remaining $strftime(%Y-%m-%d)"/>
+ <action function="break"/>
+ </match>
+ <nomatch>
+ <action function="speak-text" data="That input was invalid."/>
+ </nomatch>
+ </input>
+ <input pattern="(\d+) min (\d+) sec">
+ <match>
+ <action function="speak-text" data="You have $1 minutes, $2 seconds remaining $strftime(%Y-%m-%d)"/>
+ </match>
+ <nomatch>
+ <action function="speak-text" data="That input was invalid."/>
+ </nomatch>
+ </input>
+ </macro>
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
+</language>
+</macros>
+</section>
+</document>
Added: freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/lang_fr.tpl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/phrases/lang_fr.tpl Sat Jul 7 21:59:59 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+ <section name="phrases" description="Speech Phrase Management">
+ <macros>
+ <language name="fr" sound_path="/var/sounds/lang/fr/jean" tts_engine="cepstral" tts_voice="jean-pierre">
+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+<macro name="msgcount">
+ <input pattern="(.*)">
+ <match>
+ <action function="play-file" data="tuas.wav"/>
+ <action function="say" data="$1" method="pronounced" type="items"/>
+ <action function="play-file" data="messages.wav"/>
+ </match>
+ </input>
+</macro>
+<macro name="timeleft">
+ <input pattern="(\d+):(\d+)">
+ <match>
+ <action function="speak-text" data="il y a $1 minutes et de $2 secondes de restant"/>
+ </match>
+ </input>
+</macro>
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
+</language>
+</macros>
+</section>
+</document>
1
0
08 Jul '07
Author: trixter
Date: Sat Jul 7 21:58:05 2007
New Revision: 5514
Removed:
freeswitch/trunk/scripts/contrib/trixter/xml-curl/
Log:
rework
1
0
07 Jul '07
Author: trixter
Date: Sat Jul 7 00:27:39 2007
New Revision: 5513
Modified:
freeswitch/trunk/scripts/contrib/trixter/xml-curl/README
Log:
clarified readme
Modified: freeswitch/trunk/scripts/contrib/trixter/xml-curl/README
==============================================================================
--- freeswitch/trunk/scripts/contrib/trixter/xml-curl/README (original)
+++ freeswitch/trunk/scripts/contrib/trixter/xml-curl/README Sat Jul 7 00:27:39 2007
@@ -30,6 +30,17 @@
+The default examples require a .htaccess user to be authed with. If you dont
+want to do this (I recommend that you do password protect it) you can optionally
+just add the following somewhere near the top of curlrouting.php
+
+$_SERVER['REMOTE_USER']='switch1';
+
+which will set the username to 'switch1' which is the default user in this example
+
+
+
+
PREREQUISITES
You will need to get smarty from http://smarty.php.net to make this work
1
0