[asterisk-commits] russell: trunk r254799 - in /trunk/addons: ./ ooh323c/src/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 25 15:40:51 CDT 2010
Author: russell
Date: Thu Mar 25 15:40:48 2010
New Revision: 254799
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=254799
Log:
Fix chan_ooh323 so it works on Mac OS X, as well.
Modified:
trunk/addons/Makefile
trunk/addons/ooh323c/src/ooh323.c
trunk/addons/ooh323c/src/ooq931.c
trunk/addons/ooh323c/src/ootrace.c
Modified: trunk/addons/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/Makefile?view=diff&rev=254799&r1=254798&r2=254799
==============================================================================
--- trunk/addons/Makefile (original)
+++ trunk/addons/Makefile Thu Mar 25 15:40:48 2010
@@ -47,6 +47,5 @@
chan_ooh323.o: _ASTCFLAGS+=$(H323CFLAGS)
$(if $(filter chan_ooh323,$(EMBEDDED_MODS)),modules.link,chan_ooh323.so): _ASTCFLAGS+=$(H323CFLAGS)
-$(if $(filter chan_ooh323,$(EMBEDDED_MODS)),modules.link,chan_ooh323.so): _ASTLDFLAGS+=-lrt
$(if $(filter chan_ooh323,$(EMBEDDED_MODS)),modules.link,chan_ooh323.so): $(addprefix ooh323c/src/,$(H323OBJS)) chan_ooh323.o ooh323cDriver.o
$(addprefix ooh323c/src/,$(H323OBJS)) chan_ooh323.o ooh323cDriver.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,chan_ooh323)
Modified: trunk/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooh323.c?view=diff&rev=254799&r1=254798&r2=254799
==============================================================================
--- trunk/addons/ooh323c/src/ooh323.c (original)
+++ trunk/addons/ooh323c/src/ooh323.c Thu Mar 25 15:40:48 2010
@@ -1557,6 +1557,7 @@
DListNode *pNode = NULL;
OOTimer *pTimer=NULL;
int type = q931Msg->messageType;
+ struct timeval tv;
struct timespec ts;
/* checking of message validity for first/next messages of calls */
@@ -1600,8 +1601,9 @@
ast_mutex_lock(&call->Lock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call,
FALSE);
- clock_gettime(CLOCK_REALTIME, &ts);
- ts.tv_sec += 24;
+ tv = ast_tvnow();
+ ts.tv_sec = tv.tv_sec + 24;
+ ts.tv_nsec = tv.tv_usec * 1000;
ast_cond_timedwait(&call->gkWait, &call->Lock, &ts);
if (call->callState == OO_CALL_WAITING_ADMISSION)
call->callState = OO_CALL_CLEAR;
Modified: trunk/addons/ooh323c/src/ooq931.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooq931.c?view=diff&rev=254799&r1=254798&r2=254799
==============================================================================
--- trunk/addons/ooh323c/src/ooq931.c (original)
+++ trunk/addons/ooh323c/src/ooq931.c Thu Mar 25 15:40:48 2010
@@ -16,6 +16,7 @@
#include <asterisk.h>
#include <asterisk/lock.h>
+#include "asterisk/utils.h"
#include <time.h>
#include "ooq931.h"
@@ -2017,6 +2018,7 @@
OOCTXT *pctxt;
ooAliases *pNewAlias=NULL, *alias=NULL;
struct timespec ts;
+ struct timeval tv;
int i=0, irand=0, ret = OO_OK;
/* Note: We keep same callToken, for new call which is going
to replace an existing call, thus treating it as a single call.*/
@@ -2072,8 +2074,9 @@
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, fwdedCall, FALSE);
fwdedCall->callState = OO_CALL_WAITING_ADMISSION;
ast_mutex_lock(&fwdedCall->Lock);
- clock_gettime(CLOCK_REALTIME, &ts);
- ts.tv_sec += 24;
+ tv = ast_tvnow();
+ ts.tv_sec += tv.tv_sec + 24;
+ ts.tv_nsec = tv.tv_usec * 1000;
ast_cond_timedwait(&fwdedCall->gkWait, &fwdedCall->Lock, &ts);
if (fwdedCall->callState == OO_CALL_WAITING_ADMISSION) /* GK is not responding */
fwdedCall->callState = OO_CALL_CLEAR;
@@ -2114,6 +2117,7 @@
int ret=0, i=0, irand=0;
char tmp[30]="\0";
char *ip=NULL, *port = NULL;
+ struct timeval tv;
struct timespec ts;
if(!dest)
@@ -2195,8 +2199,9 @@
call->callState = OO_CALL_WAITING_ADMISSION;
ast_mutex_lock(&call->Lock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
- clock_gettime(CLOCK_REALTIME, &ts);
- ts.tv_sec += 24;
+ tv = ast_tvnow();
+ ts.tv_sec = tv.tv_sec + 24;
+ ts.tv_nsec = tv.tv_usec * 1000;
ast_cond_timedwait(&call->gkWait, &call->Lock, &ts);
if (call->callState == OO_CALL_WAITING_ADMISSION)
call->callState = OO_CALL_CLEAR;
Modified: trunk/addons/ooh323c/src/ootrace.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ootrace.c?view=diff&rev=254799&r1=254798&r2=254799
==============================================================================
--- trunk/addons/ooh323c/src/ootrace.c (original)
+++ trunk/addons/ooh323c/src/ootrace.c Thu Mar 25 15:40:48 2010
@@ -111,7 +111,7 @@
struct timeval systemTime;
gettimeofday(&systemTime, NULL);
fprintf(gH323ep.fptraceFile, "%s:%03ld %s", timeString,
- systemTime.tv_usec/1000, logMessage);
+ (long) systemTime.tv_usec/1000, logMessage);
}
else
fprintf(gH323ep.fptraceFile, "%s", logMessage);
More information about the asterisk-commits
mailing list