Allow capicommand(progress) "early-B3" for non-NT-mode incoming channels too.

This commit is contained in:
MelwareDE 2008-08-29 11:03:54 +00:00
parent c9291ed2ff
commit 54ca760357
3 changed files with 23 additions and 12 deletions

View File

@ -7,6 +7,7 @@ HEAD
- added config option for subscriber prefix. Some lines may show local calls without area code
signaled as subscriber-number. Here the complete prefix including area code must be added.
- better counting of active b-channels.
- make capicommand(progress) "early-B3" usable for non NT-mode incoming channels too.
chan_capi-1.1.1

6
README
View File

@ -290,6 +290,12 @@ Chat (MeetMe/Conference):
Possible options:
'm' = The first caller will get music-on-hold until second caller arrives.
Progress / early-B3 on incoming calls:
Activate early-B3 on incoming channels to signal progress tones
when in NT-mode or if the Telco-line supports this.
Example:
exten => s,1,capicommand(progress)
Using CLIR
==========

View File

@ -4602,21 +4602,18 @@ static int pbx_capi_realhangup(struct ast_channel *c, char *param)
/*
* set early-B3 (progress) for incoming connections
* (only for NT mode)
* (mainly for NT mode)
*/
static int pbx_capi_signal_progress(struct ast_channel *c, char *param)
{
struct capi_pvt *i = CC_CHANNEL_PVT(c);
unsigned char fac[] = "\x04\x1e\x02\x82\x88"; /* In-Band info available */
unsigned char fac[] = "\x04\x1e\x02\x82\x88"; /* In-Band info available (for NT-mode) */
if ((i->state != CAPI_STATE_DID) && (i->state != CAPI_STATE_INCALL)) {
if ((i->state != CAPI_STATE_DID) && (i->state != CAPI_STATE_INCALL) &&
(i->state != CAPI_STATE_ALERTING)) {
cc_log(LOG_DEBUG, "wrong channel state to signal PROGRESS\n");
return 0;
}
if (!(i->ntmode)) {
cc_log(LOG_WARNING, "PROGRESS sending for non NT-mode not possible\n");
return 0;
}
if ((i->isdnstate & CAPI_ISDN_STATE_B3_UP)) {
cc_verbose(4, 1, VERBOSE_PREFIX_4 "%s: signal_progress in NT: B-channel already up\n",
i->vname);
@ -4627,15 +4624,22 @@ static int pbx_capi_signal_progress(struct ast_channel *c, char *param)
i->vname);
return 0;
}
if (!(i->ntmode)) {
if (i->state != CAPI_STATE_ALERTING) {
pbx_capi_alert(c);
}
}
i->isdnstate |= CAPI_ISDN_STATE_B3_PEND;
cc_select_b(i, NULL);
/* send facility for Progress 'In-Band info available' */
capi_sendf(NULL, 0, CAPI_INFO_REQ, i->PLCI, get_capi_MessageNumber(),
"()(()()()s())",
fac
);
if ((i->ntmode)) {
/* send facility for Progress 'In-Band info available' */
capi_sendf(NULL, 0, CAPI_INFO_REQ, i->PLCI, get_capi_MessageNumber(),
"()(()()()s())",
fac
);
}
return 0;
}