[svn-commits] kmoore: trunk r415192 - in /trunk: ./ channels/chan_pjsip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 5 06:59:11 CDT 2014


Author: kmoore
Date: Thu Jun  5 06:59:09 2014
New Revision: 415192

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=415192
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/
........

Merged revisions 415191 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/channels/chan_pjsip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_pjsip.c?view=diff&rev=415192&r1=415191&r2=415192
==============================================================================
--- trunk/channels/chan_pjsip.c (original)
+++ trunk/channels/chan_pjsip.c Thu Jun  5 06:59:09 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 svn-commits mailing list