- added capicommand to set CAPI application id into asterisk dialplan variable.

This commit is contained in:
MelwareDE 2009-01-06 14:15:47 +00:00
parent a0976a0f3e
commit eb7496a92b
3 changed files with 26 additions and 1 deletions

View File

@ -14,6 +14,7 @@ HEAD
- fixed big-endian issue for DATA_B3 messages in internal libcapi code.
- fixed NULL-pointer when no digits are signaled in DID mode.
- adapt to new Asterisk 1.6.1 changes.
- added capicommand to set CAPI application id into an Asterisk dialplan variable.
chan_capi-1.1.1

5
README
View File

@ -302,6 +302,11 @@ Progress / early-B3 on incoming calls:
Example:
exten => s,1,capicommand(progress)
Get CAPI application ID:
To store the CAPI application ID in an asterisk dialplan variable, use:
Example:
exten => s,1,capicommand(getid,CAPI_ID)
exten => s,2,NoOp(CAPI appl-id is ${CAPI_ID})
Using CLIR
==========

View File

@ -4241,6 +4241,24 @@ static int pbx_capi_call_deflect(struct ast_channel *c, char *param)
return 0;
}
/*
* store the peer for future actions
*/
static int pbx_capi_get_id(struct ast_channel *c, char *param)
{
char buffer[32];
if ((!param) || (!(*param))) {
cc_log(LOG_WARNING, "Parameter for getid missing.\n");
return -1;
}
snprintf(buffer, sizeof(buffer) - 1, "%d", capi_ApplID);
pbx_builtin_setvar_helper(c, param, buffer);
return 0;
}
/*
* store the peer for future actions
*/
@ -4760,6 +4778,7 @@ static struct capicommands_s {
int (*cmd)(struct ast_channel *, char *);
int capionly;
} capicommands[] = {
{ "getid", pbx_capi_get_id, 0 },
{ "peerlink", pbx_capi_peer_link, 0 },
{ "progress", pbx_capi_signal_progress, 1 },
{ "deflect", pbx_capi_call_deflect, 1 },
@ -5150,7 +5169,7 @@ static void *capidev_loop(void *data)
time_t lastcall = 0;
time_t newtime;
cc_log(LOG_NOTICE, "Started CAPI device thread.\n");
cc_log(LOG_NOTICE, "Started CAPI device thread for CAPI Appl-ID %d.\n", capi_ApplID);
for (/* for ever */;;) {
switch(Info = capidev_check_wait_get_cmsg(&monCMSG)) {