[svn-commits] rmudgett: branch 1.4 r296165 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 24 16:41:12 CST 2010


Author: rmudgett
Date: Wed Nov 24 16:41:07 2010
New Revision: 296165

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=296165
Log:
Oneway audio to SIP phone from FXS port after FXS port gets a CallWaiting pip.

The FXS connected phone has to have CW/CID support to fail, as it will
send back a DTMF 'A' or 'D' when it's ready to receive CallerID.  A normal
phone with no CID never fails.  Also the SIP phone does not hear MOH when
the CW call is answered.

The DTMF end frame is suppressed when the phone acknowledges the CW signal
for CID.  The problem is the DTMF begin frame needs to be suppressed as
well.  The DTMF begin frame is causing SIP to start sending the DTMF RTP
frames.  Since the DTMF end frame is suppressed, SIP will not stop sending
those DTMF RTP packets.

* Suppress the DTMF begin and end frames when the channel driver is
looking for DTMF digits.

* Fixed a couple issues caused by not cleaning up the CID spill if you
answer the CW call while it is sending the CID spill.

* Fixed not sending CW/CID spill to the phone when the call is natively
bridged.  (Fixed by not using native bridge if CW/CID is possible.)

* Suppress received audio when sending CW/CID spills.  The other parties
involved do not need to hear the CW/CID spills and may be confused if the
CW call is for them.

(closes issue #18129)
Reported by: alecdavis
Patches:
      issue_18129_v1.8_v3.patch uploaded by rmudgett (license 664)
Tested by: alecdavis, rmudgett


NOTE:

* v1.4 does not have the main problem fixed by suppressing the DTMF start
frames.  The other three items fixed are relevant.

* If you really must restore native bridging between analog ports, you
need to disable CW/CID either by configuring chan_dahdi.conf
callwaitingcallerid=no or dialing *70 before dialing the number to
temporarily disable CW.

Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=296165&r1=296164&r2=296165
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Wed Nov 24 16:41:07 2010
@@ -285,11 +285,12 @@
 #define MASK_AVAIL		(1 << 0)	/*!< Channel available for PRI use */
 #define MASK_INUSE		(1 << 1)	/*!< Channel currently in use */
 
-#define CALLWAITING_SILENT_SAMPLES	( (300 * 8) / READ_SIZE) /*!< 300 ms */
-#define CALLWAITING_REPEAT_SAMPLES	( (10000 * 8) / READ_SIZE) /*!< 10,000 ms */
-#define CIDCW_EXPIRE_SAMPLES		( (500 * 8) / READ_SIZE) /*!< 500 ms */
-#define MIN_MS_SINCE_FLASH			( (2000) )	/*!< 2000 ms */
-#define DEFAULT_RINGT 				( (8000 * 8) / READ_SIZE) /*!< 8,000 ms */
+#define CALLWAITING_SILENT_SAMPLES		((300 * 8) / READ_SIZE) /*!< 300 ms */
+#define CALLWAITING_REPEAT_SAMPLES		((10000 * 8) / READ_SIZE) /*!< 10,000 ms */
+#define CALLWAITING_SUPPRESS_SAMPLES	((100 * 8) / READ_SIZE) /*!< 100 ms */
+#define CIDCW_EXPIRE_SAMPLES			((500 * 8) / READ_SIZE) /*!< 500 ms */
+#define MIN_MS_SINCE_FLASH				((2000) )	/*!< 2000 ms */
+#define DEFAULT_RINGT 					((8000 * 8) / READ_SIZE) /*!< 8,000 ms */
 
 struct dahdi_pvt;
 
@@ -774,7 +775,8 @@
 	int cid_start;					/*!< CID start indicator, polarity or ring */
 	int callingpres;				/*!< The value of callling presentation that we're going to use when placing a PRI call */
 	int callwaitingrepeat;				/*!< How many samples to wait before repeating call waiting */
-	int cidcwexpire;				/*!< When to expire our muting for CID/CW */
+	int cidcwexpire;				/*!< When to stop waiting for CID/CW CAS response (In samples) */
+	int cid_suppress_expire;		/*!< How many samples to suppress after a CID spill. */
 	/*! \brief Analog caller ID waveform sample buffer */
 	unsigned char *cidspill;
 	/*! \brief Position in the cidspill buffer to send out next. */
@@ -795,7 +797,12 @@
 	 * characters are processed.
 	 */
 	int stripmsd;
-	/*! \brief BOOLEAN. XXX Meaning what?? */
+	/*!
+	 * \brief TRUE if Call Waiting (CW) CPE Alert Signal (CAS) is being sent.
+	 * \note
+	 * After CAS is sent, the call waiting caller id will be sent if the phone
+	 * gives a positive reply.
+	 */
 	int callwaitcas;
 	/*! \brief Number of call waiting rings. */
 	int callwaitrings;
@@ -2056,9 +2063,9 @@
 			ast_log(LOG_WARNING, "Unable to restore conference info: %s\n", strerror(errno));
 			return -1;
 		}
-	}
-	if (option_debug)
-		ast_log(LOG_DEBUG, "Restored conferencing\n");
+		if (option_debug)
+			ast_log(LOG_DEBUG, "Restored conferencing\n");
+	}
 	return 0;
 }
 
@@ -2068,6 +2075,7 @@
 {
 	p->callwaitcas = 0;
 	p->cidcwexpire = 0;
+	p->cid_suppress_expire = 0;
 	if (!(p->cidspill = ast_malloc(MAX_CALLERID_SIZE)))
 		return -1;
 	p->cidlen = ast_callerid_callwaiting_generate(p->cidspill, p->callwait_name, p->callwait_num, AST_LAW(p));
@@ -2109,11 +2117,13 @@
 			return 0;
 		p->cidpos += res;
 	}
+	p->cid_suppress_expire = CALLWAITING_SUPPRESS_SAMPLES;
 	free(p->cidspill);
 	p->cidspill = NULL;
 	if (p->callwaitcas) {
 		/* Wait for CID/CW to expire */
 		p->cidcwexpire = CIDCW_EXPIRE_SAMPLES;
+		p->cid_suppress_expire = p->cidcwexpire;
 	} else
 		restore_conference(p);
 	return 0;
@@ -2127,6 +2137,11 @@
 		ast_log(LOG_WARNING, "Spill already exists?!?\n");
 		free(p->cidspill);
 	}
+
+	/*
+	 * SAS: Subscriber Alert Signal, 440Hz for 300ms
+	 * CAS: CPE Alert Signal, 2130Hz * 2750Hz sine waves
+	 */
 	if (!(p->cidspill = ast_malloc(2400 /* SAS */ + 680 /* CAS */ + READ_SIZE * 4)))
 		return -1;
 	save_conference(p);
@@ -2599,6 +2614,8 @@
 		p->prev->next = p->next;
 	if (p->next)
 		p->next->prev = p->prev;
+
+	free(p->cidspill);
 	if (p->use_smdi)
 		ast_smdi_interface_unref(p->smdi_iface);
 	ast_mutex_destroy(&p->lock);
@@ -2672,15 +2689,11 @@
 	/* Destroy all the interfaces and free their memory */
 	p = iflist;
 	while (p) {
-		/* Free any callerid */
-		if (p->cidspill)
-			ast_free(p->cidspill);
 		pl = p;
 		p = p->next;
 		x = pl->channel;
 		/* Free associated memory */
-		if (pl)
-			destroy_dahdi_pvt(&pl);
+		destroy_dahdi_pvt(&pl);
 		if (option_verbose > 2) 
 			ast_verbose(VERBOSE_PREFIX_2 "Unregistered channel %d\n", x);
 	}
@@ -3151,15 +3164,14 @@
 		default:
 			tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
 		}
-		if (p->cidspill)
-			free(p->cidspill);
+		free(p->cidspill);
+		p->cidspill = NULL;
 		if (p->sig)
 			dahdi_disable_ec(p);
 		x = 0;
 		ast_channel_setoption(ast,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
 		ast_channel_setoption(ast,AST_OPTION_TDD,&x,sizeof(char),0);
 		p->didtdd = 0;
-		p->cidspill = NULL;
 		p->callwaitcas = 0;
 		p->callwaiting = p->permcallwaiting;
 		p->hidecallerid = p->permhidecallerid;
@@ -3192,6 +3204,7 @@
 
 	p->callwaitingrepeat = 0;
 	p->cidcwexpire = 0;
+	p->cid_suppress_expire = 0;
 	p->oprmode = 0;
 	ast->tech_pvt = NULL;
 	ast_mutex_unlock(&p->lock);
@@ -3768,6 +3781,24 @@
 		return AST_BRIDGE_RETRY;
 	}
 
+	if ((p0->callwaiting && p0->callwaitingcallerid)
+		|| (p1->callwaiting && p1->callwaitingcallerid)) {
+		/*
+		 * Call Waiting Caller ID requires DTMF detection to know if it
+		 * can send the CID spill.
+		 *
+		 * For now, don't attempt to native bridge if either channel
+		 * needs DTMF detection.  There is code below to handle it
+		 * properly until DTMF is actually seen, but due to currently
+		 * unresolved issues it's ignored...
+		 */
+		ast_mutex_unlock(&p0->lock);
+		ast_mutex_unlock(&p1->lock);
+		ast_mutex_unlock(&c0->lock);
+		ast_mutex_unlock(&c1->lock);
+		return AST_BRIDGE_FAILED_NOWARN;
+	}
+
 	if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
 		if (p0->owner && p1->owner) {
 			/* If we don't have a call-wait in a 3-way, and we aren't in a 3-way, we can be master */
@@ -4185,86 +4216,104 @@
 	return DAHDI_ALARM_NONE;
 }
 
-static void dahdi_handle_dtmfup(struct ast_channel *ast, int index, struct ast_frame **dest)
+static void dahdi_handle_dtmf(struct ast_channel *ast, int index, struct ast_frame **dest)
 {
 	struct dahdi_pvt *p = ast->tech_pvt;
 	struct ast_frame *f = *dest;
 
 	if (option_debug)
-		ast_log(LOG_DEBUG, "DTMF digit: %c on %s\n", f->subclass, ast->name);
+		ast_log(LOG_DEBUG, "%s DTMF digit: 0x%02X '%c' on %s\n",
+			f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End",
+			f->subclass, f->subclass, ast->name);
 
 	if (p->confirmanswer) {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Confirm answer on %s!\n", ast->name);
-		/* Upon receiving a DTMF digit, consider this an answer confirmation instead
-		   of a DTMF digit */
-		p->subs[index].f.frametype = AST_FRAME_CONTROL;
-		p->subs[index].f.subclass = AST_CONTROL_ANSWER;
+		if (f->frametype == AST_FRAME_DTMF_END) {
+			if (option_debug)
+				ast_log(LOG_DEBUG, "Confirm answer on %s!\n", ast->name);
+			/* Upon receiving a DTMF digit, consider this an answer confirmation instead
+			   of a DTMF digit */
+			p->subs[index].f.frametype = AST_FRAME_CONTROL;
+			p->subs[index].f.subclass = AST_CONTROL_ANSWER;
+			/* Reset confirmanswer so DTMF's will behave properly for the duration of the call */
+			p->confirmanswer = 0;
+		} else {
+			p->subs[index].f.frametype = AST_FRAME_NULL;
+			p->subs[index].f.subclass = 0;
+		}
 		*dest = &p->subs[index].f;
-		/* Reset confirmanswer so DTMF's will behave properly for the duration of the call */
-		p->confirmanswer = 0;
 	} else if (p->callwaitcas) {
-		if ((f->subclass == 'A') || (f->subclass == 'D')) {
-			if (option_debug)
-				ast_log(LOG_DEBUG, "Got some DTMF, but it's for the CAS\n");
-			if (p->cidspill)
+		if (f->frametype == AST_FRAME_DTMF_END) {
+			if ((f->subclass == 'A') || (f->subclass == 'D')) {
+				if (option_debug)
+					ast_log(LOG_DEBUG, "Got some DTMF, but it's for the CAS\n");
 				free(p->cidspill);
-			send_cwcidspill(p);
-		}
-		if ((f->subclass != 'm') && (f->subclass != 'u')) 
-			p->callwaitcas = 0;
+				p->cidspill = NULL;
+				send_cwcidspill(p);
+			}
+			if ((f->subclass != 'm') && (f->subclass != 'u')) 
+				p->callwaitcas = 0;
+		}
 		p->subs[index].f.frametype = AST_FRAME_NULL;
 		p->subs[index].f.subclass = 0;
 		*dest = &p->subs[index].f;
 	} else if (f->subclass == 'f') {
-		/* Fax tone -- Handle and return NULL */
-		if ((p->callprogress & 0x6) && !p->faxhandled) {
-			p->faxhandled = 1;
-			if (strcmp(ast->exten, "fax")) {
-				const char *target_context = S_OR(ast->macrocontext, ast->context);
-
-				/* We need to unlock 'ast' here because ast_exists_extension has the
-				 * potential to start autoservice on the channel. Such action is prone
-				 * to deadlock.
-				 */
-				ast_mutex_unlock(&p->lock);
-				ast_channel_unlock(ast);
-				if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) {
-					ast_channel_lock(ast);
-					ast_mutex_lock(&p->lock);
-					if (option_verbose > 2)
-						ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name);
-					/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
-					pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
-					if (ast_async_goto(ast, target_context, "fax", 1))
-						ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
-				} else {
-					ast_channel_lock(ast);
-					ast_mutex_lock(&p->lock);
-					ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n");
-				}
+		if (f->frametype == AST_FRAME_DTMF_END) {
+			/* Fax tone -- Handle and return NULL */
+			if ((p->callprogress & 0x6) && !p->faxhandled) {
+				p->faxhandled = 1;
+				if (strcmp(ast->exten, "fax")) {
+					const char *target_context = S_OR(ast->macrocontext, ast->context);
+
+					/* We need to unlock 'ast' here because ast_exists_extension has the
+					 * potential to start autoservice on the channel. Such action is prone
+					 * to deadlock.
+					 */
+					ast_mutex_unlock(&p->lock);
+					ast_channel_unlock(ast);
+					if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) {
+						ast_channel_lock(ast);
+						ast_mutex_lock(&p->lock);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name);
+						/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
+						pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
+						if (ast_async_goto(ast, target_context, "fax", 1))
+							ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
+					} else {
+						ast_channel_lock(ast);
+						ast_mutex_lock(&p->lock);
+						ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n");
+					}
+				} else if (option_debug)
+					ast_log(LOG_DEBUG, "Already in a fax extension, not redirecting\n");
 			} else if (option_debug)
-				ast_log(LOG_DEBUG, "Already in a fax extension, not redirecting\n");
-		} else if (option_debug)
 				ast_log(LOG_DEBUG, "Fax already handled\n");
-		dahdi_confmute(p, 0);
+			dahdi_confmute(p, 0);
+		}
 		p->subs[index].f.frametype = AST_FRAME_NULL;
 		p->subs[index].f.subclass = 0;
 		*dest = &p->subs[index].f;
 	} else if (f->subclass == 'm') {
-		/* Confmute request */
-		dahdi_confmute(p, 1);
+		if (f->frametype == AST_FRAME_DTMF_END) {
+			/* Confmute request */
+			dahdi_confmute(p, 1);
+		}
 		p->subs[index].f.frametype = AST_FRAME_NULL;
 		p->subs[index].f.subclass = 0;
 		*dest = &p->subs[index].f;		
 	} else if (f->subclass == 'u') {
-		/* Unmute */
-		dahdi_confmute(p, 0);
+		if (f->frametype == AST_FRAME_DTMF_END) {
+			/* Unmute */
+			dahdi_confmute(p, 0);
+		}
 		p->subs[index].f.frametype = AST_FRAME_NULL;
 		p->subs[index].f.subclass = 0;
 		*dest = &p->subs[index].f;		
-	} else
-		dahdi_confmute(p, 0);
+	} else {
+		if (f->frametype == AST_FRAME_DTMF_END) {
+			dahdi_confmute(p, 0);
+		}
+	}
 }
 			
 static void handle_alarms(struct dahdi_pvt *p, int alarms)
@@ -4336,24 +4385,31 @@
 #ifdef HAVE_PRI
 		if (!p->proceeding && p->sig == SIG_PRI && p->pri && (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) {
 			/* absorb event */
-		} else {
+		} else
 #endif
+		{
 			p->subs[index].f.frametype = AST_FRAME_DTMF_END;
 			p->subs[index].f.subclass = res & 0xff;
-#ifdef HAVE_PRI
-		}
-#endif
-		dahdi_handle_dtmfup(ast, index, &f);
+			dahdi_handle_dtmf(ast, index, &f);
+		}
 		return f;
 	}
 
 	if (res & DAHDI_EVENT_DTMFDOWN) {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "DTMF Down '%c'\n", res & 0xff);
-		/* Mute conference */
-		dahdi_confmute(p, 1);
-		p->subs[index].f.frametype = AST_FRAME_DTMF_BEGIN;
-		p->subs[index].f.subclass = res & 0xff;
+#ifdef HAVE_PRI
+		if (!p->proceeding && p->sig == SIG_PRI && p->pri && (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) {
+			/* absorb event */
+		} else
+#endif
+		{
+			/* Mute conference */
+			dahdi_confmute(p, 1);
+			p->subs[index].f.frametype = AST_FRAME_DTMF_BEGIN;
+			p->subs[index].f.subclass = res & 0xff;
+			dahdi_handle_dtmf(ast, index, &f);
+		}
 		return &p->subs[index].f;
 	}
 
@@ -4504,6 +4560,7 @@
 #endif						
 						p->callwaitingrepeat = 0;
 						p->cidcwexpire = 0;
+						p->cid_suppress_expire = 0;
 						p->owner = NULL;
 						/* Don't start streaming audio yet if the incoming call isn't up yet */
 						if (p->subs[SUB_REAL].owner->_state != AST_STATE_UP)
@@ -4647,11 +4704,12 @@
 					dahdi_set_hook(p->subs[index].dfd, DAHDI_OFFHOOK);
 					p->subs[SUB_REAL].needringing = 0;
 					ast_log(LOG_DEBUG, "channel %d answered\n", p->channel);
-					if (p->cidspill) {
-						/* Cancel any running CallerID spill */
-						free(p->cidspill);
-						p->cidspill = NULL;
-					}
+
+					/* Cancel any running CallerID spill */
+					free(p->cidspill);
+					p->cidspill = NULL;
+					restore_conference(p);
+
 					p->dialing = 0;
 					p->callwaitcas = 0;
 					if (p->confirmanswer) {
@@ -4823,6 +4881,11 @@
 			case SIG_FXOKS:
 				ast_log(LOG_DEBUG, "Winkflash, index: %d, normal: %d, callwait: %d, thirdcall: %d\n",
 					index, p->subs[SUB_REAL].dfd, p->subs[SUB_CALLWAIT].dfd, p->subs[SUB_THREEWAY].dfd);
+
+				/* Cancel any running CallerID spill */
+				free(p->cidspill);
+				p->cidspill = NULL;
+				restore_conference(p);
 				p->callwaitcas = 0;
 
 				if (index != SUB_REAL) {
@@ -4853,6 +4916,7 @@
 					}
 					p->callwaitingrepeat = 0;
 					p->cidcwexpire = 0;
+					p->cid_suppress_expire = 0;
 
 					/* Start music on hold if appropriate */
 					if (!p->subs[SUB_CALLWAIT].inthreeway && ast_bridged_channel(p->subs[SUB_CALLWAIT].owner)) {
@@ -5219,6 +5283,7 @@
 				dahdi_ring_phone(p);
 				p->callwaitingrepeat = 0;
 				p->cidcwexpire = 0;
+				p->cid_suppress_expire = 0;
 			} else {
 				ast_log(LOG_WARNING, "Absorbed %s, but nobody is left!?!?\n",
 					event2str(res));
@@ -5250,6 +5315,7 @@
 				}
 				p->callwaitingrepeat = 0;
 				p->cidcwexpire = 0;
+				p->cid_suppress_expire = 0;
 				if (ast_bridged_channel(p->owner))
 					ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
 				p->subs[SUB_REAL].needunhold = 1;
@@ -5496,22 +5562,26 @@
 			return &p->subs[index].f;
 		}
 	}
-	/* Ensure the CW timer decrements only on a single subchannel */
-	if (p->callwaitingrepeat && dahdi_get_index(ast, p, 1) == SUB_REAL) {
-		p->callwaitingrepeat--;
-	}
-	if (p->cidcwexpire)
-		p->cidcwexpire--;
-	/* Repeat callwaiting */
-	if (p->callwaitingrepeat == 1) {
-		p->callwaitrings++;
-		dahdi_callwait(ast);
-	}
-	/* Expire CID/CW */
-	if (p->cidcwexpire == 1) {
-		if (option_verbose > 2)
-			ast_verbose(VERBOSE_PREFIX_3 "CPE does not support Call Waiting Caller*ID.\n");
-		restore_conference(p);
+	if (index == SUB_REAL) {
+		/* Ensure the CW timers decrement only on a single subchannel */
+		if (p->cidcwexpire) {
+			if (!--p->cidcwexpire) {
+				/* Expired CID/CW */
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "CPE does not support Call Waiting Caller*ID.\n");
+				restore_conference(p);
+			}
+		}
+		if (p->cid_suppress_expire) {
+			--p->cid_suppress_expire;
+		}
+		if (p->callwaitingrepeat) {
+			if (!--p->callwaitingrepeat) {
+				/* Expired, Repeat callwaiting tone */
+				++p->callwaitrings;
+				dahdi_callwait(ast);
+			}
+		}
 	}
 	if (p->subs[index].linear) {
 		p->subs[index].f.datalen = READ_SIZE * 2;
@@ -5573,8 +5643,28 @@
 	} else 
 		f = &p->subs[index].f; 
 
-	if (f && (f->frametype == AST_FRAME_DTMF))
-		dahdi_handle_dtmfup(ast, index, &f);
+	if (f) {
+		switch (f->frametype) {
+		case AST_FRAME_DTMF_BEGIN:
+		case AST_FRAME_DTMF_END:
+			dahdi_handle_dtmf(ast, index, &f);
+			break;
+		case AST_FRAME_VOICE:
+			if (p->cidspill || p->cid_suppress_expire) {
+				/* We are/were sending a caller id spill.  Suppress any echo. */
+				p->subs[index].f.frametype = AST_FRAME_NULL;
+				p->subs[index].f.subclass = 0;
+				p->subs[index].f.samples = 0;
+				p->subs[index].f.mallocd = 0;
+				p->subs[index].f.offset = 0;
+				p->subs[index].f.data = NULL;
+				p->subs[index].f.datalen= 0;
+			}
+			break;
+		default:
+			break;
+		}
+	}
 
 	/* If we have a fake_event, trigger exception to handle it */
 	if (p->fake_event)
@@ -5657,8 +5747,11 @@
 		return 0;
 	}
 	if (p->cidspill) {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Dropping frame since I've still got a callerid spill\n");
+		if (option_debug) {
+			ast_log(LOG_DEBUG,
+				"Dropping frame since I've still got a callerid spill on %s...\n",
+				ast->name);
+		}
 		return 0;
 	}
 	/* Return if it's not valid data */
@@ -7350,11 +7443,12 @@
 			res = dahdi_set_hook(i->subs[SUB_REAL].dfd, DAHDI_OFFHOOK);
 			if (res && (errno == EBUSY))
 				break;
-			if (i->cidspill) {
-				/* Cancel VMWI spill */
-				free(i->cidspill);
-				i->cidspill = NULL;
-			}
+
+			/* Cancel VMWI spill */
+			free(i->cidspill);
+			i->cidspill = NULL;
+			restore_conference(i);
+
 			if (i->immediate) {
 				dahdi_enable_ec(i);
 				/* The channel is immediately up.  Start right away */
@@ -7700,7 +7794,7 @@
 							i->cidpos += res2;
 							if (i->cidpos >= i->cidlen) {
 								free(i->cidspill);
-								i->cidspill = 0;
+								i->cidspill = NULL;
 								i->cidpos = 0;
 								i->cidlen = 0;
 							}




More information about the svn-commits mailing list