PR#15: Send DATE/TIME to device on CONNECT when in NT-mode.

This commit is contained in:
MelwareDE 2007-10-20 08:22:53 +00:00
parent ab0108b92b
commit 442186050c
3 changed files with 43 additions and 1 deletions

View File

@ -3,6 +3,7 @@ CHANGES
HEAD
------------------
- send local DATE/TIME with CONNECT when in NT-mode.
- added transfergroup config option to set controllers allowed for transfer.
chan_capi-1.0.2

1
README
View File

@ -69,6 +69,7 @@ This chan_capi version includes:
- CCBS (call completion on busy subscriber)
- CAPI CHAT (CAPI MeetMe using onboard DSPs)
- KEYPAD digits detection
- provide DATE/TIME in NT-mode.
The Dial string

View File

@ -474,6 +474,42 @@ static void capi_channel_task(struct ast_channel *c, int task)
c->name, task);
}
/*
* Added date/time IE to facility structure
*/
static void capi_facility_add_datetime(unsigned char *facilityarray)
{
unsigned int idx;
time_t current_time;
struct tm *time_local;
unsigned char year;
if (!facilityarray)
return;
current_time = time(NULL);
time_local = localtime(&current_time);
year = time_local->tm_year;
while (year > 99) {
year -= 100;
}
idx = facilityarray[0] + 1;
facilityarray[idx++] = 0x29; /* date/time IE */
facilityarray[idx++] = 5; /* length */
facilityarray[idx++] = year;
facilityarray[idx++] = time_local->tm_mon + 1;
facilityarray[idx++] = time_local->tm_mday;
facilityarray[idx++] = time_local->tm_hour;
facilityarray[idx++] = time_local->tm_min;
facilityarray[0] = idx - 1;
return;
}
/*
* Echo cancellation is for cards w/ integrated echo cancellation only
* (i.e. Eicon active cards support it)
@ -1385,6 +1421,11 @@ static int capi_send_answer(struct ast_channel *c, _cstruct b3conf)
facilityarray = alloca(CAPI_MAX_FACILITYDATAARRAY_SIZE);
cc_qsig_add_call_answer_data(facilityarray, i, c);
if (i->ntmode) {
/* in NT-mode we send the current local time to device */
capi_facility_add_datetime(facilityarray);
}
if (capi_sendf(NULL, 0, CAPI_CONNECT_RESP, i->PLCI, i->MessageNumber,
"w(wwwssss)s()()(()()()s())",
0, /* accept call */
@ -2792,7 +2833,6 @@ static void capidev_handle_info_indication(_cmsg *CMSG, unsigned int PLCI, unsig
INFO_IND_INFOELEMENT(CMSG)[1], INFO_IND_INFOELEMENT(CMSG)[2],
INFO_IND_INFOELEMENT(CMSG)[3], INFO_IND_INFOELEMENT(CMSG)[4],
INFO_IND_INFOELEMENT(CMSG)[5]);
capidev_sendback_info(i, CMSG);
break;
case 0x002c: /* Keypad facility */
cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: info element KEYPAD FACILITY\n",