Index: channels/ooh323c/src/ootypes.h =================================================================== --- channels/ooh323c/src/ootypes.h (revision 1091) +++ channels/ooh323c/src/ootypes.h (working copy) @@ -180,8 +180,9 @@ typedef enum OOCallClearReason { #define OORequestChannelCloseRelease 128 #define OOEndSessionCommand 129 #define OOUserInputIndication 130 +#define OORequestDelayResponse 131 -#define OO_MSGTYPE_MAX 130 +#define OO_MSGTYPE_MAX 131 /* Timer types */ #define OO_CALLESTB_TIMER (1<<0) Index: channels/ooh323c/src/ooh245.c =================================================================== --- channels/ooh323c/src/ooh245.c (revision 1091) +++ channels/ooh323c/src/ooh245.c (working copy) @@ -1969,7 +1969,54 @@ int ooOnReceivedRequestChannelClose(OOH323CallData return ret; } +int ooOnReceivedRoundTripDelayRequest(OOH323CallData *call, + H245SequenceNumber sequenceNumber) +{ + int ret=0; + H245Message *ph245msg=NULL; + H245ResponseMessage *response = NULL; + OOCTXT *pctxt=NULL; + H245RoundTripDelayResponse *rtdr; + ret = ooCreateH245Message(&ph245msg, + T_H245MultimediaSystemControlMessage_response); + if(ret != OO_OK) + { + OOTRACEERR3("ERROR:Memory allocation for RoundTripDelayResponse message " + "failed (%s, %s)\n", call->callType, call->callToken); + return OO_FAILED; + } + + pctxt = &gH323ep.msgctxt; + ph245msg->msgType = OORequestDelayResponse; + response = ph245msg->h245Msg.u.response; + response->t = T_H245ResponseMessage_roundTripDelayResponse; + response->u.roundTripDelayResponse = (H245RoundTripDelayResponse *)ASN1MALLOC + (pctxt, sizeof(H245RoundTripDelayResponse)); + if(!response->u.roundTripDelayResponse) + { + OOTRACEERR3("ERROR:Failed to allocate memory for H245RoundTripDelayResponse " + "message (%s, %s)\n", call->callType, call->callToken); + return OO_FAILED; + } + rtdr = response->u.roundTripDelayResponse; + memset(rtdr, 0, sizeof(H245RoundTripDelayResponse)); + rtdr->sequenceNumber = sequenceNumber; + + OOTRACEDBGA3("Built RoundTripDelayResponse message (%s, %s)\n", + call->callType, call->callToken); + ret = ooSendH245Msg(call, ph245msg); + if(ret != OO_OK) + { + OOTRACEERR3("Error:Failed to enqueue RoundTripDelayResponse to outbound queue. (%s, %s)\n", + call->callType, call->callToken); + } + + ooFreeH245Message(call, ph245msg); + + return ret; +} + /* We clear channel here. Ideally the remote endpoint should send CloseLogicalChannel and then the channel should be cleared. But there's no @@ -2159,6 +2206,11 @@ int ooHandleH245Message(OOH323CallData *call, H245 ooOnReceivedRequestChannelClose(call, request->u.requestChannelClose); break; + case T_H245RequestMessage_roundTripDelayRequest: + OOTRACEINFO4("Received roundTripDelayRequest - %d (%s, %s)\n", + request->u.roundTripDelayRequest->sequenceNumber, call->callType, call->callToken); + ooOnReceivedRoundTripDelayRequest(call, request->u.roundTripDelayRequest->sequenceNumber); + break; default: ; } /* End of Request Message */ Index: channels/ooh323c/src/ooh245.h =================================================================== --- channels/ooh323c/src/ooh245.h (revision 1091) +++ channels/ooh323c/src/ooh245.h (working copy) @@ -29,6 +29,10 @@ #include "ooq931.h" #include "MULTIMEDIA-SYSTEM-CONTROL.h" +int ooOnReceivedRoundTripDelayRequest(OOH323CallData *call, + H245SequenceNumber sequenceNumber); + + #ifdef __cplusplus extern "C" { #endif Index: channels/ooh323c/src/ooSocket.c =================================================================== --- channels/ooh323c/src/ooSocket.c (revision 1091) +++ channels/ooh323c/src/ooSocket.c (working copy) @@ -575,6 +575,7 @@ int ooSocketGetInterfaceList(OOCTXT *pctxt, OOInte struct ifconf ifc; int ifNum; OOInterface *pIf=NULL; + struct sockaddr_in sin; OOTRACEDBGA1("Retrieving local interfaces\n"); if(ooSocketCreateUDP(&sock)!= ASN_OK) @@ -653,7 +654,8 @@ int ooSocketGetInterfaceList(OOCTXT *pctxt, OOInte memFreePtr(pctxt, pIf); continue; } - strcpy(addr, inet_ntoa(((struct sockaddr_in*)&ifReq.ifr_addr)->sin_addr)); + memcpy(&sin, &ifReq.ifr_addr, sizeof(struct sockaddr_in)); + strcpy(addr, inet_ntoa(sin.sin_addr)); OOTRACEDBGA2("\tIP address is %s\n", addr); pIf->addr = (char*)memAlloc(pctxt, strlen(addr)+1); if(!pIf->addr) @@ -676,7 +678,8 @@ int ooSocketGetInterfaceList(OOCTXT *pctxt, OOInte memFreePtr(pctxt, pIf); continue; } - strcpy(mask, inet_ntoa(((struct sockaddr_in *)&ifReq.ifr_netmask)->sin_addr)); + memcpy(&sin, &ifReq.ifr_netmask, sizeof(struct sockaddr_in)); + strcpy(mask, inet_ntoa(sin.sin_addr)); OOTRACEDBGA2("\tMask is %s\n", mask); pIf->mask = (char*)memAlloc(pctxt, strlen(mask)+1); if(!pIf->mask) Index: channels/ooh323c/src/ooq931.c =================================================================== --- channels/ooh323c/src/ooq931.c (revision 1091) +++ channels/ooh323c/src/ooq931.c (working copy) @@ -3378,7 +3378,9 @@ const char* ooGetMsgTypeText (int msgType) "OORequestChannelCloseAck", "OORequestChannelCloseReject", "OORequestChannelCloseRelease", - "OOEndSessionCommand" + "OOEndSessionCommand", + "OOUserInputIndication", + "OORequestDelayResponse" }; int idx = msgType - OO_MSGTYPE_MIN; return ooUtilsGetText (idx, msgTypeText, OONUMBEROF(msgTypeText));