aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c
diff options
context:
space:
mode:
authormay <may@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-24 22:42:11 +0000
committermay <may@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-24 22:42:11 +0000
commit901630e56d49150925387fe59ec07fbdfd6e6021 (patch)
tree9f6b57f17d4c31304e70c47817e22f4cbde87ded /addons/ooh323c
parente9e6d14932447cf2767a8abdae04eef0017f3d8a (diff)
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) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242645 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'addons/ooh323c')
-rw-r--r--addons/ooh323c/src/ooCmdChannel.c9
-rw-r--r--addons/ooh323c/src/ooStackCmds.c48
-rw-r--r--addons/ooh323c/src/ooStackCmds.h5
-rw-r--r--addons/ooh323c/src/oochannels.c2
-rw-r--r--addons/ooh323c/src/ooh323.c11
5 files changed, 73 insertions, 2 deletions
diff --git a/addons/ooh323c/src/ooCmdChannel.c b/addons/ooh323c/src/ooCmdChannel.c
index 003a5df1b..27a28a282 100644
--- a/addons/ooh323c/src/ooCmdChannel.c
+++ b/addons/ooh323c/src/ooCmdChannel.c
@@ -402,6 +402,15 @@ int ooReadAndProcessCallStackCommand(OOH323CallData* call)
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");
}
}
diff --git a/addons/ooh323c/src/ooStackCmds.c b/addons/ooh323c/src/ooStackCmds.c
index f09d33405..4c732d538 100644
--- a/addons/ooh323c/src/ooStackCmds.c
+++ b/addons/ooh323c/src/ooStackCmds.c
@@ -494,6 +494,54 @@ OOStkCmdStat ooSendDTMFDigit(const char *callToken, const char* dtmf)
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;
diff --git a/addons/ooh323c/src/ooStackCmds.h b/addons/ooh323c/src/ooStackCmds.h
index 3fd1a8dab..dc6a2128e 100644
--- a/addons/ooh323c/src/ooStackCmds.h
+++ b/addons/ooh323c/src/ooStackCmds.h
@@ -67,7 +67,8 @@ typedef enum OOStackCmdID {
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 @@ EXTERN OOStkCmdStat ooRunCall(const char* dest, char* callToken, size_t bufsiz,
int ooGenerateOutgoingCallToken (char *callToken, size_t size);
+EXTERN OOStkCmdStat ooSetANI(const char *callToken, const char* ani);
+
#ifdef __cplusplus
}
#endif
diff --git a/addons/ooh323c/src/oochannels.c b/addons/ooh323c/src/oochannels.c
index fd6cbb376..2b2f0b493 100644
--- a/addons/ooh323c/src/oochannels.c
+++ b/addons/ooh323c/src/oochannels.c
@@ -1124,7 +1124,7 @@ int ooH2250Receive(OOH323CallData *call)
finishPrint();
removeEventHandler(pctxt);
if(ret == OO_OK) {
- ooHandleH2250Message(call, pmsg);
+ ret = ooHandleH2250Message(call, pmsg);
}
return ret;
}
diff --git a/addons/ooh323c/src/ooh323.c b/addons/ooh323c/src/ooh323.c
index 971b668a2..59b6afdb1 100644
--- a/addons/ooh323c/src/ooh323.c
+++ b/addons/ooh323c/src/ooh323.c
@@ -1533,6 +1533,17 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
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 */