[asterisk-commits] kmoore: branch 12 r415191 - /branches/12/channels/chan_pjsip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 5 06:55:41 CDT 2014


Author: kmoore
Date: Thu Jun  5 06:55:32 2014
New Revision: 415191

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=415191
Log:
PJSIP: Send initial connected line information

This makes chan_pjsip send connected line information when it is called
so that connected line information is available on the connected
channel.

(closes issue DPMA-442)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/3584/

Modified:
    branches/12/channels/chan_pjsip.c

Modified: branches/12/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_pjsip.c?view=diff&rev=415191&r1=415190&r2=415191
==============================================================================
--- branches/12/channels/chan_pjsip.c (original)
+++ branches/12/channels/chan_pjsip.c Thu Jun  5 06:55:32 2014
@@ -1467,6 +1467,38 @@
 	return res;
 }
 
+static void update_initial_connected_line(struct ast_sip_session *session)
+{
+	struct ast_party_connected_line connected;
+	struct ast_set_party_connected_line update_connected;
+	struct ast_sip_endpoint_id_configuration *id = &session->endpoint->id;
+
+	if (!id->self.number.valid && !id->self.name.valid) {
+		return;
+	}
+
+	/* Supply initial connected line information if available. */
+	memset(&update_connected, 0, sizeof(update_connected));
+	ast_party_connected_line_init(&connected);
+	connected.id.number = id->self.number;
+	connected.id.name = id->self.name;
+	connected.id.tag = id->self.tag;
+	connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+
+	if (connected.id.number.valid) {
+		update_connected.id.number = 1;
+	}
+
+	if (connected.id.name.valid) {
+		update_connected.id.name = 1;
+	}
+
+	/* Invalidate any earlier private connected id representation */
+	ast_set_party_id_all(&update_connected.priv);
+
+	ast_channel_queue_connected_line_update(session->channel, &connected, &update_connected);
+}
+
 static int call(void *data)
 {
 	struct ast_sip_session *session = data;
@@ -1477,6 +1509,7 @@
 	if (res) {
 		ast_queue_hangup(session->channel);
 	} else {
+		update_initial_connected_line(session);
 		ast_sip_session_send_request(session, tdata);
 	}
 	ao2_ref(session, -1);




More information about the asterisk-commits mailing list