[asterisk-commits] murf: trunk r65202 - in /trunk: ./ apps/app_dial.c include/asterisk/cdr.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 18 15:33:52 MST 2007


Author: murf
Date: Fri May 18 17:33:51 2007
New Revision: 65202

URL: http://svn.digium.com/view/asterisk?view=rev&rev=65202
Log:
Merged revisions 65200 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r65200 | murf | 2007-05-18 16:06:27 -0600 (Fri, 18 May 2007) | 9 lines

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

........
r65172 | murf | 2007-05-18 14:56:20 -0600 (Fri, 18 May 2007) | 1 line

This update will fix the situation that occurs as described by 9717, where when several targets are specified for a dial, if any one them reports FAIL, the whole call gets FAIL, even though others were ringing OK. I rearranged the priorities, so that a new disposition, NULL, is at the lowest level, and the disposition get init'd to NULL. Then, next up is FAIL, and next up is BUSY, then NOANSWER, then ANSWERED. All the related set routines will only do so if the disposition value to be set to is greater than what's already there. This gives the intended effect. So, if all the targets are busy, you'd get BUSY for the call disposition. If all get BUSY, but one, and that one rings is not answered, you get NOANSWER. If by some freak of nature, the NULL value doesn't get overridden, then the disp2str routine will report NOANSWER as before.
........

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

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c
    trunk/include/asterisk/cdr.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=65202&r1=65201&r2=65202
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Fri May 18 17:33:51 2007
@@ -751,6 +751,7 @@
 				/* Got hung up */
 				*to = -1;
 				strcpy(pa->status, "CANCEL");
+				ast_cdr_noanswer(in->cdr);
 				if (f)
 					ast_frfree(f);
 				return NULL;
@@ -764,6 +765,7 @@
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
 						*to=0;
+						ast_cdr_noanswer(in->cdr);
 						*result = f->subclass;
 						strcpy(pa->status, "CANCEL");
 						ast_frfree(f);
@@ -777,6 +779,7 @@
 						ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
 					*to=0;
 					strcpy(pa->status, "CANCEL");
+					ast_cdr_noanswer(in->cdr);
 					ast_frfree(f);
 					return NULL;
 				}
@@ -804,6 +807,10 @@
 		}
 		if (!*to && (option_verbose > 2))
 			ast_verbose(VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
+		if (!*to || ast_check_hangup(in)) {
+			ast_cdr_noanswer(in->cdr);
+		}
+		
 	}
 
 	return peer;

Modified: trunk/include/asterisk/cdr.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/cdr.h?view=diff&rev=65202&r1=65201&r2=65202
==============================================================================
--- trunk/include/asterisk/cdr.h (original)
+++ trunk/include/asterisk/cdr.h Fri May 18 17:33:51 2007
@@ -30,9 +30,10 @@
 #define AST_CDR_FLAG_CHILD			(1 << 3)
 #define AST_CDR_FLAG_POST_DISABLED		(1 << 4)
 
-#define AST_CDR_NOANSWER			(1 << 0)
+#define AST_CDR_NULL                0
+#define AST_CDR_FAILED				(1 << 0)
 #define AST_CDR_BUSY				(1 << 1)
-#define AST_CDR_FAILED				(1 << 2)
+#define AST_CDR_NOANSWER			(1 << 2)
 #define AST_CDR_ANSWERED			(1 << 3)
 
 /*! AMA Flags */
@@ -177,6 +178,13 @@
  */
 void ast_cdr_answer(struct ast_cdr *cdr);
 
+/*! A call wasn't answered */
+/*!
+ * \param cdr the cdr you wish to associate with the call
+ * Marks the channel disposition as "NO ANSWER"
+ */
+extern void ast_cdr_noanswer(struct ast_cdr *cdr);
+
 /*! Busy a call */
 /*!
  * \param cdr the cdr you wish to associate with the call



More information about the asterisk-commits mailing list