[asterisk-commits] rmudgett: branch group/issue8824 r143604 - in /team/group/issue8824: channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 18 21:13:21 CDT 2008


Author: rmudgett
Date: Thu Sep 18 21:13:20 2008
New Revision: 143604

URL: http://svn.digium.com/view/asterisk?view=rev&rev=143604
Log:
channels/chan_misdn.c
*  Made the redirecting reason conversion routines use the existing
mISDN redirecting reason enum.
*  Made other conversion routine names more consistent and shorter.

channels/misdn/isdn_lib.c
channels/misdn/isdn_lib.h
channels/misdn/isdn_msg_parser.c
*  Prevent redirecting reason enum name conflicts.

funcs/func_redirecting.c
*  Added more redirecting reason enum values.

include/asterisk/channel.h
*  Updated comment


Modified:
    team/group/issue8824/channels/chan_misdn.c
    team/group/issue8824/channels/misdn/isdn_lib.c
    team/group/issue8824/channels/misdn/isdn_lib.h
    team/group/issue8824/channels/misdn/isdn_msg_parser.c
    team/group/issue8824/funcs/func_redirecting.c
    team/group/issue8824/include/asterisk/channel.h
    team/group/issue8824/main/callerid.c

Modified: team/group/issue8824/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_misdn.c?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/channels/chan_misdn.c (original)
+++ team/group/issue8824/channels/chan_misdn.c Thu Sep 18 21:13:20 2008
@@ -108,9 +108,6 @@
 static char *complete_ch(struct ast_cli_args *a);
 static char *complete_debug_port(struct ast_cli_args *a);
 static char *complete_show_config(struct ast_cli_args *a);
-
-static enum Q931_REDIRECTING_REASON ast_to_q931_reason(const enum AST_REDIRECTING_REASON ast);
-static enum AST_REDIRECTING_REASON q931_to_ast_reason(const enum Q931_REDIRECTING_REASON q931);
 
 /* BEGIN: chan_misdn.h */
 
@@ -140,37 +137,6 @@
 	MISDN_HOLD_DISCONNECT, /*!< if this chan is holded */
 };
 
-/*! 
- * \brief Q.931 encoded redirecting reason
- */
-enum Q931_REDIRECTING_REASON {
-	Q931_REDIRECTING_REASON_UNKNOWN = 0x0,
-	Q931_REDIRECTING_REASON_CALL_FWD_BUSY = 0x1,/* Call forwarding busy or called DTE busy */
-	Q931_REDIRECTING_REASON_NO_REPLY = 0x2,     /* Call forwarding no reply */
-	Q931_REDIRECTING_REASON_DEFLECTION = 0x4,   /* Call deflection */
-	Q931_REDIRECTING_REASON_OUT_OF_ORDER = 0x9, /* Called DTE out of order */
-	Q931_REDIRECTING_REASON_CALL_FWD_DTE = 0xA, /* Call forwarding by the called DTE */
-	Q931_REDIRECTING_REASON_CALL_FWD = 0xF      /* Call forwarding unconditional or systematic call redirection */
-};
-
-static struct misdn_reasons {
-	enum AST_REDIRECTING_REASON ast;
-	enum Q931_REDIRECTING_REASON q931;
-} misdn_reason_table[] = {
-	{ AST_REDIRECTING_REASON_UNKNOWN, Q931_REDIRECTING_REASON_UNKNOWN },
-	{ AST_REDIRECTING_REASON_USER_BUSY, Q931_REDIRECTING_REASON_CALL_FWD_BUSY },
-	{ AST_REDIRECTING_REASON_NO_ANSWER, Q931_REDIRECTING_REASON_NO_REPLY },
-	{ AST_REDIRECTING_REASON_UNAVAILABLE, Q931_REDIRECTING_REASON_NO_REPLY },
-	{ AST_REDIRECTING_REASON_UNCONDITIONAL, Q931_REDIRECTING_REASON_CALL_FWD },
-	{ AST_REDIRECTING_REASON_TIME_OF_DAY, Q931_REDIRECTING_REASON_UNKNOWN },
-	{ AST_REDIRECTING_REASON_DO_NOT_DISTURB, Q931_REDIRECTING_REASON_UNKNOWN },
-	{ AST_REDIRECTING_REASON_DEFLECTION, Q931_REDIRECTING_REASON_DEFLECTION },
-	{ AST_REDIRECTING_REASON_FOLLOW_ME, Q931_REDIRECTING_REASON_UNKNOWN },
-	{ AST_REDIRECTING_REASON_OUT_OF_ORDER, Q931_REDIRECTING_REASON_OUT_OF_ORDER },
-	{ AST_REDIRECTING_REASON_AWAY, Q931_REDIRECTING_REASON_UNKNOWN },
-	{ AST_REDIRECTING_REASON_CALL_FWD_DTE, Q931_REDIRECTING_REASON_CALL_FWD_DTE }
-};
-
 #define ORG_AST 1
 #define ORG_MISDN 2
 
@@ -455,6 +421,7 @@
 static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame *frame);
 
 
+
 static inline void free_robin_list_r (struct robin_list *r)
 {
 	if (r) {
@@ -615,7 +582,7 @@
  *
  * \return The mISDN type of number code as a string
  */
-static const char *misdn_ton_to_str(enum mISDN_NUMBER_TYPE number_type)
+static const char *misdn_to_str_ton(enum mISDN_NUMBER_TYPE number_type)
 {
 	const char *str;
 
@@ -647,7 +614,7 @@
 	}	/* end switch */
 
 	return str;
-}	/* end misdn_ton_to_str() */
+}	/* end misdn_to_str_ton() */
 
 
 
@@ -661,7 +628,7 @@
  *
  * \return Asterisk type of number code
  */
-static int misdn_ton_to_ast_ton(enum mISDN_NUMBER_TYPE number_type)
+static int misdn_to_ast_ton(enum mISDN_NUMBER_TYPE number_type)
 {
 	int ast_number_type;
 
@@ -693,7 +660,7 @@
 	}	/* end switch */
 
 	return ast_number_type;
-}	/* end misdn_ton_to_ast_ton() */
+}	/* end misdn_to_ast_ton() */
 
 
 
@@ -707,7 +674,7 @@
  *
  * \return mISDN type of number code
  */
-static enum mISDN_NUMBER_TYPE ast_ton_to_misdn_ton(unsigned ast_number_type)
+static enum mISDN_NUMBER_TYPE ast_to_misdn_ton(unsigned ast_number_type)
 {
 	enum mISDN_NUMBER_TYPE number_type;
 
@@ -739,7 +706,7 @@
 	}	/* end switch */
 
 	return number_type;
-}	/* end ast_ton_to_misdn_ton() */
+}	/* end ast_to_misdn_ton() */
 
 
 
@@ -753,7 +720,7 @@
  *
  * \return The mISDN numbering plan code as a string
  */
-static const char *misdn_plan_to_str(enum mISDN_NUMBER_PLAN number_plan)
+static const char *misdn_to_str_plan(enum mISDN_NUMBER_PLAN number_plan)
 {
 	const char *str;
 
@@ -785,7 +752,7 @@
 	}	/* end switch */
 
 	return str;
-}	/* end misdn_plan_to_str() */
+}	/* end misdn_to_str_plan() */
 
 
 
@@ -799,7 +766,7 @@
  *
  * \return Asterisk numbering plan code
  */
-static int misdn_plan_to_ast_plan(enum mISDN_NUMBER_PLAN number_plan)
+static int misdn_to_ast_plan(enum mISDN_NUMBER_PLAN number_plan)
 {
 	int ast_number_plan;
 
@@ -831,7 +798,7 @@
 	}	/* end switch */
 
 	return ast_number_plan;
-}	/* end misdn_plan_to_ast_plan() */
+}	/* end misdn_to_ast_plan() */
 
 
 
@@ -845,7 +812,7 @@
  *
  * \return mISDN numbering plan code
  */
-static enum mISDN_NUMBER_PLAN ast_plan_to_misdn_plan(unsigned ast_number_plan)
+static enum mISDN_NUMBER_PLAN ast_to_misdn_plan(unsigned ast_number_plan)
 {
 	enum mISDN_NUMBER_PLAN number_plan;
 
@@ -877,7 +844,7 @@
 	}	/* end switch */
 
 	return number_plan;
-}	/* end ast_plan_to_misdn_plan() */
+}	/* end ast_to_misdn_plan() */
 
 
 
@@ -891,7 +858,7 @@
  *
  * \return The mISDN presentation code as a string
  */
-static const char *misdn_pres_to_str(int presentation)
+static const char *misdn_to_str_pres(int presentation)
 {
 	const char *str;
 
@@ -914,7 +881,7 @@
 	}	/* end switch */
 
 	return str;
-}	/* end misdn_pres_to_str() */
+}	/* end misdn_to_str_pres() */
 
 
 
@@ -928,7 +895,7 @@
  *
  * \return Asterisk presentation code
  */
-static int misdn_pres_to_ast_pres(int presentation)
+static int misdn_to_ast_pres(int presentation)
 {
 	switch (presentation) {
 	default:
@@ -946,7 +913,7 @@
 	}	/* end switch */
 
 	return presentation;
-}	/* end misdn_pres_to_ast_pres() */
+}	/* end misdn_to_ast_pres() */
 
 
 
@@ -960,7 +927,7 @@
  *
  * \return mISDN presentation code
  */
-static int ast_pres_to_misdn_pres(int presentation)
+static int ast_to_misdn_pres(int presentation)
 {
 	switch (presentation & AST_PRES_RESTRICTION) {
 	default:
@@ -978,7 +945,7 @@
 	}	/* end switch */
 
 	return presentation;
-}	/* end ast_pres_to_misdn_pres() */
+}	/* end ast_to_misdn_pres() */
 
 
 
@@ -992,7 +959,7 @@
  *
  * \return The mISDN screening code as a string
  */
-static const char *misdn_screen_to_str(int screening)
+static const char *misdn_to_str_screen(int screening)
 {
 	const char *str;
 
@@ -1019,7 +986,7 @@
 	}	/* end switch */
 
 	return str;
-}	/* end misdn_screen_to_str() */
+}	/* end misdn_to_str_screen() */
 
 
 
@@ -1033,7 +1000,7 @@
  *
  * \return Asterisk screening code
  */
-static int misdn_screen_to_ast_screen(int screening)
+static int misdn_to_ast_screen(int screening)
 {
 	switch (screening) {
 	default:
@@ -1055,7 +1022,7 @@
 	}	/* end switch */
 
 	return screening;
-}	/* end misdn_screen_to_ast_screen() */
+}	/* end misdn_to_ast_screen() */
 
 
 
@@ -1069,7 +1036,7 @@
  *
  * \return mISDN screening code
  */
-static int ast_screen_to_misdn_screen(int screening)
+static int ast_to_misdn_screen(int screening)
 {
 	switch (screening & AST_PRES_NUMBER_TYPE) {
 	default:
@@ -1091,55 +1058,101 @@
 	}	/* end switch */
 
 	return screening;
-}	/* end ast_screen_to_misdn_screen() */
-
-/*! \brief convert core redirecting reason to a Q.931 redirecting reason code
+}	/* end ast_to_misdn_screen() */
+
+
+
+
+/* ******************************************************************* */
+/*!
+ * \internal
+ * \brief Convert Asterisk redirecting reason to mISDN redirecting reason code.
+ *
+ * \param ast Asterisk redirecting reason code.
+ *
+ * \return mISDN reason code
  */
-static enum Q931_REDIRECTING_REASON ast_to_q931_reason(const enum AST_REDIRECTING_REASON ast)
-{
-	enum Q931_REDIRECTING_REASON q931;
-
-	if (ast >= 0 && ast < ARRAY_LEN(misdn_reason_table))
-		return misdn_reason_table[ast].q931;
-
-	return Q931_REDIRECTING_REASON_UNKOWN;
-}
-
-/*! \brief convert a Q.931 redirecting reason code into a core redirecting reason
+static enum mISDN_REDIRECTING_REASON ast_to_misdn_reason(const enum AST_REDIRECTING_REASON ast)
+{
+	unsigned index;
+
+	static const struct misdn_reasons {
+		enum AST_REDIRECTING_REASON ast;
+		enum mISDN_REDIRECTING_REASON q931;
+	} misdn_reason_table[] = {
+	/* *INDENT-OFF* */
+		{ AST_REDIRECTING_REASON_UNKNOWN,        mISDN_REDIRECTING_REASON_UNKNOWN },
+		{ AST_REDIRECTING_REASON_USER_BUSY,      mISDN_REDIRECTING_REASON_CALL_FWD_BUSY },
+		{ AST_REDIRECTING_REASON_NO_ANSWER,      mISDN_REDIRECTING_REASON_NO_REPLY },
+		{ AST_REDIRECTING_REASON_UNAVAILABLE,    mISDN_REDIRECTING_REASON_NO_REPLY },
+		{ AST_REDIRECTING_REASON_UNCONDITIONAL,  mISDN_REDIRECTING_REASON_CALL_FWD },
+		{ AST_REDIRECTING_REASON_TIME_OF_DAY,    mISDN_REDIRECTING_REASON_UNKNOWN },
+		{ AST_REDIRECTING_REASON_DO_NOT_DISTURB, mISDN_REDIRECTING_REASON_UNKNOWN },
+		{ AST_REDIRECTING_REASON_DEFLECTION,     mISDN_REDIRECTING_REASON_DEFLECTION },
+		{ AST_REDIRECTING_REASON_FOLLOW_ME,      mISDN_REDIRECTING_REASON_UNKNOWN },
+		{ AST_REDIRECTING_REASON_OUT_OF_ORDER,   mISDN_REDIRECTING_REASON_OUT_OF_ORDER },
+		{ AST_REDIRECTING_REASON_AWAY,           mISDN_REDIRECTING_REASON_UNKNOWN },
+		{ AST_REDIRECTING_REASON_CALL_FWD_DTE,   mISDN_REDIRECTING_REASON_CALL_FWD_DTE }
+	/* *INDENT-ON* */
+	};
+
+	for (index = 0; index < ARRAY_LEN(misdn_reason_table); ++index) {
+		if (misdn_reason_table[index].ast == ast) {
+			return misdn_reason_table[index].q931;
+		}
+	}	/* end for */
+	return mISDN_REDIRECTING_REASON_UNKNOWN;
+}	/* end ast_to_misdn_reason() */
+
+
+
+
+/* ******************************************************************* */
+/*!
+ * \internal
+ * \brief Convert the mISDN redirecting reason to Asterisk redirecting reason code
+ *
+ * \param q931 mISDN redirecting reason code.
+ *
+ * \return Asterisk redirecting reason code
  */
-static enum AST_REDIRECTING_REASON q931_to_ast_reason(const enum Q931_REDIRECTING_REASON q931)
+static enum AST_REDIRECTING_REASON misdn_to_ast_reason(const enum mISDN_REDIRECTING_REASON q931)
 {
 	enum AST_REDIRECTING_REASON ast;
 
 	switch (q931) {
-		case Q931_REDIRECTING_REASON_UNKNOWN:
-			ast = AST_REDIRECTING_REASON_UNKNOWN;
-			break;
-		case Q931_REDIRECTING_REASON_CALL_FWD_BUSY:
-			ast = AST_REDIRECTING_REASON_USER_BUSY;
-			break;
-		case Q931_REDIRECTING_REASON_NO_REPLY:
-			ast = AST_REDIRECTING_REASON_NO_ANSWER;
-			break;
-		case Q931_REDIRECTING_REASON_DEFLECTION:
-			ast = AST_REDIRECTING_REASON_DEFLECTION;
-			break;
-		case Q931_REDIRECTING_REASON_OUT_OF_ORDER:
-			ast = AST_REDIRECTING_REASON_OUT_OF_ORDER;
-			break;
-		case Q931_REDIRECTING_REASON_CALL_FWD_DTE:
-			ast = AST_REDIRECTING_REASON_CALL_FWD_DTE;
-			break;
-		case Q931_REDIRECTING_REASON_CALL_FWD:
-			ast = AST_REDIRECTING_REASON_UNCONDITIONAL;
-			break;
-		default:
-			ast = AST_REDIRECTING_REASON_UNKNOWN;
-			break;
-	}
+	default:
+	case mISDN_REDIRECTING_REASON_UNKNOWN:
+		ast = AST_REDIRECTING_REASON_UNKNOWN;
+		break;
+
+	case mISDN_REDIRECTING_REASON_CALL_FWD_BUSY:
+		ast = AST_REDIRECTING_REASON_USER_BUSY;
+		break;
+
+	case mISDN_REDIRECTING_REASON_NO_REPLY:
+		ast = AST_REDIRECTING_REASON_NO_ANSWER;
+		break;
+
+	case mISDN_REDIRECTING_REASON_DEFLECTION:
+		ast = AST_REDIRECTING_REASON_DEFLECTION;
+		break;
+
+	case mISDN_REDIRECTING_REASON_OUT_OF_ORDER:
+		ast = AST_REDIRECTING_REASON_OUT_OF_ORDER;
+		break;
+
+	case mISDN_REDIRECTING_REASON_CALL_FWD_DTE:
+		ast = AST_REDIRECTING_REASON_CALL_FWD_DTE;
+		break;
+
+	case mISDN_REDIRECTING_REASON_CALL_FWD:
+		ast = AST_REDIRECTING_REASON_UNCONDITIONAL;
+		break;
+	}	/* end switch */
 
 	return ast;
-}
+}	/* end misdn_to_ast_reason() */
 
 
 
@@ -2552,11 +2565,11 @@
 	if (pres < 0 || screen < 0) {
 		chan_misdn_log(2, port, " --> pres: %x\n", ast->cid.cid_pres);
 			
-		bc->caller.presentation = ast_pres_to_misdn_pres(ast->cid.cid_pres);
-		chan_misdn_log(2, port, " --> PRES: %s(%d)\n", misdn_pres_to_str(bc->caller.presentation), bc->caller.presentation);
+		bc->caller.presentation = ast_to_misdn_pres(ast->cid.cid_pres);
+		chan_misdn_log(2, port, " --> PRES: %s(%d)\n", misdn_to_str_pres(bc->caller.presentation), bc->caller.presentation);
 			
-		bc->caller.screening = ast_screen_to_misdn_screen(ast->cid.cid_pres);
-		chan_misdn_log(2, port, " --> SCREEN: %s(%d)\n", misdn_screen_to_str(bc->caller.screening), bc->caller.screening);
+		bc->caller.screening = ast_to_misdn_screen(ast->cid.cid_pres);
+		chan_misdn_log(2, port, " --> SCREEN: %s(%d)\n", misdn_to_str_screen(bc->caller.screening), bc->caller.screening);
 	} else {
 		bc->caller.screening = screen;
 		bc->caller.presentation = pres;
@@ -2854,12 +2867,12 @@
 			ast->cid.cid_rdnis = ast_strdup(bc->redirecting.from.number);
 
 			ast->redirecting.from.number_type =
-				misdn_ton_to_ast_ton(bc->redirecting.from.number_type)
-				| misdn_plan_to_ast_plan(bc->redirecting.from.number_plan);
+				misdn_to_ast_ton(bc->redirecting.from.number_type)
+				| misdn_to_ast_plan(bc->redirecting.from.number_plan);
 			ast->redirecting.from.number_presentation =
-				misdn_pres_to_ast_pres(bc->redirecting.from.presentation)
-				| misdn_screen_to_ast_screen(bc->redirecting.from.screening);
-			ast->redirecting.reason = q931_to_ast_reason(bc->redirecting.reason);
+				misdn_to_ast_pres(bc->redirecting.from.presentation)
+				| misdn_to_ast_screen(bc->redirecting.from.screening);
+			ast->redirecting.reason = misdn_to_ast_reason(bc->redirecting.reason);
 		}
 	
 		misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial));
@@ -2904,10 +2917,10 @@
 static void misdn_update_connectedline(struct ast_channel *ast, struct misdn_bchannel *bc)
 {
 	ast_copy_string(bc->connected.number, S_OR(ast->connected.id.number, ""), sizeof(bc->connected.number));
-	bc->connected.presentation = ast_pres_to_misdn_pres(ast->connected.id.number_presentation);
-	bc->connected.screening = ast_screen_to_misdn_screen(ast->connected.id.number_presentation);
-	bc->connected.number_type = ast_ton_to_misdn_ton(ast->connected.id.number_type);
-	bc->connected.number_plan = ast_plan_to_misdn_plan(ast->connected.id.number_type);
+	bc->connected.presentation = ast_to_misdn_pres(ast->connected.id.number_presentation);
+	bc->connected.screening = ast_to_misdn_screen(ast->connected.id.number_presentation);
+	bc->connected.number_type = ast_to_misdn_ton(ast->connected.id.number_type);
+	bc->connected.number_plan = ast_to_misdn_plan(ast->connected.id.number_type);
 }	/* end misdn_update_connectedline() */
 
 
@@ -2926,11 +2939,11 @@
 static void misdn_copy_redirecting_from_ast(struct misdn_bchannel *bc, struct ast_channel *ast)
 {
 	ast_copy_string(bc->redirecting.from.number, S_OR(ast->cid.cid_rdnis, ""), sizeof(bc->redirecting.from.number));
-	bc->redirecting.from.presentation = ast_pres_to_misdn_pres(ast->redirecting.from.number_presentation);
-	bc->redirecting.from.screening = ast_screen_to_misdn_screen(ast->redirecting.from.number_presentation);
-	bc->redirecting.from.number_type = ast_ton_to_misdn_ton(ast->redirecting.from.number_type);
-	bc->redirecting.from.number_plan = ast_plan_to_misdn_plan(ast->redirecting.from.number_type);
-	bc->redirecting.reason = ast_to_q931_reason(ast->redirecting.reason);
+	bc->redirecting.from.presentation = ast_to_misdn_pres(ast->redirecting.from.number_presentation);
+	bc->redirecting.from.screening = ast_to_misdn_screen(ast->redirecting.from.number_presentation);
+	bc->redirecting.from.number_type = ast_to_misdn_ton(ast->redirecting.from.number_type);
+	bc->redirecting.from.number_plan = ast_to_misdn_plan(ast->redirecting.from.number_type);
+	bc->redirecting.reason = ast_to_misdn_reason(ast->redirecting.reason);
 }	/* end misdn_copy_redirecting_from_ast() */
 
 
@@ -5070,15 +5083,15 @@
 		ch->ast->rings = 1;
 		ast_setstate(ch->ast, AST_STATE_RINGING);
 
-		chan_misdn_log(2, bc->port, " --> TON: %s(%d)\n", misdn_ton_to_str(bc->caller.number_type), bc->caller.number_type);
-		chan_misdn_log(2, bc->port, " --> PLAN: %s(%d)\n", misdn_plan_to_str(bc->caller.number_plan), bc->caller.number_plan);
-		chan->cid.cid_ton = misdn_ton_to_ast_ton(bc->caller.number_type)
-			| misdn_plan_to_ast_plan(bc->caller.number_plan);
-
-		chan_misdn_log(2, bc->port, " --> PRES: %s(%d)\n", misdn_pres_to_str(bc->caller.presentation), bc->caller.presentation);
-		chan_misdn_log(2, bc->port, " --> SCREEN: %s(%d)\n", misdn_screen_to_str(bc->caller.screening), bc->caller.screening);
-		chan->cid.cid_pres = misdn_pres_to_ast_pres(bc->caller.presentation)
-			| misdn_screen_to_ast_screen(bc->caller.screening);
+		chan_misdn_log(2, bc->port, " --> TON: %s(%d)\n", misdn_to_str_ton(bc->caller.number_type), bc->caller.number_type);
+		chan_misdn_log(2, bc->port, " --> PLAN: %s(%d)\n", misdn_to_str_plan(bc->caller.number_plan), bc->caller.number_plan);
+		chan->cid.cid_ton = misdn_to_ast_ton(bc->caller.number_type)
+			| misdn_to_ast_plan(bc->caller.number_plan);
+
+		chan_misdn_log(2, bc->port, " --> PRES: %s(%d)\n", misdn_to_str_pres(bc->caller.presentation), bc->caller.presentation);
+		chan_misdn_log(2, bc->port, " --> SCREEN: %s(%d)\n", misdn_to_str_screen(bc->caller.screening), bc->caller.screening);
+		chan->cid.cid_pres = misdn_to_ast_pres(bc->caller.presentation)
+			| misdn_to_ast_screen(bc->caller.screening);
 
 		pbx_builtin_setvar_helper(chan, "TRANSFERCAPABILITY", ast_transfercapability2str(bc->capability));
 		chan->transfercapability = bc->capability;
@@ -5359,10 +5372,10 @@
 
 			ast_party_connected_line_init(&connected);
 			connected.id.number = bc->connected.number;
-			connected.id.number_type = misdn_ton_to_ast_ton(bc->connected.number_type)
-				| misdn_plan_to_ast_plan(bc->connected.number_plan);
-			connected.id.number_presentation = misdn_pres_to_ast_pres(bc->connected.presentation)
-				| misdn_screen_to_ast_screen(bc->connected.screening);
+			connected.id.number_type = misdn_to_ast_ton(bc->connected.number_type)
+				| misdn_to_ast_plan(bc->connected.number_plan);
+			connected.id.number_presentation = misdn_to_ast_pres(bc->connected.presentation)
+				| misdn_to_ast_screen(bc->connected.screening);
 			connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 			ast_queue_connected_line_update(ch->ast, &connected);
 		}

Modified: team/group/issue8824/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_lib.c?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_lib.c (original)
+++ team/group/issue8824/channels/misdn/isdn_lib.c Thu Sep 18 21:13:20 2008
@@ -654,7 +654,7 @@
 	bc->redirecting.from.number[0] = 0;
 	bc->redirecting.from.subaddress[0] = 0;
 
-	bc->redirecting.reason = REDIRECTING_REASON_UNKNOWN;
+	bc->redirecting.reason = mISDN_REDIRECTING_REASON_UNKNOWN;
 
 	bc->dummy=0;
 

Modified: team/group/issue8824/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_lib.h?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_lib.h (original)
+++ team/group/issue8824/channels/misdn/isdn_lib.h Thu Sep 18 21:13:20 2008
@@ -201,13 +201,13 @@
  * \brief Q.931 encoded redirecting reason
  */
 enum mISDN_REDIRECTING_REASON {
-	REDIRECTING_REASON_UNKNOWN = 0x0,
-	REDIRECTING_REASON_CALL_FWD_BUSY = 0x1,	/* Call forwarding busy or called DTE busy */
-	REDIRECTING_REASON_NO_REPLY = 0x2,		/* Call forwarding no reply */
-	REDIRECTING_REASON_DEFLECTION = 0x4,	/* Call deflection */
-	REDIRECTING_REASON_OUT_OF_ORDER = 0x9,	/* Called DTE out of order */
-	REDIRECTING_REASON_CALL_FWD_DTE = 0xA,	/* Call forwarding by the called DTE */
-	REDIRECTING_REASON_CALL_FWD = 0xF		/* Call forwarding unconditional or systematic call redirection */
+	mISDN_REDIRECTING_REASON_UNKNOWN = 0x0,
+	mISDN_REDIRECTING_REASON_CALL_FWD_BUSY = 0x1,	/* Call forwarding busy or called DTE busy */
+	mISDN_REDIRECTING_REASON_NO_REPLY = 0x2,		/* Call forwarding no reply */
+	mISDN_REDIRECTING_REASON_DEFLECTION = 0x4,		/* Call deflection */
+	mISDN_REDIRECTING_REASON_OUT_OF_ORDER = 0x9,	/* Called DTE out of order */
+	mISDN_REDIRECTING_REASON_CALL_FWD_DTE = 0xA,	/* Call forwarding by the called DTE */
+	mISDN_REDIRECTING_REASON_CALL_FWD = 0xF			/* Call forwarding unconditional or systematic call redirection */
 };
 
 enum { /*CODECS*/

Modified: team/group/issue8824/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_msg_parser.c?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_msg_parser.c (original)
+++ team/group/issue8824/channels/misdn/isdn_msg_parser.c Thu Sep 18 21:13:20 2008
@@ -223,7 +223,7 @@
 	if (0 <= reason) {
 		bc->redirecting.reason = reason;
 	} else {
-		bc->redirecting.reason = REDIRECTING_REASON_UNKNOWN;
+		bc->redirecting.reason = mISDN_REDIRECTING_REASON_UNKNOWN;
 	}
 
 	{

Modified: team/group/issue8824/funcs/func_redirecting.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/funcs/func_redirecting.c?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/funcs/func_redirecting.c (original)
+++ team/group/issue8824/funcs/func_redirecting.c Thu Sep 18 21:13:20 2008
@@ -389,8 +389,13 @@
 		"unknown      - Unknown\n"
 		"cfb          - Call Forwarding Busy\n"
 		"cfnr         - Call Forwarding No Reply\n"
+		"unavailable  - Callee is Unavailable\n"
+		"time_of_day  - Time of Day\n"
+		"dnd          - Do Not Disturb\n"
 		"deflection   - Call Deflection\n"
+		"follow_me    - Follow Me\n"
 		"out_of_order - Called DTE Out-Of-Order\n"
+		"away         - Callee is Away\n"
 		"cf_dte       - Call Forwarding By The Called DTE\n"
 		"cfu          - Call Forwarding Unconditional\n",
 	.read = redirecting_read,

Modified: team/group/issue8824/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/include/asterisk/channel.h?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/include/asterisk/channel.h (original)
+++ team/group/issue8824/include/asterisk/channel.h Thu Sep 18 21:13:20 2008
@@ -330,7 +330,7 @@
 	/*! \brief Number of times the call was redirected */
 	int count;
 
-	/*! \brief Q.931 encoded reason for redirection */
+	/*! \brief enum AST_REDIRECTING_REASON value for redirection */
 	int reason;
 };
 

Modified: team/group/issue8824/main/callerid.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/main/callerid.c?view=diff&rev=143604&r1=143603&r2=143604
==============================================================================
--- team/group/issue8824/main/callerid.c (original)
+++ team/group/issue8824/main/callerid.c Thu Sep 18 21:13:20 2008
@@ -1109,7 +1109,7 @@
 };
 
 /*! \brief Translation table for Caller ID Presentation settings */
-static struct ast_value_translation pres_types[] = {
+static const struct ast_value_translation pres_types[] = {
 /* *INDENT-OFF* */
 	{ AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED,        "allowed_not_screened",  "Presentation Allowed, Not Screened" },
 	{ AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_PASSED_SCREEN,     "allowed_passed_screen", "Presentation Allowed, Passed Screen" },
@@ -1192,7 +1192,7 @@
 
 
 /*! \brief Translation table for redirecting reason settings */
-static struct ast_value_translation redirecting_reason_types[] = {
+static const struct ast_value_translation redirecting_reason_types[] = {
 /* *INDENT-OFF* */
 	{ AST_REDIRECTING_REASON_UNKNOWN,        "unknown",      "Unknown" },
 	{ AST_REDIRECTING_REASON_USER_BUSY,      "cfb",          "Call Forwarding Busy" },
@@ -1291,7 +1291,7 @@
 
 
 /*! \brief Translation table for connected line update source settings */
-static struct ast_value_translation connected_line_source_types[] = {
+static const struct ast_value_translation connected_line_source_types[] = {
 /* *INDENT-OFF* */
 	{ AST_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN,   "unknown",   "Unknown" },
 	{ AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER,    "answer",    "Normal Call Answering" },




More information about the asterisk-commits mailing list