mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
Fixed remote base audio problem (where 2 different interfaces are in use) and
allow for non-rbi remotes and rbi remotes to co-exist on same system git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
* Asterisk -- A telephony toolkit for Linux.
|
* Asterisk -- A telephony toolkit for Linux.
|
||||||
*
|
*
|
||||||
* Radio Repeater / Remote Base program
|
* Radio Repeater / Remote Base program
|
||||||
* version 0.13 7/12/04
|
* version 0.14 8/15/04
|
||||||
*
|
*
|
||||||
* See http://www.zapatatelephony.org/app_rpt.html
|
* See http://www.zapatatelephony.org/app_rpt.html
|
||||||
*
|
*
|
||||||
@@ -136,7 +136,7 @@ enum {SOURCE_RPT, SOURCE_LNK, SOURCE_RMT};
|
|||||||
#include <tonezone.h>
|
#include <tonezone.h>
|
||||||
#include <linux/zaptel.h>
|
#include <linux/zaptel.h>
|
||||||
|
|
||||||
static char *tdesc = "Radio Repeater / Remote Base version 0.13 07/12/2004";
|
static char *tdesc = "Radio Repeater / Remote Base version 0.14 08/15/2004";
|
||||||
static char *app = "Rpt";
|
static char *app = "Rpt";
|
||||||
|
|
||||||
static char *synopsis = "Radio Repeater/Remote Base Control System";
|
static char *synopsis = "Radio Repeater/Remote Base Control System";
|
||||||
@@ -237,7 +237,7 @@ static struct rpt
|
|||||||
char remotetx;
|
char remotetx;
|
||||||
char remoteon;
|
char remoteon;
|
||||||
char simple;
|
char simple;
|
||||||
char remote;
|
char *remote;
|
||||||
char tounkeyed;
|
char tounkeyed;
|
||||||
char tonotify;
|
char tonotify;
|
||||||
char enable;
|
char enable;
|
||||||
@@ -2469,7 +2469,10 @@ static int setrbi(struct rpt *myrpt)
|
|||||||
char tmp[MAXREMSTR] = "",rbicmd[5],*s;
|
char tmp[MAXREMSTR] = "",rbicmd[5],*s;
|
||||||
int band,txoffset = 0,txpower = 0,rxpl;
|
int band,txoffset = 0,txpower = 0,rxpl;
|
||||||
|
|
||||||
|
/* must be a remote system */
|
||||||
|
if (!myrpt->remote) return(0);
|
||||||
|
/* must have rbi hardware */
|
||||||
|
if (strncmp(myrpt->remote,"rbi",3)) return(0);
|
||||||
strncpy(tmp, myrpt->freq, sizeof(tmp) - 1);
|
strncpy(tmp, myrpt->freq, sizeof(tmp) - 1);
|
||||||
s = strchr(tmp,'.');
|
s = strchr(tmp,'.');
|
||||||
/* if no decimal, is invalid */
|
/* if no decimal, is invalid */
|
||||||
@@ -3467,9 +3470,7 @@ int i,j,n,longestnode;
|
|||||||
rpt_vars[n].idtime = retrieve_astcfgint( this, "idtime", 60000, 2400000, IDTIME); /* Enforce a min max */
|
rpt_vars[n].idtime = retrieve_astcfgint( this, "idtime", 60000, 2400000, IDTIME); /* Enforce a min max */
|
||||||
rpt_vars[n].politeid = retrieve_astcfgint( this, "politeid", 30000, 300000, POLITEID); /* Enforce a min max */
|
rpt_vars[n].politeid = retrieve_astcfgint( this, "politeid", 30000, 300000, POLITEID); /* Enforce a min max */
|
||||||
|
|
||||||
val = ast_variable_retrieve(cfg,this,"remote");
|
rpt_vars[n].remote = ast_variable_retrieve(cfg,this,"remote");
|
||||||
if (val) rpt_vars[n].remote = ast_true(val);
|
|
||||||
else rpt_vars[n].remote = 0;
|
|
||||||
rpt_vars[n].tonezone = ast_variable_retrieve(cfg,this,"tonezone");
|
rpt_vars[n].tonezone = ast_variable_retrieve(cfg,this,"tonezone");
|
||||||
val = ast_variable_retrieve(cfg,this,"iobase");
|
val = ast_variable_retrieve(cfg,this,"iobase");
|
||||||
if (val) rpt_vars[n].iobase = atoi(val);
|
if (val) rpt_vars[n].iobase = atoi(val);
|
||||||
@@ -3549,7 +3550,7 @@ int i,j,n,longestnode;
|
|||||||
|
|
||||||
static int rpt_exec(struct ast_channel *chan, void *data)
|
static int rpt_exec(struct ast_channel *chan, void *data)
|
||||||
{
|
{
|
||||||
int res=-1,i,keyed = 0,rem_totx;
|
int res=-1,i,keyed = 0,rem_totx,n;
|
||||||
struct localuser *u;
|
struct localuser *u;
|
||||||
char tmp[256];
|
char tmp[256];
|
||||||
char *options,*stringp,*tele;
|
char *options,*stringp,*tele;
|
||||||
@@ -3705,7 +3706,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_set_write_format(myrpt->rxchannel,AST_FORMAT_SLINEAR);
|
ast_set_write_format(myrpt->rxchannel,AST_FORMAT_SLINEAR);
|
||||||
myrpt->rxchannel->whentohangup = 0;
|
myrpt->rxchannel->whentohangup = 0;
|
||||||
myrpt->rxchannel->appl = "Apprpt";
|
myrpt->rxchannel->appl = "Apprpt";
|
||||||
myrpt->rxchannel->data = "(Repeater Rx)";
|
myrpt->rxchannel->data = "(Link Rx)";
|
||||||
if (option_verbose > 2)
|
if (option_verbose > 2)
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
|
ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
|
||||||
myrpt->rxchanname,tele,myrpt->rxchannel->name);
|
myrpt->rxchanname,tele,myrpt->rxchannel->name);
|
||||||
@@ -3737,7 +3738,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_set_write_format(myrpt->txchannel,AST_FORMAT_SLINEAR);
|
ast_set_write_format(myrpt->txchannel,AST_FORMAT_SLINEAR);
|
||||||
myrpt->txchannel->whentohangup = 0;
|
myrpt->txchannel->whentohangup = 0;
|
||||||
myrpt->txchannel->appl = "Apprpt";
|
myrpt->txchannel->appl = "Apprpt";
|
||||||
myrpt->txchannel->data = "(Repeater Rx)";
|
myrpt->txchannel->data = "(Link Tx)";
|
||||||
if (option_verbose > 2)
|
if (option_verbose > 2)
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
|
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
|
||||||
myrpt->txchanname,tele,myrpt->txchannel->name);
|
myrpt->txchanname,tele,myrpt->txchannel->name);
|
||||||
@@ -3776,14 +3777,17 @@ static int rpt_exec(struct ast_channel *chan, void *data)
|
|||||||
if (chan->_state != AST_STATE_UP) {
|
if (chan->_state != AST_STATE_UP) {
|
||||||
ast_answer(chan);
|
ast_answer(chan);
|
||||||
}
|
}
|
||||||
cs[0] = chan;
|
n = 0;
|
||||||
cs[1] = myrpt->rxchannel;
|
cs[n++] = chan;
|
||||||
|
cs[n++] = myrpt->rxchannel;
|
||||||
|
if (myrpt->rxchannel != myrpt->txchannel)
|
||||||
|
cs[n++] = myrpt->txchannel;
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
if (ast_check_hangup(chan)) break;
|
if (ast_check_hangup(chan)) break;
|
||||||
if (ast_check_hangup(myrpt->rxchannel)) break;
|
if (ast_check_hangup(myrpt->rxchannel)) break;
|
||||||
ms = MSWAIT;
|
ms = MSWAIT;
|
||||||
who = ast_waitfor_n(cs,2,&ms);
|
who = ast_waitfor_n(cs,n,&ms);
|
||||||
if (who == NULL) ms = 0;
|
if (who == NULL) ms = 0;
|
||||||
elap = MSWAIT - ms;
|
elap = MSWAIT - ms;
|
||||||
if (!ms) continue;
|
if (!ms) continue;
|
||||||
@@ -3895,6 +3899,27 @@ static int rpt_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((myrpt->rxchannel != myrpt->txchannel) &&
|
||||||
|
(who == myrpt->txchannel)) /* do this cuz you have to */
|
||||||
|
{
|
||||||
|
f = ast_read(myrpt->txchannel);
|
||||||
|
if (!f)
|
||||||
|
{
|
||||||
|
if (debug) printf("@@@@ link:Hung Up\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (f->frametype == AST_FRAME_CONTROL)
|
||||||
|
{
|
||||||
|
if (f->subclass == AST_CONTROL_HANGUP)
|
||||||
|
{
|
||||||
|
if (debug) printf("@@@@ rpt:Hung Up\n");
|
||||||
|
ast_frfree(f);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ast_frfree(f);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
ast_mutex_lock(&myrpt->lock);
|
ast_mutex_lock(&myrpt->lock);
|
||||||
|
@@ -59,7 +59,8 @@
|
|||||||
; specify the rxchannel and the txchannel will be assumed from the rxchannel
|
; specify the rxchannel and the txchannel will be assumed from the rxchannel
|
||||||
;txchannel = Zap/6 ; Tx audio/signalling channel
|
;txchannel = Zap/6 ; Tx audio/signalling channel
|
||||||
;functions = functions-remote
|
;functions = functions-remote
|
||||||
;remote = yes
|
;remote = rbi ; Set remote=y for dumb remote or
|
||||||
|
; remote=rbi for Doug Hall RBI1
|
||||||
;iobase = 0x378 ; Specify IO port for parallel port (optional)
|
;iobase = 0x378 ; Specify IO port for parallel port (optional)
|
||||||
|
|
||||||
;[functions-repeater]
|
;[functions-repeater]
|
||||||
|
Reference in New Issue
Block a user