[asterisk-commits] may: trunk r247035 - in /trunk/addons: chan_ooh323.c ooh323c/src/ooh323.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 16 16:58:26 CST 2010


Author: may
Date: Tue Feb 16 16:58:22 2010
New Revision: 247035

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=247035
Log:
generate connected line info update from info in h.323 packets
Tested by: benngard


Modified:
    trunk/addons/chan_ooh323.c
    trunk/addons/ooh323c/src/ooh323.c

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=247035&r1=247034&r2=247035
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Tue Feb 16 16:58:22 2010
@@ -1503,6 +1503,14 @@
 		return 0;
 	}
 	c = p->owner;
+
+	if (call->remoteDisplayName) {
+		struct ast_party_connected_line connected;
+		ast_party_connected_line_init(&connected);
+		connected.id.name = (char *) call->remoteDisplayName;
+		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+		ast_channel_queue_connected_line_update(c, &connected);
+	}
 	if (c->_state != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
 
@@ -1546,6 +1554,14 @@
 		return 0;
 	}
 	c = p->owner;
+
+	if (call->remoteDisplayName) {
+		struct ast_party_connected_line connected;
+		ast_party_connected_line_init(&connected);
+		connected.id.name = (char *) call->remoteDisplayName;
+		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+		ast_channel_queue_connected_line_update(c, &connected);
+	}
 	if (c->_state != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
 
@@ -1927,6 +1943,15 @@
 		}
 		if (p->owner) {
 			struct ast_channel* c = p->owner;
+
+			if (call->remoteDisplayName) {
+				struct ast_party_connected_line connected;
+				ast_party_connected_line_init(&connected);
+				connected.id.name = (char *) call->remoteDisplayName;
+				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+				ast_channel_queue_connected_line_update(c, &connected);
+			}
+
 			ast_queue_control(c, AST_CONTROL_ANSWER);
    			ast_channel_unlock(p->owner);
 			manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n"

Modified: trunk/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooh323.c?view=diff&rev=247035&r1=247034&r2=247035
==============================================================================
--- trunk/addons/ooh323c/src/ooh323.c (original)
+++ trunk/addons/ooh323c/src/ooh323.c Tue Feb 16 16:58:22 2010
@@ -38,6 +38,23 @@
 int ooOnReceivedCallProceeding(OOH323CallData *call, Q931Message *q931Msg);
 int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg);
 int ooOnReceivedProgress(OOH323CallData *call, Q931Message *q931Msg);
+int ooHandleDisplayIE(OOH323CallData *call, Q931Message *q931Msg);
+
+int ooHandleDisplayIE(OOH323CallData *call, Q931Message *q931Msg) {
+   Q931InformationElement* pDisplayIE;
+
+   /* check for display ie */
+   pDisplayIE = ooQ931GetIE(q931Msg, Q931DisplayIE);
+   if(pDisplayIE) {
+      if (call->remoteDisplayName)
+	memFreePtr(call->pctxt, call->remoteDisplayName);
+      call->remoteDisplayName = (char *) memAllocZ(call->pctxt, 
+                                 pDisplayIE->length*sizeof(ASN1OCTET)+1);
+      strncpy(call->remoteDisplayName, (char *)pDisplayIE->data, pDisplayIE->length*sizeof(ASN1OCTET));
+   }
+
+   return OO_OK;
+}
 
 int ooHandleFastStart(OOH323CallData *call, H225Facility_UUIE *facility)
 {
@@ -796,6 +813,7 @@
    H245H2250LogicalChannelParameters * h2250lcp = NULL;  
    int i=0, ret=0;
 
+   ooHandleDisplayIE(call, q931Msg);
 
    if(!q931Msg->userInfo)
    {
@@ -1019,6 +1037,7 @@
    H245H2250LogicalChannelParameters * h2250lcp = NULL;  
    int i=0, ret=0;
 
+   ooHandleDisplayIE(call, q931Msg);
 
    if(!q931Msg->userInfo)
    {
@@ -1241,6 +1260,8 @@
    ASN1OCTET msgbuf[MAXMSGLEN];
    ooLogicalChannel * pChannel = NULL;
    H245H2250LogicalChannelParameters * h2250lcp = NULL;  
+
+   ooHandleDisplayIE(call, q931Msg);
 
    if(!q931Msg->userInfo)
    {




More information about the asterisk-commits mailing list