[asterisk-commits] branch oej/test-this-branch r14105 - in /team/oej/test-this-branch: ./ agi/ a...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 21 23:51:54 MST 2006


Author: oej
Date: Wed Mar 22 00:51:34 2006
New Revision: 14105

URL: http://svn.digium.com/view/asterisk?rev=14105&view=rev
Log:
Reset automerge

Modified:
    team/oej/test-this-branch/   (props changed)
    team/oej/test-this-branch/UPGRADE.txt
    team/oej/test-this-branch/agi/Makefile
    team/oej/test-this-branch/apps/app_meetme.c
    team/oej/test-this-branch/astmm.c
    team/oej/test-this-branch/channel.c
    team/oej/test-this-branch/channels/chan_iax2.c
    team/oej/test-this-branch/channels/chan_misdn.c
    team/oej/test-this-branch/channels/chan_skinny.c
    team/oej/test-this-branch/channels/chan_zap.c
    team/oej/test-this-branch/channels/misdn/chan_misdn_config.h
    team/oej/test-this-branch/channels/misdn/isdn_lib.c
    team/oej/test-this-branch/channels/misdn_config.c
    team/oej/test-this-branch/codecs/Makefile
    team/oej/test-this-branch/codecs/gsm/libgsm.vcproj   (props changed)
    team/oej/test-this-branch/codecs/ilbc/libilbc.vcproj   (props changed)
    team/oej/test-this-branch/codecs/lpc10/liblpc10.vcproj   (props changed)
    team/oej/test-this-branch/configs/features.conf.sample
    team/oej/test-this-branch/configs/indications.conf.sample
    team/oej/test-this-branch/configs/misdn.conf.sample
    team/oej/test-this-branch/configs/zapata.conf.sample
    team/oej/test-this-branch/db.c
    team/oej/test-this-branch/doc/enum.txt
    team/oej/test-this-branch/editline/term.c
    team/oej/test-this-branch/funcs/func_enum.c
    team/oej/test-this-branch/image.c
    team/oej/test-this-branch/include/asterisk/channel.h
    team/oej/test-this-branch/include/asterisk/module.h
    team/oej/test-this-branch/include/solaris-compat/compat.h
    team/oej/test-this-branch/pbx.c
    team/oej/test-this-branch/res/res_features.c
    team/oej/test-this-branch/sample.call
    team/oej/test-this-branch/sounds.txt
    team/oej/test-this-branch/strcompat.c

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 22 00:51:34 2006
@@ -1,1 +1,1 @@
-/trunk:1-13616
+/trunk:1-14104

Modified: team/oej/test-this-branch/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/UPGRADE.txt?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/UPGRADE.txt (original)
+++ team/oej/test-this-branch/UPGRADE.txt Wed Mar 22 00:51:34 2006
@@ -78,3 +78,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/test-this-branch/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/agi/Makefile?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/agi/Makefile (original)
+++ team/oej/test-this-branch/agi/Makefile Wed Mar 22 00:51:34 2006
@@ -13,7 +13,7 @@
 
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
-CFLAGS+=
+CFLAGS+=-DNO_AST_MM
 
 LIBS=
 ifeq ($(OSARCH),SunOS)

Modified: team/oej/test-this-branch/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_meetme.c?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_meetme.c (original)
+++ team/oej/test-this-branch/apps/app_meetme.c Wed Mar 22 00:51:34 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/test-this-branch/astmm.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/astmm.c?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/astmm.c (original)
+++ team/oej/test-this-branch/astmm.c Wed Mar 22 00:51:34 2006
@@ -38,6 +38,7 @@
 #include "asterisk/options.h"
 #include "asterisk/lock.h"
 #include "asterisk/strings.h"
+#include "asterisk/unaligned.h"
 
 #define SOME_PRIME 563
 
@@ -104,7 +105,7 @@
 		regions[hash] = reg;
 		reg->fence = FENCE_MAGIC;
 		fence = (ptr + reg->len);
-		*fence = FENCE_MAGIC;
+		put_unaligned_uint32(fence, FENCE_MAGIC);
 	}
 	ast_mutex_unlock(&reglock);
 	if (!reg) {
@@ -166,7 +167,7 @@
 				fflush(mmlog);
 			}
 		}
-		if (*fence != FENCE_MAGIC) {
+		if (get_unaligned_uint32(fence) != FENCE_MAGIC) {
 			fprintf(stderr, "WARNING: High fence violation at %p, in %s of %s, line %d\n", reg->data, reg->func, reg->file, reg->lineno);
 			if (mmlog) {
 				fprintf(mmlog, "%ld - WARNING: High fence violation at %p, in %s of %s, line %d\n", time(NULL), reg->data, reg->func, reg->file, reg->lineno);
@@ -316,7 +317,7 @@
 						fflush(mmlog);
 					}
 				}
-				if (*fence != FENCE_MAGIC) {
+				if (get_unaligned_uint32(fence) != FENCE_MAGIC) {
 					fprintf(stderr, "WARNING: High fence violation at %p, in %s of %s, line %d\n", reg->data, reg->func, reg->file, reg->lineno);
 					if (mmlog) {
 						fprintf(mmlog, "%ld - WARNING: High fence violation at %p, in %s of %s, line %d\n", time(NULL), reg->data, reg->func, reg->file, reg->lineno);

Modified: team/oej/test-this-branch/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channel.c?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/channel.c (original)
+++ team/oej/test-this-branch/channel.c Wed Mar 22 00:51:34 2006
@@ -1013,6 +1013,7 @@
 	ast_jb_destroy(chan);
 #endif /* AST_JB */
 
+	ast_string_field_free_all(chan);
 	free(chan);
 	AST_LIST_UNLOCK(&channels);
 

Modified: team/oej/test-this-branch/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_iax2.c?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_iax2.c (original)
+++ team/oej/test-this-branch/channels/chan_iax2.c Wed Mar 22 00:51:34 2006
@@ -5051,7 +5051,8 @@
 				ast_copy_string(iaxs[callno]->cid_name, user->cid_name, sizeof(iaxs[callno]->cid_name));
 				iaxs[callno]->calling_pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
 			}
-			ast_copy_string(iaxs[callno]->ani, user->cid_num, sizeof(iaxs[callno]->ani));
+			if (ast_strlen_zero(iaxs[callno]->ani))
+				ast_copy_string(iaxs[callno]->ani, user->cid_num, sizeof(iaxs[callno]->ani));
 		} else {
 			iaxs[callno]->calling_pres = AST_PRES_NUMBER_NOT_AVAILABLE;
 		}

Modified: team/oej/test-this-branch/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_misdn.c?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_misdn.c (original)
+++ team/oej/test-this-branch/channels/chan_misdn.c Wed Mar 22 00:51:34 2006
@@ -1105,6 +1105,21 @@
 	
 	chan_misdn_log(1,port,"update_config: Getting Config\n");
 
+
+	int hdlc=0;
+	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
+	
+	if (hdlc) {
+		switch (bc->capability) {
+		case INFO_CAPABILITY_DIGITAL_UNRESTRICTED:
+		case INFO_CAPABILITY_DIGITAL_RESTRICTED:
+			chan_misdn_log(1,bc->port," --> CONF HDLC\n");
+			bc->hdlc=1;
+			break;
+		}
+		
+	}
+	
 	
 	int pres, screen;
 			
@@ -1244,7 +1259,19 @@
 
 	misdn_cfg_get( port, MISDN_CFG_NEED_MORE_INFOS, &bc->need_more_infos, sizeof(int));
 	
-
+	int hdlc=0;
+	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
+	
+	if (hdlc) {
+		switch (bc->capability) {
+		case INFO_CAPABILITY_DIGITAL_UNRESTRICTED:
+		case INFO_CAPABILITY_DIGITAL_RESTRICTED:
+			chan_misdn_log(1,bc->port," --> CONF HDLC\n");
+			bc->hdlc=1;
+			break;
+		}
+		
+	}
 	/*Initialize new Jitterbuffer*/
 	{
 		misdn_cfg_get( port, MISDN_CFG_JITTERBUFFER, &ch->jb_len, sizeof(int));
@@ -1573,7 +1600,7 @@
 
 		/* update screening and presentation */ 
 		update_config(ch,ORG_AST);
-
+		
 		/* fill in some ies from channel vary*/
 		import_ies(ast, newbc);
 		
@@ -2053,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;
 	}
 	
@@ -2137,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);
 	}
@@ -2201,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;
@@ -2209,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;
@@ -2227,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;
@@ -3298,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/test-this-branch/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_skinny.c?rev=14105&r1=14104&r2=14105&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_skinny.c (original)
+++ team/oej/test-this-branch/channels/chan_skinny.c Wed Mar 22 00:51:34 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;

[... 2091 lines stripped ...]


More information about the asterisk-commits mailing list