[asterisk-commits] branch oej/test-this-branch r15613 - in /team/oej/test-this-branch: ./ apps/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 28 10:06:03 MST 2006


Author: oej
Date: Tue Mar 28 11:05:59 2006
New Revision: 15613

URL: http://svn.digium.com/view/asterisk?rev=15613&view=rev
Log:
Resolve conflict, reset automerge, move on

Added:
    team/oej/test-this-branch/doc/ip-tos.txt
      - copied unchanged from r15581, trunk/doc/ip-tos.txt
Modified:
    team/oej/test-this-branch/   (props changed)
    team/oej/test-this-branch/acl.c
    team/oej/test-this-branch/app.c
    team/oej/test-this-branch/apps/app_channelredirect.c
    team/oej/test-this-branch/apps/app_rpt.c
    team/oej/test-this-branch/channels/chan_agent.c
    team/oej/test-this-branch/channels/chan_iax2.c
    team/oej/test-this-branch/channels/chan_oss.c
    team/oej/test-this-branch/channels/chan_sip.c
    team/oej/test-this-branch/channels/iax2-provision.c
    team/oej/test-this-branch/configs/http.conf.sample
    team/oej/test-this-branch/configs/iax.conf.sample
    team/oej/test-this-branch/configs/iaxprov.conf.sample
    team/oej/test-this-branch/configs/oss.conf.sample
    team/oej/test-this-branch/configs/sip.conf.sample
    team/oej/test-this-branch/include/asterisk/acl.h
    team/oej/test-this-branch/include/asterisk/module.h
    team/oej/test-this-branch/pbx/pbx_dundi.c
    team/oej/test-this-branch/res/res_smdi.c
    team/oej/test-this-branch/slinfactory.c

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

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 28 11:05:59 2006
@@ -1,1 +1,1 @@
-/trunk:1-15424
+/trunk:1-15611

Modified: team/oej/test-this-branch/acl.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/acl.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/acl.c (original)
+++ team/oej/test-this-branch/acl.c Tue Mar 28 11:05:59 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -20,7 +20,7 @@
  *
  * \brief Various sorts of access control
  *
- * \author Mark Spencer <markster at digium.com> 
+ * \author Mark Spencer <markster at digium.com>
  */
 
 #include <stdio.h>
@@ -136,7 +136,7 @@
 		if (prev)
 			prev->next = link;		/* Link previous to this object */
 
-		if (!ret) 
+		if (!ret)
 			ret = link;		/* Save starting point */
 
 		start = start->next;		/* Go to next object */
@@ -153,7 +153,7 @@
 	struct ast_ha *prev = NULL;
 	struct ast_ha *ret;
 	int x, z;
-	unsigned int y;		
+	unsigned int y;
 
 	ret = path;
 	while (path) {
@@ -252,12 +252,55 @@
 	return 0;
 }
 
-int ast_str2tos(const char *value, int *tos)
+struct dscp_codepoint {
+	char *name;
+	unsigned int space;
+};
+
+/* IANA registered DSCP codepoints */
+
+static const struct dscp_codepoint dscp_pool1[] = {
+	{ "CS0", 0x00 },
+	{ "CS1", 0x08 },
+	{ "CS2", 0x10 },
+	{ "CS3", 0x18 },
+	{ "CS4", 0x20 },
+	{ "CS5", 0x28 },
+	{ "CS6", 0x30 },
+	{ "CS7", 0x38 },
+	{ "AF11", 0x0A },
+	{ "AF12", 0x0C },
+	{ "AF13", 0x0E },
+	{ "AF21", 0x12 },
+	{ "AF22", 0x14 },
+	{ "AF23", 0x16 },
+	{ "AF31", 0x1A },
+	{ "AF32", 0x1C },
+	{ "AF33", 0x1E },
+	{ "AF41", 0x22 },
+	{ "AF42", 0x24 },
+	{ "AF43", 0x26 },
+	{ "EF", 0x2E },
+};
+
+int ast_str2tos(const char *value, unsigned int *tos)
 {
 	int fval;
-	if (sscanf(value, "%i", &fval) == 1)
-		*tos = fval & 0xff;
-	else if (!strcasecmp(value, "lowdelay")) {
+	unsigned int x;
+
+	if (sscanf(value, "%i", &fval) == 1) {
+		*tos = fval & 0xFF;
+		return 0;
+	}
+
+	for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+		if (!strcasecmp(value, dscp_pool1[x].name)) {
+			*tos = dscp_pool1[x].space << 2;
+			return 0;
+		}
+	}
+
+	if (!strcasecmp(value, "lowdelay")) {
 		*tos = IPTOS_LOWDELAY;
 		ast_log(LOG_WARNING, "tos value %s is deprecated.  See doc/iptos.txt for more information.", value);
 	} else if (!strcasecmp(value, "throughput")) {
@@ -310,16 +353,44 @@
 		*tos = 0;
 	else
 		return -1;
+
+	ast_log(LOG_WARNING, "tos value %s is deprecated.  See doc/ip-tos.txt for more information.", value);
+
 	return 0;
 }
 
+const char *ast_tos2str(unsigned int tos)
+{
+	unsigned int x;
+
+	switch (tos) {
+	case 0:
+		return "none";
+	case IPTOS_LOWDELAY:
+		return "lowdelay";
+	case IPTOS_THROUGHPUT:
+		return "throughput";
+	case IPTOS_RELIABILITY:
+		return "reliability";
+	case IPTOS_MINCOST:
+		return "mincost";
+	default:
+		for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+			if (dscp_pool1[x].space == (tos >> 2))
+				return dscp_pool1[x].name;
+		}
+	}
+
+	return "unknown";
+}
+
 int ast_get_ip(struct sockaddr_in *sin, const char *value)
 {
 	return ast_get_ip_or_srv(sin, value, NULL);
 }
 
 /* iface is the interface (e.g. eth0); address is the return value */
-int ast_lookup_iface(char *iface, struct in_addr *address) 
+int ast_lookup_iface(char *iface, struct in_addr *address)
 {
 	int mysock, res = 0;
 	struct my_ifreq ifreq;
@@ -398,4 +469,3 @@
 		return 0;
 	return -1;
 }
-

Modified: team/oej/test-this-branch/app.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/app.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/app.c (original)
+++ team/oej/test-this-branch/app.c Tue Mar 28 11:05:59 2006
@@ -79,7 +79,7 @@
 	else 
 		ast_log(LOG_NOTICE,"Huh....? no dial for indications?\n");
 	
-	for (x = strlen(collect); strlen(collect) < maxlen; ) {
+	for (x = strlen(collect); x < maxlen; ) {
 		res = ast_waitfordigit(chan, timeout);
 		if (!ast_ignore_pattern(context, collect))
 			ast_playtones_stop(chan);
@@ -94,12 +94,8 @@
 			break;
 		}
 	}
-	if (res >= 0) {
-		if (ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num))
-			res = 1;
-		else
-			res = 0;
-	}
+	if (res >= 0)
+		res = ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num) ? 1 : 0;
 	return res;
 }
 
@@ -1153,9 +1149,10 @@
 	char *fs;
 	int res;
 	int fd;
+	int lp = strlen(path);
 	time_t start;
 
-	if (!(s = alloca(strlen(path) + 10)) || !(fs = alloca(strlen(path) + 20))) {
+	if (!(s = alloca(lp + 10)) || !(fs = alloca(lp + 20))) {
 		ast_log(LOG_WARNING, "Out of memory!\n");
 		return AST_LOCK_FAILURE;
 	}
@@ -1510,7 +1507,7 @@
 	if (fd < 0) {
 		ast_log(LOG_WARNING, "Cannot open file '%s' for reading: %s\n", filename, strerror(errno));
 		return NULL;
-	}	
+	}
 	if ((output = ast_malloc(count))) {
 		res = read(fd, output, count - 1);
 		if (res == count - 1) {
@@ -1540,14 +1537,13 @@
 
 	s = optstr;
 	while (*s) {
-		curarg = *s++ & 0x7f;
+		curarg = *s++ & 0x7f;	/* the array (in app.h) has 128 entries */
 		ast_set_flag(flags, options[curarg].flag);
 		argloc = options[curarg].arg_index;
 		if (*s == '(') {
 			/* Has argument */
 			arg = ++s;
-			while (*s && (*s != ')'))
-				s++;
+			s = strchr(s, ')');
 			if (*s) {
 				if (argloc)
 					args[argloc - 1] = arg;

Modified: team/oej/test-this-branch/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_channelredirect.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_channelredirect.c (original)
+++ team/oej/test-this-branch/apps/app_channelredirect.c Tue Mar 28 11:05:59 2006
@@ -47,8 +47,6 @@
 static char *descrip = 
 "ChannelRedirect(channel|[[context|]extension|]priority):\n"
 "  Sends the specified channel to the specified extension priority\n";
-
-STANDARD_LOCAL_USER;
 
 LOCAL_USER_DECL;
 

Modified: team/oej/test-this-branch/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_rpt.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_rpt.c (original)
+++ team/oej/test-this-branch/apps/app_rpt.c Tue Mar 28 11:05:59 2006
@@ -260,7 +260,6 @@
 
 struct	ast_config *cfg;
 
-STANDARD_LOCAL_USER;
 LOCAL_USER_DECL;
 
 #define	MSWAIT 200

Modified: team/oej/test-this-branch/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_agent.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_agent.c (original)
+++ team/oej/test-this-branch/channels/chan_agent.c Tue Mar 28 11:05:59 2006
@@ -1552,18 +1552,15 @@
 
 static char *complete_agent_logoff_cmd(const char *line, const char *word, int pos, int state)
 {
-	struct agent_pvt *p;
-	char name[AST_MAX_AGENT];
-	int which = 0;
-
 	if (pos == 2) {
+		struct agent_pvt *p;
+		char name[AST_MAX_AGENT];
+		int which = 0, len = strlen(word);
+
 		AST_LIST_TRAVERSE(&agents, p, list) {
 			snprintf(name, sizeof(name), "Agent/%s", p->agent);
-			if (!strncasecmp(word, name, strlen(word))) {
-				if (++which > state) {
-					return ast_strdup(name);
-				}
-			}
+			if (!strncasecmp(word, name, len) && ++which > state)
+				return ast_strdup(name);
 		}
 	} else if (pos == 3 && state == 0) {
 		return ast_strdup("soft");

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=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_iax2.c (original)
+++ team/oej/test-this-branch/channels/chan_iax2.c Tue Mar 28 11:05:59 2006
@@ -9062,7 +9062,7 @@
 	tosval = ast_variable_retrieve(cfg, "general", "tos");
 	if (tosval) {
 		if (ast_str2tos(tosval, &tos))
-			ast_log(LOG_WARNING, "Invalid tos value, see doc/iptos.txt for more information.\n");
+			ast_log(LOG_WARNING, "Invalid tos value, see doc/ip-tos.txt for more information.\n");
 	}
 	while(v) {
 		if (!strcasecmp(v->name, "bindport")){ 
@@ -9212,7 +9212,7 @@
 				ast_context_create(NULL, regcontext, "IAX2");
 		} else if (!strcasecmp(v->name, "tos")) {
 			if (ast_str2tos(v->value, &tos))
-				ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/iptos.txt for more information.'\n", v->lineno);
+				ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/ip-tos.txt for more information.'\n", v->lineno);
 		} else if (!strcasecmp(v->name, "accountcode")) {
 			ast_copy_string(accountcode, v->value, sizeof(accountcode));
 		} else if (!strcasecmp(v->name, "amaflags")) {

Modified: team/oej/test-this-branch/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_oss.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_oss.c (original)
+++ team/oej/test-this-branch/channels/chan_oss.c Tue Mar 28 11:05:59 2006
@@ -94,24 +94,51 @@
 START_CONFIG
 
 [general]
-; general config options, default values are shown
-; all but debug can go also in the device-specific sections.
-; debug=0x0		; misc debug flags, default is 0
+    ; General config options, with default values shown.
+    ; You should use one section per device, with [general] being used
+    ; for the first device and also as a template for other devices.
+    ;
+    ; All but 'debug' can go also in the device-specific sections.
+    ;
+    ; debug = 0x0		; misc debug flags, default is 0
+
+    ; Set the device to use for I/O
+    ; device = /dev/dsp
+
+    ; Optional mixer command to run upon startup (e.g. to set
+    ; volume levels, mutes, etc.
+    ; mixer =
+
+    ; Software mic volume booster (or attenuator), useful for sound
+    ; cards or microphones with poor sensitivity. The volume level
+    ; is in dB, ranging from -20.0 to +20.0
+    ; boost = n			; mic volume boost in dB
+
+    ; Set the callerid for outgoing calls
+    ; callerid = John Doe <555-1234>
+
+    ; autoanswer = no		; no autoanswer on call
+    ; autohangup = yes		; hangup when other party closes
+    ; extension = s		; default extension to call
+    ; context = default		; default context for outgoing calls
+    ; language = ""		; default language
+
+    ; If you set overridecontext to 'yes', then the whole dial string
+    ; will be interpreted as an extension, which is extremely useful
+    ; to dial SIP, IAX and other extensions which use the '@' character.
+    ; The default is 'no' just for backward compatibility, but the
+    ; suggestion is to change it.
+    ; overridecontext = no	; if 'no', the last @ will start the context
+				; if 'yes' the whole string is an extension.
+
+    ; low level device parameters in case you have problems with the
+    ; device driver on your operating system. You should not touch these
+    ; unless you know what you are doing.
+    ; queuesize = 10		; frames in device driver
+    ; frags = 8			; argument to SETFRAGMENT
 
 [card1]
-; autoanswer = no	; no autoanswer on call
-; autohangup = yes	; hangup when other party closes
-; extension=s		; default extension to call
-; context=default	; default context
-; language=""		; default language
-; overridecontext=yes	; the whole dial string is considered an extension.
-			; if no, the last @ will start the context
-
-; device=/dev/dsp	; device to open
-; mixer="-f /dev/mixer0 pcm 80 ; mixer command to run on start
-; queuesize=10		; frames in device driver
-; frags=8		; argument to SETFRAGMENT
-; boost = n		; mic volume boost in dB
+    ; device = /dev/dsp1	; alternate device
 
 END_CONFIG
 

Modified: team/oej/test-this-branch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_sip.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Tue Mar 28 11:05:59 2006
@@ -438,9 +438,9 @@
 static int global_allowsubscribe;	/*!< Flag for disabling ALL subscriptions, this is FALSE only if all peers are FALSE 
 					    the global setting is in globals_flags[1] */
 static int global_mwitime;		/*!< Time between MWI checks for peers */
-static int global_tos_sip;		/*!< IP Type of service for SIP */
-static int global_tos_audio;		/*!< IP Type of service for RTP audio */
-static int global_tos_video;		/*!< IP Type of service for RTP video */
+static int global_tos_sip;		/*!< IP type of service for SIP packets */
+static int global_tos_audio;		/*!< IP type of service for audio RTP packets */
+static int global_tos_video;		/*!< IP type of service for video RTP packets */
 static int compactheaders;		/*!< send compact sip headers */
 static int recordhistory;		/*!< Record SIP history. Off by default */
 static int dumphistory;			/*!< Dump history to verbose before destroying SIP dialog */
@@ -690,13 +690,13 @@
 #define SIP_PAGE2_VIDEOSUPPORT		(1 << 9)	/*!< Support video for this peer */
 #define SIP_PAGE2_ALLOWSUBSCRIBE	(1 << 10)	/*!< Allow subscriptions from this peer? */
 #define SIP_PAGE2_ALLOWOVERLAP		(1 << 11)	/*!< Allow overlap dialing ? */
-#define SIP_PAGE2_PEER_REGISTER		(1 << 12)	/*!< Register this peer with service */
+#define SIP_PAGE2_SUBSCRIBEMWIONLY	(1 << 12)	/*!< Only issue MWI notification if subscribed to */
+#define SIP_PAGE2_PEER_REGISTER		(1 << 13)	/*!< Register this peer with service */
 
 #define SIP_PAGE2_T38SUPPORT		(7 << 14)       /*!< T38 Fax Passthrough Support, need three bits */
 #define SIP_PAGE2_T38SUPPORT_UDPTL	(1 << 14)       /*!< 15: T38 Fax Passthrough Support */
 #define SIP_PAGE2_T38SUPPORT_RTP	(2 << 14)       /*!< 16: T38 Fax Passthrough Support */
 #define SIP_PAGE2_T38SUPPORT_TCP	(4 << 14)       /*!< 17: T38 Fax Passthrough Support */
-#define SIP_PAGE2_SUBSCRIBEMWIONLY	(1 << 22)	/*!< Only support subscription-related MWI notification */
 
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_ALLOWSUBSCRIBE  \
@@ -819,9 +819,9 @@
 	
 	struct ast_dsp *vad;			/*!< Voice Activation Detection dsp */
 	
-	struct sip_peer *relatedpeer;		/*!< If this dialog is to related to a peer, which one */
-	struct sip_registry *registry;		/*!< If this is a REGISTER dialog, to which registry
-							If this is an INVITE, to which registry */
+	struct sip_peer *relatedpeer;		/*!< If this dialog is related to a peer, which one 
+							Used in peerpoke, mwi subscriptions */
+	struct sip_registry *registry;		/*!< If this is a REGISTER dialog, to which registry */
 	struct ast_rtp *rtp;			/*!< RTP Session */
 	struct ast_rtp *vrtp;			/*!< Video RTP session */
 	struct sip_pkt *packets;		/*!< Packets scheduled for re-transmission */
@@ -907,7 +907,7 @@
 	struct sockaddr_in defaddr;	/*!<  Default IP address, used until registration */
 	struct ast_ha *ha;		/*!<  Access control list */
 	struct ast_variable *chanvars;	/*!<  Variables to set for channel created by user */
-	struct sip_pvt *mwipvt;		/*!< Subscription for MWI */
+	struct sip_pvt *mwipvt;		/*!<  Subscription for MWI */
 	struct sip_registry *registry;	/*!< If this peer registers with outside service */
 	int lastmsg;
 };
@@ -1062,6 +1062,8 @@
 static int sip_send_mwi_to_peer(struct sip_peer *peer);
 static int sip_scheddestroy(struct sip_pvt *p, int ms);
 static void sip_registry_destroy(struct sip_registry *reg);
+static int sip_send_mwi_to_peer(struct sip_peer *peer);
+static int sip_scheddestroy(struct sip_pvt *p, int ms);
 
 /*------ T38 Support --------- */
 #ifdef T38_DEBUG
@@ -1806,6 +1808,9 @@
 	if (device->chanvars) {
 		ast_variables_destroy(device->chanvars);
 		device->chanvars = NULL;
+	}
+	if (device->mwipvt) {	/* We have an active subscription, delete it */
+		sip_destroy(device->mwipvt);
 	}
 	if (device->expire > -1)
 		ast_sched_del(sched, device->expire);
@@ -3498,8 +3503,7 @@
 		if (p->vrtp)
 			ast_rtp_settos(p->vrtp, global_tos_video);
 		if (p->udptl)
-			ast_udptl_settos(p->udptl, global_tos_sip);	/* Oej's choice - it's really a data stream  that
-					should not need higher TOS */
+			ast_udptl_settos(p->udptl, global_tos_audio);
 		p->rtptimeout = global_rtptimeout;
 		p->rtpholdtimeout = global_rtpholdtimeout;
 		p->rtpkeepalive = global_rtpkeepalive;
@@ -9152,9 +9156,9 @@
 	ast_cli(fd, "  From: Domain:           %s\n", default_fromdomain);
 	ast_cli(fd, "  Record SIP history:     %s\n", recordhistory ? "On" : "Off");
 	ast_cli(fd, "  Call Events:            %s\n", global_callevents ? "On" : "Off");
-	ast_cli(fd, "  IP ToS SIP:             0x%x\n", global_tos_sip);
-	ast_cli(fd, "  IP ToS RTP audio:       0x%x\n", global_tos_audio);
-	ast_cli(fd, "  IP ToS RTP video:       0x%x\n", global_tos_video);
+	ast_cli(fd, "  IP ToS SIP:             %s\n", ast_tos2str(global_tos_sip));
+	ast_cli(fd, "  IP ToS RTP audio:       %s\n", ast_tos2str(global_tos_audio));
+	ast_cli(fd, "  IP ToS RTP video:       %s\n", ast_tos2str(global_tos_video));
 #ifdef OSP_SUPPORT
 	ast_cli(fd, "  OSP Support:            Yes\n");
 #else
@@ -11806,7 +11810,6 @@
 	}
 
 	if (!ignore && !p->initreq.headers) {	/* Set up dialog, new subscription */
-
 		/* Use this as the basis */
 		if (debug)
 			ast_verbose("Creating new subscription\n");
@@ -11819,13 +11822,6 @@
 		ast_verbose("Ignoring this SUBSCRIBE request\n");
 
 
-	/* Find parameters to Event: header value and remove them for now */
-	eventparam = strchr(event, ';');
-	if (eventparam) {
-		*eventparam = '\0';
-		eventparam++;
-	}
-
 	/* Handle authentication if this is our first subscribe */
 	res = check_user_full(p, req, SIP_SUBSCRIBE, e, 0, sin, ignore, &authpeer);
 	if (res) {
@@ -11835,6 +11831,10 @@
 		}
 		return 0;
 	}
+
+	/* Find parameters to Event: header value and remove them for now */
+	if ((eventparam = strchr(event, ';')))
+		*eventparam++ = '\0';
 
 	/* Check if this user/peer is allowed to subscribe at all */
 	if (! ast_test_flag(&p->flags[1], SIP_PAGE2_ALLOWSUBSCRIBE)) {
@@ -11857,13 +11857,10 @@
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
 		return 0;
 	} else {
-
 		/* Initialize tag for new subscriptions */	
 		if (ast_strlen_zero(p->tag))
 			make_our_tag(p->tag, sizeof(p->tag));
-
 		if (!strcmp(event, "presence") || !strcmp(event, "dialog")) { /* Presence, RFC 3842 */
-
 			/* Header from Xten Eye-beam Accept: multipart/related, application/rlmi+xml, application/pidf+xml, application/xpidf+xml */
  			if (strstr(accept, "application/pidf+xml")) {
  				p->subscribed = PIDF_XML;         /* RFC 3863 format */
@@ -11905,7 +11902,7 @@
 			transmit_response(p, "489 Bad Event", req);
 			if (option_debug > 1)
 				ast_log(LOG_DEBUG, "Received SIP subscribe for unknown event package: %s\n", event);
-			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
+ 			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 			return 0;
 		}
 		if (p->subscribed != MWI_NOTIFICATION)
@@ -11943,7 +11940,7 @@
 			}
 		} else {
 			if ((firststate = ast_extension_state(NULL, p->context, p->exten)) < 0) {
-				ast_log(LOG_ERROR, "Got SUBSCRIBE for extensions without hint. Please add hint to %s in context %s\n", p->exten, p->context);
+				ast_log(LOG_ERROR, "Got SUBSCRIBE for extension without hint. Please add hint to %s in context %s\n", p->exten, p->context);
 				transmit_response(p, "404 Not found", req);
 				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 				return 0;
@@ -11969,12 +11966,11 @@
 					ast_mutex_lock(&p_old->lock);
 					if (!strcmp(p_old->username, p->username)) {
 						if (!strcmp(p_old->exten, p->exten) &&
-					    	!strcmp(p_old->context, p->context)) {
+						    !strcmp(p_old->context, p->context)) {
 							ast_set_flag(&p_old->flags[0], SIP_NEEDDESTROY);
 							ast_mutex_unlock(&p_old->lock);
 							break;
 						}
-
 					}
 					ast_mutex_unlock(&p_old->lock);
 				}
@@ -12350,10 +12346,12 @@
 }
 
 /*! \brief Check whether peer needs a new MWI notification check */
-static int does_peer_need_mwi(struct sip_peer *peer) {
+static int does_peer_need_mwi(struct sip_peer *peer)
+{
 	time_t t;
 
-	if(ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) &&  !peer->mwipvt) {	/* We don't have a subscription */
+	if (ast_test_flag(&peer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY) &&
+	    !peer->mwipvt) {	/* We don't have a subscription */
 		time(&peer->lastmsgcheck);	/* Reset timer */
 		return FALSE;
 	}
@@ -13360,8 +13358,7 @@
 		} else if (!strcasecmp(v->name, "mailbox")) {
 			ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
 		} else if (!strcasecmp(v->name, "subscribemwi")) {
-			if (ast_true(v->value))
-				ast_set_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY);
+			ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_SUBSCRIBEMWIONLY);
 		} else if (!strcasecmp(v->name, "vmexten")) {
 			ast_copy_string(peer->vmexten, v->value, sizeof(peer->vmexten));
 		} else if (!strcasecmp(v->name, "callgroup")) {
@@ -13743,18 +13740,18 @@
 				global_tos_sip = temp_tos;
 				global_tos_audio = temp_tos;
 				global_tos_video = temp_tos;
-				ast_log(LOG_WARNING, "tos value at line %d is deprecated.  See doc/iptos.txt for more information.", v->lineno);
+				ast_log(LOG_WARNING, "tos value at line %d is deprecated.  See doc/ip-tos.txt for more information.", v->lineno);
 			} else
-				ast_log(LOG_WARNING, "Invalid tos value at line %d, See doc/iptos.txt for more information.\n", v->lineno);
+				ast_log(LOG_WARNING, "Invalid tos value at line %d, See doc/ip-tos.txt for more information.\n", v->lineno);
 		} else if (!strcasecmp(v->name, "tos_sip")) {
 			if (ast_str2tos(v->value, &global_tos_sip))
-				ast_log(LOG_WARNING, "Invalid tos_sip value at line %d, recommended value is 'cs3'. See doc/iptos.txt.\n", v->lineno);
+				ast_log(LOG_WARNING, "Invalid tos_sip value at line %d, recommended value is 'cs3'. See doc/ip-tos.txt.\n", v->lineno);
 		} else if (!strcasecmp(v->name, "tos_audio")) {
 			if (ast_str2tos(v->value, &global_tos_audio))
-				ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, recommended value is 'ef'. See doc/iptos.txt.\n", v->lineno);
+				ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, recommended value is 'ef'. See doc/ip-tos.txt.\n", v->lineno);
 		} else if (!strcasecmp(v->name, "tos_video")) {
 			if (ast_str2tos(v->value, &global_tos_video))
-				ast_log(LOG_WARNING, "Invalid tos_video value at line %d, recommended value is 'af41'. See doc/iptos.txt.\n", v->lineno);
+				ast_log(LOG_WARNING, "Invalid tos_video value at line %d, recommended value is 'af41'. See doc/ip-tos.txt.\n", v->lineno);
 		} else if (!strcasecmp(v->name, "bindport")) {
 			if (sscanf(v->value, "%d", &ourport) == 1) {
 				bindaddr.sin_port = htons(ourport);
@@ -13871,10 +13868,10 @@
 				if (option_verbose > 1) { 
 					ast_verbose(VERBOSE_PREFIX_2 "SIP Listening on %s:%d\n", 
 					ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port));
-					ast_verbose(VERBOSE_PREFIX_2 "Using SIP TOS bits %d\n", global_tos_sip);
+					ast_verbose(VERBOSE_PREFIX_2 "Using SIP TOS: %s\n", ast_tos2str(global_tos_sip));
 				}
 				if (setsockopt(sipsock, IPPROTO_IP, IP_TOS, &global_tos_sip, sizeof(global_tos_sip))) 
-					ast_log(LOG_WARNING, "Unable to set SIP TOS to %d\n", global_tos_sip);
+					ast_log(LOG_WARNING, "Unable to set SIP TOS to %s\n", ast_tos2str(global_tos_sip));
 			}
 		}
 	}

Modified: team/oej/test-this-branch/channels/iax2-provision.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/iax2-provision.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/iax2-provision.c (original)
+++ team/oej/test-this-branch/channels/iax2-provision.c Tue Mar 28 11:05:59 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -47,6 +47,7 @@
 #include "asterisk/md5.h"
 #include "asterisk/astdb.h"
 #include "asterisk/utils.h"
+#include "asterisk/acl.h"
 #include "iax2.h"
 #include "iax2-provision.h"
 #include "iax2-parser.h"
@@ -330,7 +331,7 @@
 				ast_log(LOG_WARNING, "Ignoring invalid codec '%s' for '%s' at line %d\n", v->value, s, v->lineno);
 		} else if (!strcasecmp(v->name, "tos")) {
 			if (ast_str2tos(v->value, &cur->tos))
-				ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/iptos.txt for more information.\n", v->lineno);
+				ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/ip-tos.txt for more information.\n", v->lineno);
 		} else if (!strcasecmp(v->name, "user")) {
 			strncpy(cur->user, v->value, sizeof(cur->user) - 1);
 			if (strcmp(cur->user, v->value))

Modified: team/oej/test-this-branch/configs/http.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/http.conf.sample?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/http.conf.sample (original)
+++ team/oej/test-this-branch/configs/http.conf.sample Tue Mar 28 11:05:59 2006
@@ -6,7 +6,7 @@
 ;
 ; Whether HTTP interface is enabled or not.
 ;
-enabled=yes
+enabled=no
 ;
 ; Address to bind to
 ;

Modified: team/oej/test-this-branch/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/iax.conf.sample?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/iax.conf.sample (original)
+++ team/oej/test-this-branch/configs/iax.conf.sample Tue Mar 28 11:05:59 2006
@@ -207,15 +207,8 @@
 ;
 ;authdebug=no
 ;
-; Finally, you can set values for your TOS bits to help improve 
-; performance.  Valid values are:
-;   lowdelay		-- Minimize delay
-;   throughput		-- Maximize throughput
-;   reliability		-- Maximize reliability
-;   mincost		-- Minimize cost
-;   none		-- No flags
-;
-tos=lowdelay
+; See doc/README.tos for a description of the tos parameters.
+;tos=ef
 ;
 ; If regcontext is specified, Asterisk will dynamically create and destroy
 ; a NoOp priority 1 extension for a given peer who registers or unregisters

Modified: team/oej/test-this-branch/configs/iaxprov.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/iaxprov.conf.sample?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/iaxprov.conf.sample (original)
+++ team/oej/test-this-branch/configs/iaxprov.conf.sample Tue Mar 28 11:05:59 2006
@@ -53,10 +53,8 @@
 ;
 flags=register,heartbeat
 ;
-; tos is the requested type of service setting and may be one a number or
-; 'lowdelay','throughput','reliability','mincost' or 'none'
-;
-tos=lowdelay
+; See doc/README.tos for a description of this parameter.
+;tos=ef
 ;
 ; Example iaxy provisioning
 ;

Modified: team/oej/test-this-branch/configs/oss.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/oss.conf.sample?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/oss.conf.sample (original)
+++ team/oej/test-this-branch/configs/oss.conf.sample Tue Mar 28 11:05:59 2006
@@ -1,43 +1,51 @@
-;
-; Open Sound System Console Driver Configuration File
-;
+#
+# Automatically generated from ../channels/chan_oss.c
+#
+
 [general]
-;
-; Automatically answer incoming calls on the console?  Choose yes if
-; for example you want to use this as an intercom.
-;
-autoanswer=yes
-;
-; Default context (is overridden with @context syntax)
-;
-context=local
-;
-; Set overridecontext to yes if you want the context specified above
-; to override what someone places on the command line.
-;
-;overridecontext=yes
-;
-; Default extension to call
-;
-extension=s
-;
-; Default language
-;
-;language=en
-;
-; CallerID for outbound calls
-;
-;callerid=John Doe <1234>
-;
-; Silence supression can be enabled when sound is over a certain threshold.
-; The value for the threshold should probably be between 500 and 2000 or so,
-; but your mileage may vary.  Use the echo test to evaluate the best setting.
-;silencesuppression = yes
-;silencethreshold = 1000
-;
-; On half-duplex cards, the driver attempts to switch back and forth between
-; read and write modes.  Unfortunately, this fails sometimes on older hardware.
-; To prevent the driver from switching (ie. only play files on your speakers),
-; then set the playbackonly option to yes.  Default is no.  Note this option has
-; no effect on full-duplex cards.
-;playbackonly=no
+    ; General config options, with default values shown.
+    ; You should use one section per device, with [general] being used
+    ; for the first device and also as a template for other devices.
+    ;
+    ; All but 'debug' can go also in the device-specific sections.
+    ;
+    ; debug = 0x0		; misc debug flags, default is 0
+
+    ; Set the device to use for I/O
+    ; device = /dev/dsp
+
+    ; Optional mixer command to run upon startup (e.g. to set
+    ; volume levels, mutes, etc.
+    ; mixer =
+
+    ; Software mic volume booster (or attenuator), useful for sound
+    ; cards or microphones with poor sensitivity. The volume level
+    ; is in dB, ranging from -20.0 to +20.0
+    ; boost = n			; mic volume boost in dB
+
+    ; Set the callerid for outgoing calls
+    ; callerid = John Doe <555-1234>
+
+    ; autoanswer = no		; no autoanswer on call
+    ; autohangup = yes		; hangup when other party closes
+    ; extension = s		; default extension to call
+    ; context = default		; default context for outgoing calls
+    ; language = ""		; default language
+
+    ; If you set overridecontext to 'yes', then the whole dial string
+    ; will be interpreted as an extension, which is extremely useful
+    ; to dial SIP, IAX and other extensions which use the '@' character.
+    ; The default is 'no' just for backward compatibility, but the
+    ; suggestion is to change it.
+    ; overridecontext = no	; if 'no', the last @ will start the context
+				; if 'yes' the whole string is an extension.
+
+    ; low level device parameters in case you have problems with the
+    ; device driver on your operating system. You should not touch these
+    ; unless you know what you are doing.
+    ; queuesize = 10		; frames in device driver
+    ; frags = 8			; argument to SETFRAGMENT
+
+[card1]
+    ; device = /dev/dsp1	; alternate device
+

Modified: team/oej/test-this-branch/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/sip.conf.sample?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/sip.conf.sample (original)
+++ team/oej/test-this-branch/configs/sip.conf.sample Tue Mar 28 11:05:59 2006
@@ -58,8 +58,12 @@
 ;pedantic=yes			; Enable slow, pedantic checking for Pingtel
 				; and multiline formatted headers for strict
 				; SIP compatibility (defaults to "no")
-;tos=184			; Set IP QoS to either a keyword or numeric val
-;tos=lowdelay			; lowdelay,throughput,reliability,mincost,none
+
+; See doc/README.tos for a description of these parameters.
+;tos_sip=cs3                    ; Sets TOS for SIP packets.
+;tos_audio=ef                   ; Sets TOS for RTP audio packets.
+;tos_video=af41                 ; Sets TOS for RTP video packets.
+
 ;maxexpiry=3600			; Max length of incoming registrations/subscriptions we allow (seconds)
 ;minexpiry=60			; Minimum length of registrations/subscriptions (default 60)
 ;defaultexpiry=120		; Default length of incoming/outoing registration
@@ -463,6 +467,8 @@
 ;dtmfmode=inband		; Choices are inband, rfc2833, or info
 ;defaultip=192.168.0.59		; IP used until peer registers
 ;mailbox=1234 at context,2345      ; Mailbox(-es) for message waiting indicator
+;subscribemwi=yes		; Only send notifications if this phone 
+				; subscribes for mailbox notification
 ;vmexten=voicemail		; dialplan extension to reach mailbox 
 				; sets the Message-Account in the MWI notify message
 				; defaults to global vmexten which defaults to "asterisk"

Modified: team/oej/test-this-branch/include/asterisk/acl.h
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/include/asterisk/acl.h?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/include/asterisk/acl.h (original)
+++ team/oej/test-this-branch/include/asterisk/acl.h Tue Mar 28 11:05:59 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -38,16 +38,17 @@
 
 struct ast_ha;
 
-extern void ast_free_ha(struct ast_ha *ha);
-extern struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path);
-extern int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin);
-extern int ast_get_ip(struct sockaddr_in *sin, const char *value);
-extern int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service);
-extern int ast_ouraddrfor(struct in_addr *them, struct in_addr *us);
-extern int ast_lookup_iface(char *iface, struct in_addr *address);
-extern struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original);
-extern int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr);
-extern int ast_str2tos(const char *value, int *tos);
+void ast_free_ha(struct ast_ha *ha);
+struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path);
+int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin);
+int ast_get_ip(struct sockaddr_in *sin, const char *value);
+int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service);
+int ast_ouraddrfor(struct in_addr *them, struct in_addr *us);
+int ast_lookup_iface(char *iface, struct in_addr *address);
+struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original);
+int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr);
+int ast_str2tos(const char *value, unsigned int *tos);
+const char *ast_tos2str(unsigned int tos);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Modified: team/oej/test-this-branch/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/include/asterisk/module.h?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/include/asterisk/module.h (original)
+++ team/oej/test-this-branch/include/asterisk/module.h Tue Mar 28 11:05:59 2006
@@ -279,8 +279,6 @@
 	struct ast_channel *chan;
 	struct localuser *next;
 };
-
-#define STANDARD_LOCAL_USER	/* unused and deprecated now */
 
 /*! 
  * \brief The localuser declaration.

Modified: team/oej/test-this-branch/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/pbx/pbx_dundi.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/pbx/pbx_dundi.c (original)
+++ team/oej/test-this-branch/pbx/pbx_dundi.c Tue Mar 28 11:05:59 2006
@@ -1129,17 +1129,16 @@
 	int weight;
 	int length;
 	int z;
-	int expiration;
 	char fs[256];
-	time_t timeout;
 
 	/* Build request string */
 	if (!ast_db_get("dundi/cache", key, data, sizeof(data))) {
+		time_t timeout;
 		ptr = data;
 		if (!ast_get_time_t(ptr, &timeout, 0, &length)) {
-			expiration = timeout - now;
+			int expiration = timeout - now;
 			if (expiration > 0) {
-				ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", (int)(timeout - now));
+				ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", expiration);
 				ptr += length + 1;
 				while((sscanf(ptr, "%d/%d/%d/%n", &(flags.flags), &weight, &tech, &length) == 3)) {
 					ptr += length;
@@ -2229,25 +2228,20 @@
 
 static char *complete_peer_helper(const char *line, const char *word, int pos, int state, int rpos)
 {
-	int which=0;
-	char *ret;
+	int which=0, len;
+	char *ret = NULL;
 	struct dundi_peer *p;
 	char eid_str[20];
+
 	if (pos != rpos)
 		return NULL;
 	ast_mutex_lock(&peerlock);
-	p = peers;
-	while(p) {
-		if (!strncasecmp(word, dundi_eid_to_str(eid_str, sizeof(eid_str), &p->eid), strlen(word))) {
-			if (++which > state)
-				break;
-		}
-		p = p->next;
-	}
-	if (p) {
-		ret = strdup(dundi_eid_to_str(eid_str, sizeof(eid_str), &p->eid));
-	} else
-		ret = NULL;
+	len = strlen(word);
+	for (p = peers; !ret && p; p = p->next) {
+		const char *s = dundi_eid_to_str(eid_str, sizeof(eid_str), &p->eid);
+		if (!strncasecmp(word, s, len) && ++which > state)
+			ret = ast_strdup(s);
+	}
 	ast_mutex_unlock(&peerlock);
 	return ret;
 }
@@ -3846,15 +3840,14 @@
 	struct localuser *u;
 	struct dundi_result dr[MAX_RESULTS];
 
-	LOCAL_USER_ADD(u);
-
 	buf[0] = '\0';
 
 	if (ast_strlen_zero(num)) {
 		ast_log(LOG_WARNING, "DUNDILOOKUP requires an argument (number)\n");
-		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
+
+	LOCAL_USER_ADD(u);
 
 	context = strchr(num, '|');
 	if (context) {

Modified: team/oej/test-this-branch/res/res_smdi.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/res/res_smdi.c?rev=15613&r1=15612&r2=15613&view=diff
==============================================================================
--- team/oej/test-this-branch/res/res_smdi.c (original)
+++ team/oej/test-this-branch/res/res_smdi.c Tue Mar 28 11:05:59 2006
@@ -59,8 +59,7 @@
 
 /* Use count stuff */
 

[... 58 lines stripped ...]


More information about the asterisk-commits mailing list