diff options
author | Mark Spencer <markster@digium.com> | 2003-05-29 16:03:53 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-05-29 16:03:53 +0000 |
commit | ed04393d27f112d61b237b8f7787b20da2cd06c5 (patch) | |
tree | 20c31a6288c67cee7ea801d785115018964c25f7 /channels | |
parent | d6e3f866bc29acd0478d6c81b2621b6474dcc9a0 (diff) |
Fix feature group d MF
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_zap.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 92fcacbd4..81fcca924 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -3658,6 +3658,24 @@ char c; } } +static int zt_wink(struct zt_pvt *p, int index) +{ + int j; + zt_set_hook(p->subs[index].zfd, ZT_WINK); + for(;;) + { + /* set bits of interest */ + j = ZT_IOMUX_SIGEVENT; + /* wait for some happening */ + if (ioctl(p->subs[index].zfd,ZT_IOMUX,&j) == -1) return(-1); + /* exit loop if we have it */ + if (j & ZT_IOMUX_SIGEVENT) break; + } + /* get the event info */ + if (ioctl(p->subs[index].zfd,ZT_GETEVENT,&j) == -1) return(-1); + return 0; +} + static void *ss_thread(void *data) { struct ast_channel *chan = data; @@ -3670,7 +3688,7 @@ static void *ss_thread(void *data) struct callerid_state *cs; char *name=NULL, *number=NULL; int flags; - int i,j; + int i; int timeout; int getforward=0; char *s1, *s2; @@ -3696,18 +3714,8 @@ static void *ss_thread(void *data) case SIG_SF_FEATDMF: case SIG_SF_FEATB: case SIG_SFWINK: - zt_set_hook(p->subs[index].zfd, ZT_WINK); - for(;;) - { - /* set bits of interest */ - j = ZT_IOMUX_SIGEVENT; - /* wait for some happening */ - if (ioctl(p->subs[index].zfd,ZT_IOMUX,&j) == -1) return(NULL); - /* exit loop if we have it */ - if (j & ZT_IOMUX_SIGEVENT) break; - } - /* get the event info */ - if (ioctl(p->subs[index].zfd,ZT_GETEVENT,&j) == -1) return(NULL); + if (zt_wink(p, index)) + return NULL; /* Fall through */ case SIG_EM: case SIG_SF: @@ -3822,6 +3830,9 @@ static void *ss_thread(void *data) } else ast_log(LOG_WARNING, "Got a non-Feature Group B input on channel %d. Assuming E&M Wink instead\n", p->channel); } + if (p->sig == SIG_FEATDMF) { + zt_wink(p, index); + } zt_enable_ec(p); if (ast_exists_extension(chan, chan->context, exten, 1, chan->callerid)) { strncpy(chan->exten, exten, sizeof(chan->exten)-1); |