[asterisk-commits] mmichelson: branch mmichelson/caller_id r384733 - in /team/mmichelson/caller_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 3 17:01:26 CDT 2013


Author: mmichelson
Date: Wed Apr  3 17:01:23 2013
New Revision: 384733

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384733
Log:
Add options to determine when to send P-Asserted-Identity and Remote-Party-ID


Modified:
    team/mmichelson/caller_id/include/asterisk/res_sip.h
    team/mmichelson/caller_id/res/res_sip/sip_configuration.c
    team/mmichelson/caller_id/res/res_sip_caller_id.c

Modified: team/mmichelson/caller_id/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/caller_id/include/asterisk/res_sip.h?view=diff&rev=384733&r1=384732&r2=384733
==============================================================================
--- team/mmichelson/caller_id/include/asterisk/res_sip.h (original)
+++ team/mmichelson/caller_id/include/asterisk/res_sip.h Wed Apr  3 17:01:23 2013
@@ -318,6 +318,10 @@
 	unsigned int disable_direct_media_on_nat;
 	/*! Do we trust identity information that originates externally (e.g. P-Asserted-Identity header)? */
 	unsigned int trust_external_id;
+	/*! Do we send P-Asserted-Identity headers to this endpoint? */
+	unsigned int send_pai;
+	/*! Do we send Remote-Party-ID headers to this endpoint? */
+	unsigned int send_rpid;
 };
 
 /*!

Modified: team/mmichelson/caller_id/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/caller_id/res/res_sip/sip_configuration.c?view=diff&rev=384733&r1=384732&r2=384733
==============================================================================
--- team/mmichelson/caller_id/res/res_sip/sip_configuration.c (original)
+++ team/mmichelson/caller_id/res/res_sip/sip_configuration.c Wed Apr  3 17:01:23 2013
@@ -303,6 +303,8 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "disable_direct_media_on_nat", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, disable_direct_media_on_nat));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "callerid", "", caller_id_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "trust_external_id", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, trust_external_id));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_pai", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_pai));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_rpid", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_rpid));
 
 	if (ast_sip_initialize_sorcery_transport(sip_sorcery)) {
 		ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");

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=384733&r1=384732&r2=384733
==============================================================================
--- team/mmichelson/caller_id/res/res_sip_caller_id.c (original)
+++ team/mmichelson/caller_id/res/res_sip_caller_id.c Wed Apr  3 17:01:23 2013
@@ -282,7 +282,9 @@
 		set_from_header(dlg->pool, dlg->local.info,
 				&ast_channel_connected(session->channel)->id);
 	}
-	add_pai_header(tdata, &ast_channel_connected(session->channel)->id);
+	if (session->endpoint->send_pai) {
+		add_pai_header(tdata, &ast_channel_connected(session->channel)->id);
+	}
 }
 
 static void caller_id_outgoing_response(struct ast_sip_session *session, pjsip_tx_data *tdata)
@@ -290,7 +292,9 @@
 	if (!session->channel) {
 		return;
 	}
-	add_pai_header(tdata, &ast_channel_connected(session->channel)->id);
+	if (session->endpoint->send_pai) {
+		add_pai_header(tdata, &ast_channel_connected(session->channel)->id);
+	}
 }
 
 static struct ast_sip_session_supplement caller_id_supplement = {




More information about the asterisk-commits mailing list