aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c
diff options
context:
space:
mode:
Diffstat (limited to 'addons/ooh323c')
-rw-r--r--addons/ooh323c/src/ooSocket.h5
-rw-r--r--addons/ooh323c/src/oochannels.c19
2 files changed, 8 insertions, 16 deletions
diff --git a/addons/ooh323c/src/ooSocket.h b/addons/ooh323c/src/ooSocket.h
index dff1c8a16..da3dcbf1c 100644
--- a/addons/ooh323c/src/ooSocket.h
+++ b/addons/ooh323c/src/ooSocket.h
@@ -23,6 +23,7 @@
#define _OOSOCKET_H_
#include "asterisk/poll-compat.h"
+#include "asterisk/compiler.h"
#ifdef _WIN32_WCE
#include <winsock.h>
@@ -329,9 +330,9 @@ EXTERN int ooSocketSendTo(OOSOCKET socket, const ASN1OCTET* pdata,
* returns.
* @return Completion status of operation: 0 (ASN_OK) = success,
* negative return value is error.
- */
+ */
EXTERN int ooSocketSelect(int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval * timeout);
+ fd_set *exceptfds, struct timeval * timeout) __attribute_deprecated__;
EXTERN int ooSocketPoll(struct pollfd *pfds, int nfds, int timeout);
diff --git a/addons/ooh323c/src/oochannels.c b/addons/ooh323c/src/oochannels.c
index 446b56a27..a6045aa34 100644
--- a/addons/ooh323c/src/oochannels.c
+++ b/addons/ooh323c/src/oochannels.c
@@ -15,6 +15,7 @@
*****************************************************************************/
#include "asterisk.h"
#include "asterisk/lock.h"
+#include "asterisk/poll-compat.h"
#include "ooports.h"
#include "oochannels.h"
@@ -1980,22 +1981,12 @@ int ooStopMonitorCalls()
OOBOOL ooChannelsIsConnectionOK(OOH323CallData *call, OOSOCKET sock)
{
- struct timeval to;
- fd_set readfds;
- int ret = 0, nfds=0;
+ struct timeval to = { .tv_usec = 500 };
+ struct pollfd pfds = { .fd = sock, .events = POLLIN };
+ int ret = 0;
- to.tv_sec = 0;
- to.tv_usec = 500;
- FD_ZERO(&readfds);
+ ret = ast_poll2(&pfds, 1, &to);
- FD_SET(sock, &readfds);
- if(nfds < (int)sock)
- nfds = (int)sock;
-
- nfds++;
-
- ret = ooSocketSelect(nfds, &readfds, NULL, NULL, &to);
-
if(ret == -1)
{
OOTRACEERR3("Error in select ...broken pipe check(%s, %s)\n",