[asterisk-commits] mmichelson: branch mmichelson/caller_id r384807 - /team/mmichelson/caller_id/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 4 18:44:12 CDT 2013


Author: mmichelson
Date: Thu Apr  4 18:44:08 2013
New Revision: 384807

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384807
Log:
Switch to using the "effective" connected line when sending out ID based on connected line.

This ensures that we use any "private" caller ID that may have been set in the dialplan.


Modified:
    team/mmichelson/caller_id/res/res_sip_caller_id.c

Modified: team/mmichelson/caller_id/res/res_sip_caller_id.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/caller_id/res/res_sip_caller_id.c?view=diff&rev=384807&r1=384806&r2=384807
==============================================================================
--- team/mmichelson/caller_id/res/res_sip_caller_id.c (original)
+++ team/mmichelson/caller_id/res/res_sip_caller_id.c Thu Apr  4 18:44:08 2013
@@ -363,10 +363,12 @@
 
 static void caller_id_outgoing_request(struct ast_sip_session *session, pjsip_tx_data *tdata)
 {
+	struct ast_party_id connected_id;
 	if (!session->channel) {
 		return;
 	}
 
+	connected_id = ast_channel_connected_effective_id(session->channel);
 	if (session->inv_session->state < PJSIP_INV_STATE_CONFIRMED) {
 		/* Only change the From header on the initial outbound INVITE. Switching it
 		 * mid-call might confuse some UAs.
@@ -377,18 +379,17 @@
 		from = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_FROM, tdata->msg->hdr.next);
 		dlg = session->inv_session->dlg;
 
-		modify_id_header(tdata->pool, from, &ast_channel_connected(session->channel)->id);
-		modify_id_header(dlg->pool, dlg->local.info,
-				&ast_channel_connected(session->channel)->id);
+		modify_id_header(tdata->pool, from, &connected_id);
+		modify_id_header(dlg->pool, dlg->local.info, &connected_id);
 		if (should_queue_connected_line_update(session, &session->endpoint->id)) {
 			queue_connected_line_update(session, &session->endpoint->id);
 		}
 	}
 	if (session->endpoint->send_pai) {
-		add_pai_header(tdata, &ast_channel_connected(session->channel)->id);
+		add_pai_header(tdata, &connected_id);
 	}
 	if (session->endpoint->send_rpid) {
-		add_rpid_header(tdata, &ast_channel_connected(session->channel)->id);
+		add_rpid_header(tdata, &connected_id);
 	}
 }
 




More information about the asterisk-commits mailing list