From 8e90622210c64d8455b24a80394f978de5e4ff60 Mon Sep 17 00:00:00 2001
From: Steve Murphy <murf@digium.com>
Date: Wed, 2 May 2007 20:57:55 +0000
Subject: [PATCH] Merged revisions 62738 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r62738 | murf | 2007-05-02 14:46:07 -0600 (Wed, 02 May 2007) | 9 lines

Merged revisions 62737 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62737 | murf | 2007-05-02 14:10:32 -0600 (Wed, 02 May 2007) | 1 line

Some tweaks to satisfy CDR bug 8796, where being in 'h' extension louses up the dst field
........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/cdr.c | 8 +++++---
 main/pbx.c | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/main/cdr.c b/main/cdr.c
index fa68ae9fcc..eaad66f052 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -884,9 +884,11 @@ int ast_cdr_update(struct ast_channel *c)
 
 			/* Copy account code et-al */	
 			ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
-			/* Destination information */ /* XXX privilege macro* ? */
-			ast_copy_string(cdr->dst, S_OR(c->macroexten, c->exten), sizeof(cdr->dst));
-			ast_copy_string(cdr->dcontext, S_OR(c->macrocontext, c->context), sizeof(cdr->dcontext));
+			if (!ast_check_hangup(c)) {
+				/* Destination information */ /* XXX privilege macro* ? */
+				ast_copy_string(cdr->dst, S_OR(c->macroexten, c->exten), sizeof(cdr->dst));
+				ast_copy_string(cdr->dcontext, S_OR(c->macrocontext, c->context), sizeof(cdr->dcontext));
+			}
 		}
 	}
 
diff --git a/main/pbx.c b/main/pbx.c
index edb3d1ba7a..9b2d9cc310 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -515,7 +515,7 @@ int pbx_exec(struct ast_channel *c, 		/*!< Channel */
 	const char *saved_c_appl;
 	const char *saved_c_data;
 
-	if (c->cdr && !(c->exten[0] == 'h' && c->exten[1] == 0) )
+	if (c->cdr &&  !ast_check_hangup(c))
 		ast_cdr_setapp(c->cdr, app->name, data);
 
 	/* save channel values */
-- 
GitLab