[asterisk-commits] rmudgett: branch group/issue8824 r158798 - in /team/group/issue8824: ./ chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 24 10:50:39 CST 2008


Author: rmudgett
Date: Mon Nov 24 10:50:39 2008
New Revision: 158798

URL: http://svn.digium.com/view/asterisk?view=rev&rev=158798
Log:
Resolved conflict and restarted automerge.

Merged revisions 158686,158688,158690,158694,158723,158754,158756 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r158686 | mvanbaak | 2008-11-22 09:58:49 -0600 (Sat, 22 Nov 2008) | 2 lines
  
  make this compile under devmode
........
  r158688 | mvanbaak | 2008-11-22 10:06:38 -0600 (Sat, 22 Nov 2008) | 4 lines
  
  fix a very occasional core dump in chan_skinny found by wedhorn.
  
  (issue #13948)
........
  r158690 | mvanbaak | 2008-11-22 10:48:09 -0600 (Sat, 22 Nov 2008) | 4 lines
  
  Add Media Source Update to skinny's control2str
  
  (issue #13948)
........
  r158694 | mvanbaak | 2008-11-22 10:57:11 -0600 (Sat, 22 Nov 2008) | 8 lines
  
  dont send reorder tone after a device is hungup if a dialout is abandoned or failed.
  Without this reorder tone will play after hangup and both wedhorn's and my wife have threatened to use an axe on our asterisk box
  
  (closes issue #13948)
  Reported by: wedhorn
  Patches:
  	switch.diff uploaded by wedhorn (license 30)
........
  r158723 | mvanbaak | 2008-11-22 11:17:33 -0600 (Sat, 22 Nov 2008) | 4 lines
  
  last commit worked on OpenBSD but still generated warning on Ubuntu.
  
  Initialise a variable so --enable-dev-mode does not complain
........
  r158754 | seanbright | 2008-11-22 21:30:46 -0600 (Sat, 22 Nov 2008) | 3 lines
  
  No need to use a separate structure for this since we can just pass
  our sip_pvt pointer in directly.
........
  r158756 | seanbright | 2008-11-22 21:36:52 -0600 (Sat, 22 Nov 2008) | 6 lines
  
  If you enabled 'notifycid' one of the limitations is that the calling channel
  is only found if it dialed the extension that was subscribed to.  You can now
  specify 'ignore-context' for the 'notifycid' option in sip.conf which will, as
  it's value implies, ignore the current context of the caller when doing the
  lookup.
........

Modified:
    team/group/issue8824/   (props changed)
    team/group/issue8824/channels/chan_sip.c
    team/group/issue8824/channels/chan_skinny.c
    team/group/issue8824/configs/sip.conf.sample
    team/group/issue8824/funcs/func_realtime.c

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Nov 24 10:50:39 2008
@@ -1,1 +1,1 @@
-/trunk:1-158667
+/trunk:1-158793

Modified: team/group/issue8824/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_sip.c?view=diff&rev=158798&r1=158797&r2=158798
==============================================================================
--- team/group/issue8824/channels/chan_sip.c (original)
+++ team/group/issue8824/channels/chan_sip.c Mon Nov 24 10:50:39 2008
@@ -773,6 +773,13 @@
 	SIP_PING,		/*!< Not supported at all, no standard but still implemented out there */
 };
 
+/*! \brief Settings for the 'notifycid' option, see sip.conf.sample for details. */
+enum notifycid_setting {
+	DISABLED       = 0,
+	ENABLED        = 1,
+	IGNORE_CONTEXT = 2,
+};
+
 /*! \brief The core structure to setup dialogs. We parse incoming messages by using
 	structure and then route the messages according to the type.
 
@@ -998,7 +1005,7 @@
 #define DEFAULT_ALLOW_EXT_DOM	TRUE		/*!< Allow external domains */
 #define DEFAULT_REALM		"asterisk"	/*!< Realm for HTTP digest authentication */
 #define DEFAULT_NOTIFYRINGING	TRUE		/*!< Notify devicestate system on ringing state */
-#define DEFAULT_NOTIFYCID		FALSE	/*!< Include CID with ringing notifications */
+#define DEFAULT_NOTIFYCID		DISABLED	/*!< Include CID with ringing notifications */
 #define DEFAULT_PEDANTIC	FALSE		/*!< Avoid following SIP standards for dialog matching */
 #define DEFAULT_AUTOCREATEPEER	FALSE		/*!< Don't create peers automagically */
 #define	DEFAULT_MATCHEXTERNIPLOCALLY FALSE	/*!< Match extern IP locally default setting */
@@ -1068,8 +1075,9 @@
 
 static int global_notifyringing;	/*!< Send notifications on ringing */
 static int global_notifyhold;		/*!< Send notifications on hold */
-static int global_notifycid;        /*!< Send CID with ringing notifications */
 static int global_match_auth_username;		/*!< Match auth username if available instead of From: Default off. */
+
+static enum notifycid_setting global_notifycid; /*!< Send CID with ringing notifications */
 
 static int global_relaxdtmf;		/*!< Relax DTMF */
 static int global_rtptimeout;		/*!< Time out call if no RTP */
@@ -10013,17 +10021,12 @@
 	return 0;
 }
 
-struct caller_criteria {
-	const char *exten;
-	const char *context;
-};
-
 static int find_calling_channel(struct ast_channel *c, void *data) {
-	struct caller_criteria *info = data;
+	struct sip_pvt *p = data;
 
 	return (c->pbx &&
-			(!strcasecmp(c->macroexten, info->exten) || !strcasecmp(c->exten, info->exten)) &&
-			!strcasecmp(c->context, info->context));
+			(!strcasecmp(c->macroexten, p->exten) || !strcasecmp(c->exten, p->exten)) &&
+			(global_notifycid == IGNORE_CONTEXT || !strcasecmp(c->context, p->context)));
 }
 
 /*! \brief Used in the SUBSCRIBE notification subsystem (RFC3265) */
@@ -10191,13 +10194,7 @@
 			   callee must be dialing the same extension that is being monitored.  Simply dialing
 			   the hint'd device is not sufficient. */
 			if (global_notifycid) {
-				struct ast_channel *caller = NULL;
-				struct caller_criteria data = {
-					.exten = p->exten,
-					.context = p->context,
-				};
-
-				caller = ast_channel_search_locked(find_calling_channel, &data);
+				struct ast_channel *caller = ast_channel_search_locked(find_calling_channel, p);
 
 				if (caller) {
 					local_display = ast_strdupa(caller->cid.cid_name);
@@ -14850,7 +14847,9 @@
 	ast_cli(a->fd, "  Outbound reg. attempts: %d\n", global_regattempts_max);
 	ast_cli(a->fd, "  Notify ringing state:   %s\n", cli_yesno(global_notifyringing));
 	if (global_notifyringing) {
-		ast_cli(a->fd, "    Include CID:          %s\n", cli_yesno(global_notifycid));
+		ast_cli(a->fd, "    Include CID:          %s%s\n",
+				cli_yesno(global_notifycid),
+				global_notifycid == IGNORE_CONTEXT ? " (Ignoring context)" : "");
 	}
 	ast_cli(a->fd, "  Notify hold state:      %s\n", cli_yesno(global_notifyhold));
 	ast_cli(a->fd, "  SIP Transfer mode:      %s\n", transfermode2str(global_allowtransfer));
@@ -23238,7 +23237,11 @@
 		} else if (!strcasecmp(v->name, "notifyhold")) {
 			global_notifyhold = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifycid")) {
-			global_notifycid = ast_true(v->value);
+			if (!strcasecmp(v->value, "ignore-context")) {
+				global_notifycid = IGNORE_CONTEXT;
+			} else {
+				global_notifycid = ast_true(v->value);
+			}
 		} else if (!strcasecmp(v->name, "alwaysauthreject")) {
 			sip_cfg.alwaysauthreject = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "mohinterpret")) {

Modified: team/group/issue8824/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_skinny.c?view=diff&rev=158798&r1=158797&r2=158798
==============================================================================
--- team/group/issue8824/channels/chan_skinny.c (original)
+++ team/group/issue8824/channels/chan_skinny.c Mon Nov 24 10:50:39 2008
@@ -3219,7 +3219,9 @@
 		} else if (res == 0) {
 			ast_debug(1, "Not enough digits (%s) (and no ambiguous match)...\n", d->exten);
 			memset(d->exten, 0, sizeof(d->exten));
-			transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
+			if (l->hookstate == SKINNY_OFFHOOK) {
+				transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
+			}
 			if (sub->owner && sub->owner->_state != AST_STATE_UP) {
 				ast_indicate(c, -1);
 				ast_hangup(c);
@@ -3229,9 +3231,11 @@
 			   ((d->exten[0] != '*') || (!ast_strlen_zero(d->exten) > 2))) {
 			ast_log(LOG_WARNING, "Can't match [%s] from '%s' in context %s\n", d->exten, c->cid.cid_num ? c->cid.cid_num : "<Unknown Caller>", c->context);
 			memset(d->exten, 0, sizeof(d->exten));
-			transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
-			/* hang out for 3 seconds to let congestion play */
-			ast_safe_sleep(c, 3000);
+			if (l->hookstate == SKINNY_OFFHOOK) {
+				transmit_tone(d, SKINNY_REORDER, l->instance, sub->callid);
+				/* hang out for 3 seconds to let congestion play */
+				ast_safe_sleep(c, 3000);
+			}
 			break;
 		}
 		if (!timeout) {
@@ -3351,6 +3355,7 @@
 				transmit_closereceivechannel(d, sub);
 				transmit_stopmediatransmission(d, sub);
 				transmit_lamp_indication(d, STIMULUS_LINE, l->instance, SKINNY_LAMP_BLINK);
+				transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
 			} else {    /* we are killing a background sub on the line with other subs*/
 				ast_verb(4,"Killing inactive sub %d\n", sub->callid);
 				if (AST_LIST_NEXT(sub, list)) {
@@ -3371,6 +3376,7 @@
 				transmit_stopmediatransmission(d, sub);
 				transmit_speaker_mode(d, SKINNY_SPEAKEROFF);
 				transmit_ringer_mode(d, SKINNY_RING_OFF);
+				transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
 				/* we should check to see if we can start the ringer if another line is ringing */
 			}
 		}
@@ -3613,6 +3619,8 @@
 		return "Hold";
 	case AST_CONTROL_UNHOLD:
 		return "Unhold";
+	case AST_CONTROL_SRCUPDATE:
+		return "Media Source Update";
 	case AST_CONTROL_CONNECTED_LINE:
 		return "Connected Line";
 	case -1:
@@ -4621,9 +4629,9 @@
 	if (sub && sub->outgoing) {
 		/* We're answering a ringing call */
 		ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
+		transmit_callstate(d, l->instance, SKINNY_OFFHOOK, sub->callid);
+		transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
 		transmit_callstateonly(d, sub, SKINNY_CONNECTED);
-		transmit_tone(d, SKINNY_SILENCE, l->instance, sub->callid);
-		transmit_callstate(d, l->instance, SKINNY_CONNECTED, sub->callid);
 		transmit_selectsoftkeys(d, l->instance, sub->callid, KEYDEF_CONNECTED);
 		start_rtp(sub);
 		ast_setstate(sub->owner, AST_STATE_UP);
@@ -4726,7 +4734,8 @@
 				l->name, d->name, sub->callid);
 		}
 	}
-	if ((l->hookstate == SKINNY_ONHOOK) && (AST_LIST_NEXT(sub, list) && !AST_LIST_NEXT(sub, list)->rtp)) {
+	/* The bit commented below gives a very occasional core dump. */
+	if ((l->hookstate == SKINNY_ONHOOK) && (AST_LIST_NEXT(sub, list) /*&& !AST_LIST_NEXT(sub, list)->rtp*/)) {
 		do_housekeeping(s);
 	}
 	return 1;

Modified: team/group/issue8824/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/configs/sip.conf.sample?view=diff&rev=158798&r1=158797&r2=158798
==============================================================================
--- team/group/issue8824/configs/sip.conf.sample (original)
+++ team/group/issue8824/configs/sip.conf.sample Mon Nov 24 10:50:39 2008
@@ -393,7 +393,9 @@
                                 ; user or peer (if subscribecontext is different than context).
                                 ; This is also limited to a single caller, meaning that if an
                                 ; extension is ringing because multiple calls are incoming,
-                                ; only one will be used as the source of caller ID.
+                                ; only one will be used as the source of caller ID.  Specify
+                                ; 'ignore-context' to ignore the called context when looking
+                                ; for the caller's channel.  The default value is 'no.'
 ;callcounter = yes              ; Enable call counters on devices. This can be set per
                                 ; device too.
 

Modified: team/group/issue8824/funcs/func_realtime.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/funcs/func_realtime.c?view=diff&rev=158798&r1=158797&r2=158798
==============================================================================
--- team/group/issue8824/funcs/func_realtime.c (original)
+++ team/group/issue8824/funcs/func_realtime.c Mon Nov 24 10:50:39 2008
@@ -252,7 +252,7 @@
 	struct ast_str *escapebuf = ast_str_thread_get(&buf1, 16);
 	struct ast_str *fields = ast_str_thread_get(&buf2, 16);
 	struct ast_str *values = ast_str_thread_get(&buf3, 16);
-	int first;
+	int first = 0;
 	enum { rtfield, rthash } which;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(family);




More information about the asterisk-commits mailing list