summaryrefslogtreecommitdiff
path: root/addons/ooh323c/src/ooq931.c
diff options
context:
space:
mode:
authorAlexandr Anikin <may@telecom-service.ru>2011-02-10 13:29:19 +0000
committerAlexandr Anikin <may@telecom-service.ru>2011-02-10 13:29:19 +0000
commit707cf78c5af4ae221225a0351d79e0ddea5add26 (patch)
treeb42e93cc9103f80288a96db6edc77d9c13a64bca /addons/ooh323c/src/ooq931.c
parent8f7982f280e78491624b88b9dcf37af8b5e3fb57 (diff)
Corrections for properly work with H.323v2 (older) endpoints and other
small fixes. Interpret remote side H.225 version. Corrections for H.323v2 endpoints: don't start TCS and MSD before connect, don't start TCS and MSD by accepting H.245 connection, start TCS and MSD by StartH245 facility message. Other fixes: fix non zeroended remoteDisplayName issue, small fixes in call clearing by closing H.245 connection, tcp keepalive introduced on TCP connections (now is hardcoded, will be configurable in the future), don't force H.245tunneling if FastStart is active, don't send Alerting singal more than once per call. (closes issue #18542) Reported by: vmikhelson Patches: issue18542-final-3.patch uploaded by may213 (license 454) Tested by: vmikhelson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'addons/ooh323c/src/ooq931.c')
-rw-r--r--addons/ooh323c/src/ooq931.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/addons/ooh323c/src/ooq931.c b/addons/ooh323c/src/ooq931.c
index d0233f363..dddcf15ec 100644
--- a/addons/ooh323c/src/ooq931.c
+++ b/addons/ooh323c/src/ooq931.c
@@ -53,6 +53,7 @@ EXTERN int ooQ931Decode
int offset, x;
int rv = ASN_OK;
char number[128];
+ char *display = NULL;
/* OOCTXT *pctxt = &gH323ep.msgctxt; */
OOCTXT *pctxt = call->msgctxt;
@@ -164,9 +165,15 @@ EXTERN int ooQ931Decode
}
if(ie->discriminator == Q931DisplayIE)
{
- OOTRACEDBGB1(" Display IE = {\n");
- OOTRACEDBGB2(" %s\n", ie->data);
- OOTRACEDBGB1(" }\n");
+ if (!(display = memAllocZ(pctxt, ie->length + 1))) {
+ OOTRACEERR4("Can't alloc DisplayIE buffer for %n bytes, (%s, %s)\n", ie->length,
+ call->callType, call->callToken);
+ } else {
+ memcpy(display, ie->data,ie->length);
+ OOTRACEDBGB1(" Display IE = {\n");
+ OOTRACEDBGB2(" %s\n", display);
+ OOTRACEDBGB1(" }\n");
+ }
}
if(ie->discriminator == Q931KeypadIE)
@@ -1451,7 +1458,9 @@ int ooSendAlerting(OOH323CallData *call)
OOTRACEERR3("Error: Failed to enqueue Alerting message to outbound queue. (%s, %s)\n", call->callType, call->callToken);
}
- ooSendTCSandMSD(call);
+ if (call->h225version >= 4) {
+ ooSendTCSandMSD(call);
+ }
memReset (call->msgctxt);
return ret;
@@ -1588,7 +1597,9 @@ int ooSendProgress(OOH323CallData *call)
if (!OO_TESTFLAG(call->flags, OO_M_TUNNELING) && call->h245listener)
ooSendStartH245Facility(call);
- ooSendTCSandMSD(call);
+ if (call->h225version >= 4) {
+ ooSendTCSandMSD(call);
+ }
memReset (call->msgctxt);
return ret;
@@ -1957,12 +1968,16 @@ int ooAcceptCall(OOH323CallData *call)
}
- /* Add h245 listener address. Do not add H245 listener address in case
- of fast-start. */
+ /* Add h245 listener address. */
+ /* Do not add H245 listener address in case
+ of fast-start. why? */
+ /* May 20110205 */
+ /* Send h245 listener addr any case if H245 connection isn't established */
if (/* (!OO_TESTFLAG(call->flags, OO_M_FASTSTART) ||
call->remoteFastStartOLCs.count == 0) && */
!OO_TESTFLAG (call->flags, OO_M_TUNNELING) &&
- !call->h245listener && ooCreateH245Listener(call) == OO_OK)
+ ( (!call->h245listener && ooCreateH245Listener(call) == OO_OK) ||
+ !call->pH245Channel))
{
connect->m.h245AddressPresent = TRUE;
connect->h245Address.t = T_H225TransportAddress_ipAddress;
@@ -1997,6 +2012,7 @@ int ooAcceptCall(OOH323CallData *call)
return OO_FAILED;
}
/* memReset(&gH323ep.msgctxt); */
+ ooSendTCSandMSD(call);
memReset(call->msgctxt);
call->callState = OO_CALL_CONNECTED;
@@ -2721,11 +2737,8 @@ int ooH323MakeCall_helper(OOH323CallData *call)
/* For H.323 version 4 and higher, if fast connect, tunneling should be
supported.
+ why?
*/
- if(OO_TESTFLAG(call->flags, OO_M_FASTSTART)) {
- q931msg->userInfo->h323_uu_pdu.h245Tunneling = TRUE;
- OO_SETFLAG(call->flags, OO_M_TUNNELING);
- }
OOTRACEDBGA3("Built SETUP message (%s, %s)\n", call->callType,
call->callToken);