[asterisk-commits] branch oej/filenamelen r14106 - in
/team/oej/filenamelen: ./ apps/ channels/ ...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Mar 21 23:56:51 MST 2006
Author: oej
Date: Wed Mar 22 00:56:41 2006
New Revision: 14106
URL: http://svn.digium.com/view/asterisk?rev=14106&view=rev
Log:
Reset automerge
Modified:
team/oej/filenamelen/ (props changed)
team/oej/filenamelen/UPGRADE.txt
team/oej/filenamelen/apps/app_meetme.c
team/oej/filenamelen/apps/app_voicemail.c
team/oej/filenamelen/channels/chan_misdn.c
team/oej/filenamelen/channels/chan_skinny.c
team/oej/filenamelen/channels/chan_zap.c
team/oej/filenamelen/codecs/Makefile
team/oej/filenamelen/configs/features.conf.sample
team/oej/filenamelen/configs/indications.conf.sample
team/oej/filenamelen/configs/zapata.conf.sample
team/oej/filenamelen/doc/enum.txt
team/oej/filenamelen/include/asterisk/module.h
team/oej/filenamelen/res/res_features.c
team/oej/filenamelen/sample.call
team/oej/filenamelen/sounds.txt
Propchange: team/oej/filenamelen/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/filenamelen/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/filenamelen/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/filenamelen/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 22 00:56:41 2006
@@ -1,1 +1,1 @@
-/trunk:1-13723
+/trunk:1-14105
Modified: team/oej/filenamelen/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/filenamelen/UPGRADE.txt?rev=14106&r1=14105&r2=14106&view=diff
==============================================================================
--- team/oej/filenamelen/UPGRADE.txt (original)
+++ team/oej/filenamelen/UPGRADE.txt Wed Mar 22 00:56:41 2006
@@ -76,3 +76,10 @@
ASTBINDIR /usr/local/bin/asterisk
ASTSBINDIR /usr/local/sbin/asterisk
+Sounds:
+
+* The phonetic sounds directory has been removed from the asterisk-sounds package
+ because they are now included directly in Asterisk. However, it is important to
+ note that the phonetic sounds that existed in asterisk-sounds used a different
+ naming convention than the sounds in Asterisk. For example, instead of alpha.gsm
+ and bravo.gsm, Asterisk has a_p.gsm and b_p.gsm.
Modified: team/oej/filenamelen/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/filenamelen/apps/app_meetme.c?rev=14106&r1=14105&r2=14106&view=diff
==============================================================================
--- team/oej/filenamelen/apps/app_meetme.c (original)
+++ team/oej/filenamelen/apps/app_meetme.c Wed Mar 22 00:56:41 2006
@@ -957,7 +957,9 @@
snprintf(user->namerecloc, sizeof(user->namerecloc),
"%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
conf->confno, user->user_no);
- ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
+ res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
+ if (res == -1)
+ goto outrun;
}
if ( !(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON)) ) {
@@ -1830,28 +1832,20 @@
ast_log(LOG_WARNING, "No %s file :(\n", CONFIG_FILE_NAME);
return NULL;
}
- var = ast_variable_browse(cfg, "rooms");
- for (; var; var = var->next) {
+ for (var = ast_variable_browse(cfg, "rooms"); var; var = var->next) {
if (strcasecmp(var->name, "conf"))
continue;
if (!(parse = ast_strdupa(var->value)))
return NULL;
- AST_STANDARD_APP_ARGS(args, parse);
+ AST_NONSTANDARD_APP_ARGS(args, parse, ',');
if (!strcasecmp(args.confno, confno)) {
/* Bingo it's a valid conference */
- if (args.pin) {
- if (args.pinadmin)
- cnf = build_conf(args.confno, args.pin, args.pinadmin, make, dynamic, refcount);
- else
- cnf = build_conf(args.confno, args.pin, "", make, dynamic, refcount);
- } else {
- if (args.pinadmin)
- cnf = build_conf(args.confno, "", args.pinadmin, make, dynamic, refcount);
- else
- cnf = build_conf(args.confno, "", "", make, dynamic, refcount);
- }
+ cnf = build_conf(args.confno,
+ ast_strlen_zero(args.pin) ? "" : args.pin,
+ ast_strlen_zero(args.pinadmin) ? "" : args.pinadmin,
+ make, dynamic, refcount);
break;
}
}
@@ -2026,7 +2020,7 @@
AST_LIST_UNLOCK(&confs);
if (!found) {
/* At this point, we have a confno_tmp (static conference) that is empty */
- if ((empty_no_pin && ((!stringp) || (stringp && (stringp[0] == '\0')))) || (!empty_no_pin)) {
+ if ((empty_no_pin && ast_strlen_zero(stringp)) || (!empty_no_pin)) {
/* Case 1: empty_no_pin and pin is nonexistent (NULL)
* Case 2: empty_no_pin and pin is blank (but not NULL)
* Case 3: not empty_no_pin
Modified: team/oej/filenamelen/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/filenamelen/apps/app_voicemail.c?rev=14106&r1=14105&r2=14106&view=diff
==============================================================================
--- team/oej/filenamelen/apps/app_voicemail.c (original)
+++ team/oej/filenamelen/apps/app_voicemail.c Wed Mar 22 00:56:41 2006
@@ -2374,6 +2374,7 @@
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
{
char txtfile[AST_MAX_FILENAME_LEN];
+ char tmptxtfile[AST_MAX_FILENAME_LEN];
char callerid[256];
FILE *txt;
int res = 0;
@@ -2572,7 +2573,8 @@
/* Store information */
snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
- txt = fopen(txtfile, "w+");
+ snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn);
+ txt = fopen(tmptxtfile, "w+");
if (txt) {
get_date(date, sizeof(date));
fprintf(txt,
@@ -2612,6 +2614,7 @@
if (txt) {
fprintf(txt, "duration=%d\n", duration);
fclose(txt);
+ rename(tmptxtfile, txtfile);
}
if (duration < vmminmessage) {
Modified: team/oej/filenamelen/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/filenamelen/channels/chan_misdn.c?rev=14106&r1=14105&r2=14106&view=diff
==============================================================================
--- team/oej/filenamelen/channels/chan_misdn.c (original)
+++ team/oej/filenamelen/channels/chan_misdn.c Wed Mar 22 00:56:41 2006
@@ -2080,7 +2080,7 @@
if ( !frame->subclass) {
- chan_misdn_log(0, ch->bc->port, "misdn_write: * prods us\n");
+ chan_misdn_log(2, ch->bc->port, "misdn_write: * prods us\n");
return 0;
}
@@ -2164,19 +2164,19 @@
int ecwb;
misdn_cfg_get( ch1->bc->port, MISDN_CFG_ECHOCANCELWHENBRIDGED, &ecwb, sizeof(int));
if ( !ecwb ) {
- chan_misdn_log(0, ch1->bc->port, "Disabling Echo Cancellor when Bridged\n");
+ chan_misdn_log(2, ch1->bc->port, "Disabling Echo Cancellor when Bridged\n");
ch1->bc->ec_enable=0;
manager_ec_disable(ch1->bc);
}
misdn_cfg_get( ch2->bc->port, MISDN_CFG_ECHOCANCELWHENBRIDGED, &ecwb, sizeof(int));
if ( !ecwb ) {
- chan_misdn_log(0, ch2->bc->port, "Disabling Echo Cancellor when Bridged\n");
+ chan_misdn_log(2, ch2->bc->port, "Disabling Echo Cancellor when Bridged\n");
ch2->bc->ec_enable=0;
manager_ec_disable(ch2->bc);
}
/* trying to make a mISDN_dsp conference */
- chan_misdn_log(0, ch1->bc->port, "I SEND: Making conference with Number:%d\n", (ch1->bc->pid<<1) +1);
+ chan_misdn_log(1, ch1->bc->port, "I SEND: Making conference with Number:%d\n", (ch1->bc->pid<<1) +1);
misdn_lib_bridge(ch1->bc,ch2->bc);
}
@@ -2228,7 +2228,7 @@
const struct tone_zone_sound *ts= NULL;
struct ast_channel *ast=cl->ast;
- chan_misdn_log(0,cl->bc->port,"Tone Indicate:\n");
+ chan_misdn_log(2,cl->bc->port,"Tone Indicate:\n");
if (!cl->ast) {
return 0;
@@ -2236,17 +2236,17 @@
switch (tone) {
case TONE_DIAL:
- chan_misdn_log(0,cl->bc->port," --> Dial\n");
+ chan_misdn_log(2,cl->bc->port," --> Dial\n");
ts=ast_get_indication_tone(ast->zone,"dial");
misdn_lib_tone_generator_start(cl->bc);
break;
case TONE_ALERTING:
- chan_misdn_log(0,cl->bc->port," --> Ring\n");
+ chan_misdn_log(2,cl->bc->port," --> Ring\n");
ts=ast_get_indication_tone(ast->zone,"ring");
misdn_lib_tone_generator_stop(cl->bc);
break;
case TONE_BUSY:
- chan_misdn_log(0,cl->bc->port," --> Busy\n");
+ chan_misdn_log(2,cl->bc->port," --> Busy\n");
ts=ast_get_indication_tone(ast->zone,"busy");
misdn_lib_tone_generator_stop(cl->bc);
break;
@@ -2254,7 +2254,7 @@
break;
case TONE_NONE:
- chan_misdn_log(0,cl->bc->port," --> None\n");
+ chan_misdn_log(2,cl->bc->port," --> None\n");
misdn_lib_tone_generator_stop(cl->bc);
ast_playtones_stop(ast);
break;
@@ -3325,7 +3325,7 @@
}
- chan_misdn_log(0,bc->port,"CONTEXT:%s\n",ch->context);
+ chan_misdn_log(5,bc->port,"CONTEXT:%s\n",ch->context);
if(!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
chan_misdn_log(-1, bc->port, "Extension can never match, so disconnecting\n");
Modified: team/oej/filenamelen/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/oej/filenamelen/channels/chan_skinny.c?rev=14106&r1=14105&r2=14106&view=diff
==============================================================================
--- team/oej/filenamelen/channels/chan_skinny.c (original)
+++ team/oej/filenamelen/channels/chan_skinny.c Wed Mar 22 00:56:41 2006
@@ -70,9 +70,9 @@
#include "asterisk/dsp.h"
#include "asterisk/stringfields.h"
-/************************************************************************************/
-/* Skinny/Asterisk Protocol Settings */
-/************************************************************************************/
+/*************************************
+ * Skinny/Asterisk Protocol Settings *
+ *************************************/
static const char desc[] = "Skinny Client Control Protocol (Skinny)";
static const char tdesc[] = "Skinny Client Control Protocol (Skinny)";
static const char config[] = "skinny.conf";
@@ -81,17 +81,17 @@
static int capability = AST_FORMAT_ULAW;
#define DEFAULT_SKINNY_PORT 2000
-#define DEFAULT_SKINNY_BACKLOG 2
+#define DEFAULT_SKINNY_BACKLOG 2
#define SKINNY_MAX_PACKET 1000
-static int keep_alive = 120;
+static int keep_alive = 120;
static char date_format[6] = "D-M-Y";
static char version_id[16] = "P002F202";
/* these should be in an include file, but dunno what to include */
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned int UINT32;
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define letohl(x) (x)
@@ -101,13 +101,13 @@
#else
#if defined(SOLARIS) || defined(__Darwin__) || defined(__NetBSD__)
#define __bswap_16(x) \
- ((((x) & 0xff00) >> 8) | \
- (((x) & 0x00ff) << 8))
+ ((((x) & 0xff00) >> 8) | \
+ (((x) & 0x00ff) << 8))
#define __bswap_32(x) \
- ((((x) & 0xff000000) >> 24) | \
- (((x) & 0x00ff0000) >> 8) | \
- (((x) & 0x0000ff00) << 8) | \
- (((x) & 0x000000ff) << 24))
+ ((((x) & 0xff000000) >> 24) | \
+ (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | \
+ (((x) & 0x000000ff) << 24))
#else
#include <bits/byteswap.h>
#endif
@@ -118,9 +118,9 @@
#endif
-/************************************************************************************/
-/* Protocol Messages */
-/************************************************************************************/
+/*********************
+ * Protocol Messages *
+ *********************/
/* message types */
#define KEEP_ALIVE_MESSAGE 0x0000
/* no additional struct */
@@ -248,7 +248,7 @@
#define STOP_MEDIA_TRANSMISSION_MESSAGE 0x008B
typedef struct stop_media_transmission_message {
int conferenceId;
- int passThruPartyId;
+ int passThruPartyId;
} stop_media_transmission_message;
#define CALL_INFO_MESSAGE 0x008F
@@ -257,9 +257,9 @@
char callingParty[24];
char calledPartyName[40];
char calledParty[24];
- int instance;
- int reference;
- int type;
+ int instance;
+ int reference;
+ int type;
char originalCalledPartyName[40];
char originalCalledParty[24];
} call_info_message;
@@ -273,10 +273,10 @@
#define LINE_STAT_RES_MESSAGE 0x0092
typedef struct line_stat_res_message {
- int linenumber;
+ int linenumber;
char lineDirNumber[24];
char lineDisplayName[42];
- int space;
+ int space;
} line_stat_res_message;
#define DEFINETIMEDATE_MESSAGE 0x0094
@@ -533,7 +533,7 @@
int softKeyOffset;
int softKeyCount;
int totalSoftKeyCount;
- soft_key_template_definition softKeyTemplateDefinition[32];
+ soft_key_template_definition softKeyTemplateDefinition[32];
} soft_key_template;
#define SOFT_KEY_SET_RES_MESSAGE 0x0109
@@ -574,7 +574,7 @@
};
typedef struct soft_key_set_definition {
- UINT8 softKeyTemplateIndex[16];
+ UINT8 softKeyTemplateIndex[16];
UINT16 softKeyInfoIndex[16];
} soft_key_set_definition;
@@ -620,12 +620,12 @@
int lineInstance;
} activate_call_plane_message;
-#define DIALLED_NUMBER_MESSAGE 0x011D
-typedef struct dialled_number_message {
- char dialledNumber[24];
+#define DIALED_NUMBER_MESSAGE 0x011D
+typedef struct dialed_number_message {
+ char dialedNumber[24];
int lineInstance;
int callReference;
-} dialled_number_message;
+} dialed_number_message;
/* packet composition */
typedef struct {
@@ -665,13 +665,13 @@
open_recieve_channel_ack_message openrecievechannelack;
close_recieve_channel_message closerecievechannel;
display_notify_message displaynotify;
- dialled_number_message diallednumber;
+ dialed_number_message dialednumber;
} data;
} skinny_req;
-/************************************************************************************/
-/* Asterisk specific globals */
-/************************************************************************************/
+/*****************************
+ * Asterisk specific globals *
+ *****************************/
static int skinnydebug = 1; /* XXX for now, enable debugging default */
@@ -681,7 +681,7 @@
static int ourport;
static struct in_addr __ourip;
struct ast_hostent ahp; struct hostent *hp;
-static int skinnysock = -1;
+static int skinnysock = -1;
static pthread_t tcp_thread;
static pthread_t accept_t;
static char context[AST_MAX_CONTEXT] = "default";
@@ -708,7 +708,7 @@
static int callnums = 1;
#define SUB_REAL 0
-#define SUB_ALT 1
+#define SUB_ALT 1
#define MAX_SUBS 2
#define SKINNY_SPEAKERON 1
@@ -737,7 +737,7 @@
#define SKINNY_NOTONE 0x7F
#define SKINNY_LAMP_OFF 1
-#define SKINNY_LAMP_ON 2
+#define SKINNY_LAMP_ON 2
#define SKINNY_LAMP_WINK 3
#define SKINNY_LAMP_FLASH 4
#define SKINNY_LAMP_BLINK 5
@@ -751,21 +751,21 @@
#define TYPE_LINE 2
/* Skinny rtp stream modes. Do we really need this? */
-#define SKINNY_CX_SENDONLY 0
-#define SKINNY_CX_RECVONLY 1
-#define SKINNY_CX_SENDRECV 2
-#define SKINNY_CX_CONF 3
-#define SKINNY_CX_CONFERENCE 3
-#define SKINNY_CX_MUTE 4
-#define SKINNY_CX_INACTIVE 4
+#define SKINNY_CX_SENDONLY 0
+#define SKINNY_CX_RECVONLY 1
+#define SKINNY_CX_SENDRECV 2
+#define SKINNY_CX_CONF 3
+#define SKINNY_CX_CONFERENCE 3
+#define SKINNY_CX_MUTE 4
+#define SKINNY_CX_INACTIVE 4
#if 0
static char *skinny_cxmodes[] = {
- "sendonly",
- "recvonly",
- "sendrecv",
- "confrnce",
- "inactive"
+ "sendonly",
+ "recvonly",
+ "sendrecv",
+ "confrnce",
+ "inactive"
};
#endif
@@ -792,7 +792,7 @@
#endif
/* This is the thread for the monitor which checks for input on the channels
- which are not currently in use. */
+ which are not currently in use. */
static pthread_t monitor_thread = AST_PTHREADT_NULL;
/* Wait up to 16 seconds for first digit */
@@ -825,7 +825,7 @@
ast_mutex_t lock;
char name[80];
char label[42]; /* Label that shows next to the line buttons */
- struct skinny_subchannel *sub; /* pointer to our current connection, channel and stuff */
+ struct skinny_subchannel *sub; /* pointer to our current connection, channel and stuff */
char accountcode[AST_MAX_ACCOUNT_CODE];
char exten[AST_MAX_EXTENSION]; /* Extention where to start */
char context[AST_MAX_CONTEXT];
@@ -1006,7 +1006,7 @@
/* XXX Do this right */
static int convert_cap(int capability)
{
- return 4; /* ulaw (this is not the same as asterisk's '4' */
+ return 4; /* ulaw (this is not the same as asterisk's '4' */
}
@@ -1063,11 +1063,11 @@
req->data.closerecievechannel.partyId = 0;
transmit_response(s, req);
memset(req, 0, memsize);
- req->len = htolel(sizeof(stop_media_transmission_message)+4);
- req->e = htolel(STOP_MEDIA_TRANSMISSION_MESSAGE);
- req->data.stopmedia.conferenceId = 0;
- req->data.stopmedia.passThruPartyId = 0;
- transmit_response(s, req);
+ req->len = htolel(sizeof(stop_media_transmission_message)+4);
+ req->e = htolel(STOP_MEDIA_TRANSMISSION_MESSAGE);
+ req->data.stopmedia.conferenceId = 0;
+ req->data.stopmedia.passThruPartyId = 0;
+ transmit_response(s, req);
}
}
@@ -1233,10 +1233,10 @@
req = req_alloc(sizeof(struct display_notify_message));
- if (!req) {
- ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
- return;
- }
+ if (!req) {
+ ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
+ return;
+ }
req->e = htolel(DISPLAY_NOTIFY_MESSAGE);
req->len = htolel(sizeof(display_notify_message) + 4);
@@ -1256,10 +1256,10 @@
req = req_alloc(sizeof(struct display_prompt_status_message));
- if (!req) {
- ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
- return;
- }
+ if (!req) {
+ ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
+ return;
+ }
req->e = htolel(DISPLAY_PROMPT_STATUS_MESSAGE);
req->len = htolel(sizeof(display_prompt_status_message) + 4);
@@ -1275,22 +1275,22 @@
transmit_response(s, req);
}
-static void transmit_diallednumber(struct skinnysession *s, char *text, int instance, int callid)
+static void transmit_dialednumber(struct skinnysession *s, char *text, int instance, int callid)
{
skinny_req *req;
- req = req_alloc(sizeof(struct dialled_number_message));
-
- if (!req) {
- ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
- return;
- }
-
- req->e = htolel(DIALLED_NUMBER_MESSAGE);
- req->len = htolel(sizeof(dialled_number_message) + 4);
- strncpy(req->data.diallednumber.dialledNumber, text, sizeof(req->data.diallednumber.dialledNumber)-1);
- req->data.diallednumber.lineInstance = htolel(instance);
- req->data.diallednumber.callReference = htolel(callid);
+ req = req_alloc(sizeof(struct dialed_number_message));
+
+ if (!req) {
+ ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
+ return;
+ }
+
+ req->e = htolel(DIALED_NUMBER_MESSAGE);
+ req->len = htolel(sizeof(dialed_number_message) + 4);
+ strncpy(req->data.dialednumber.dialedNumber, text, sizeof(req->data.dialednumber.dialedNumber)-1);
+ req->data.dialednumber.lineInstance = htolel(instance);
+ req->data.dialednumber.callReference = htolel(callid);
transmit_response(s, req);
}
@@ -1357,7 +1357,7 @@
static struct ast_rtp_protocol skinny_rtp = {
.type = "Skinny",
.get_rtp_info = skinny_get_rtp_peer,
- .get_vrtp_info = skinny_get_vrtp_peer,
+ .get_vrtp_info = skinny_get_vrtp_peer,
.set_rtp_peer = skinny_set_rtp_peer,
};
@@ -1383,7 +1383,7 @@
static int skinny_show_devices(int fd, int argc, char *argv[])
{
- struct skinny_device *d;
+ struct skinny_device *d;
struct skinny_line *l;
int numlines = 0;
char iabuf[INET_ADDRSTRLEN];
@@ -1418,7 +1418,7 @@
static int skinny_show_lines(int fd, int argc, char *argv[])
{
- struct skinny_device *d;
+ struct skinny_device *d;
struct skinny_line *l;
if (argc != 3) {
@@ -1460,16 +1460,16 @@
"Usage: skinny no debug\n"
" Disables dumping of Skinny packets for debugging purposes\n";
-static struct ast_cli_entry cli_show_devices =
+static struct ast_cli_entry cli_show_devices =
{ { "skinny", "show", "devices", NULL }, skinny_show_devices, "Show defined Skinny devices", show_devices_usage };
-static struct ast_cli_entry cli_show_lines =
+static struct ast_cli_entry cli_show_lines =
{ { "skinny", "show", "lines", NULL }, skinny_show_lines, "Show defined Skinny lines per device", show_lines_usage };
-static struct ast_cli_entry cli_debug =
+static struct ast_cli_entry cli_debug =
{ { "skinny", "debug", NULL }, skinny_do_debug, "Enable Skinny debugging", debug_usage };
-static struct ast_cli_entry cli_no_debug =
+static struct ast_cli_entry cli_no_debug =
{ { "skinny", "no", "debug", NULL }, skinny_no_debug, "Disable Skinny debugging", no_debug_usage };
#if 0
@@ -1499,16 +1499,16 @@
} else if (!strcasecmp(v->name, "port")) {
d->addr.sin_port = htons(atoi(v->value));
} else if (!strcasecmp(v->name, "device")) {
- strncpy(d->id, v->value, sizeof(d->id)-1);
+ strncpy(d->id, v->value, sizeof(d->id)-1);
} else if (!strcasecmp(v->name, "permit") || !strcasecmp(v->name, "deny")) {
d->ha = ast_append_ha(v->name, v->value, d->ha);
} else if (!strcasecmp(v->name, "context")) {
strncpy(context, v->value, sizeof(context) - 1);
} else if (!strcasecmp(v->name, "version")) {
- strncpy(d->version_id, v->value, sizeof(d->version_id) -1);
+ strncpy(d->version_id, v->value, sizeof(d->version_id) -1);
} else if (!strcasecmp(v->name, "nat")) {
nat = ast_true(v->value);
- } else if (!strcasecmp(v->name, "model")) {
+ } else if (!strcasecmp(v->name, "model")) {
strncpy(d->model, v->value, sizeof(d->model) - 1);
} else if (!strcasecmp(v->name, "callerid")) {
if (!strcasecmp(v->value, "asreceived")) {
@@ -1519,44 +1519,44 @@
}
} else if (!strcasecmp(v->name, "language")) {
strncpy(language, v->value, sizeof(language)-1);
- } else if (!strcasecmp(v->name, "accountcode")) {
- strncpy(accountcode, v->value, sizeof(accountcode)-1);
- } else if (!strcasecmp(v->name, "amaflags")) {
- y = ast_cdr_amaflags2int(v->value);
- if (y < 0) {
- ast_log(LOG_WARNING, "Invalid AMA flags: %s at line %d\n", v->value, v->lineno);
- } else {
- amaflags = y;
- }
+ } else if (!strcasecmp(v->name, "accountcode")) {
+ strncpy(accountcode, v->value, sizeof(accountcode)-1);
+ } else if (!strcasecmp(v->name, "amaflags")) {
+ y = ast_cdr_amaflags2int(v->value);
+ if (y < 0) {
+ ast_log(LOG_WARNING, "Invalid AMA flags: %s at line %d\n", v->value, v->lineno);
+ } else {
+ amaflags = y;
+ }
} else if (!strcasecmp(v->name, "musiconhold")) {
- strncpy(musicclass, v->value, sizeof(musicclass)-1);
- } else if (!strcasecmp(v->name, "callgroup")) {
- cur_callergroup = ast_get_group(v->value);
- } else if (!strcasecmp(v->name, "pickupgroup")) {
- cur_pickupgroup = ast_get_group(v->value);
- } else if (!strcasecmp(v->name, "immediate")) {
- immediate = ast_true(v->value);
- } else if (!strcasecmp(v->name, "cancallforward")) {
- cancallforward = ast_true(v->value);
- } else if (!strcasecmp(v->name, "mailbox")) {
- strncpy(mailbox, v->value, sizeof(mailbox) -1);
- } else if (!strcasecmp(v->name, "callreturn")) {
+ strncpy(musicclass, v->value, sizeof(musicclass)-1);
+ } else if (!strcasecmp(v->name, "callgroup")) {
+ cur_callergroup = ast_get_group(v->value);
+ } else if (!strcasecmp(v->name, "pickupgroup")) {
+ cur_pickupgroup = ast_get_group(v->value);
+ } else if (!strcasecmp(v->name, "immediate")) {
+ immediate = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "cancallforward")) {
+ cancallforward = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "mailbox")) {
+ strncpy(mailbox, v->value, sizeof(mailbox) -1);
+ } else if (!strcasecmp(v->name, "callreturn")) {
callreturn = ast_true(v->value);
- } else if (!strcasecmp(v->name, "callwaiting")) {
- callwaiting = ast_true(v->value);
- } else if (!strcasecmp(v->name, "transfer")) {
- transfer = ast_true(v->value);
- } else if (!strcasecmp(v->name, "threewaycalling")) {
- threewaycalling = ast_true(v->value);
- } else if (!strcasecmp(v->name, "mwiblink")) {
- mwiblink = ast_true(v->value);
- } else if (!strcasecmp(v->name, "linelabel")) {
- strncpy(linelabel, v->value, sizeof(linelabel)-1);
- } else if (!strcasecmp(v->name, "trunk") || !strcasecmp(v->name, "line")) {
+ } else if (!strcasecmp(v->name, "callwaiting")) {
+ callwaiting = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "transfer")) {
+ transfer = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "threewaycalling")) {
+ threewaycalling = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "mwiblink")) {
+ mwiblink = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "linelabel")) {
+ strncpy(linelabel, v->value, sizeof(linelabel)-1);
+ } else if (!strcasecmp(v->name, "trunk") || !strcasecmp(v->name, "line")) {
l = malloc(sizeof(struct skinny_line));;
if (l) {
memset(l, 0, sizeof(struct skinny_line));
- ast_mutex_init(&l->lock);
+ ast_mutex_init(&l->lock);
strncpy(l->name, v->value, sizeof(l->name) - 1);
/* XXX Should we check for uniqueness?? XXX */
@@ -1565,7 +1565,7 @@
strncpy(l->cid_name, cid_name, sizeof(l->cid_name) - 1);
strncpy(l->label, linelabel, sizeof(l->label) - 1);
strncpy(l->language, language, sizeof(l->language) - 1);
- strncpy(l->musicclass, musicclass, sizeof(l->musicclass)-1);
+ strncpy(l->musicclass, musicclass, sizeof(l->musicclass)-1);
strncpy(l->mailbox, mailbox, sizeof(l->mailbox)-1);
strncpy(l->mailbox, mailbox, sizeof(l->mailbox)-1);
if (!ast_strlen_zero(mailbox)) {
@@ -1583,42 +1583,42 @@
l->callgroup = cur_callergroup;
l->pickupgroup = cur_pickupgroup;
l->callreturn = callreturn;
- l->cancallforward = cancallforward;
- l->callwaiting = callwaiting;
- l->transfer = transfer;
- l->threewaycalling = threewaycalling;
- l->mwiblink = mwiblink;
- l->onhooktime = time(NULL);
+ l->cancallforward = cancallforward;
+ l->callwaiting = callwaiting;
+ l->transfer = transfer;
+ l->threewaycalling = threewaycalling;
+ l->mwiblink = mwiblink;
+ l->onhooktime = time(NULL);
l->instance = 1;
- /* ASSUME we're onhook at this point*/
- l->hookstate = SKINNY_ONHOOK;
-
- for (i = 0; i < MAX_SUBS; i++) {
- sub = malloc(sizeof(struct skinny_subchannel));
- if (sub) {
- ast_verbose(VERBOSE_PREFIX_3 "Allocating Skinny subchannel '%d' on %s@%s\n", i, l->name, d->name);
- memset(sub, 0, sizeof(struct skinny_subchannel));
- ast_mutex_init(&sub->lock);
- sub->parent = l;
- /* Make a call*ID */
+ /* ASSUME we're onhook at this point*/
+ l->hookstate = SKINNY_ONHOOK;
+
+ for (i = 0; i < MAX_SUBS; i++) {
+ sub = malloc(sizeof(struct skinny_subchannel));
+ if (sub) {
+ ast_verbose(VERBOSE_PREFIX_3 "Allocating Skinny subchannel '%d' on %s@%s\n", i, l->name, d->name);
+ memset(sub, 0, sizeof(struct skinny_subchannel));
+ ast_mutex_init(&sub->lock);
+ sub->parent = l;
+ /* Make a call*ID */
sub->callid = callnums;
callnums++;
- sub->cxmode = SKINNY_CX_INACTIVE;
- sub->nat = nat;
- sub->next = l->sub;
- l->sub = sub;
- } else {
- /* XXX Should find a way to clean up our memory */
- ast_log(LOG_WARNING, "Out of memory allocating subchannel");
- return NULL;
- }
- }
- l->next = d->lines;
+ sub->cxmode = SKINNY_CX_INACTIVE;
+ sub->nat = nat;
+ sub->next = l->sub;
+ l->sub = sub;
+ } else {
+ /* XXX Should find a way to clean up our memory */
+ ast_log(LOG_WARNING, "Out of memory allocating subchannel");
+ return NULL;
+ }
+ }
+ l->next = d->lines;
d->lines = l;
- } else {
- /* XXX Should find a way to clean up our memory */
- ast_log(LOG_WARNING, "Out of memory allocating line");
- return NULL;
+ } else {
+ /* XXX Should find a way to clean up our memory */
+ ast_log(LOG_WARNING, "Out of memory allocating line");
+ return NULL;
}
} else {
ast_log(LOG_WARNING, "Don't know keyword '%s' at line %d\n", v->name, v->lineno);
@@ -1698,212 +1698,212 @@
int timeout = firstdigittimeout;
int res;
int getforward=0;
-
+
if (option_verbose > 2) {
ast_verbose( VERBOSE_PREFIX_3 "Starting simple switch on '%s@%s'\n", l->name, l->parent->name);
}
while(len < AST_MAX_EXTENSION-1) {
- res = ast_waitfordigit(chan, timeout);
- timeout = 0;
- if (res < 0) {
+ res = ast_waitfordigit(chan, timeout);
+ timeout = 0;
+ if (res < 0) {
if (skinnydebug) {
ast_verbose("Skinny(%s@%s): waitfordigit returned < 0\n", l->name, l->parent->name);
- }
+ }
ast_indicate(chan, -1);
ast_hangup(chan);
- return NULL;
- } else if (res) {
- exten[len++]=res;
- exten[len] = '\0';
- }
- if (!ast_ignore_pattern(chan->context, exten)) {
+ return NULL;
+ } else if (res) {
+ exten[len++]=res;
+ exten[len] = '\0';
+ }
+ if (!ast_ignore_pattern(chan->context, exten)) {
transmit_tone(s, SKINNY_SILENCE);
- }
- if (ast_exists_extension(chan, chan->context, exten, 1, l->cid_num)) {
- if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, l->cid_num)) {
- if (getforward) {
- /* Record this as the forwarding extension */
- strncpy(l->call_forward, exten, sizeof(l->call_forward) - 1);
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
- l->call_forward, chan->name);
- }
- transmit_tone(s, SKINNY_DIALTONE);
- if (res) {
- break;
- }
+ }
+ if (ast_exists_extension(chan, chan->context, exten, 1, l->cid_num)) {
+ if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, l->cid_num)) {
+ if (getforward) {
+ /* Record this as the forwarding extension */
+ strncpy(l->call_forward, exten, sizeof(l->call_forward) - 1);
+ if (option_verbose > 2) {
+ ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %s\n",
+ l->call_forward, chan->name);
+ }
+ transmit_tone(s, SKINNY_DIALTONE);
+ if (res) {
+ break;
+ }
ast_safe_sleep(chan, 500);
- ast_indicate(chan, -1);
+ ast_indicate(chan, -1);
ast_safe_sleep(chan, 1000);
- memset(exten, 0, sizeof(exten));
- transmit_tone(s, SKINNY_DIALTONE);
- len = 0;
- getforward = 0;
- } else {
- strncpy(chan->exten, exten, sizeof(chan->exten)-1);
- if (!ast_strlen_zero(l->cid_num)) {
- if (!l->hidecallerid) {
- chan->cid.cid_num = strdup(l->cid_num);
- chan->cid.cid_ani = strdup(l->cid_num);
- }
- ast_setstate(chan, AST_STATE_RING);
- res = ast_pbx_run(chan);
- if (res) {
- ast_log(LOG_WARNING, "PBX exited non-zero\n");
+ memset(exten, 0, sizeof(exten));
+ transmit_tone(s, SKINNY_DIALTONE);
+ len = 0;
+ getforward = 0;
+ } else {
+ strncpy(chan->exten, exten, sizeof(chan->exten)-1);
+ if (!ast_strlen_zero(l->cid_num)) {
+ if (!l->hidecallerid) {
+ chan->cid.cid_num = strdup(l->cid_num);
+ chan->cid.cid_ani = strdup(l->cid_num);
+ }
+ ast_setstate(chan, AST_STATE_RING);
+ res = ast_pbx_run(chan);
+ if (res) {
+ ast_log(LOG_WARNING, "PBX exited non-zero\n");
transmit_tone(s, SKINNY_REORDER);
- }
- return NULL;
- }
+ }
+ return NULL;
+ }
}
- } else {
- /* It's a match, but they just typed a digit, and there is an ambiguous match,
- so just set the timeout to matchdigittimeout and wait some more */
- timeout = matchdigittimeout;
- }
+ } else {
+ /* It's a match, but they just typed a digit, and there is an ambiguous match,
+ so just set the timeout to matchdigittimeout and wait some more */
+ timeout = matchdigittimeout;
+ }
} else if (res == 0) {
- ast_log(LOG_DEBUG, "Not enough digits (and no ambiguous match)...\n");
- transmit_tone(s, SKINNY_REORDER);
- ast_hangup(chan);
- return NULL;
- } else if (l->callwaiting && !strcmp(exten, "*70")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
- }
- /* Disable call waiting if enabled */
- l->callwaiting = 0;
- transmit_tone(s, SKINNY_DIALTONE);
+ ast_log(LOG_DEBUG, "Not enough digits (and no ambiguous match)...\n");
+ transmit_tone(s, SKINNY_REORDER);
+ ast_hangup(chan);
+ return NULL;
+ } else if (l->callwaiting && !strcmp(exten, "*70")) {
+ if (option_verbose > 2) {
+ ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
+ }
+ /* Disable call waiting if enabled */
+ l->callwaiting = 0;
+ transmit_tone(s, SKINNY_DIALTONE);
len = 0;
- memset(exten, 0, sizeof(exten));\
- timeout = firstdigittimeout;
- } else if (!strcmp(exten,ast_pickup_ext())) {
- /* Scan all channels and see if any there
- * ringing channqels with that have call groups
- * that equal this channels pickup group
- */
- if (ast_pickup_call(chan)) {
- ast_log(LOG_WARNING, "No call pickup possible...\n");
+ memset(exten, 0, sizeof(exten));
+ timeout = firstdigittimeout;
+ } else if (!strcmp(exten,ast_pickup_ext())) {
+ /* Scan all channels and see if any there
+ * ringing channels with that have call groups
+ * that equal this channels pickup group
+ */
+ if (ast_pickup_call(chan)) {
+ ast_log(LOG_WARNING, "No call pickup possible...\n");
transmit_tone(s, SKINNY_REORDER);
- }
- ast_hangup(chan);
- return NULL;
- } else if (!l->hidecallerid && !strcmp(exten, "*67")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
- }
- /* Disable Caller*ID if enabled */
- l->hidecallerid = 1;
- if (chan->cid.cid_num) {
- free(chan->cid.cid_num);
- }
- chan->cid.cid_num = NULL;
- if (chan->cid.cid_name) {
- free(chan->cid.cid_name);
- }
- chan->cid.cid_name = NULL;
- transmit_tone(s, SKINNY_DIALTONE);
- len = 0;
- memset(exten, 0, sizeof(exten));
- timeout = firstdigittimeout;
- } else if (l->callreturn && !strcmp(exten, "*69")) {
- res = 0;
- if (!ast_strlen_zero(l->lastcallerid)) {
- res = ast_say_digit_str(chan, l->lastcallerid, "", chan->language);
- }
- if (!res) {
- transmit_tone(s, SKINNY_DIALTONE);
- }
- break;
- } else if (!strcmp(exten, "*78")) {
- /* Do not disturb */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %s\n", chan->name);
- }
- transmit_tone(s, SKINNY_DIALTONE);
- l->dnd = 1;
- getforward = 0;
- memset(exten, 0, sizeof(exten));
- len = 0;
- } else if (!strcmp(exten, "*79")) {
- /* Do not disturb */
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %s\n", chan->name);
- }
+ }
+ ast_hangup(chan);
+ return NULL;
+ } else if (!l->hidecallerid && !strcmp(exten, "*67")) {
+ if (option_verbose > 2) {
+ ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
+ }
+ /* Disable Caller*ID if enabled */
+ l->hidecallerid = 1;
+ if (chan->cid.cid_num) {
+ free(chan->cid.cid_num);
+ }
+ chan->cid.cid_num = NULL;
+ if (chan->cid.cid_name) {
+ free(chan->cid.cid_name);
+ }
+ chan->cid.cid_name = NULL;
transmit_tone(s, SKINNY_DIALTONE);
- l->dnd = 0;
- getforward = 0;
- memset(exten, 0, sizeof(exten));
- len = 0;
- } else if (l->cancallforward && !strcmp(exten, "*72")) {
- transmit_tone(s, SKINNY_DIALTONE);
- getforward = 1;
- memset(exten, 0, sizeof(exten));
- len = 0;
- } else if (l->cancallforward && !strcmp(exten, "*73")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %s\n", chan->name);
- }
- transmit_tone(s, SKINNY_DIALTONE);
- memset(l->call_forward, 0, sizeof(l->call_forward));
- getforward = 0;
- memset(exten, 0, sizeof(exten));
- len = 0;
- } else if (!strcmp(exten, ast_parking_ext()) &&
- sub->next->owner &&
- ast_bridged_channel(sub->next->owner)) {
- /* This is a three way call, the main call being a real channel,
- and we're parking the first call. */
- ast_masq_park_call(ast_bridged_channel(sub->next->owner), chan, 0, NULL);
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
- }
- break;
- } else if (!ast_strlen_zero(l->lastcallerid) && !strcmp(exten, "*60")) {
- if (option_verbose > 2) {
- ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", l->lastcallerid);
- }
[... 1364 lines stripped ...]
More information about the asterisk-commits
mailing list