Added variable CAPI_CIP

master
MelwareDE 14 years ago
parent d1d15d1365
commit 4c42d3fe26
  1. 1
      CHANGES
  2. 5
      README
  3. 14
      chan_capi.c

@ -6,6 +6,7 @@ HEAD
- fixed buffer length error with internal libcapi debug code.
- performance optimizations, use debug code when needed only.
- added commands for media features supported by Dialogic Diva cards.
- added variable CAPI_CIP for full access to all bearer capabilities.
chan_capi-1.1.2

@ -481,6 +481,11 @@ CALLINGSUBADDRESS
CALLEDSUBADDRESS
If set on dial(), the called subaddress will be set to the content.
CAPI_CIP
The real CIP value, not the transformed 'transfercapability'.
Set on incoming call automatically. If set on outgoing call, it is used
instead of transfercapability.
CCBSSTATUS
When using capicommand(ccbs|....), this variable is set to either "ERROR" or
"ACTIVATED".

@ -1294,6 +1294,7 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout)
int CLIR;
int callernplan = 0;
int use_defaultcid = 0;
_cword cip;
const char *ton, *p;
char *osa = NULL;
char *dsa = NULL;
@ -1373,9 +1374,9 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout)
/* if this is a CCBS/CCNR callback call */
if (i->ccbsnrhandle) {
_cword cip = (_cword)tcap2cip(i->transfercapability);
_cword rbref;
cip = (_cword)tcap2cip(i->transfercapability);
i->doOverlap = 0;
rbref = capi_ccbsnr_take_ref(i->ccbsnrhandle);
@ -1431,6 +1432,13 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout)
dsa = calledsubaddress;
}
if ((p = pbx_builtin_getvar_helper(c, "CAPI_CIP"))) {
cip = (_cword)atoi(p);
i->transfercapability = cip2tcap(cip);
} else {
cip = tcap2cip(i->transfercapability);
}
if (capi_tcap_is_digital(i->transfercapability)) {
i->bproto = CC_BPROTO_TRANSPARENT;
cc_verbose(4, 0, VERBOSE_PREFIX_2 "%s: is digital call, set proto to TRANSPARENT\n",
@ -1476,7 +1484,7 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout)
error = capi_sendf(NULL, 0, CAPI_CONNECT_REQ, i->controller, i->MessageNumber,
"wssss(wwwsss())()()()((w)()()ss)",
tcap2cip(i->transfercapability), /* CIP value */
cip, /* CIP value */
called, /* called party number */
calling, /* calling party number */
dsa, /* called party subaddress */
@ -4033,6 +4041,8 @@ static void capidev_handle_connect_indication(_cmsg *CMSG, unsigned int PLCI, un
pbx_builtin_setvar_helper(i->owner, "BCHANNELINFO", bchannelinfo);
sprintf(buffer, "%d", callednplan);
pbx_builtin_setvar_helper(i->owner, "CALLEDTON", buffer);
sprintf(buffer, "%d", i->cip);
pbx_builtin_setvar_helper(i->owner, "CAPI_CIP", buffer);
/*
pbx_builtin_setvar_helper(i->owner, "CALLINGSUBADDRESS",
CONNECT_IND_CALLINGPARTYSUBADDRESS(CMSG));

Loading…
Cancel
Save