- hopefully fixed ECT channel hang

- added option 'x' to ect for real explicit call transfer
This commit is contained in:
MelwareDE 2007-04-22 11:24:25 +00:00
parent 14abf19bb2
commit 767dd90bed
3 changed files with 24 additions and 18 deletions

View File

@ -3,7 +3,9 @@ CHANGES
HEAD HEAD
------------------ ------------------
- possibly fixed ECT channel hang
- added 'x' option to capicommand(ect) to have real 'explicit call transfer'
(needed by some ISDN lines)
chan_capi-1.0.1 chan_capi-1.0.1

4
README
View File

@ -190,6 +190,10 @@ ECT:
exten => s,1,capicommand(hold) exten => s,1,capicommand(hold)
exten => s,2,Wait(1) exten => s,2,Wait(1)
exten => s,3,Dial(CAPI/contr1/1234,60,M(capiect)) exten => s,3,Dial(CAPI/contr1/1234,60,M(capiect))
Note: Normaly a PBX needs 'implicit call transfer', which is done by default
with this command. But if the line needs real 'explicit call transfer', use
exten => s,1,capicommand(ect|x)
instead.
3PTY: 3PTY:
Initiate a Three-Party Conference (must have one call on hold and one active call!). Initiate a Three-Party Conference (must have one call on hold and one active call!).

View File

@ -938,8 +938,6 @@ static void capi_activehangup(struct ast_channel *c, int state)
if ((i->isdnstate & CAPI_ISDN_STATE_ECT)) { if ((i->isdnstate & CAPI_ISDN_STATE_ECT)) {
cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: activehangup ECT call\n", cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: activehangup ECT call\n",
i->vname); i->vname);
/* we do nothing, just wait for DISCONNECT_IND */
return;
} }
cc_verbose(2, 1, VERBOSE_PREFIX_3 "%s: activehangingup (cause=%d) for PLCI=%#x\n", cc_verbose(2, 1, VERBOSE_PREFIX_3 "%s: activehangingup (cause=%d) for PLCI=%#x\n",
@ -2474,20 +2472,13 @@ static void capidev_handle_info_disconnect(_cmsg *CMSG, unsigned int PLCI, unsig
i->isdnstate |= CAPI_ISDN_STATE_DISCONNECT; i->isdnstate |= CAPI_ISDN_STATE_DISCONNECT;
if ((i->isdnstate & CAPI_ISDN_STATE_ECT)) { if ((PLCI == i->onholdPLCI) || (i->isdnstate & CAPI_ISDN_STATE_ECT)) {
cc_verbose(4, 1, VERBOSE_PREFIX_3 "%s: Disconnect ECT call\n", cc_verbose(4, 1, VERBOSE_PREFIX_3 "%s: Disconnect onhold/ECT call\n",
i->vname);
/* we do nothing, just wait for DISCONNECT_IND */
return;
}
if (PLCI == i->onholdPLCI) {
cc_verbose(4, 1, VERBOSE_PREFIX_3 "%s: Disconnect onhold call\n",
i->vname); i->vname);
/* the caller onhold hung up (or ECTed away) */ /* the caller onhold hung up (or ECTed away) */
/* send a disconnect_req , we cannot hangup the channel here!!! */ /* send a disconnect_req , we cannot hangup the channel here!!! */
DISCONNECT_REQ_HEADER(&CMSG2, capi_ApplID, get_capi_MessageNumber(), 0); DISCONNECT_REQ_HEADER(&CMSG2, capi_ApplID, get_capi_MessageNumber(), 0);
DISCONNECT_REQ_PLCI(&CMSG2) = i->onholdPLCI; DISCONNECT_REQ_PLCI(&CMSG2) = PLCI;
_capi_put_cmsg(&CMSG2); _capi_put_cmsg(&CMSG2);
return; return;
} }
@ -4029,13 +4020,17 @@ static int pbx_capi_ect(struct ast_channel *c, char *param)
struct capi_pvt *ii = NULL; struct capi_pvt *ii = NULL;
const char *id; const char *id;
unsigned int plci = 0; unsigned int plci = 0;
unsigned int ectplci;
char *holdid;
if ((id = pbx_builtin_getvar_helper(c, "CALLERHOLDID"))) { if ((id = pbx_builtin_getvar_helper(c, "CALLERHOLDID"))) {
plci = (unsigned int)strtoul(id, NULL, 0); plci = (unsigned int)strtoul(id, NULL, 0);
} }
if (param) { holdid = strsep(&param, "|");
plci = (unsigned int)strtoul(param, NULL, 0);
if (holdid) {
plci = (unsigned int)strtoul(holdid, NULL, 0);
} }
if (!plci) { if (!plci) {
@ -4056,8 +4051,13 @@ static int pbx_capi_ect(struct ast_channel *c, char *param)
return -1; return -1;
} }
ectplci = plci;
if ((param) && (*param == 'x')) {
ectplci = i->PLCI;
}
cc_verbose(2, 1, VERBOSE_PREFIX_4 "%s: using PLCI=%#x for ECT\n", cc_verbose(2, 1, VERBOSE_PREFIX_4 "%s: using PLCI=%#x for ECT\n",
i->vname, plci); i->vname, ectplci);
if (!(capi_controllers[i->controller]->ECT)) { if (!(capi_controllers[i->controller]->ECT)) {
cc_log(LOG_WARNING, "%s: ECT for %s not supported by controller.\n", cc_log(LOG_WARNING, "%s: ECT for %s not supported by controller.\n",
@ -4082,7 +4082,7 @@ static int pbx_capi_ect(struct ast_channel *c, char *param)
cc_mutex_lock(&ii->lock); cc_mutex_lock(&ii->lock);
/* implicit ECT */ /* implicit ECT */
capi_sendf(ii, 1, CAPI_FACILITY_REQ, plci, get_capi_MessageNumber(), capi_sendf(ii, 1, CAPI_FACILITY_REQ, ectplci, get_capi_MessageNumber(),
"w(w(d))", "w(w(d))",
FACILITYSELECTOR_SUPPLEMENTARY, FACILITYSELECTOR_SUPPLEMENTARY,
0x0006, /* ECT */ 0x0006, /* ECT */
@ -4096,7 +4096,7 @@ static int pbx_capi_ect(struct ast_channel *c, char *param)
cc_mutex_unlock(&ii->lock); cc_mutex_unlock(&ii->lock);
cc_verbose(2, 1, VERBOSE_PREFIX_4 "%s: sent ECT for PLCI=%#x to PLCI=%#x\n", cc_verbose(2, 1, VERBOSE_PREFIX_4 "%s: sent ECT for PLCI=%#x to PLCI=%#x\n",
i->vname, plci, i->PLCI); i->vname, plci, ectplci);
return 0; return 0;
} }