Typos and coding style.
This commit is contained in:
parent
5076ada4c7
commit
01d9dbfa34
|
@ -6,7 +6,7 @@
|
|||
| Control MWI indicators (MWI Server) |
|
||||
+-------------------------------------------------------------------+
|
||||
|
||||
Using Asterisk 1.6 or newer it iss possible to provide information about state of user
|
||||
Using Asterisk 1.6 or newer it is possible to provide information about state of user
|
||||
mailbox to ISDN phone.
|
||||
Dependent on the state of mailbox this is possible to send MWI Activate or MWI deactivate
|
||||
request to activate or to deactivate Message Waiting Indicator on the phone.
|
||||
|
@ -25,7 +25,7 @@ Where:
|
|||
controlling user number - Number where mailbox can be accessed (often same as mailbox)
|
||||
controlling user provided number - Password, used by PBX to check permissions
|
||||
|
||||
Additiona configuration parameters depends on type of PBX used and on the PBX installation:
|
||||
Additional configuration parameters depends on type of PBX used and on the PBX installation:
|
||||
mwifacptynrtype - type of MWI facility party number, 0 - unknown (default), 1 - public
|
||||
mwifacptynrton - MWI facility party number type of number and numbering plan identification
|
||||
(coding as for byte 0 of the calling party number). This byte is only valid
|
||||
|
@ -44,14 +44,14 @@ Example:
|
|||
controller=1
|
||||
mwimailbox=12345:12345:221122@other,12347:12348,12349
|
||||
|
||||
activates monitoring of therr mailboxes: 12345@other, 12347@default and 12349@default and sending
|
||||
activates monitoring of the mailboxes: 12345@other, 12347@default and 12349@default and sending
|
||||
of MWI requests using CAPI controller 1.
|
||||
|
||||
+-------------------------------------------------------------------+
|
||||
| Direct control MWI indicators (MWI Server) |
|
||||
+-------------------------------------------------------------------+
|
||||
|
||||
This iss possible to send MWI Activate and MWI deactivate messages
|
||||
This is possible to send MWI Activate and MWI deactivate messages
|
||||
directly from dialplan using capicommand(mwi, ...).
|
||||
This can be necessary if testing the system, if voice mailbox is managed
|
||||
by other software (not by asterisk) or to verify MWI parameters.
|
||||
|
|
|
@ -87,7 +87,7 @@ devices=2 ;number of concurrent calls (B-Channels) on this controller
|
|||
; (coding as for byte 1 of the calling party number).
|
||||
; This byte is only valid if byte mwifacptynrtype contains the value 1
|
||||
;mwibasicservice=1;MWI basic Service, coded in accordance with ETS 300 196 [D.5]
|
||||
;mwiinvocation=2 ;MWI invocation mode, 0 - deffered, 1 - immediate, 2 - combined,
|
||||
;mwiinvocation=2 ;MWI invocation mode, 0 - deferred, 1 - immediate, 2 - combined,
|
||||
; 65535 - suppres invocation code
|
||||
;mwimailbox=12345 ;',' separated list of mailboxes for MWI in format:
|
||||
; mailbox[:controlling user number[:controlling user provided number]][@context]
|
||||
|
|
60
chan_capi.c
60
chan_capi.c
|
@ -220,17 +220,20 @@ static int pbx_capi_indicate(struct ast_channel *c, int condition);
|
|||
static struct capi_pvt* get_active_plci(struct ast_channel *c);
|
||||
static void clear_channel_fax_loop(struct ast_channel *c, struct capi_pvt *i);
|
||||
static struct ast_channel* capidev_acquire_locks_from_thread_context(struct capi_pvt *i);
|
||||
static void pbx_capi_add_diva_protocol_independent_extension (struct capi_pvt *i,
|
||||
static void pbx_capi_add_diva_protocol_independent_extension(
|
||||
struct capi_pvt *i,
|
||||
unsigned char *facilityarray,
|
||||
struct ast_channel *c,
|
||||
const char* variable);
|
||||
static unsigned char* pbx_capi_build_facility_number (unsigned char mwifacptynrtype,
|
||||
static unsigned char* pbx_capi_build_facility_number(
|
||||
unsigned char mwifacptynrtype,
|
||||
unsigned char mwifacptynrton,
|
||||
unsigned char mwifacptynrpres,
|
||||
const char* number);
|
||||
static void pbx_capi_register_mwi(struct cc_capi_controller *controller);
|
||||
static void pbx_capi_refresh_mwi(struct cc_capi_controller *controller);
|
||||
static int pbx_capi_xmit_mwi (struct cc_capi_controller *controller,
|
||||
static int pbx_capi_xmit_mwi(
|
||||
struct cc_capi_controller *controller,
|
||||
unsigned short basicService,
|
||||
unsigned int numberOfMessages,
|
||||
unsigned short messageStatus,
|
||||
|
@ -241,7 +244,8 @@ static int pbx_capi_xmit_mwi (struct cc_capi_controller *controller,
|
|||
const unsigned char* controllingUserProvidedNumber,
|
||||
const unsigned char* timeX208);
|
||||
static int pbx_capi_mwi(struct ast_channel *c, char *info);
|
||||
static int pbx_capi_xmit_mwi_deactivate (struct cc_capi_controller *controller,
|
||||
static int pbx_capi_xmit_mwi_deactivate(
|
||||
struct cc_capi_controller *controller,
|
||||
unsigned short basicService,
|
||||
unsigned short invocationMode,
|
||||
const unsigned char* receivingUserNumber,
|
||||
|
@ -7824,7 +7828,7 @@ int mkif(struct cc_capi_conf *conf)
|
|||
/*
|
||||
Init MWI subscriptions
|
||||
*/
|
||||
if (mwiController != 0 && conf->mwimailbox != 0) {
|
||||
if ((mwiController != 0) && (conf->mwimailbox != 0)) {
|
||||
char* mailboxList = conf->mwimailbox;
|
||||
char* mailboxMember;
|
||||
|
||||
|
@ -7837,7 +7841,7 @@ int mkif(struct cc_capi_conf *conf)
|
|||
const char* mailboxNumber = strsep (&mailboxNumbers, ":");
|
||||
const char* controllingUserNumber = strsep (&mailboxNumbers, ":");
|
||||
const char* controllingUserProvidedNumber = mailboxNumbers;
|
||||
if (mailboxNumber != 0 && *mailboxNumber != 0) {
|
||||
if ((mailboxNumber != 0) && (*mailboxNumber != 0)) {
|
||||
cc_capi_mwi_mailbox_t* mwiSubscribtion = ast_malloc(sizeof(*mwiSubscribtion));
|
||||
if (mwiSubscribtion != 0) {
|
||||
mwiSubscribtion->mailboxNumber = pbx_capi_build_facility_number(conf->mwifacptynrtype, conf->mwifacptynrton, conf->mwifacptynrpres, mailboxNumber);
|
||||
|
@ -7849,9 +7853,9 @@ int mkif(struct cc_capi_conf *conf)
|
|||
mwiSubscribtion->basicService = conf->mwibasicservice;
|
||||
mwiSubscribtion->invocationMode = conf->mwiinvocation;
|
||||
|
||||
if (mwiSubscribtion->mailboxNumber == 0 || mwiSubscribtion->mailboxContext == 0 ||
|
||||
(mwiSubscribtion->controllingUserNumber == 0 && controllingUserNumber != 0) ||
|
||||
(mwiSubscribtion->controllingUserProvidedNumber == 0 && controllingUserProvidedNumber != 0)) {
|
||||
if ((mwiSubscribtion->mailboxNumber == 0) || (mwiSubscribtion->mailboxContext == 0) ||
|
||||
((mwiSubscribtion->controllingUserNumber == 0) && (controllingUserNumber != 0)) ||
|
||||
((mwiSubscribtion->controllingUserProvidedNumber == 0) && (controllingUserProvidedNumber != 0))) {
|
||||
ast_free(mwiSubscribtion->mailboxNumber);
|
||||
ast_free(mwiSubscribtion->mailboxContext);
|
||||
ast_free(mwiSubscribtion->controllingUserNumber);
|
||||
|
@ -7862,8 +7866,8 @@ int mkif(struct cc_capi_conf *conf)
|
|||
mwiSubscribtion->controller->controller,
|
||||
mwiSubscribtion->mailboxNumber + 4,
|
||||
mwiSubscribtion->mailboxContext,
|
||||
mwiSubscribtion->controllingUserNumber != 0 ? (char*)mwiSubscribtion->controllingUserNumber+4 : "",
|
||||
mwiSubscribtion->controllingUserProvidedNumber != 0 ? (char*)mwiSubscribtion->controllingUserProvidedNumber+4 : "");
|
||||
(mwiSubscribtion->controllingUserNumber != 0) ? (char*)mwiSubscribtion->controllingUserNumber+4 : "",
|
||||
(mwiSubscribtion->controllingUserProvidedNumber != 0) ? (char*)mwiSubscribtion->controllingUserProvidedNumber+4 : "");
|
||||
|
||||
memset(&mwiSubscribtion->link, 0x00, sizeof(mwiSubscribtion->link));
|
||||
AST_LIST_INSERT_TAIL(&mwiController->mwiSubscribtions, mwiSubscribtion, link);
|
||||
|
@ -7876,7 +7880,12 @@ int mkif(struct cc_capi_conf *conf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned char* pbx_capi_build_facility_number (unsigned char mwifacptynrtype, unsigned char mwifacptynrton, unsigned char mwifacptynrpres, const char* number) {
|
||||
static unsigned char* pbx_capi_build_facility_number(
|
||||
unsigned char mwifacptynrtype,
|
||||
unsigned char mwifacptynrton,
|
||||
unsigned char mwifacptynrpres,
|
||||
const char* number)
|
||||
{
|
||||
unsigned char* fnr = 0;
|
||||
|
||||
if (number != 0) {
|
||||
|
@ -9265,7 +9274,8 @@ static unsigned char* time2X208 (time_t t) {
|
|||
}
|
||||
|
||||
#if defined(CC_AST_HAS_EVENT_MWI)
|
||||
static void pbx_capi_mwi_event (const struct ast_event *event, void *userdata) {
|
||||
static void pbx_capi_mwi_event(const struct ast_event *event, void *userdata)
|
||||
{
|
||||
cc_capi_mwi_mailbox_t* mwiSubscribtion = userdata;
|
||||
/* const char *mbox_context; */
|
||||
const char *mbox_number;
|
||||
|
@ -9288,7 +9298,6 @@ static void pbx_capi_mwi_event (const struct ast_event *event, void *userdata) {
|
|||
num_messages = ast_event_get_ie_uint(event, AST_EVENT_IE_NEWMSGS);
|
||||
num_old_messages = ast_event_get_ie_uint(event, AST_EVENT_IE_OLDMSGS);
|
||||
|
||||
|
||||
t = time2X208 (time(NULL));
|
||||
|
||||
cc_verbose (4, 0, "CAPI%d MWI event for '%s@%s' %d messages\n",
|
||||
|
@ -9297,7 +9306,7 @@ static void pbx_capi_mwi_event (const struct ast_event *event, void *userdata) {
|
|||
mwiSubscribtion->mailboxContext,
|
||||
num_messages);
|
||||
|
||||
if (num_messages != 0 || num_old_messages != 0) {
|
||||
if ((num_messages != 0) || (num_old_messages != 0)) {
|
||||
ret = pbx_capi_xmit_mwi(mwiSubscribtion->controller,
|
||||
mwiSubscribtion->basicService,
|
||||
num_messages,
|
||||
|
@ -9320,7 +9329,8 @@ static void pbx_capi_mwi_event (const struct ast_event *event, void *userdata) {
|
|||
}
|
||||
#endif
|
||||
|
||||
static void pbx_capi_register_mwi (struct cc_capi_controller *controller) {
|
||||
static void pbx_capi_register_mwi(struct cc_capi_controller *controller)
|
||||
{
|
||||
cc_capi_mwi_mailbox_t* mwiSubscribtion;
|
||||
|
||||
AST_LIST_TRAVERSE(&controller->mwiSubscribtions, mwiSubscribtion, link) {
|
||||
|
@ -9343,7 +9353,8 @@ static void pbx_capi_register_mwi (struct cc_capi_controller *controller) {
|
|||
}
|
||||
}
|
||||
|
||||
static void pbx_capi_refresh_mwi (struct cc_capi_controller *controller) {
|
||||
static void pbx_capi_refresh_mwi(struct cc_capi_controller *controller)
|
||||
{
|
||||
cc_capi_mwi_mailbox_t* mwiSubscribtion;
|
||||
|
||||
AST_LIST_TRAVERSE(&controller->mwiSubscribtions, mwiSubscribtion, link) {
|
||||
|
@ -9362,7 +9373,8 @@ static void pbx_capi_refresh_mwi (struct cc_capi_controller *controller) {
|
|||
}
|
||||
}
|
||||
|
||||
static void pbx_capi_unregister_mwi(struct cc_capi_controller *controller) {
|
||||
static void pbx_capi_unregister_mwi(struct cc_capi_controller *controller)
|
||||
{
|
||||
cc_capi_mwi_mailbox_t* mwiSubscribtion;
|
||||
|
||||
AST_LIST_TRAVERSE(&controller->mwiSubscribtions, mwiSubscribtion, link) {
|
||||
|
@ -9375,7 +9387,8 @@ static void pbx_capi_unregister_mwi(struct cc_capi_controller *controller) {
|
|||
}
|
||||
}
|
||||
|
||||
static void pbx_capi_cleanup_mwi(struct cc_capi_controller *controller) {
|
||||
static void pbx_capi_cleanup_mwi(struct cc_capi_controller *controller)
|
||||
{
|
||||
cc_capi_mwi_mailbox_t* mwiSubscribtion;
|
||||
|
||||
pbx_capi_unregister_mwi(controller);
|
||||
|
@ -9389,7 +9402,8 @@ static void pbx_capi_cleanup_mwi(struct cc_capi_controller *controller) {
|
|||
}
|
||||
}
|
||||
|
||||
static int pbx_capi_xmit_mwi (struct cc_capi_controller *controller,
|
||||
static int pbx_capi_xmit_mwi(
|
||||
struct cc_capi_controller *controller,
|
||||
unsigned short basicService,
|
||||
unsigned int numberOfMessages,
|
||||
unsigned short messageStatus,
|
||||
|
@ -9421,11 +9435,13 @@ static int pbx_capi_xmit_mwi (struct cc_capi_controller *controller,
|
|||
return ((error == CapiNoError) ? 0 : -1);
|
||||
}
|
||||
|
||||
static int pbx_capi_xmit_mwi_deactivate (struct cc_capi_controller *controller,
|
||||
static int pbx_capi_xmit_mwi_deactivate(
|
||||
struct cc_capi_controller *controller,
|
||||
unsigned short basicService,
|
||||
unsigned short invocationMode,
|
||||
const unsigned char* receivingUserNumber,
|
||||
const unsigned char* controllingUserNumber) {
|
||||
const unsigned char* controllingUserNumber)
|
||||
{
|
||||
MESSAGE_EXCHANGE_ERROR error;
|
||||
_cword messageNumber = get_capi_MessageNumber();
|
||||
|
||||
|
|
Loading…
Reference in New Issue