[asterisk-commits] may: trunk r242645 - in /trunk/addons: ./ ooh323c/src/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 24 16:42:14 CST 2010


Author: may
Date: Sun Jan 24 16:42:11 2010
New Revision: 242645

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242645
Log:
AST_CONTROL_CONNECTED_LINE frame type processing added to setup DisplayIE field
incorrect q.931 message order filtered on incoming calls (first msg must be setup, 
next must be not setup)


Modified:
    trunk/addons/chan_ooh323.c
    trunk/addons/ooh323c/src/ooCmdChannel.c
    trunk/addons/ooh323c/src/ooStackCmds.c
    trunk/addons/ooh323c/src/ooStackCmds.h
    trunk/addons/ooh323c/src/oochannels.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=242645&r1=242644&r2=242645
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Sun Jan 24 16:42:11 2010
@@ -902,6 +902,10 @@
       		if(p->callerid_name)
 			free(p->callerid_name);
 		p->callerid_name = strdup(ast->connected.id.name);
+	} else if (ast->connected.id.number) {
+      		if(p->callerid_name)
+			free(p->callerid_name);
+		p->callerid_name = strdup(ast->connected.id.number);
 	} else {
 		ast->connected.id.name = strdup(gCallerID);
       		if(p->callerid_name)
@@ -1204,6 +1208,13 @@
 	 break;
       case AST_CONTROL_SRCUPDATE:
 		ast_rtp_instance_new_source(p->rtp);
+		break;
+
+      case AST_CONTROL_CONNECTED_LINE:
+		if (gH323Debug)
+			ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
+				callToken, ast->connected.id.name);
+		ooSetANI(callToken, ast->connected.id.name);
 		break;
 
       case AST_CONTROL_T38_PARAMETERS:

Modified: trunk/addons/ooh323c/src/ooCmdChannel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooCmdChannel.c?view=diff&rev=242645&r1=242644&r2=242645
==============================================================================
--- trunk/addons/ooh323c/src/ooCmdChannel.c (original)
+++ trunk/addons/ooh323c/src/ooCmdChannel.c Sun Jan 24 16:42:11 2010
@@ -402,6 +402,15 @@
 	       ooSendRequestMode(call, *(int *)cmd.param2);
 	       break;
 
+	    case OO_CMD_SETANI:
+		OOTRACEINFO3("Processing SetANI command %s, ani is %s\n",
+				(char *)cmd.param1, (char *)cmd.param2);
+   		if(cmd.param2) {
+     			strncpy(call->ourCallerId, cmd.param2, sizeof(call->ourCallerId)-1);
+     			call->ourCallerId[sizeof(call->ourCallerId)-1] = '\0';
+   		}
+		break;
+
             default: OOTRACEERR1("ERROR:Unknown command\n");
          }
       }

Modified: trunk/addons/ooh323c/src/ooStackCmds.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooStackCmds.c?view=diff&rev=242645&r1=242644&r2=242645
==============================================================================
--- trunk/addons/ooh323c/src/ooStackCmds.c (original)
+++ trunk/addons/ooh323c/src/ooStackCmds.c Sun Jan 24 16:42:11 2010
@@ -494,6 +494,54 @@
    return OO_STKCMD_SUCCESS;
 }
 
+OOStkCmdStat ooSetANI(const char *callToken, const char* ani)
+{
+   OOStackCommand cmd;
+   OOH323CallData *call;
+
+   if(!callToken)
+   {
+      return OO_STKCMD_INVALIDPARAM;
+   }
+
+   if(!(call = ooFindCallByToken(callToken))) {
+      return OO_STKCMD_INVALIDPARAM;
+   }
+
+   if(call->CmdChan == 0)
+   {
+      if(ooCreateCallCmdConnection(call) != OO_OK)
+         return OO_STKCMD_CONNECTIONERR;
+   }
+
+   memset(&cmd, 0, sizeof(OOStackCommand));
+   cmd.type = OO_CMD_SETANI;
+
+   cmd.param1 = (void*) malloc(strlen(callToken)+1);
+   cmd.param2 = (void*) malloc(strlen(ani)+1);
+   if(!cmd.param1 || !cmd.param2)
+   {
+      if(cmd.param1)   free(cmd.param1); /* Release memory */
+      if(cmd.param2)   free(cmd.param2);
+      return OO_STKCMD_MEMERR;
+   }
+   strcpy((char*)cmd.param1, callToken);
+   cmd.plen1 = strlen(callToken);
+   strcpy((char*)cmd.param2, ani);
+   cmd.plen2 = strlen(ani);
+   
+   if(ooWriteCallStackCommand(call,&cmd) != OO_OK)
+   {
+      free(cmd.param1);
+      free(cmd.param2);
+      return OO_STKCMD_WRITEERR;
+   }
+   free(cmd.param1);
+   free(cmd.param2);
+
+   return OO_STKCMD_SUCCESS;
+}
+
 OOStkCmdStat ooRequestChangeMode(const char *callToken, int isT38Mode)
 {
    OOStackCommand cmd;

Modified: trunk/addons/ooh323c/src/ooStackCmds.h
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooStackCmds.h?view=diff&rev=242645&r1=242644&r2=242645
==============================================================================
--- trunk/addons/ooh323c/src/ooStackCmds.h (original)
+++ trunk/addons/ooh323c/src/ooStackCmds.h Sun Jan 24 16:42:11 2010
@@ -67,7 +67,8 @@
    OO_CMD_MANUALRINGBACK,    /*!< Send Alerting - ringback */
    OO_CMD_MANUALPROGRESS,    /*!< Send progress */
    OO_CMD_STOPMONITOR,       /*!< Stop the event monitor */
-   OO_CMD_REQMODE	     /*!< Request new mode */
+   OO_CMD_REQMODE,	     /*!< Request new mode */
+   OO_CMD_SETANI	     /*! <Set conncted info */
    
 } OOStackCmdID;
 
@@ -176,6 +177,8 @@
 
 int ooGenerateOutgoingCallToken (char *callToken, size_t size);
 
+EXTERN OOStkCmdStat ooSetANI(const char *callToken, const char* ani);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/oochannels.c?view=diff&rev=242645&r1=242644&r2=242645
==============================================================================
--- trunk/addons/ooh323c/src/oochannels.c (original)
+++ trunk/addons/ooh323c/src/oochannels.c Sun Jan 24 16:42:11 2010
@@ -1124,7 +1124,7 @@
    finishPrint();
    removeEventHandler(pctxt);
    if(ret == OO_OK) {
-      ooHandleH2250Message(call, pmsg);
+      ret = ooHandleH2250Message(call, pmsg);
    }
    return ret;
 }

Modified: trunk/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooh323.c?view=diff&rev=242645&r1=242644&r2=242645
==============================================================================
--- trunk/addons/ooh323c/src/ooh323.c (original)
+++ trunk/addons/ooh323c/src/ooh323.c Sun Jan 24 16:42:11 2010
@@ -1533,6 +1533,17 @@
    OOTimer *pTimer=NULL;
    int type = q931Msg->messageType;
    struct timespec ts;
+
+/* checking of message validity for first/next messages of calls */
+
+   if (!strcmp(call->callType, "incoming")) {
+	if ((call->callState != OO_CALL_CREATED && type == Q931SetupMsg) ||
+	    (call->callState == OO_CALL_CREATED && type != Q931SetupMsg)) {
+		ooFreeQ931Message(call->msgctxt, q931Msg);
+		return OO_FAILED;
+	}
+   }
+
    switch(type)
    {
       case Q931SetupMsg: /* SETUP message is received */




More information about the asterisk-commits mailing list