Set temporary holdtype via capicommand().

This commit is contained in:
MelwareDE 2005-08-25 19:30:31 +00:00
parent d5490d3ac5
commit 7ee382db9e
2 changed files with 40 additions and 0 deletions

12
README
View File

@ -129,6 +129,18 @@ Hold:
or
exten => s,1,capicommand(hold|MYHOLDVAR)
Holdtype:
Set the type of 'hold'. When Asterisk wants to put the call on hold, the specified method
will be used.
Example:
exten => s,1,capicommand(holdtype|local) ;no hold, Asterisk can play MOH
or
exten => s,1,capicommand(holdtype|hold) ;ISDN-HOLD
or
; not yet implemented
exten => s,1,capicommand(holdtype|notify) ;notify the peer only, Asterisk can play MOH
Retrieve:
Gets back the holded call. An optional parameter is the reference ID of the call
on hold.

View File

@ -3276,6 +3276,32 @@ static int capi_echosquelch(struct ast_channel *c, char *param)
return 0;
}
/*
* set holdtype
*/
static int capi_holdtype(struct ast_channel *c, char *param)
{
struct ast_capi_pvt *i = CC_AST_CHANNEL_PVT(c);
if (!param) {
ast_log(LOG_WARNING, "Parameter for holdtype missing.\n");
return -1;
}
if (!strcasecmp(param, "hold")) {
i->doholdtype = CC_HOLDTYPE_HOLD;
} else if (!strcasecmp(param, "notify")) {
i->doholdtype = CC_HOLDTYPE_NOTIFY;
} else if (!strcasecmp(param, "local")) {
i->doholdtype = CC_HOLDTYPE_LOCAL;
} else {
ast_log(LOG_WARNING, "Parameter for holdtype invalid.\n");
return -1;
}
cc_ast_verbose(2, 1, VERBOSE_PREFIX_4 "%s: holdtype switched %s\n",
i->name, i->doES ? "ON":"OFF");
return 0;
}
/*
* set early-B3 for incoming connections
* (only for NT mode)
@ -3361,6 +3387,8 @@ static int capicommand_exec(struct ast_channel *chan, void *data)
res = capi_malicious(chan, params);
} else if (!strcasecmp(command, "hold")) {
res = capi_hold(chan, params);
} else if (!strcasecmp(command, "holdtype")) {
res = capi_holdtype(chan, params);
} else if (!strcasecmp(command, "retrieve")) {
res = capi_retrieve(chan, params);
} else if (!strcasecmp(command, "ect")) {