diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 1999-12-16 13:44:30 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 1999-12-16 13:44:30 +0000 |
commit | 509765aef52f3ce306a114832ab885ad85522d2e (patch) | |
tree | 900d9952178c438c1347376241e306e457817f58 /channels/chan_vofr.c | |
parent | 70f08a7afb001c7c1608181fa4546c6460890e04 (diff) |
Version 0.1.1 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@139 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_vofr.c')
-rwxr-xr-x | channels/chan_vofr.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/channels/chan_vofr.c b/channels/chan_vofr.c index ea17df951..aee44ff2e 100755 --- a/channels/chan_vofr.c +++ b/channels/chan_vofr.c @@ -3,7 +3,7 @@ * * Implementation of Voice over Frame Relay, Adtran Style * - * Copyright (C) 1999, Adtran Inc. and Linux Support Services, LLC + * Copyright (C) 1999, Mark Spencer * * Mark Spencer <markster@linux-support.net> * @@ -55,7 +55,7 @@ static pthread_mutex_t monlock = PTHREAD_MUTEX_INITIALIZER; which are not currently in use. */ static pthread_t monitor_thread = -1; -static int restart_monitor(); +static int restart_monitor(void); /* The private structures of the Adtran VoFR channels are linked for selecting outgoing channels */ @@ -558,6 +558,9 @@ static struct ast_frame *vofr_read(struct ast_channel *ast) fr->subclass = 0; break; } + case VOFR_SIGNAL_RING: + ast->rings++; + break; case VOFR_SIGNAL_UNKNOWN: switch(vh->data[1]) { case 0x1: @@ -783,7 +786,21 @@ static int vofr_mini_packet(struct vofr_pvt *i, struct vofr_hdr *pkt, int len) switch(pkt->data[0]) { case VOFR_SIGNAL_RING: /* If we get a RING, we definitely want to start a new thread */ - vofr_new(i, AST_STATE_RING); + if (!i->owner) + vofr_new(i, AST_STATE_RING); + else + ast_log(LOG_WARNING, "Got a ring, but there's an owner?\n"); + break; + case VOFR_SIGNAL_OFF_HOOK: + /* Network termination, go off hook */ +#if 0 + ast_log(LOG_DEBUG, "Off hook\n"); +#endif + vofr_xmit_signal(i, 0x10, 2); + if (!i->owner) + vofr_new(i, AST_STATE_UP); + else + ast_log(LOG_WARNING, "Got an offhook, but there's an owner?\n"); break; case VOFR_SIGNAL_ON_HOOK: break; @@ -896,7 +913,7 @@ static void *do_monitor(void *data) } -static int restart_monitor() +static int restart_monitor(void) { /* If we're supposed to be stopped -- stay stopped */ if (monitor_thread == -2) @@ -926,7 +943,7 @@ static int restart_monitor() return 0; } -struct vofr_pvt *mkif(char *type, char *iface) +static struct vofr_pvt *mkif(char *type, char *iface) { /* Make a vofr_pvt structure for this interface */ struct vofr_pvt *tmp; |