- added config 'defaultcid' to set a default caller id which will be
used if dial option 'd' is specified.
This commit is contained in:
parent
65100a1838
commit
a9192a9555
1
README
1
README
|
@ -77,6 +77,7 @@ The Dial string
|
|||
The string consists of a list of characters with the following meaning:
|
||||
'b' : early B3 always.
|
||||
'B' : early B3 on successful calls only.
|
||||
'd' : use the default caller id which is set by defaultcid= in capi.conf
|
||||
'o' : use overlap sending of number.
|
||||
(Useful if additional digits shall be send afterwards or together
|
||||
with 'b' to get dialtone and then send the number, e.g. if otherwise
|
||||
|
|
|
@ -20,6 +20,8 @@ txgain=0.8
|
|||
isdnmode=msn ;'MSN' (point-to-multipoint) or 'DID' (direct inward dial)
|
||||
;when using NT-mode, 'DID' should be set in any case
|
||||
incomingmsn=* ;allow incoming calls to this list of MSNs/DIDs, * = any
|
||||
;defaultcid=123 ;set a default caller id to that interface for dial-out,
|
||||
;this caller id will be used when dial option 'd' is set.
|
||||
;controller=0 ;ISDN4BSD default
|
||||
;controller=7 ;ISDN4BSD USB default
|
||||
controller=1 ;capi controller number to use
|
||||
|
|
14
chan_capi.c
14
chan_capi.c
|
@ -851,6 +851,7 @@ static int capi_call(struct ast_channel *c, char *idest, int timeout)
|
|||
char bchaninfo[3];
|
||||
int CLIR;
|
||||
int callernplan = 0;
|
||||
int use_defaultcid = 0;
|
||||
char *ton, *p;
|
||||
char *osa = NULL;
|
||||
char *dsa = NULL;
|
||||
|
@ -883,11 +884,16 @@ static int capi_call(struct ast_channel *c, char *idest, int timeout)
|
|||
ast_log(LOG_WARNING, "B3 already set in '%s'\n", idest);
|
||||
i->doB3 = AST_CAPI_B3_ON_SUCCESS;
|
||||
break;
|
||||
case 'o': /* overlap sending of digits len > 2 */
|
||||
case 'o': /* overlap sending of digits */
|
||||
if (i->doOverlap)
|
||||
ast_log(LOG_WARNING, "Overlap already set in '%s'\n", idest);
|
||||
i->doOverlap = 1;
|
||||
break;
|
||||
case 'd': /* use default cid */
|
||||
if (i->doOverlap)
|
||||
ast_log(LOG_WARNING, "Default CID already set in '%s'\n", idest);
|
||||
use_defaultcid = 1;
|
||||
break;
|
||||
default:
|
||||
ast_log(LOG_WARNING, "Unknown parameter '%c' in '%s', ignoring.\n",
|
||||
*param, idest);
|
||||
|
@ -960,6 +966,10 @@ static int capi_call(struct ast_channel *c, char *idest, int timeout)
|
|||
else
|
||||
memset(callerid, 0, sizeof(callerid));
|
||||
|
||||
if (use_defaultcid) {
|
||||
strncpy(callerid, i->defaultcid, sizeof(callerid) - 1);
|
||||
}
|
||||
|
||||
calling[0] = strlen(callerid) + 2;
|
||||
calling[1] = callernplan;
|
||||
calling[2] = 0x80 | (CLIR & 0x63);
|
||||
|
@ -4139,6 +4149,7 @@ int mkif(struct ast_capi_conf *conf)
|
|||
}
|
||||
strncpy(tmp->context, conf->context, sizeof(tmp->context) - 1);
|
||||
strncpy(tmp->incomingmsn, conf->incomingmsn, sizeof(tmp->incomingmsn) - 1);
|
||||
strncpy(tmp->defaultcid, conf->defaultcid, sizeof(tmp->defaultcid) - 1);
|
||||
strncpy(tmp->prefix, conf->prefix, sizeof(tmp->prefix)-1);
|
||||
strncpy(tmp->accountcode, conf->accountcode, sizeof(tmp->accountcode) - 1);
|
||||
|
||||
|
@ -4567,6 +4578,7 @@ static int conf_interface(struct ast_capi_conf *conf, struct ast_variable *v)
|
|||
CONF_INTEGER(conf->devices, "devices");
|
||||
CONF_STRING(conf->context, "context");
|
||||
CONF_STRING(conf->incomingmsn, "incomingmsn");
|
||||
CONF_STRING(conf->defaultcid, "defaultcid");
|
||||
CONF_STRING(conf->controllerstr, "controller");
|
||||
CONF_STRING(conf->prefix, "prefix");
|
||||
CONF_STRING(conf->accountcode, "accountcode");
|
||||
|
|
|
@ -237,6 +237,8 @@ struct ast_capi_pvt {
|
|||
char incomingmsn[AST_CAPI_MAX_STRING];
|
||||
/*! Prefix to Build CID */
|
||||
char prefix[AST_MAX_EXTENSION];
|
||||
/* the default caller id */
|
||||
char defaultcid[AST_CAPI_MAX_STRING];
|
||||
|
||||
/*! Caller ID if available */
|
||||
char cid[AST_MAX_EXTENSION];
|
||||
|
@ -342,6 +344,7 @@ struct ast_capi_profile {
|
|||
struct ast_capi_conf {
|
||||
char name[AST_CAPI_MAX_STRING];
|
||||
char incomingmsn[AST_CAPI_MAX_STRING];
|
||||
char defaultcid[AST_CAPI_MAX_STRING];
|
||||
char context[AST_MAX_EXTENSION];
|
||||
char controllerstr[AST_CAPI_MAX_STRING];
|
||||
char prefix[AST_MAX_EXTENSION];
|
||||
|
|
Loading…
Reference in New Issue