Switched to 'holdtype' configuration.
This commit is contained in:
parent
aa6849f48f
commit
e7cc5d7be4
|
@ -26,7 +26,9 @@ softdtmf=on ;enable/disable software dtmf detection, recommended for AVM ca
|
||||||
relaxdtmf=on ;in addition to softdtmf, you can use relaxed dtmf detection
|
relaxdtmf=on ;in addition to softdtmf, you can use relaxed dtmf detection
|
||||||
accountcode= ;Asterisk accountcode to use in CDRs
|
accountcode= ;Asterisk accountcode to use in CDRs
|
||||||
context=capi-in ;context for incoming calls
|
context=capi-in ;context for incoming calls
|
||||||
hold=yes ;when Asterisk put on hold, ISDN HOLD shall be used
|
holdtype=hold ;when Asterisk puts the call on hold, ISDN HOLD will be used. If
|
||||||
|
;set to 'local' (default value), no hold is done and Asterisk may
|
||||||
|
;play MOH.
|
||||||
;immediate=yes ;immediate start of pbx with extension 's' if no digits were
|
;immediate=yes ;immediate start of pbx with extension 's' if no digits were
|
||||||
;received on incoming call (no destination number yet)
|
;received on incoming call (no destination number yet)
|
||||||
;echosquelch=1 ;_VERY_PRIMITIVE_ echo suppression
|
;echosquelch=1 ;_VERY_PRIMITIVE_ echo suppression
|
||||||
|
|
18
chan_capi.c
18
chan_capi.c
|
@ -1160,6 +1160,7 @@ static struct ast_channel *capi_new(struct ast_capi_pvt *i, int state)
|
||||||
i->doES = i->ES;
|
i->doES = i->ES;
|
||||||
i->outgoing = 0;
|
i->outgoing = 0;
|
||||||
i->onholdPLCI = 0;
|
i->onholdPLCI = 0;
|
||||||
|
i->doholdtype = i->holdtype;
|
||||||
i->B3q = 0;
|
i->B3q = 0;
|
||||||
ast_mutex_init(&i->lockB3q);
|
ast_mutex_init(&i->lockB3q);
|
||||||
memset(i->txavg, 0, ECHO_TX_COUNT);
|
memset(i->txavg, 0, ECHO_TX_COUNT);
|
||||||
|
@ -3174,6 +3175,7 @@ static int capi_hold(struct ast_channel *c, char *param)
|
||||||
char buffer[16];
|
char buffer[16];
|
||||||
char fac[4];
|
char fac[4];
|
||||||
|
|
||||||
|
#warning TODO: support holdtype notify
|
||||||
if (i->isdnstate & CAPI_ISDN_STATE_HOLD) {
|
if (i->isdnstate & CAPI_ISDN_STATE_HOLD) {
|
||||||
ast_log(LOG_NOTICE,"%s: %s already on hold.\n",
|
ast_log(LOG_NOTICE,"%s: %s already on hold.\n",
|
||||||
i->name, c->name);
|
i->name, c->name);
|
||||||
|
@ -3435,14 +3437,14 @@ static int capi_indicate(struct ast_channel *c, int condition)
|
||||||
case AST_CONTROL_HOLD:
|
case AST_CONTROL_HOLD:
|
||||||
cc_ast_verbose(3, 1, VERBOSE_PREFIX_2 "%s: Requested HOLD-Indication for %s\n",
|
cc_ast_verbose(3, 1, VERBOSE_PREFIX_2 "%s: Requested HOLD-Indication for %s\n",
|
||||||
i->name, c->name);
|
i->name, c->name);
|
||||||
if (i->hold) {
|
if (i->doholdtype != CC_HOLDTYPE_LOCAL) {
|
||||||
ret = capi_hold(c, NULL);
|
ret = capi_hold(c, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AST_CONTROL_UNHOLD:
|
case AST_CONTROL_UNHOLD:
|
||||||
cc_ast_verbose(3, 1, VERBOSE_PREFIX_2 "%s: Requested UNHOLD-Indication for %s\n",
|
cc_ast_verbose(3, 1, VERBOSE_PREFIX_2 "%s: Requested UNHOLD-Indication for %s\n",
|
||||||
i->name, c->name);
|
i->name, c->name);
|
||||||
if (i->hold) {
|
if (i->doholdtype != CC_HOLDTYPE_LOCAL) {
|
||||||
ret = capi_retrieve(c, NULL);
|
ret = capi_retrieve(c, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3655,7 +3657,7 @@ int mkif(struct ast_capi_conf *conf)
|
||||||
tmp->callgroup = conf->callgroup;
|
tmp->callgroup = conf->callgroup;
|
||||||
tmp->group = conf->group;
|
tmp->group = conf->group;
|
||||||
tmp->immediate = conf->immediate;
|
tmp->immediate = conf->immediate;
|
||||||
tmp->hold = conf->hold;
|
tmp->holdtype = conf->holdtype;
|
||||||
|
|
||||||
tmp->smoother = ast_smoother_new(AST_CAPI_MAX_B3_BLOCK_SIZE);
|
tmp->smoother = ast_smoother_new(AST_CAPI_MAX_B3_BLOCK_SIZE);
|
||||||
|
|
||||||
|
@ -4025,9 +4027,13 @@ static int conf_interface(struct ast_capi_conf *conf, struct ast_variable *v)
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcasecmp(v->name, "hold")) {
|
if (!strcasecmp(v->name, "holdtype")) {
|
||||||
if (ast_true(v->value)) {
|
if (!strcasecmp(v->value, "hold")) {
|
||||||
conf->hold = 1;
|
conf->holdtype = CC_HOLDTYPE_HOLD;
|
||||||
|
} else if (!strcasecmp(v->value, "notify")) {
|
||||||
|
conf->holdtype = CC_HOLDTYPE_NOTIFY;
|
||||||
|
} else {
|
||||||
|
conf->holdtype = CC_HOLDTYPE_LOCAL;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
11
chan_capi.h
11
chan_capi.h
|
@ -129,6 +129,10 @@ typedef struct fax3proto3 {
|
||||||
#define FACILITYSELECTOR_SUPPLEMENTARY 3
|
#define FACILITYSELECTOR_SUPPLEMENTARY 3
|
||||||
#define FACILITYSELECTOR_ECHO_CANCEL 6
|
#define FACILITYSELECTOR_ECHO_CANCEL 6
|
||||||
|
|
||||||
|
#define CC_HOLDTYPE_LOCAL 0
|
||||||
|
#define CC_HOLDTYPE_HOLD 1
|
||||||
|
#define CC_HOLDTYPE_NOTIFY 2
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* state combination for a normal incoming call:
|
* state combination for a normal incoming call:
|
||||||
* DIS -> ALERT -> CON -> BCON -> CON -> DIS
|
* DIS -> ALERT -> CON -> BCON -> CON -> DIS
|
||||||
|
@ -246,8 +250,9 @@ struct ast_capi_pvt {
|
||||||
int isdnmode;
|
int isdnmode;
|
||||||
/* Answer before getting digits? */
|
/* Answer before getting digits? */
|
||||||
int immediate;
|
int immediate;
|
||||||
/* Use ISDN HOLD */
|
/* which holdtype */
|
||||||
int hold;
|
int holdtype;
|
||||||
|
int doholdtype;
|
||||||
|
|
||||||
/* Common ISDN Profile (CIP) */
|
/* Common ISDN Profile (CIP) */
|
||||||
int cip;
|
int cip;
|
||||||
|
@ -319,7 +324,7 @@ struct ast_capi_conf {
|
||||||
int ectail;
|
int ectail;
|
||||||
int isdnmode;
|
int isdnmode;
|
||||||
int immediate;
|
int immediate;
|
||||||
int hold;
|
int holdtype;
|
||||||
int es;
|
int es;
|
||||||
unsigned int callgroup;
|
unsigned int callgroup;
|
||||||
unsigned int group;
|
unsigned int group;
|
||||||
|
|
Loading…
Reference in New Issue