[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r329100 - in /team/irroot/di...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 21 06:02:25 CDT 2011


Author: irroot
Date: Thu Jul 21 06:02:22 2011
New Revision: 329100

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=329100
Log:
Fixup conflicts after merge

Modified:
    team/irroot/distrotech-customers-trunk/CHANGES
    team/irroot/distrotech-customers-trunk/apps/app_queue.c
    team/irroot/distrotech-customers-trunk/channels/chan_local.c
    team/irroot/distrotech-customers-trunk/main/dsp.c

Modified: team/irroot/distrotech-customers-trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/CHANGES?view=diff&rev=329100&r1=329099&r2=329100
==============================================================================
--- team/irroot/distrotech-customers-trunk/CHANGES (original)
+++ team/irroot/distrotech-customers-trunk/CHANGES Thu Jul 21 06:02:22 2011
@@ -176,6 +176,8 @@
 SIP Changes
 -----------
  * Add T38 support for REJECTED state where T.38 Negotiation is explicitly rejected.
+ * Enable Optional SRTP by setting encryption=try
+ * Add option encryption_taglen to set auth taglen only 32 and 80 are supported currently.
 
 Queue changes
 -------------

Modified: team/irroot/distrotech-customers-trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/apps/app_queue.c?view=diff&rev=329100&r1=329099&r2=329100
==============================================================================
--- team/irroot/distrotech-customers-trunk/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-trunk/apps/app_queue.c Thu Jul 21 06:02:22 2011
@@ -5076,8 +5076,26 @@
 		qe->handled++;
 		ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
 													(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
-		if (update_cdr && qe->chan->cdr) 
-			ast_copy_string(qe->chan->cdr->dstchannel, member->membername, sizeof(qe->chan->cdr->dstchannel));
+
+		if (update_cdr && qe->chan->cdr) {
+			struct ast_cdr *cdr;
+			struct ast_cdr *newcdr;
+
+			cdr = qe->chan->cdr;
+			while (cdr->next) {
+				cdr = cdr->next;
+			}
+			if ((strcasecmp(cdr->uniqueid, qe->chan->uniqueid)) && (strcasecmp(cdr->linkedid, qe->chan->uniqueid))) {
+				if ((newcdr = ast_cdr_dup(cdr))) {
+					ast_cdr_init(newcdr, qe->chan);
+					ast_cdr_reset(newcdr, 0);
+					cdr->next = newcdr;
+					cdr = cdr->next;
+				}
+			}
+			ast_copy_string(cdr->dstchannel, member->membername, sizeof(cdr->dstchannel));
+		}
+
 		if (qe->parent->eventwhencalled)
 			manager_event(EVENT_FLAG_AGENT, "AgentConnect",
 					"Queue: %s\r\n"

Modified: team/irroot/distrotech-customers-trunk/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/channels/chan_local.c?view=diff&rev=329100&r1=329099&r2=329100
==============================================================================
--- team/irroot/distrotech-customers-trunk/channels/chan_local.c (original)
+++ team/irroot/distrotech-customers-trunk/channels/chan_local.c Thu Jul 21 06:02:22 2011
@@ -587,6 +587,7 @@
 static int local_write(struct ast_channel *ast, struct ast_frame *f)
 {
 	struct local_pvt *p = ast->tech_pvt;
+	struct ast_channel *bridge;
 	int res = -1;
 	int isoutbound;
 
@@ -601,6 +602,20 @@
 
 	if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
 		check_bridge(p);
+	} else if (!isoutbound) {
+		/* fixup formats nativeformat has changed we must adjust
+		 * ast is p->owner and is locked here*/
+		bridge = ast_bridged_channel(ast);
+		if (bridge && !ast_format_cap_identical(bridge->nativeformats, ast->nativeformats)) {
+			ast_format_cap_copy(bridge->nativeformats, p->owner->nativeformats);
+			ast_set_read_format(ast, &ast->readformat);
+			ast_set_write_format(ast, &ast->writeformat);
+			ast_channel_lock(p->chan);
+			ast_format_cap_copy(bridge->nativeformats, p->chan->nativeformats);
+			ast_set_read_format(p->chan, &p->chan->readformat);
+			ast_set_write_format(p->chan, &p->chan->writeformat);
+			ast_channel_unlock(p->chan);
+		}
 	}
 
 	if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {

Modified: team/irroot/distrotech-customers-trunk/main/dsp.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/dsp.c?view=diff&rev=329100&r1=329099&r2=329100
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/dsp.c (original)
+++ team/irroot/distrotech-customers-trunk/main/dsp.c Thu Jul 21 06:02:22 2011
@@ -1449,58 +1449,65 @@
 	return res;
 }
 
-int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
+static int ast_dsp_silence_noise_with_energy(struct ast_dsp *dsp, struct ast_frame *f, int *total, int *frames_energy, int noise)
 {
 	short *s;
 	int len;
-	
+	int x;
+	unsigned char *odata;
+
+	if (!f) {
+		return 0;
+	}
+
 	if (f->frametype != AST_FRAME_VOICE) {
 		ast_log(LOG_WARNING, "Can't calculate silence on a non-voice frame\n");
 		return 0;
 	}
 	if (!ast_format_is_slinear(&f->subclass.format)) {
-		ast_log(LOG_WARNING, "Can only calculate silence on signed-linear frames :(\n");
-		return 0;
-	}
-	s = f->data.ptr;
-	len = f->datalen/2;
-	return __ast_dsp_silence_noise(dsp, s, len, totalsilence, NULL, NULL);
+		odata = f->data.ptr;
+		len = f->datalen;
+		switch (f->subclass.format.id) {
+			case AST_FORMAT_ULAW:
+				s = alloca(len * 2);
+				for (x = 0;x < len; x++) {
+					s[x] = AST_MULAW(odata[x]);
+				}
+				break;
+			case AST_FORMAT_ALAW:
+				s = alloca(len * 2);
+				for (x = 0;x < len; x++) {
+					s[x] = AST_ALAW(odata[x]);
+				}
+				break;
+			default:
+				ast_log(LOG_WARNING, "Can only calculate silence on signed-linear, alaw or ulaw frames :(\n");
+			return 0;
+		}
+	} else {
+		s = f->data.ptr;
+		len = f->datalen/2;
+	}
+	if (noise) {
+		return __ast_dsp_silence_noise(dsp, s, len, NULL, total, frames_energy);
+	} else {
+		return __ast_dsp_silence_noise(dsp, s, len, total, NULL, frames_energy);
+	}
 }
 
 int ast_dsp_silence_with_energy(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence, int *frames_energy)
 {
-	short *s;
-	int len;
-
-	if (f->frametype != AST_FRAME_VOICE) {
-		ast_log(LOG_WARNING, "Can't calculate silence on a non-voice frame\n");
-		return 0;
-	}
-	if (!ast_format_is_slinear(&f->subclass.format)) {
-		ast_log(LOG_WARNING, "Can only calculate silence on signed-linear frames :(\n");
-		return 0;
-	}
-	s = f->data.ptr;
-	len = f->datalen/2;
-	return __ast_dsp_silence_noise(dsp, s, len, totalsilence, NULL, frames_energy);
+	return ast_dsp_silence_noise_with_energy(dsp, f, totalsilence, frames_energy, 0);
+}
+
+int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
+{
+	return ast_dsp_silence_noise_with_energy(dsp, f, totalsilence, NULL, 0);
 }
 
 int ast_dsp_noise(struct ast_dsp *dsp, struct ast_frame *f, int *totalnoise)
 {
-       short *s;
-       int len;
-
-       if (f->frametype != AST_FRAME_VOICE) {
-               ast_log(LOG_WARNING, "Can't calculate noise on a non-voice frame\n");
-               return 0;
-       }
-       if (!ast_format_is_slinear(&f->subclass.format)) {
-               ast_log(LOG_WARNING, "Can only calculate noise on signed-linear frames :(\n");
-               return 0;
-       }
-       s = f->data.ptr;
-       len = f->datalen/2;
-       return __ast_dsp_silence_noise(dsp, s, len, NULL, totalnoise, NULL);
+	return ast_dsp_silence_noise_with_energy(dsp, f, totalnoise, NULL, 1);
 }
 
 
@@ -1858,9 +1865,9 @@
 int ast_dsp_set_faxmode(struct ast_dsp *dsp, int faxmode)
 {
 	if (dsp->faxmode != faxmode) {
+		dsp->faxmode = faxmode;
 		ast_fax_detect_init(dsp);
 	}
-	dsp->faxmode = faxmode;
 	return 0;
 }
 




More information about the asterisk-commits mailing list