aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-21 17:13:50 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-21 17:13:50 +0000
commitc3947dc9841cfce4c542afed6367fa0bb434ab5d (patch)
tree8e79e79fa908fa3147ac6f4c571d167c08736226 /channels/chan_dahdi.c
parentcbdf06e91e9cd6e8c04c7aeb703492f05fd960ae (diff)
Revert r207638, this approach could potentially block for an unacceptable
amount of time. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@207785 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c56
1 files changed, 1 insertions, 55 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 629b5b515..3ca22c955 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -292,8 +292,6 @@ static const char config[] = "chan_dahdi.conf";
#define CALLPROGRESS_FAX_INCOMING 4
#define CALLPROGRESS_FAX (CALLPROGRESS_FAX_INCOMING | CALLPROGRESS_FAX_OUTGOING)
-#define OUTBOUND_EM_WINK_RX_TIMEOUT 10000 /*!< Default time to wait for wink on outbound E&M Wink start trunks in ms*/
-
static char defaultcic[64] = "";
static char defaultozz[64] = "";
@@ -394,34 +392,6 @@ static inline int dahdi_wait_event(int fd)
return j;
}
-static char *event2str(int event);
-
-/*! \brief Waits for a wink from the far party with a timeout, returns 0 on wink received, -1 on timeout */
-static inline int dahdi_wait_for_wink(int dfd, int timeout_ms, int *hookcomplete_evt_rcvd)
-{
- int res = 0;
- while (timeout_ms > 0)
- {
- res = dahdi_get_event(dfd);
- ast_debug(2, "Detected event: %s, timeout_ms %d\n", event2str(res), timeout_ms);
- switch (res) {
- case DAHDI_EVENT_NONE:
- timeout_ms -= 100;
- usleep(100000);
- break;
- case DAHDI_EVENT_HOOKCOMPLETE:
- *hookcomplete_evt_rcvd = 1;
- break;
- case DAHDI_EVENT_WINKFLASH:
- return 0;
- break;
- default:
- break;
- }
- }
- return -1; /* indicate timeout has elapsed */
-}
-
/*! Chunk size to read -- we use 20ms chunks to make things happy. */
#define READ_SIZE 160
@@ -3141,8 +3111,6 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
char *s = NULL;
#endif
char dest[256]; /* must be same length as p->dialdest */
- /* flag for if we got a HOOKCOMPLETE event while waiting for the wink */
- int em_w_hookcomplete_evt_rcvd = 0;
ast_mutex_lock(&p->lock);
ast_copy_string(dest, rdest, sizeof(dest));
ast_copy_string(p->dialdest, rdest, sizeof(p->dialdest));
@@ -3317,28 +3285,6 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
#ifdef HAVE_PRI
}
#endif
-
- /* If the outbound protocol is E&M Wink start, this code will wait for the wink
- * before proceeding. It waits for the wink to be detected with a timeout and
- * also detects and notes the HOOKCOMPLETE event which will come before the
- * WINKFLASH event in the normal operation of outbound E&M Wink trunks.
- */
- if (mysig == SIG_EMWINK) {
- if (dahdi_wait_for_wink(p->subs[SUB_REAL].dfd, OUTBOUND_EM_WINK_RX_TIMEOUT, &em_w_hookcomplete_evt_rcvd)) {
- /* we never received a wink from the far side */
- ast_log(LOG_WARNING, "Timer elapsed while waiting to receive a wink on an E&M Wink trunk\n");
- /* put this channel on hook and exit */
- res = dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_ONHOOK);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to hangup channel: %s\n", strerror(errno));
- } else {
- ast_log(LOG_WARNING, "Stopping channel since we did not get a wink before timeout\n");
- }
- ast_mutex_unlock(&p->lock);
- return -1;
- }
- }
-
ast_debug(1, "Dialing '%s'\n", c);
p->dop.op = DAHDI_DIAL_OP_REPLACE;
@@ -3420,7 +3366,7 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
#ifdef HAVE_PRI
}
#endif
- if (!res || em_w_hookcomplete_evt_rcvd) {
+ if (!res) {
if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_DIAL, &p->dop)) {
int saveerr = errno;