diff --git a/CHANGES b/CHANGES index 966383a..baa2ae5 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ HEAD - Add 'econtransitconn' configurations parameter. Allows to preserve EC for transit connections - added variable DISCONNECT_IND_REASON to get real reason code from CAPI +- added capicommand(keypad) chan_capi-1.1.5 ------------------ diff --git a/README b/README index ca872a2..8e18263 100644 --- a/README +++ b/README @@ -188,6 +188,11 @@ Enable/Disable echocancel: econtransitconn=2 ; Deactivate EC on primary call of transit connection only econtransitconn=3 ; Do not deactivate EC on transit connections +Send Keypad Facility: + Send Keypad Faciliaty information. + Example: + exten => s,1,capicommand(keypad|) + Malicious Call Identification: Reports a call of malicious nature. Example: diff --git a/chan_capi.c b/chan_capi.c index d8ad27b..03832a8 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -5694,6 +5694,38 @@ static int pbx_capi_ect(struct ast_channel *c, char *param) return 0; } +/* + * send keypad facility + */ +static int pbx_capi_keypad(struct ast_channel *c, char *param) +{ + struct capi_pvt *i = CC_CHANNEL_PVT(c); + unsigned char buffer[32]; + int length; + + if ((!param) || (!(*param))) { + cc_log(LOG_WARNING, "Parameter for keypad missing.\n"); + return -1; + } + + length = strlen(param); + if (length > (sizeof(buffer) - 1)) + length = sizeof(buffer) - 1; + + buffer[0] = length; + memcpy(&buffer[1], param, length); + + capi_sendf(NULL, 0, CAPI_INFO_REQ, i->PLCI, get_capi_MessageNumber(), + "()(()s()()())", + buffer + ); + + cc_verbose(2, 1, VERBOSE_PREFIX_4 "%s: sent KEYPAD [%s] for PLCI=%#x\n", + i->vname, param, i->PLCI); + + return 0; +} + /* * hold a call */ @@ -6771,6 +6803,7 @@ static struct capicommands_s { { "getplci", pbx_capi_getplci, 1, 0 }, { "malicious", pbx_capi_malicious, 1, 0 }, + { "keypad", pbx_capi_keypad, 1, 0 }, { "hold", pbx_capi_hold, 1, 0 }, { "holdtype", pbx_capi_holdtype, 1, 0 }, { "retrieve", pbx_capi_retrieve, 0, 0 },