[asterisk-commits] rmudgett: branch rmudgett/cid r265745 - in /team/rmudgett/cid: addons/ apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 25 17:08:26 CDT 2010


Author: rmudgett
Date: Tue May 25 17:08:23 2010
New Revision: 265745

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=265745
Log:
Added party update indication support to the ast_party_id_set() and derivative functions.

Callers of ast_party_id_set() and higher level derivative
ast_party_xxx_set() functions can now indicate what components are to be
updated.  This allows the channel driver to only update party number
information without changing name or subaddress information that the user
may have set previously.

Modified:
    team/rmudgett/cid/addons/chan_ooh323.c
    team/rmudgett/cid/apps/app_dial.c
    team/rmudgett/cid/apps/app_directed_pickup.c
    team/rmudgett/cid/apps/app_queue.c
    team/rmudgett/cid/channels/chan_local.c
    team/rmudgett/cid/channels/chan_misdn.c
    team/rmudgett/cid/channels/chan_sip.c
    team/rmudgett/cid/channels/sig_pri.c
    team/rmudgett/cid/funcs/func_connectedline.c
    team/rmudgett/cid/funcs/func_redirecting.c
    team/rmudgett/cid/include/asterisk/channel.h
    team/rmudgett/cid/main/channel.c
    team/rmudgett/cid/main/features.c

Modified: team/rmudgett/cid/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/addons/chan_ooh323.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/addons/chan_ooh323.c (original)
+++ team/rmudgett/cid/addons/chan_ooh323.c Tue May 25 17:08:23 2010
@@ -1537,11 +1537,15 @@
 
 	if (call->remoteDisplayName) {
 		struct ast_party_connected_line connected;
+		struct ast_set_party_connected_line update_connected;
+
+		memset(&update_connected, 0, sizeof(update_connected));
+		update_connected.id.name = 1;
 		ast_party_connected_line_init(&connected);
 		connected.id.XXX_name.valid = 1;
 		connected.id.XXX_name.str = (char *) call->remoteDisplayName;
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-		ast_channel_queue_connected_line_update(c, &connected);
+		ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 	}
 	if (c->_state != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
@@ -1589,11 +1593,15 @@
 
 	if (call->remoteDisplayName) {
 		struct ast_party_connected_line connected;
+		struct ast_set_party_connected_line update_connected;
+
+		memset(&update_connected, 0, sizeof(update_connected));
+		update_connected.id.name = 1;
 		ast_party_connected_line_init(&connected);
 		connected.id.XXX_name.valid = 1;
 		connected.id.XXX_name.str = (char *) call->remoteDisplayName;
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-		ast_channel_queue_connected_line_update(c, &connected);
+		ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 	}
 	if (c->_state != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
@@ -1983,11 +1991,15 @@
 
 			if (call->remoteDisplayName) {
 				struct ast_party_connected_line connected;
+				struct ast_set_party_connected_line update_connected;
+
+				memset(&update_connected, 0, sizeof(update_connected));
+				update_connected.id.name = 1;
 				ast_party_connected_line_init(&connected);
 				connected.id.XXX_name.valid = 1;
 				connected.id.XXX_name.str = (char *) call->remoteDisplayName;
 				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-				ast_channel_queue_connected_line_update(c, &connected);
+				ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 			}
 
 			ast_queue_control(c, AST_CONTROL_ANSWER);

Modified: team/rmudgett/cid/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_dial.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/apps/app_dial.c (original)
+++ team/rmudgett/cid/apps/app_dial.c Tue May 25 17:08:23 2010
@@ -852,7 +852,7 @@
 			ast_rtp_instance_early_bridge_make_compatible(c, in);
 		}
 
-		ast_channel_set_redirecting(c, &original->redirecting);
+		ast_channel_set_redirecting(c, &original->redirecting, NULL);
 		ast_channel_lock(c);
 		while (ast_channel_trylock(in)) {
 			CHANNEL_DEADLOCK_AVOIDANCE(c);
@@ -894,7 +894,7 @@
 			while (ast_channel_trylock(c)) {
 				CHANNEL_DEADLOCK_AVOIDANCE(in);
 			}
-			ast_channel_update_redirecting(in, &c->redirecting);
+			ast_channel_update_redirecting(in, &c->redirecting, NULL);
 			ast_channel_unlock(c);
 		}
 
@@ -985,7 +985,7 @@
 			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller);
 			ast_channel_unlock(outgoing->chan);
 			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-			ast_channel_update_connected_line(in, &connected_caller);
+			ast_channel_update_connected_line(in, &connected_caller, NULL);
 			ast_party_connected_line_free(&connected_caller);
 		}
 	}
@@ -1042,14 +1042,14 @@
 					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
-								ast_channel_update_connected_line(in, &o->connected);
+								ast_channel_update_connected_line(in, &o->connected, NULL);
 							}
 						} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 							ast_channel_lock(c);
 							ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
 							ast_channel_unlock(c);
 							connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-							ast_channel_update_connected_line(in, &connected_caller);
+							ast_channel_update_connected_line(in, &connected_caller, NULL);
 							ast_party_connected_line_free(&connected_caller);
 						}
 					}
@@ -1104,14 +1104,14 @@
 						if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 							if (o->pending_connected_update) {
 								if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
-									ast_channel_update_connected_line(in, &o->connected);
+									ast_channel_update_connected_line(in, &o->connected, NULL);
 								}
 							} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 								ast_channel_lock(c);
 								ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
 								ast_channel_unlock(c);
 								connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-								ast_channel_update_connected_line(in, &connected_caller);
+								ast_channel_update_connected_line(in, &connected_caller, NULL);
 								ast_party_connected_line_free(&connected_caller);
 							}
 						}
@@ -1221,7 +1221,7 @@
 						ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", c->name, in->name);
 						ast_party_connected_line_set_init(&connected, &o->connected);
 						ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
-						ast_party_connected_line_set(&o->connected, &connected);
+						ast_party_connected_line_set(&o->connected, &connected, NULL);
 						ast_party_connected_line_free(&connected);
 						o->pending_connected_update = 1;
 					} else {
@@ -2038,7 +2038,7 @@
 				ast_party_caller_set_init(&caller, &tc->caller);
 				caller.id = chan->connected.id;
 				caller.ani = chan->connected.ani;
-				ast_channel_set_caller_event(tc, &caller);
+				ast_channel_set_caller_event(tc, &caller, NULL);
 			} else if (!ast_strlen_zero(chan->dialed.number.str)) {
 				ast_set_callerid(tc, chan->dialed.number.str, NULL, NULL);
 			} else if (!ast_strlen_zero(S_OR(chan->macroexten, chan->exten))) {
@@ -2071,7 +2071,7 @@
 				connected.id.XXX_name.presentation = pres;
 			}
 			connected.id.tag = cid_tag;
-			ast_channel_set_connected_line(tmp->chan, &connected);
+			ast_channel_set_connected_line(tmp->chan, &connected, NULL);
 		} else {
 			ast_connected_line_copy_from_caller(&tc->connected, &chan->caller);
 		}

Modified: team/rmudgett/cid/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_directed_pickup.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/apps/app_directed_pickup.c (original)
+++ team/rmudgett/cid/apps/app_directed_pickup.c Tue May 25 17:08:23 2010
@@ -111,7 +111,7 @@
 	ast_party_connected_line_copy(&connected_caller, &target->connected);
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 	if (ast_channel_connected_line_macro(NULL, chan, &connected_caller, 0, 0)) {
-		ast_channel_update_connected_line(chan, &connected_caller);
+		ast_channel_update_connected_line(chan, &connected_caller, NULL);
 	}
 	ast_party_connected_line_free(&connected_caller);
 
@@ -119,7 +119,7 @@
 	ast_connected_line_copy_from_caller(&connected_caller, &chan->caller);
 	ast_channel_unlock(chan);
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-	ast_channel_queue_connected_line_update(chan, &connected_caller);
+	ast_channel_queue_connected_line_update(chan, &connected_caller, NULL);
 	ast_party_connected_line_free(&connected_caller);
 
 	if ((res = ast_answer(chan))) {

Modified: team/rmudgett/cid/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_queue.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/apps/app_queue.c (original)
+++ team/rmudgett/cid/apps/app_queue.c Tue May 25 17:08:23 2010
@@ -2893,7 +2893,7 @@
 			ast_party_caller_set_init(&caller, &tmp->chan->caller);
 			caller.id = qe->chan->connected.id;
 			caller.ani = qe->chan->connected.ani;
-			ast_channel_set_caller_event(tmp->chan, &caller);
+			ast_channel_set_caller_event(tmp->chan, &caller, NULL);
 		} else if (!ast_strlen_zero(qe->chan->dialed.number.str)) {
 			ast_set_callerid(tmp->chan, qe->chan->dialed.number.str, NULL, NULL);
 		} else if (!ast_strlen_zero(S_OR(qe->chan->macroexten, qe->chan->exten))) {
@@ -3329,14 +3329,14 @@
 					if (update_connectedline) {
 						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
-								ast_channel_update_connected_line(in, &o->connected);
+								ast_channel_update_connected_line(in, &o->connected, NULL);
 							}
 						} else if (!o->dial_callerid_absent) {
 							ast_channel_lock(o->chan);
 							ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller);
 							ast_channel_unlock(o->chan);
 							connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-							ast_channel_update_connected_line(in, &connected_caller);
+							ast_channel_update_connected_line(in, &connected_caller, NULL);
 							ast_party_connected_line_free(&connected_caller);
 						}
 					}
@@ -3389,7 +3389,7 @@
 
 						ast_string_field_set(o->chan, accountcode, in->accountcode);
 
-						ast_channel_set_redirecting(o->chan, &original->redirecting);
+						ast_channel_set_redirecting(o->chan, &original->redirecting, NULL);
 						if (!o->chan->redirecting.from.XXX_number.valid
 							|| ast_strlen_zero(o->chan->redirecting.from.XXX_number.str)) {
 							/*
@@ -3421,7 +3421,7 @@
 							CHANNEL_DEADLOCK_AVOIDANCE(in);
 						}
 						if (res) {
-							ast_channel_update_redirecting(in, &o->chan->redirecting);
+							ast_channel_update_redirecting(in, &o->chan->redirecting, NULL);
 						}
 
 						update_connectedline = 1;
@@ -3451,14 +3451,14 @@
 								if (update_connectedline) {
 									if (o->pending_connected_update) {
 										if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
-											ast_channel_update_connected_line(in, &o->connected);
+											ast_channel_update_connected_line(in, &o->connected, NULL);
 										}
 									} else if (!o->dial_callerid_absent) {
 										ast_channel_lock(o->chan);
 										ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller);
 										ast_channel_unlock(o->chan);
 										connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-										ast_channel_update_connected_line(in, &connected_caller);
+										ast_channel_update_connected_line(in, &connected_caller, NULL);
 										ast_party_connected_line_free(&connected_caller);
 									}
 								}
@@ -3522,7 +3522,7 @@
 								ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", ochan_name, inchan_name);
 								ast_party_connected_line_set_init(&connected, &o->connected);
 								ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
-								ast_party_connected_line_set(&o->connected, &connected);
+								ast_party_connected_line_set(&o->connected, &connected, NULL);
 								ast_party_connected_line_free(&connected);
 								o->pending_connected_update = 1;
 							} else {

Modified: team/rmudgett/cid/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_local.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/channels/chan_local.c (original)
+++ team/rmudgett/cid/channels/chan_local.c Tue May 25 17:08:23 2010
@@ -436,9 +436,9 @@
 				if (isoutbound) {
 					ast_connected_line_copy_to_caller(&the_other_channel->caller, &this_channel->connected);
 				}
-				f.datalen = ast_connected_line_build_data(frame_data, sizeof(frame_data), &this_channel->connected);
+				f.datalen = ast_connected_line_build_data(frame_data, sizeof(frame_data), &this_channel->connected, NULL);
 			} else {
-				f.datalen = ast_redirecting_build_data(frame_data, sizeof(frame_data), &this_channel->redirecting);
+				f.datalen = ast_redirecting_build_data(frame_data, sizeof(frame_data), &this_channel->redirecting, NULL);
 			}
 			f.subclass.integer = condition;
 			f.data.ptr = frame_data;

Modified: team/rmudgett/cid/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_misdn.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/channels/chan_misdn.c (original)
+++ team/rmudgett/cid/channels/chan_misdn.c Tue May 25 17:08:23 2010
@@ -6018,8 +6018,11 @@
 static void misdn_queue_connected_line_update(struct ast_channel *ast, const struct misdn_party_id *id, enum AST_CONNECTED_LINE_UPDATE_SOURCE source, char *cid_tag)
 {
 	struct ast_party_connected_line connected;
+	struct ast_set_party_connected_line update_connected;
 
 	ast_party_connected_line_init(&connected);
+	memset(&update_connected, 0, sizeof(update_connected));
+	update_connected.id.number = 1;
 	connected.id.XXX_number.valid = 1;
 	connected.id.XXX_number.str = (char *) id->number;
 	connected.id.XXX_number.plan = misdn_to_ast_ton(id->number_type)
@@ -6028,7 +6031,7 @@
 		| misdn_to_ast_screen(id->screening);
 	connected.id.tag = cid_tag;
 	connected.source = source;
-	ast_channel_queue_connected_line_update(ast, &connected);
+	ast_channel_queue_connected_line_update(ast, &connected, &update_connected);
 }
 
 /*!
@@ -6228,9 +6231,12 @@
 static void misdn_copy_redirecting_to_ast(struct ast_channel *ast, const struct misdn_party_redirecting *redirect, char *tag)
 {
 	struct ast_party_redirecting redirecting;
+	struct ast_set_party_redirecting update_redirecting;
 
 	ast_party_redirecting_set_init(&redirecting, &ast->redirecting);
-
+	memset(&update_redirecting, 0, sizeof(update_redirecting));
+
+	update_redirecting.from.number = 1;
 	redirecting.from.XXX_number.valid = 1;
 	redirecting.from.XXX_number.str = (char *) redirect->from.number;
 	redirecting.from.XXX_number.plan =
@@ -6241,6 +6247,7 @@
 		| misdn_to_ast_screen(redirect->from.screening);
 	redirecting.from.tag = tag;
 
+	update_redirecting.to.number = 1;
 	redirecting.to.XXX_number.valid = 1;
 	redirecting.to.XXX_number.str = (char *) redirect->to.number;
 	redirecting.to.XXX_number.plan =
@@ -6254,7 +6261,7 @@
 	redirecting.reason = misdn_to_ast_reason(redirect->reason);
 	redirecting.count = redirect->count;
 
-	ast_channel_set_redirecting(ast, &redirecting);
+	ast_channel_set_redirecting(ast, &redirecting, &update_redirecting);
 }
 
 /*!
@@ -9002,7 +9009,7 @@
 					bc->fac_in.u.DivertingLegInformation3.PresentationAllowedIndicator
 					? AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED
 					: AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED;
-				ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting);
+				ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting, NULL);
 			}
 		}
 		break;
@@ -10175,7 +10182,7 @@
 			if (ch->ast) {
 				ch->ast->redirecting.to.XXX_number.presentation =
 					AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED;
-				ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting);
+				ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting, NULL);
 			}
 		}
 #endif	/* defined(AST_MISDN_ENHANCEMENTS) */
@@ -10609,7 +10616,8 @@
 						break;
 					}
 					misdn_copy_redirecting_to_ast(ch->ast, &bc->redirecting, bc->incoming_cid_tag);
-					ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting);
+					ast_channel_queue_redirecting_update(ch->ast, &ch->ast->redirecting,
+						NULL);
 				}
 			}
 			break;

Modified: team/rmudgett/cid/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_sip.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/channels/chan_sip.c (original)
+++ team/rmudgett/cid/channels/chan_sip.c Tue May 25 17:08:23 2010
@@ -1499,7 +1499,6 @@
 static int transmit_state_notify(struct sip_pvt *p, int state, int full, int timeout);
 static void update_connectedline(struct sip_pvt *p, const void *data, size_t datalen);
 static void update_redirecting(struct sip_pvt *p, const void *data, size_t datalen);
-static void change_redirecting_information(struct sip_pvt *p, struct sip_request *req, struct ast_party_redirecting *redirecting, int set_call_forward);
 static int get_domain(const char *str, char *domain, int len);
 static void get_realm(struct sip_pvt *p, const struct sip_request *req);
 
@@ -17525,7 +17524,9 @@
 /*! \brief update redirecting information for a channel based on headers
  *
  */
-static void change_redirecting_information(struct sip_pvt *p, struct sip_request *req, struct ast_party_redirecting *redirecting, int set_call_forward)
+static void change_redirecting_information(struct sip_pvt *p, struct sip_request *req,
+	struct ast_party_redirecting *redirecting,
+	struct ast_set_party_redirecting *update_redirecting, int set_call_forward)
 {
 	char *redirecting_from_name = NULL;
 	char *redirecting_from_number = NULL;
@@ -17556,12 +17557,14 @@
 
 	if (!ast_strlen_zero(redirecting_from_number)) {
 		ast_debug(3, "Got redirecting from number %s\n", redirecting_from_number);
+		update_redirecting->from.number = 1;
 		redirecting->from.XXX_number.valid = 1;
 		ast_free(redirecting->from.XXX_number.str);
 		redirecting->from.XXX_number.str = redirecting_from_number;
 	}
 	if (!ast_strlen_zero(redirecting_from_name)) {
 		ast_debug(3, "Got redirecting from name %s\n", redirecting_from_name);
+		update_redirecting->from.name = 1;
 		redirecting->from.XXX_name.valid = 1;
 		ast_free(redirecting->from.XXX_name.str);
 		redirecting->from.XXX_name.str = redirecting_from_name;
@@ -17574,12 +17577,14 @@
 	}
 	if (!ast_strlen_zero(redirecting_to_number)) {
 		ast_debug(3, "Got redirecting to number %s\n", redirecting_to_number);
+		update_redirecting->to.number = 1;
 		redirecting->to.XXX_number.valid = 1;
 		ast_free(redirecting->to.XXX_number.str);
 		redirecting->to.XXX_number.str = redirecting_to_number;
 	}
 	if (!ast_strlen_zero(redirecting_to_name)) {
 		ast_debug(3, "Got redirecting to name %s\n", redirecting_from_number);
+		update_redirecting->to.name = 1;
 		redirecting->to.XXX_name.valid = 1;
 		ast_free(redirecting->to.XXX_name.str);
 		redirecting->to.XXX_name.str = redirecting_to_name;
@@ -17874,6 +17879,7 @@
 	char *p_hdrval;
 	int rtn;
 	struct ast_party_connected_line connected;
+	struct ast_set_party_connected_line update_connected;
 
 	if (reinvite)
 		ast_debug(4, "SIP response %d to RE-invite on %s call %s\n", resp, outgoing ? "outgoing" : "incoming", p->callid);
@@ -17929,19 +17935,23 @@
 		if (!req->ignore && p->owner) {
 			if (get_rpid(p, req)) {
 				ast_party_connected_line_init(&connected);
+				memset(&update_connected, 0, sizeof(update_connected));
 				if (p->cid_num) {
+					update_connected.id.number = 1;
 					connected.id.XXX_number.valid = 1;
 					connected.id.XXX_number.str = (char *) p->cid_num;
 					connected.id.XXX_number.presentation = p->callingpres;
 				}
 				if (p->cid_name) {
+					update_connected.id.name = 1;
 					connected.id.XXX_name.valid = 1;
 					connected.id.XXX_name.str = (char *) p->cid_name;
 					connected.id.XXX_name.presentation = p->callingpres;
 				}
 				connected.id.tag = (char *) p->cid_tag;
 				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-				ast_channel_queue_connected_line_update(p->owner, &connected);
+				ast_channel_queue_connected_line_update(p->owner, &connected,
+					&update_connected);
 			}
 			sip_handle_cc(p, req, AST_CC_CCNR);
 			ast_queue_control(p->owner, AST_CONTROL_RINGING);
@@ -17967,10 +17977,14 @@
 			ast_log(LOG_WARNING, "Unable to cancel SIP destruction.  Expect bad things.\n");
 		if (!req->ignore && p->owner) {
 			struct ast_party_redirecting redirecting;
+			struct ast_set_party_redirecting update_redirecting;
 
 			ast_party_redirecting_init(&redirecting);
-			change_redirecting_information(p, req, &redirecting, FALSE);
-			ast_channel_queue_redirecting_update(p->owner, &redirecting);
+			memset(&update_redirecting, 0, sizeof(update_redirecting));
+			change_redirecting_information(p, req, &redirecting, &update_redirecting,
+				FALSE);
+			ast_channel_queue_redirecting_update(p->owner, &redirecting,
+				&update_redirecting);
 			ast_party_redirecting_free(&redirecting);
 			sip_handle_cc(p, req, AST_CC_CCNR);
 		}
@@ -17984,19 +17998,23 @@
 			if (get_rpid(p, req)) {
 				/* Queue a connected line update */
 				ast_party_connected_line_init(&connected);
+				memset(&update_connected, 0, sizeof(update_connected));
 				if (p->cid_num) {
+					update_connected.id.number = 1;
 					connected.id.XXX_number.valid = 1;
 					connected.id.XXX_number.str = (char *) p->cid_num;
 					connected.id.XXX_number.presentation = p->callingpres;
 				}
 				if (p->cid_name) {
+					update_connected.id.name = 1;
 					connected.id.XXX_name.valid = 1;
 					connected.id.XXX_name.str = (char *) p->cid_name;
 					connected.id.XXX_name.presentation = p->callingpres;
 				}
 				connected.id.tag = (char *) p->cid_tag;
 				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-				ast_channel_queue_connected_line_update(p->owner, &connected);
+				ast_channel_queue_connected_line_update(p->owner, &connected,
+					&update_connected);
 			}
 			sip_handle_cc(p, req, AST_CC_CCNR);
 		}
@@ -18037,19 +18055,23 @@
 		if (!req->ignore && p->owner && (get_rpid(p, req) || !reinvite)) {
 			/* Queue a connected line update */
 			ast_party_connected_line_init(&connected);
+			memset(&update_connected, 0, sizeof(update_connected));
 			if (p->cid_num) {
+				update_connected.id.number = 1;
 				connected.id.XXX_number.valid = 1;
 				connected.id.XXX_number.str = (char *) p->cid_num;
 				connected.id.XXX_number.presentation = p->callingpres;
 			}
 			if (p->cid_name) {
+				update_connected.id.name = 1;
 				connected.id.XXX_name.valid = 1;
 				connected.id.XXX_name.str = (char *) p->cid_name;
 				connected.id.XXX_name.presentation = p->callingpres;
 			}
 			connected.id.tag = (char *) p->cid_tag;
 			connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-			ast_channel_queue_connected_line_update(p->owner, &connected);
+			ast_channel_queue_connected_line_update(p->owner, &connected,
+				&update_connected);
 		}
 
 		/* Parse contact header for continued conversation */
@@ -18957,10 +18979,13 @@
 				case 305: /* Use Proxy */
 				if (p->owner) {
 					struct ast_party_redirecting redirecting;
+					struct ast_set_party_redirecting update_redirecting;
 
 					ast_party_redirecting_init(&redirecting);
-					change_redirecting_information(p, req, &redirecting, TRUE);
-					ast_channel_set_redirecting(p->owner, &redirecting);
+					change_redirecting_information(p, req, &redirecting,
+						&update_redirecting, TRUE);
+					ast_channel_set_redirecting(p->owner, &redirecting,
+						&update_redirecting);
 					ast_party_redirecting_free(&redirecting);
 				}
 					/* Fall through */
@@ -20191,20 +20216,24 @@
 	}
 	if (get_rpid(p, req)) {
 		struct ast_party_connected_line connected;
+		struct ast_set_party_connected_line update_connected;
 		ast_party_connected_line_init(&connected);
+		memset(&update_connected, 0, sizeof(update_connected));
 		if (p->cid_num) {
+			update_connected.id.number = 1;
 			connected.id.XXX_number.valid = 1;
 			connected.id.XXX_number.str = (char *) p->cid_num;
 			connected.id.XXX_number.presentation = p->callingpres;
 		}
 		if (p->cid_name) {
+			update_connected.id.name = 1;
 			connected.id.XXX_name.valid = 1;
 			connected.id.XXX_name.str = (char *) p->cid_name;
 			connected.id.XXX_name.presentation = p->callingpres;
 		}
 		connected.id.tag = (char *) p->cid_tag;
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-		ast_channel_queue_connected_line_update(p->owner, &connected);
+		ast_channel_queue_connected_line_update(p->owner, &connected, &update_connected);
 	}
 	transmit_response(p, "200 OK", req);
 	return 0;
@@ -20229,6 +20258,8 @@
 	struct ast_channel *c = NULL;		/* New channel */
 	int reinvite = 0;
 	int rtn;
+	struct ast_party_redirecting redirecting;
+	struct ast_set_party_redirecting update_redirecting;
 
 	const char *p_uac_se_hdr;       /* UAC's Session-Expires header string                      */
 	const char *p_uac_min_se;       /* UAC's requested Min-SE interval (char string)            */
@@ -20522,21 +20553,26 @@
 			ast_clear_flag(&p->flags[0], SIP_OUTGOING);	/* This is now an inbound dialog */
 			if (get_rpid(p, req)) {
 				struct ast_party_connected_line connected;
+				struct ast_set_party_connected_line update_connected;
 
 				ast_party_connected_line_init(&connected);
+				memset(&update_connected, 0, sizeof(update_connected));
 				if (p->cid_num) {
+					update_connected.id.number = 1;
 					connected.id.XXX_number.valid = 1;
 					connected.id.XXX_number.str = (char *) p->cid_num;
 					connected.id.XXX_number.presentation = p->callingpres;
 				}
 				if (p->cid_name) {
+					update_connected.id.name = 1;
 					connected.id.XXX_name.valid = 1;
 					connected.id.XXX_name.str = (char *) p->cid_name;
 					connected.id.XXX_name.presentation = p->callingpres;
 				}
 				connected.id.tag = (char *) p->cid_tag;
 				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-				ast_channel_queue_connected_line_update(p->owner, &connected);
+				ast_channel_queue_connected_line_update(p->owner, &connected,
+					&update_connected);
 			}
 			/* Handle SDP here if we already have an owner */
 			if (find_sdp(req)) {
@@ -20676,20 +20712,19 @@
 			build_route(p, req, 0);
 
 			if (c) {
-				struct ast_party_redirecting redirecting;
-
 				ast_party_redirecting_init(&redirecting);
+				memset(&update_redirecting, 0, sizeof(update_redirecting));
 				/* Pre-lock the call */
 				ast_channel_lock(c);
-				change_redirecting_information(p, req, &redirecting, FALSE); /*Will return immediately if no Diversion header is present */
-				ast_channel_set_redirecting(c, &redirecting);
+				change_redirecting_information(p, req, &redirecting, &update_redirecting,
+					FALSE); /*Will return immediately if no Diversion header is present */
+				ast_channel_set_redirecting(c, &redirecting, &update_redirecting);
 				ast_party_redirecting_free(&redirecting);
 			}
 		}
 	} else {
-		struct ast_party_redirecting redirecting;
-
 		ast_party_redirecting_init(&redirecting);
+		memset(&update_redirecting, 0, sizeof(update_redirecting));
 		if (sipdebug) {
 			if (!req->ignore)
 				ast_debug(2, "Got a SIP re-invite for call %s\n", p->callid);
@@ -20699,9 +20734,9 @@
 		if (!req->ignore)
 			reinvite = 1;
 		c = p->owner;
-		change_redirecting_information(p, req, &redirecting, FALSE); /*Will return immediately if no Diversion header is present */
+		change_redirecting_information(p, req, &redirecting, &update_redirecting, FALSE); /*Will return immediately if no Diversion header is present */
 		if (c) {
-			ast_channel_set_redirecting(c, &redirecting);
+			ast_channel_set_redirecting(c, &redirecting, &update_redirecting);
 		}
 		ast_party_redirecting_free(&redirecting);
 	}
@@ -21161,8 +21196,8 @@
 		ast_indicate(target.chan1, AST_CONTROL_UNHOLD);
 
 		if (target.chan2) {
-			ast_channel_queue_connected_line_update(target.chan1, &connected_to_transferee);
-			ast_channel_queue_connected_line_update(target.chan2, &connected_to_target);
+			ast_channel_queue_connected_line_update(target.chan1, &connected_to_transferee, NULL);
+			ast_channel_queue_connected_line_update(target.chan2, &connected_to_target, NULL);
 		} else {
 			/* Since target.chan1 isn't actually connected to another channel, there is no way for us
 			 * to queue a frame so that its connected line status will be updated.
@@ -21175,7 +21210,8 @@
 			int payload_size;
 			int frame_size;
 			unsigned char connected_line_data[1024];
-			payload_size = ast_connected_line_build_data(connected_line_data, sizeof(connected_line_data), &connected_to_target);
+			payload_size = ast_connected_line_build_data(connected_line_data,
+				sizeof(connected_line_data), &connected_to_target, NULL);
 			frame_size = payload_size + sizeof(*frame_payload);
 			if (payload_size != -1 && (frame_payload = alloca(frame_size))) {
 				frame_payload->payload_size = payload_size;
@@ -21187,7 +21223,7 @@
 			 * will be updated, we also are going to queue a plain old connected line update on target.chan1. This
 			 * way, either Dial or Queue can apply this connected line update to the outgoing ringing channel.
 			 */
-			ast_channel_queue_connected_line_update(target.chan1, &connected_to_transferee);
+			ast_channel_queue_connected_line_update(target.chan1, &connected_to_transferee, NULL);
 
 		}
 		ast_channel_unref(current->chan1);

Modified: team/rmudgett/cid/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/sig_pri.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/channels/sig_pri.c (original)
+++ team/rmudgett/cid/channels/sig_pri.c Tue May 25 17:08:23 2010
@@ -2373,7 +2373,7 @@
 				/* Update the connected line information on the other channel */
 				if (event_id != PRI_EVENT_RING) {
 					/* This connected_line update was not from a SETUP message. */
-					ast_channel_queue_connected_line_update(owner, &ast_connected);
+					ast_channel_queue_connected_line_update(owner, &ast_connected, NULL);
 				}
 
 				ast_party_connected_line_free(&ast_connected);
@@ -2389,10 +2389,10 @@
 
 /*! \todo XXX Original called data can be put in a channel data store that is inherited. */
 
-				ast_channel_set_redirecting(owner, &ast_redirecting);
+				ast_channel_set_redirecting(owner, &ast_redirecting, NULL);
 				if (event_id != PRI_EVENT_RING) {
 					/* This redirection was not from a SETUP message. */
-					ast_channel_queue_redirecting_update(owner, &ast_redirecting);
+					ast_channel_queue_redirecting_update(owner, &ast_redirecting, NULL);
 				}
 				ast_party_redirecting_free(&ast_redirecting);
 
@@ -2437,7 +2437,7 @@
 				}
 				sig_pri_redirecting_convert(&ast_redirecting, &pri_deflection,
 					&owner->redirecting, pri);
-				ast_channel_set_redirecting(owner, &ast_redirecting);
+				ast_channel_set_redirecting(owner, &ast_redirecting, NULL);
 				ast_party_redirecting_free(&ast_redirecting);
 
 				/*

Modified: team/rmudgett/cid/funcs/func_connectedline.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/funcs/func_connectedline.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/funcs/func_connectedline.c (original)
+++ team/rmudgett/cid/funcs/func_connectedline.c Tue May 25 17:08:23 2010
@@ -139,7 +139,7 @@
 	struct ast_party_connected_line connected;
 	char *val;
 	char *option;
-	void (*set_it)(struct ast_channel *chan, const struct ast_party_connected_line *connected);
+	void (*set_it)(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update);
 
 	if (!value || !chan) {
 		return -1;
@@ -177,28 +177,28 @@
 		connected.id.XXX_name.str = name;
 		connected.id.XXX_number.valid = 1;
 		connected.id.XXX_number.str = num;
-		set_it(chan, &connected);
+		set_it(chan, &connected, NULL);
 	} else if (!strncasecmp("name", data, 4)) {
 		connected.id.XXX_name.valid = 1;
 		connected.id.XXX_name.str = ast_strdupa(value);
 		ast_trim_blanks(connected.id.XXX_name.str);
-		set_it(chan, &connected);
+		set_it(chan, &connected, NULL);
 	} else if (!strncasecmp("num", data, 3)) {
 		connected.id.XXX_number.valid = 1;
 		connected.id.XXX_number.str = ast_strdupa(value);
 		ast_trim_blanks(connected.id.XXX_number.str);
-		set_it(chan, &connected);
+		set_it(chan, &connected, NULL);
 	} else if (!strncasecmp("tag", data, 3)) {
 		connected.id.tag = ast_strdupa(value);
 		ast_trim_blanks(connected.id.tag);
-		set_it(chan, &connected);
+		set_it(chan, &connected, NULL);
 	} else if (!strncasecmp("ton", data, 3)) {
 		val = ast_strdupa(value);
 		ast_trim_blanks(val);
 
 		if (('0' <= val[0]) && (val[0] <= '9')) {
 			connected.id.XXX_number.plan = atoi(val);
-			set_it(chan, &connected);
+			set_it(chan, &connected, NULL);
 		} else {
 			ast_log(LOG_ERROR, "Unknown connectedline type of number '%s', value unchanged\n", val);
 		}
@@ -219,7 +219,7 @@
 		} else {
 			connected.id.XXX_name.presentation = pres;
 			connected.id.XXX_number.presentation = pres;
-			set_it(chan, &connected);
+			set_it(chan, &connected, NULL);
 		}
 	} else if (!strncasecmp("source", data, 6)) {
 		int source;
@@ -237,7 +237,7 @@
 			ast_log(LOG_ERROR, "Unknown connectedline source '%s', value unchanged\n", val);
 		} else {
 			connected.source = source;
-			set_it(chan, &connected);
+			set_it(chan, &connected, NULL);
 		}
 	} else if (!strncasecmp("subaddr", data, 7)) { /* outbound: set calling subaddress */
 		/* also matches subaddr-valid, subaddr-type, subaddr-odd, subaddr */
@@ -251,7 +251,7 @@
 			connected.id.subaddress.str = ast_strdupa(value);
 			ast_trim_blanks(connected.id.subaddress.str);
 		}
-		set_it(chan, &connected);
+		set_it(chan, &connected, NULL);
 	} else {
 		ast_log(LOG_ERROR, "Unknown connectedline data type '%s'.\n", data);
 	}

Modified: team/rmudgett/cid/funcs/func_redirecting.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/funcs/func_redirecting.c?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/funcs/func_redirecting.c (original)
+++ team/rmudgett/cid/funcs/func_redirecting.c Tue May 25 17:08:23 2010
@@ -314,7 +314,7 @@
 	struct ast_party_redirecting redirecting;
 	char *val;
 	char *option;
-	void (*set_it)(struct ast_channel *chan, const struct ast_party_redirecting *redirecting);
+	void (*set_it)(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update);
 
 	if (!value || !chan) {
 		return -1;
@@ -345,7 +345,7 @@
 	if (!strncasecmp("from-", data, 5)) {
 		switch (redirecting_id_write(&redirecting.from, data + 5, value)) {
 		case ID_FIELD_VALID:
-			set_it(chan, &redirecting);
+			set_it(chan, &redirecting, NULL);
 			break;
 		case ID_FIELD_INVALID:
 			break;
@@ -357,7 +357,7 @@
 	} else if (!strncasecmp("to-", data, 3)) {
 		switch (redirecting_id_write(&redirecting.to, data + 3, value)) {
 		case ID_FIELD_VALID:
-			set_it(chan, &redirecting);
+			set_it(chan, &redirecting, NULL);
 			break;
 		case ID_FIELD_INVALID:
 			break;
@@ -385,7 +385,7 @@
 			redirecting.from.XXX_number.presentation = pres;
 			redirecting.to.XXX_name.presentation = pres;
 			redirecting.to.XXX_number.presentation = pres;
-			set_it(chan, &redirecting);
+			set_it(chan, &redirecting, NULL);
 		}
 	} else if (!strncasecmp("reason", data, 6)) {
 		int reason;
@@ -403,7 +403,7 @@
 			ast_log(LOG_ERROR, "Unknown redirecting reason '%s', value unchanged\n", val);
 		} else {
 			redirecting.reason = reason;
-			set_it(chan, &redirecting);
+			set_it(chan, &redirecting, NULL);
 		}
 	} else if (!strncasecmp("count", data, 5)) {
 		val = ast_strdupa(value);
@@ -411,7 +411,7 @@
 
 		if (('0' <= val[0]) && (val[0] <= '9')) {
 			redirecting.count = atoi(val);
-			set_it(chan, &redirecting);
+			set_it(chan, &redirecting, NULL);
 		} else {
 			ast_log(LOG_ERROR, "Unknown redirecting count '%s', value unchanged\n", val);
 		}

Modified: team/rmudgett/cid/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/include/asterisk/channel.h?view=diff&rev=265745&r1=265744&r2=265745
==============================================================================
--- team/rmudgett/cid/include/asterisk/channel.h (original)
+++ team/rmudgett/cid/include/asterisk/channel.h Tue May 25 17:08:23 2010
@@ -224,7 +224,6 @@
 	 * \note Must tollerate the Q.931 screening-indicator field values being present.
 	 */
 	int presentation;
-/* BUGBUG delete the valid flag? */
 	/*! \brief TRUE if the name information is valid/present */
 	unsigned char valid;
 };
@@ -243,7 +242,6 @@
 	int plan;
 	/*! \brief Q.931 presentation-indicator and screening-indicator encoded fields */
 	int presentation;
-/* BUGBUG delete the valid flag? */
 	/*! \brief TRUE if the number information is valid/present */
 	unsigned char valid;
 };
@@ -308,6 +306,19 @@
 
 /*!
  * \since 1.8
+ * \brief Indicate what information in ast_party_id should be set.
+ */
+struct ast_set_party_id {
+	/*! TRUE if the ast_party_name information should be set. */
+	unsigned char name;
+	/*! TRUE if the ast_party_number information should be set. */
+	unsigned char number;
+	/*! TRUE if the ast_party_subaddress information should be set. */
+	unsigned char subaddress;
+};
+
+/*!
+ * \since 1.8
  * \brief Dialed/Called Party information.
  * \note Dialed Number Identifier (DNID)
  * \note All string fields here are malloc'ed, so they need to be
@@ -369,6 +380,15 @@
 
 /*!
  * \since 1.8
+ * \brief Indicate what information in ast_party_caller should be set.
+ */
+struct ast_set_party_caller {
+	/*! What caller id information to set. */
+	struct ast_set_party_id id;
+};
+
+/*!
+ * \since 1.8
  * \brief Connected Line/Party information.
  * \note All string fields here are malloc'ed, so they need to be
  * freed when the structure is deleted.
@@ -402,6 +422,15 @@
 
 /*!
  * \since 1.8
+ * \brief Indicate what information in ast_party_connected_line should be set.
+ */
+struct ast_set_party_connected_line {
+	/*! What connected line id information to set. */
+	struct ast_set_party_id id;
+};
+
+/*!
+ * \since 1.8
  * \brief Redirecting Line information.
  * RDNIS (Redirecting Directory Number Information Service)
  * Where a call diversion or transfer was invoked.
@@ -421,6 +450,17 @@
 
 	/*! \brief enum AST_REDIRECTING_REASON value for redirection */
 	int reason;
+};
+
+/*!
+ * \since 1.8
+ * \brief Indicate what information in ast_party_redirecting should be set.
+ */
+struct ast_set_party_redirecting {
+	/*! What redirecting-from id information to set. */
+	struct ast_set_party_id from;
+	/*! What redirecting-to id information to set. */

[... 1054 lines stripped ...]



More information about the asterisk-commits mailing list