String conversion of debug/verbose messages to use external changes.

This commit is contained in:
MelwareDE 2008-02-24 12:57:52 +00:00
parent 42d240e32e
commit cb12234f83
6 changed files with 162 additions and 145 deletions

View File

@ -48,18 +48,18 @@
unsigned capi_ApplID = CAPI_APPLID_UNUSED;
static const char tdesc[] = "Common ISDN API Driver (" CC_VERSION ")";
static const char channeltype[] = "CAPI";
static const char channeltype[] = CC_MESSAGE_BIGNAME;
#ifdef CC_AST_HAS_VERSION_1_4
#define AST_MODULE "chan_capi"
#else
static char *ccdesc = "Common ISDN API for Asterisk";
#endif
static char *commandtdesc = "CAPI command interface.\n"
static char *commandtdesc = CC_MESSAGE_BIGNAME " command interface.\n"
"The dial command:\n"
"Dial(CAPI/g<group>/[<callerid>:]<destination>[/<params>])\n"
"Dial(CAPI/contr<controller>/[<callerid>:]<destination>[/<params>])\n"
"Dial(CAPI/<interface-name>/[<callerid>:]<destination>[/<params>])\n"
"Dial(" CC_MESSAGE_BIGNAME "/g<group>/[<callerid>:]<destination>[/<params>])\n"
"Dial(" CC_MESSAGE_BIGNAME "/contr<controller>/[<callerid>:]<destination>[/<params>])\n"
"Dial(" CC_MESSAGE_BIGNAME "/<interface-name>/[<callerid>:]<destination>[/<params>])\n"
"\"params\" can be:\n"
"early B3:\"b\"=always, \"B\"=on successful calls only\n"
"\"d\":use callerID from capi.conf, \"o\":overlap sending number\n"
@ -76,8 +76,8 @@ static char *commandtdesc = "CAPI command interface.\n"
"\"retrieve|${MYHOLDVAR}\" gets back the held call\n"
"\"ect|${MYHOLDVAR})\" explicit call transfer of call on hold\n"
"\"3pty_begin|${MYHOLDVAR})\" Three-Party-Conference (3PTY) with active and held call\n"
"\"receivefax|filename|stationID|headline\" receive a CAPIfax\n"
"\"sendfax|filename.sff|stationID|headline\" send a CAPIfax\n"
"\"receivefax|filename|stationID|headline\" receive a " CC_MESSAGE_BIGNAME " fax\n"
"\"sendfax|filename.sff|stationID|headline\" send a " CC_MESSAGE_BIGNAME " fax\n"
"\"qsig_ssct|cidsrc|ciddst\" QSIG single step call transfer\n"
"\"qsig_ct|cidsrc|ciddst|marker|waitconnect\" QSIG call transfer\n"
"\"qsig_callmark|marker\" marks a QSIG call for later identification\n"
@ -93,10 +93,10 @@ static char *commandtdesc = "CAPI command interface.\n"
"Asterisk variables used/set by chan_capi:\n"
"BCHANNELINFO,CALLEDTON,_CALLERHOLDID,CALLINGSUBADDRESS,CALLEDSUBADDRESS\n"
"CONNECTEDNUMBER,FAXEXTEN,PRI_CAUSE,REDIRECTINGNUMBER,REDIRECTREASON\n"
"!!! for more details and samples, check the README of chan-capi !!!\n";
"!!! for more details and samples, check the README of chan_capi !!!\n";
static char *commandapp = "capiCommand";
static char *commandsynopsis = "Execute special CAPI commands";
static char *commandapp = "capicommand";
static char *commandsynopsis = "Execute special chan_capi commands";
#ifndef CC_AST_HAS_VERSION_1_4
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
@ -648,7 +648,7 @@ static int local_queue_frame(struct capi_pvt *i, struct ast_frame *f)
}
if ((capidebug) && (f->frametype != AST_FRAME_VOICE)) {
ast_frame_dump(i->vname, f, VERBOSE_PREFIX_3 "CAPI queue frame:");
ast_frame_dump(i->vname, f, VERBOSE_PREFIX_3 "chan_capi queue frame:");
}
if ((f->frametype == AST_FRAME_CONTROL) &&
@ -685,7 +685,7 @@ static void update_channel_name(struct capi_pvt *i)
{
char name[AST_CHANNEL_NAME];
snprintf(name, sizeof(name) - 1, "CAPI/%s/%s-%x",
snprintf(name, sizeof(name) - 1, CC_MESSAGE_BIGNAME "/%s/%s-%x",
i->vname, i->dnid, capi_counter++);
if (i->owner) {
ast_change_name(i->owner, name);
@ -1117,8 +1117,8 @@ static int pbx_capi_hangup(struct ast_channel *c)
state = i->state;
cc_verbose(3, 0, VERBOSE_PREFIX_2 "%s: CAPI Hangingup for PLCI=%#x in state %d\n",
i->vname, i->PLCI, state);
cc_verbose(3, 0, VERBOSE_PREFIX_2 "%s: " CC_MESSAGE_BIGNAME
" Hangingup for PLCI=%#x in state %d\n", i->vname, i->PLCI, state);
/* are we down, yet? */
if (state != CAPI_STATE_DISCONNECTED) {
@ -1910,7 +1910,7 @@ static struct ast_channel *capi_new(struct capi_pvt *i, int state)
#ifdef CC_AST_HAS_EXT2_CHAN_ALLOC
i->accountcode, i->dnid, i->context, i->amaflags,
#endif
"CAPI/%s/%s-%x", i->vname, i->dnid, capi_counter++);
CC_MESSAGE_BIGNAME "/%s/%s-%x", i->vname, i->dnid, capi_counter++);
#else
tmp = ast_channel_alloc(0);
#endif
@ -1922,10 +1922,10 @@ static struct ast_channel *capi_new(struct capi_pvt *i, int state)
#ifndef CC_AST_HAS_EXT_CHAN_ALLOC
#ifdef CC_AST_HAS_STRINGFIELD_IN_CHANNEL
ast_string_field_build(tmp, name, "CAPI/%s/%s-%x",
ast_string_field_build(tmp, name, CC_MESSAGE_BIGNAME "/%s/%s-%x",
i->vname, i->dnid, capi_counter++);
#else
snprintf(tmp->name, sizeof(tmp->name) - 1, "CAPI/%s/%s-%x",
snprintf(tmp->name, sizeof(tmp->name) - 1, CC_MESSAGE_BIGNAME "/%s/%s-%x",
i->vname, i->dnid, capi_counter++);
#endif
#endif
@ -2075,15 +2075,15 @@ pbx_capi_request(const char *type, int format, void *data, int *cause)
if (interface[0] == 'g') {
capigroup = ast_get_group(interface + 1);
cc_verbose(1, 1, VERBOSE_PREFIX_4 "capi request group = %d\n",
cc_verbose(1, 1, VERBOSE_PREFIX_4 CC_MESSAGE_NAME " request group = %d\n",
(unsigned int)capigroup);
} else if (!strncmp(interface, "contr", 5)) {
controller = atoi(interface + 5);
cc_verbose(1, 1, VERBOSE_PREFIX_4 "capi request controller = %d\n",
cc_verbose(1, 1, VERBOSE_PREFIX_4 CC_MESSAGE_NAME " request controller = %d\n",
controller);
} else if (!strncmp(interface, "ccbs", 4)) {
ccbsnrhandle = (unsigned int)strtoul(dest, NULL, 0);
cc_verbose(1, 1, VERBOSE_PREFIX_4 "capi request ccbs handle = %u\n",
cc_verbose(1, 1, VERBOSE_PREFIX_4 CC_MESSAGE_NAME " request ccbs handle = %u\n",
ccbsnrhandle);
if ((controller = capi_get_ccbsnrcontroller(ccbsnrhandle)) == 0) {
cc_verbose(2, 0, VERBOSE_PREFIX_3 "didn't find CCBS handle %u\n",
@ -2092,7 +2092,7 @@ pbx_capi_request(const char *type, int format, void *data, int *cause)
return NULL;
}
} else {
cc_verbose(1, 1, VERBOSE_PREFIX_4 "capi request for interface '%s'\n",
cc_verbose(1, 1, VERBOSE_PREFIX_4 CC_MESSAGE_NAME " request for interface '%s'\n",
interface);
}
@ -2126,7 +2126,7 @@ pbx_capi_request(const char *type, int format, void *data, int *cause)
cc_copy_string(i->dnid, dest, sizeof(i->dnid));
tmp = capi_new(i, AST_STATE_RESERVED);
if (!tmp) {
cc_log(LOG_ERROR, "cannot create new capi channel\n");
cc_log(LOG_ERROR, "cannot create new " CC_MESSAGE_NAME " channel\n");
interface_cleanup(i);
}
i->PLCI = 0;
@ -2136,8 +2136,8 @@ pbx_capi_request(const char *type, int format, void *data, int *cause)
return tmp;
}
cc_mutex_unlock(&iflock);
cc_verbose(2, 0, VERBOSE_PREFIX_3 "didn't find capi device for interface '%s'\n",
interface);
cc_verbose(2, 0, VERBOSE_PREFIX_3 "didn't find " CC_MESSAGE_NAME
" device for interface '%s'\n", interface);
*cause = AST_CAUSE_REQUESTED_CHAN_UNAVAIL;
return NULL;
}
@ -2190,7 +2190,7 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
char buffer[CAPI_MAX_STRING];
if (!data) { /* no data implies no filename or anything is present */
cc_log(LOG_WARNING, "capi receivefax requires a filename\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " receivefax requires a filename\n");
return -1;
}
@ -2206,7 +2206,7 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
if (!options)
options = emptyid;
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi receivefax: '%s' '%s' '%s' '%s'\n",
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: '%s' '%s' '%s' '%s'\n",
filename, stationid, headline, options);
/* parse the options */
@ -2214,7 +2214,7 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
switch (*options) {
case 'k': /* keepbadfax */
cc_verbose(3, 1,
VERBOSE_PREFIX_3 "capi receivefax: if fax is bad, "
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: if fax is bad, "
"file won't be deleted.\n");
keepbadfax = 1;
break;
@ -2249,7 +2249,7 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
break;
default:
i->FaxState &= ~CAPI_FAX_STATE_ACTIVE;
cc_log(LOG_WARNING, "capi receive fax in wrong state (%d)\n",
cc_log(LOG_WARNING, CC_MESSAGE_NAME " receive fax in wrong state (%d)\n",
i->state);
return -1;
}
@ -2258,7 +2258,7 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
if (ast_safe_sleep_conditional(c, 1000, capi_tell_fax_finish, i) != 0) {
/* we got a hangup */
cc_verbose(3, 1,
VERBOSE_PREFIX_3 "capi receivefax: hangup.\n");
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: hangup.\n");
break;
}
}
@ -2281,16 +2281,17 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
if (res != 0) {
cc_verbose(2, 0,
VERBOSE_PREFIX_1 "capi receivefax: fax receive failed reason=0x%04x reasonB3=0x%04x\n",
VERBOSE_PREFIX_1 CC_MESSAGE_NAME
" receivefax: fax receive failed reason=0x%04x reasonB3=0x%04x\n",
i->reason, i->reasonb3);
if (!keepbadfax) {
cc_verbose(3, 1,
VERBOSE_PREFIX_3 "capi receivefax: removing fax file.\n");
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: removing fax file.\n");
unlink(filename);
}
} else {
cc_verbose(2, 0,
VERBOSE_PREFIX_1 "capi receivefax: fax receive successful.\n");
VERBOSE_PREFIX_1 CC_MESSAGE_NAME " receivefax: fax receive successful.\n");
}
snprintf(buffer, CAPI_MAX_STRING-1, "%d", res);
pbx_builtin_setvar_helper(c, "FAXSTATUS", buffer);
@ -2310,7 +2311,7 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
char buffer[CAPI_MAX_STRING];
if (!data) { /* no data implies no filename or anything is present */
cc_log(LOG_WARNING, "capi sendfax requires a filename\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " sendfax requires a filename\n");
return -1;
}
@ -2323,7 +2324,7 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
if (!headline)
headline = emptyid;
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi sendfax: '%s' '%s' '%s'\n",
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME " sendfax: '%s' '%s' '%s'\n",
filename, stationid, headline);
capi_wait_for_answered(i);
@ -2349,7 +2350,7 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
break;
default:
i->FaxState &= ~CAPI_FAX_STATE_ACTIVE;
cc_log(LOG_WARNING, "capi send fax in wrong state (%d)\n",
cc_log(LOG_WARNING, CC_MESSAGE_NAME " send fax in wrong state (%d)\n",
i->state);
return -1;
}
@ -2357,7 +2358,7 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
if (ast_safe_sleep_conditional(c, 1000, capi_tell_fax_finish, i) != 0) {
/* we got a hangup */
cc_verbose(3, 1,
VERBOSE_PREFIX_3 "capi sendfax: hangup.\n");
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " sendfax: hangup.\n");
break;
}
}
@ -2375,11 +2376,12 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
if (res != 0) {
cc_verbose(2, 0,
VERBOSE_PREFIX_1 "capi sendfax: fax send failed reason=0x%04x reasonB3=0x%04x\n",
VERBOSE_PREFIX_1 CC_MESSAGE_NAME
" sendfax: fax send failed reason=0x%04x reasonB3=0x%04x\n",
i->reason, i->reasonb3);
} else {
cc_verbose(2, 0,
VERBOSE_PREFIX_1 "capi sendfax: fax sent successful.\n");
VERBOSE_PREFIX_1 CC_MESSAGE_NAME " sendfax: fax sent successful.\n");
}
snprintf(buffer, CAPI_MAX_STRING-1, "%d", res);
pbx_builtin_setvar_helper(c, "FAXSTATUS", buffer);
@ -3918,7 +3920,7 @@ void capidev_handle_connection_conf(struct capi_pvt **i, unsigned int PLCI,
struct ast_frame fr = { AST_FRAME_CONTROL, AST_CONTROL_BUSY, };
if (*i) {
cc_log(LOG_ERROR, "CAPI: CONNECT_CONF for already "
cc_log(LOG_ERROR, CC_MESSAGE_BIGNAME ": CONNECT_CONF for already "
"defined interface received\n");
return;
}
@ -4082,7 +4084,7 @@ static void capidev_handle_msg(_cmsg *CMSG)
break;
default:
cc_log(LOG_ERROR, "CAPI: Command=%s,0x%04x",
cc_log(LOG_ERROR, CC_MESSAGE_BIGNAME ": Command=%s,0x%04x",
capi_command_to_string(wCmd), wCmd);
break;
}
@ -4095,8 +4097,8 @@ static void capidev_handle_msg(_cmsg *CMSG)
}
if (i == NULL) {
cc_verbose(2, 1, VERBOSE_PREFIX_4
"CAPI: Command=%s,0x%04x: no interface for PLCI="
cc_verbose(2, 1, VERBOSE_PREFIX_4 CC_MESSAGE_BIGNAME
": Command=%s,0x%04x: no interface for PLCI="
"%#x, MSGNUM=%#x!\n", capi_command_to_string(wCmd),
wCmd, PLCI, wMsgNum);
} else {
@ -4118,18 +4120,21 @@ static int pbx_capi_call_deflect(struct ast_channel *c, char *param)
char facnumber[32];
if (!param) {
cc_log(LOG_WARNING, "capi deflection requires an argument (destination phone number)\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME
" deflection requires an argument (destination phone number)\n");
return -1;
}
number = strsep(&param, "|");
numberlen = strlen(number);
if (!numberlen) {
cc_log(LOG_WARNING, "capi deflection requires an argument (destination phone number)\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME
" deflection requires an argument (destination phone number)\n");
return -1;
}
if (numberlen > 35) {
cc_log(LOG_WARNING, "capi deflection does only support phone number up to 35 digits\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME
" deflection does only support phone number up to 35 digits\n");
return -1;
}
if (!(capi_controllers[i->controller]->CD)) {
@ -4188,7 +4193,7 @@ static int pbx_capi_peer_link(struct ast_channel *c, char *param)
pbx_builtin_setvar_helper(c, "_CAPIPEERLINKID", buffer);
}
cc_verbose(2, 1, VERBOSE_PREFIX_3 "Added %s as CAPI peer link.\n",
cc_verbose(2, 1, VERBOSE_PREFIX_3 "Added %s as " CC_MESSAGE_BIGNAME " peer link.\n",
c->name);
return 0;
@ -4222,7 +4227,7 @@ static int pbx_capi_retrieve(struct ast_channel *c, char *param)
}
if (!i) {
cc_log(LOG_WARNING, "%s is not valid or not on capi hold to retrieve!\n",
cc_log(LOG_WARNING, "%s is not valid or not on hold to retrieve!\n",
c->name);
return 0;
}
@ -4555,8 +4560,8 @@ static int pbx_capi_realhangup(struct ast_channel *c, char *param)
cc_mutex_unlock(&iflock);
if ((i) && (i->state == CAPI_STATE_DISCONNECTING)) {
cc_verbose(3, 1, VERBOSE_PREFIX_2 "%s: capi command hangup PLCI=0x%#x.\n",
i->vname, i->PLCI);
cc_verbose(3, 1, VERBOSE_PREFIX_2 "%s: " CC_MESSAGE_NAME
" command hangup PLCI=0x%#x.\n", i->vname, i->PLCI);
capi_disconnect(i);
}
@ -4730,7 +4735,7 @@ static int pbx_capicommand_exec(struct ast_channel *chan, void *data)
struct capicommands_s *capicmd = &capicommands[0];
if (!data) {
cc_log(LOG_WARNING, "capiCommand requires arguments\n");
cc_log(LOG_WARNING, "capicommand requires arguments\n");
return -1;
}
@ -4744,7 +4749,7 @@ static int pbx_capicommand_exec(struct ast_channel *chan, void *data)
stringp = s;
command = strsep(&stringp, "|");
params = stringp;
cc_verbose(2, 1, VERBOSE_PREFIX_3 "capiCommand: '%s' '%s'\n",
cc_verbose(2, 1, VERBOSE_PREFIX_3 "capicommand: '%s' '%s'\n",
command, params);
while(capicmd->cmd) {
@ -4758,7 +4763,7 @@ static int pbx_capicommand_exec(struct ast_channel *chan, void *data)
#else
LOCAL_USER_REMOVE(u);
#endif
cc_log(LOG_WARNING, "Unknown command '%s' for capiCommand\n",
cc_log(LOG_WARNING, "Unknown command '%s' for capicommand\n",
command);
return -1;
}
@ -4769,7 +4774,8 @@ static int pbx_capicommand_exec(struct ast_channel *chan, void *data)
#else
LOCAL_USER_REMOVE(u);
#endif
cc_log(LOG_WARNING, "capiCommand works on CAPI channels only, check your extensions.conf!\n");
cc_log(LOG_WARNING, "This capicommand works on " CC_MESSAGE_NAME
" channels only, check your extensions.conf!\n");
return -1;
}
@ -4915,7 +4921,8 @@ static int pbx_capi_devicestate(void *data)
struct capi_pvt *i;
if (!data) {
cc_verbose(3, 1, VERBOSE_PREFIX_2 "No data for capi_devicestate\n");
cc_verbose(3, 1, VERBOSE_PREFIX_2 "No data for "
CC_MESSAGE_NAME " devicestate\n");
return res;
}
@ -4964,7 +4971,7 @@ static int pbx_capi_devicestate(void *data)
/* AST_DEVICE_BUSY */
/* AST_DEVICE_UNAVAILABLE */
}
cc_verbose(3, 1, VERBOSE_PREFIX_4 "CAPI devicestate requested for %s is '%s'\n",
cc_verbose(3, 1, VERBOSE_PREFIX_4 "chan_capi devicestate requested for %s is '%s'\n",
(char *)data, devstate2str(res));
}
@ -5259,7 +5266,8 @@ int mkif(struct cc_capi_conf *conf)
tmp->next = capi_iflist; /* prepend */
capi_iflist = tmp;
cc_verbose(2, 0, VERBOSE_PREFIX_3 "capi %c %s (%s:%s) contr=%d devs=%d EC=%d,opt=%d,tail=%d\n",
cc_verbose(2, 0, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
" %c %s (%s:%s) contr=%d devs=%d EC=%d,opt=%d,tail=%d\n",
(tmp->channeltype == CAPI_CHANNELTYPE_B)? 'B' : 'D',
tmp->vname, tmp->incomingmsn, tmp->context, tmp->controller,
conf->devices, tmp->doEC, tmp->ecOption, tmp->ecTail);
@ -5433,43 +5441,43 @@ static char *show_isdnstate(unsigned int isdnstate, char *str)
* usages
*/
static char info_usage[] =
"Usage: capi info\n"
"Usage: " CC_MESSAGE_NAME " info\n"
" Show info about B channels on controllers.\n";
static char show_channels_usage[] =
"Usage: capi show channels\n"
"Usage: " CC_MESSAGE_NAME " show channels\n"
" Show info about B channels.\n";
static char debug_usage[] =
"Usage: capi debug\n"
" Enables dumping of CAPI packets for debugging purposes\n";
"Usage: " CC_MESSAGE_NAME " debug\n"
" Enables dumping of " CC_MESSAGE_BIGNAME " packets for debugging purposes\n";
static char no_debug_usage[] =
"Usage: capi no debug\n"
" Disables dumping of CAPI packets for debugging purposes\n";
"Usage: " CC_MESSAGE_NAME " no debug\n"
" Disables dumping of " CC_MESSAGE_BIGNAME " packets for debugging purposes\n";
static char qsig_debug_usage[] =
"Usage: capi qsig debug\n"
" Enables dumping of CAPI QSIG facilities for debugging purposes\n";
"Usage: " CC_MESSAGE_NAME " qsig debug\n"
" Enables dumping of QSIG facilities for debugging purposes\n";
static char qsig_no_debug_usage[] =
"Usage: capi qsig no debug\n"
" Disables dumping of CAPI QSIG facilities for debugging purposes\n";
"Usage: " CC_MESSAGE_NAME " qsig no debug\n"
" Disables dumping of QSIG facilities for debugging purposes\n";
#ifndef CC_AST_HAS_VERSION_1_6
static
#endif
char chatinfo_usage[] =
"Usage: capi chatinfo\n"
"Usage: " CC_MESSAGE_NAME " chatinfo\n"
" Show info about chat status.\n";
#define CC_CLI_TEXT_INFO "Show CAPI info"
#define CC_CLI_TEXT_INFO "Show " CC_MESSAGE_BIGNAME " info"
#define CC_CLI_TEXT_SHOW_CHANNELS "Show B-channel info"
#define CC_CLI_TEXT_DEBUG "Enable CAPI debugging"
#define CC_CLI_TEXT_NO_DEBUG "Disable CAPI debugging"
#define CC_CLI_TEXT_QSIG_DEBUG "Enable CAPI QSIG debugging"
#define CC_CLI_TEXT_QSIG_NO_DEBUG "Disable CAPI QSIG debugging"
#define CC_CLI_TEXT_CHATINFO "Show CAPI chat info"
#define CC_CLI_TEXT_DEBUG "Enable " CC_MESSAGE_BIGNAME " debugging"
#define CC_CLI_TEXT_NO_DEBUG "Disable " CC_MESSAGE_BIGNAME " debugging"
#define CC_CLI_TEXT_QSIG_DEBUG "Enable QSIG debugging"
#define CC_CLI_TEXT_QSIG_NO_DEBUG "Disable QSIG debugging"
#define CC_CLI_TEXT_CHATINFO "Show " CC_MESSAGE_BIGNAME " chat info"
/*
* do command capi show channels
@ -5488,7 +5496,7 @@ static int pbxcli_capi_show_channels(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi show channels";
e->command = CC_MESSAGE_NAME " show channels";
e->usage = show_channels_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -5501,7 +5509,7 @@ static int pbxcli_capi_show_channels(int fd, int argc, char *argv[])
return RESULT_SHOWUSAGE;
#endif
ast_cli(fd, "CAPI B-channel information:\n");
ast_cli(fd, CC_MESSAGE_BIGNAME " B-channel information:\n");
ast_cli(fd, "Line-Name NTmode state i/o bproto isdnstate ton number\n");
ast_cli(fd, "----------------------------------------------------------------\n");
@ -5563,7 +5571,7 @@ static int pbxcli_capi_info(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi info";
e->command = CC_MESSAGE_NAME " info";
e->usage = info_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -5605,7 +5613,7 @@ static int pbxcli_capi_do_debug(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi debug";
e->command = CC_MESSAGE_NAME " debug";
e->usage = debug_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -5618,7 +5626,7 @@ static int pbxcli_capi_do_debug(int fd, int argc, char *argv[])
#endif
capidebug = 1;
ast_cli(fd, "CAPI Debugging Enabled\n");
ast_cli(fd, CC_MESSAGE_BIGNAME " Message Debugging Enabled\n");
#ifdef CC_AST_HAS_VERSION_1_6
return CLI_SUCCESS;
@ -5640,7 +5648,7 @@ static int pbxcli_capi_no_debug(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi no debug";
e->command = CC_MESSAGE_NAME " no debug";
e->usage = no_debug_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -5653,7 +5661,7 @@ static int pbxcli_capi_no_debug(int fd, int argc, char *argv[])
#endif
capidebug = 0;
ast_cli(fd, "CAPI Debugging Disabled\n");
ast_cli(fd, CC_MESSAGE_BIGNAME " Message Debugging Disabled\n");
#ifdef CC_AST_HAS_VERSION_1_6
return CLI_SUCCESS;
@ -5675,7 +5683,7 @@ static int pbxcli_capi_qsig_do_debug(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi qsig debug";
e->command = CC_MESSAGE_NAME " qsig debug";
e->usage = qsig_debug_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -5688,7 +5696,7 @@ static int pbxcli_capi_qsig_do_debug(int fd, int argc, char *argv[])
#endif
capiqsigdebug = 1;
ast_cli(fd, "CAPI QSIG Debugging Enabled\n");
ast_cli(fd, "QSIG Debugging Enabled\n");
#ifdef CC_AST_HAS_VERSION_1_6
return CLI_SUCCESS;
@ -5710,7 +5718,7 @@ static int pbxcli_capi_qsig_no_debug(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi qsig no debug";
e->command = CC_MESSAGE_NAME " qsig no debug";
e->usage = qsig_no_debug_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -5723,7 +5731,7 @@ static int pbxcli_capi_qsig_no_debug(int fd, int argc, char *argv[])
#endif
capiqsigdebug = 0;
ast_cli(fd, "CAPI QSIG Debugging Disabled\n");
ast_cli(fd, "QSIG Debugging Disabled\n");
#ifdef CC_AST_HAS_VERSION_1_6
return CLI_SUCCESS;
@ -5747,19 +5755,19 @@ static struct ast_cli_entry cc_cli_cmd[] = {
};
#else
static struct ast_cli_entry cli_info =
{ { "capi", "info", NULL }, pbxcli_capi_info, CC_CLI_TEXT_INFO, info_usage };
{ { CC_MESSAGE_NAME, "info", NULL }, pbxcli_capi_info, CC_CLI_TEXT_INFO, info_usage };
static struct ast_cli_entry cli_show_channels =
{ { "capi", "show", "channels", NULL }, pbxcli_capi_show_channels, CC_CLI_TEXT_SHOW_CHANNELS, show_channels_usage };
{ { CC_MESSAGE_NAME, "show", "channels", NULL }, pbxcli_capi_show_channels, CC_CLI_TEXT_SHOW_CHANNELS, show_channels_usage };
static struct ast_cli_entry cli_debug =
{ { "capi", "debug", NULL }, pbxcli_capi_do_debug, CC_CLI_TEXT_DEBUG, debug_usage };
{ { CC_MESSAGE_NAME, "debug", NULL }, pbxcli_capi_do_debug, CC_CLI_TEXT_DEBUG, debug_usage };
static struct ast_cli_entry cli_no_debug =
{ { "capi", "no", "debug", NULL }, pbxcli_capi_no_debug, CC_CLI_TEXT_NO_DEBUG, no_debug_usage };
{ { CC_MESSAGE_NAME, "no", "debug", NULL }, pbxcli_capi_no_debug, CC_CLI_TEXT_NO_DEBUG, no_debug_usage };
static struct ast_cli_entry cli_qsig_debug =
{ { "capi", "qsig", "debug", NULL }, pbxcli_capi_qsig_do_debug, CC_CLI_TEXT_QSIG_DEBUG, qsig_debug_usage };
{ { CC_MESSAGE_NAME, "qsig", "debug", NULL }, pbxcli_capi_qsig_do_debug, CC_CLI_TEXT_QSIG_DEBUG, qsig_debug_usage };
static struct ast_cli_entry cli_qsig_no_debug =
{ { "capi", "qsig", "no", "debug", NULL }, pbxcli_capi_qsig_no_debug, CC_CLI_TEXT_QSIG_NO_DEBUG, qsig_no_debug_usage };
{ { CC_MESSAGE_NAME, "qsig", "no", "debug", NULL }, pbxcli_capi_qsig_no_debug, CC_CLI_TEXT_QSIG_NO_DEBUG, qsig_no_debug_usage };
static struct ast_cli_entry cli_chatinfo =
{ { "capi", "chatinfo", NULL }, pbxcli_capi_chatinfo, CC_CLI_TEXT_CHATINFO, chatinfo_usage };
{ { CC_MESSAGE_NAME, "chatinfo", NULL }, pbxcli_capi_chatinfo, CC_CLI_TEXT_CHATINFO, chatinfo_usage };
#endif
const struct ast_channel_tech capi_tech = {
@ -5832,7 +5840,7 @@ static int cc_init_capi(void)
unsigned int privateoptions;
if (capi20_isinstalled() != 0) {
cc_log(LOG_WARNING, "CAPI not installed, CAPI disabled!\n");
cc_log(LOG_WARNING, "CAPI not installed, chan_capi disabled!\n");
return -1;
}
@ -5885,7 +5893,7 @@ static int cc_init_capi(void)
cp->nfreebchannels = read_capi_word(&profile.nbchannels);
if (profile.globaloptions & 0x08) {
#endif
cc_verbose(3, 0, VERBOSE_PREFIX_3 "CAPI/contr%d supports DTMF\n",
cc_verbose(3, 0, VERBOSE_PREFIX_3 "Contr%d supports DTMF\n",
controller);
cp->dtmf = 1;
}
@ -5896,7 +5904,7 @@ static int cc_init_capi(void)
#else
if (profile.globaloptions2 & 0x01) {
#endif
cc_verbose(3, 0, VERBOSE_PREFIX_3 "CAPI/contr%d supports broadband (or old echo-cancel)\n",
cc_verbose(3, 0, VERBOSE_PREFIX_3 "Contr%d supports broadband (or old echo-cancel)\n",
controller);
cp->broadband = 1;
}
@ -5906,7 +5914,7 @@ static int cc_init_capi(void)
#else
if (profile.globaloptions2 & 0x02) {
#endif
cc_verbose(3, 0, VERBOSE_PREFIX_3 "CAPI/contr%d supports echo cancellation\n",
cc_verbose(3, 0, VERBOSE_PREFIX_3 "Contr%d supports echo cancellation\n",
controller);
cp->echocancel = 1;
}
@ -5924,20 +5932,20 @@ static int cc_init_capi(void)
#else
if (profile.globaloptions & 0x80) {
#endif
cc_verbose(3, 0, VERBOSE_PREFIX_3 "CAPI/contr%d supports line interconnect\n",
cc_verbose(3, 0, VERBOSE_PREFIX_3 "Contr%d supports line interconnect\n",
controller);
cp->lineinterconnect = 1;
}
if (cp->sservices == 1) {
cc_verbose(3, 0, VERBOSE_PREFIX_3 "CAPI/contr%d supports supplementary services\n",
cc_verbose(3, 0, VERBOSE_PREFIX_3 "Contr%d supports supplementary services\n",
controller);
supported_sservices(cp);
}
/* New profile options for e.g. RTP with Dialogic Diva */
privateoptions = read_capi_dword(&profile.manufacturer[0]);
cc_verbose(3, 0, VERBOSE_PREFIX_3 "CAPI/contr%d private options=0x%08x\n",
cc_verbose(3, 0, VERBOSE_PREFIX_3 "Contr%d private options=0x%08x\n",
controller, privateoptions);
if (privateoptions & 0x02) {
cc_verbose(3, 0, VERBOSE_PREFIX_4 "VoIP/RTP is supported\n");
@ -5967,7 +5975,7 @@ static int cc_post_init_capi(void)
/* if at least one line wants RTP, we need to re-register with
bigger block size for RTP-header */
if (capi_controllers[i->controller]->rtpcodec & i->capability) {
cc_verbose(3, 0, VERBOSE_PREFIX_4 "at least one CAPI controller wants RTP.\n");
cc_verbose(3, 0, VERBOSE_PREFIX_4 "at least one controller wants RTP.\n");
rtp_ext_size = RTP_HEADER_SIZE;
}
}
@ -6367,7 +6375,7 @@ int load_module(void)
/* We *must* have a config file otherwise stop immediately, well no */
if (!cfg) {
cc_log(LOG_ERROR, "Unable to load config %s, CAPI disabled\n", config);
cc_log(LOG_ERROR, "Unable to load config %s, chan_capi disabled\n", config);
return 0;
}
@ -6419,7 +6427,7 @@ int load_module(void)
if (ast_pthread_create(&capi_device_thread, NULL, capidev_loop, NULL) < 0) {
capi_device_thread = (pthread_t)(0-1);
cc_log(LOG_ERROR, "Unable to start capi device thread!\n");
cc_log(LOG_ERROR, "Unable to start CAPI device thread!\n");
return -1;
}

View File

@ -90,6 +90,12 @@ static inline unsigned int read_capi_dword(void *m)
return (val);
}
/*
* global name for messages and commands
*/
#define CC_MESSAGE_NAME "capi"
#define CC_MESSAGE_BIGNAME "CAPI"
/*
* define some private functions
*/

View File

@ -48,8 +48,8 @@ static void update_capi_mixer(int remove, unsigned int roomnumber, struct capi_p
_cword j = 0;
if (i->PLCI == 0) {
cc_verbose(2, 0, VERBOSE_PREFIX_3 "capi mixer: %s: PLCI is unset, abort.\n",
i->vname);
cc_verbose(2, 0, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
" mixer: %s: PLCI is unset, abort.\n", i->vname);
return;
}
@ -77,8 +77,8 @@ static void update_capi_mixer(int remove, unsigned int roomnumber, struct capi_p
p_list[j++] = (_cbyte)(dest >> 8);
p_list[j++] = (_cbyte)(dest >> 16);
p_list[j++] = (_cbyte)(dest >> 24);
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi mixer: listed %s PLCI=0x%04x LI=0x%x\n",
ii->vname, ii->PLCI, dest);
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
" mixer: listed %s PLCI=0x%04x LI=0x%x\n", ii->vname, ii->PLCI, dest);
}
room = room->next;
}
@ -111,8 +111,8 @@ static void update_capi_mixer(int remove, unsigned int roomnumber, struct capi_p
}
}
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi mixer: %s PLCI=0x%04x LI=0x%x\n",
i->vname, i->PLCI, datapath);
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
" mixer: %s PLCI=0x%04x LI=0x%x\n", i->vname, i->PLCI, datapath);
capi_sendf(NULL, 0, CAPI_FACILITY_REQ, i->PLCI, get_capi_MessageNumber(),
"w(w(dc))",
@ -166,7 +166,7 @@ static struct capichat_s *add_chat_member(char *roomname, struct capi_pvt *i)
room = malloc(sizeof(struct capichat_s));
if (room == NULL) {
cc_log(LOG_ERROR, "Unable to allocate capi chat struct.\n");
cc_log(LOG_ERROR, "Unable to allocate chan_capi chat struct.\n");
return NULL;
}
memset(room, 0, sizeof(struct capichat_s));
@ -319,7 +319,7 @@ int pbx_capi_chat(struct ast_channel *c, char *param)
controller = param;
if (!roomname) {
cc_log(LOG_WARNING, "capi chat requires room name.\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " chat requires room name.\n");
return -1;
}
@ -344,7 +344,7 @@ int pbx_capi_chat(struct ast_channel *c, char *param)
options++;
}
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi chat: %s: roomname=%s "
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME " chat: %s: roomname=%s "
"options=%s controller=%s (0x%x)\n",
c->name, roomname, options, controller, contr);
@ -369,7 +369,7 @@ int pbx_capi_chat(struct ast_channel *c, char *param)
room = add_chat_member(roomname, i);
if (!room) {
cc_log(LOG_WARNING, "Unable to open capi chat room.\n");
cc_log(LOG_WARNING, "Unable to open " CC_MESSAGE_NAME " chat room.\n");
return -1;
}
@ -399,7 +399,7 @@ int pbxcli_capi_chatinfo(int fd, int argc, char *argv[])
int fd = a->fd;
if (cmd == CLI_INIT) {
e->command = "capi chatinfo";
e->command = CC_MESSAGE_NAME " chatinfo";
e->usage = chatinfo_usage;
return NULL;
} else if (cmd == CLI_GENERATE)
@ -413,11 +413,11 @@ int pbxcli_capi_chatinfo(int fd, int argc, char *argv[])
#endif
if (chat_list == NULL) {
ast_cli(fd, "There are no members in CAPI CHAT.\n");
ast_cli(fd, "There are no members in " CC_MESSAGE_NAME " chat.\n");
return RESULT_SUCCESS;
}
ast_cli(fd, "CAPI CHAT\n");
ast_cli(fd, CC_MESSAGE_NAME " chat\n");
ast_cli(fd, "Room# Roomname Member Caller\n");
cc_mutex_lock(&chat_lock);

View File

@ -1164,7 +1164,7 @@ int pbx_capi_qsig_ssct(struct ast_channel *c, char *param)
struct capi_pvt *i = CC_CHANNEL_PVT(c);
if (!param) { /* no data implies no Calling Number and Destination Number */
cc_log(LOG_WARNING, "capi qsig_ssct requires source number and destination number\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " qsig_ssct requires source number and destination number\n");
return -1;
}
@ -1190,7 +1190,7 @@ int pbx_capi_qsig_ct(struct ast_channel *c, char *param)
char *marker;
if (!param) { /* no data implies no Calling Number and Destination Number */
cc_log(LOG_WARNING, "capi qsig_ct requires call marker, source number, destination number and await_connect info\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " qsig_ct requires call marker, source number, destination number and await_connect info\n");
return -1;
}
@ -1205,7 +1205,7 @@ int pbx_capi_qsig_ct(struct ast_channel *c, char *param)
}
if (!ii) {
cc_log(LOG_WARNING, "capi qsig_ct call marker not found!\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " qsig_ct call marker not found!\n");
return -1;
}

View File

@ -57,8 +57,8 @@ static void del_old_ccbsnr(void)
ccbsnr = ccbsnr_list;
while (ccbsnr) {
if ((ccbsnr->age + 86400) < time(NULL)) {
cc_verbose(1, 1, VERBOSE_PREFIX_3 "CAPI: CCBS/CCNR handle=%d timeout.\n",
ccbsnr->handle);
cc_verbose(1, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
": CCBS/CCNR handle=%d timeout.\n", ccbsnr->handle);
if (!tmp) {
ccbsnr_list = ccbsnr->next;
} else {
@ -228,7 +228,8 @@ static unsigned int select_ccbsnr_id(unsigned int id, char type,
ccbsnr->priority = priority;
ccbsnr->state = CCBSNR_REQUESTED;
ret = ccbsnr->handle;
cc_verbose(1, 1, VERBOSE_PREFIX_3 "CAPI: request CCBS/NR id=0x%x handle=%d (%s,%s,%d)\n",
cc_verbose(1, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
": request CCBS/NR id=0x%x handle=%d (%s,%s,%d)\n",
id, ret, context, exten, priority);
break;
}
@ -258,8 +259,8 @@ static void del_ccbsnr_ref(unsigned int plci, _cword ref)
tmp->next = ccbsnr->next;
}
free(ccbsnr);
cc_verbose(1, 1, VERBOSE_PREFIX_3 "CAPI: PLCI=%#x CCBS/CCNR removed "
"ref=0x%04x\n", plci, ref);
cc_verbose(1, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
": PLCI=%#x CCBS/CCNR removed ref=0x%04x\n", plci, ref);
break;
}
tmp = ccbsnr;
@ -318,12 +319,12 @@ static void del_ccbsnr_id(unsigned int plci, _cword id)
tmp->next = ccbsnr->next;
}
free(ccbsnr);
cc_verbose(1, 1, VERBOSE_PREFIX_3 "CAPI: PLCI=%#x CCBS/CCNR removed "
cc_verbose(1, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME ": PLCI=%#x CCBS/CCNR removed "
"id=0x%04x state=%d\n", plci, id, oldstate);
} else {
/* just deactivate the linkage id */
ccbsnr->id = 0xdead;
cc_verbose(1, 1, VERBOSE_PREFIX_3 "CAPI: PLCI=%#x CCBS/CCNR erase-only "
cc_verbose(1, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME ": PLCI=%#x CCBS/CCNR erase-only "
"id=0x%04x state=%d\n", plci, id, ccbsnr->state);
}
break;
@ -358,7 +359,7 @@ static void ccbsnr_remote_user_free(_cmsg *CMSG, char type, unsigned int PLCI, _
cc_mutex_unlock(&ccbsnr_lock);
if (!(ccbsnr)) {
cc_log(LOG_ERROR, "CAPI CCBS/CCBR reference not found!\n");
cc_log(LOG_ERROR, CC_MESSAGE_NAME " CCBS/CCBR reference not found!\n");
return;
}
@ -412,7 +413,7 @@ static void ccbsnr_remote_user_free(_cmsg *CMSG, char type, unsigned int PLCI, _
#endif
if (ast_pbx_start(c)) {
cc_log(LOG_ERROR, "capi CCBS/CCNR: Unable to start pbx!\n");
cc_log(LOG_ERROR, CC_MESSAGE_NAME " CCBS/CCNR: Unable to start pbx!\n");
} else {
cc_verbose(2, 1, VERBOSE_PREFIX_2 "contr%d: started PBX for CCBS/CCNR callback (%s/%s/%d)\n",
PLCI & 0xff, ccbsnr->context, ccbsnr->exten, ccbsnr->priority);
@ -484,7 +485,7 @@ int handle_facility_indication_supplementary(
PLCI & 0xff, PLCI, infoword, handle, mode, rbref);
show_capi_info(NULL, infoword);
if ((ccbsnrlink = get_ccbsnr_link(0, 0, handle, 0xffff, NULL, NULL)) == NULL) {
cc_log(LOG_WARNING, "capi ccbs request indication without request!\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " ccbs request indication without request!\n");
break;
}
if (infoword == 0) {
@ -503,7 +504,7 @@ int handle_facility_indication_supplementary(
PLCI & 0xff, PLCI, handle, infoword);
show_capi_info(NULL, infoword);
if ((ccbsnrlink = get_ccbsnr_link(0, 0, handle, 0xffff, NULL, NULL)) == NULL) {
cc_log(LOG_WARNING, "capi ccbs deactivate indication without request!\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " ccbs deactivate indication without request!\n");
break;
}
if (infoword == 0) {
@ -524,7 +525,7 @@ int handle_facility_indication_supplementary(
cc_verbose(1, 1, VERBOSE_PREFIX_3 "contr%d: PLCI=%#x CCBS status ref=0x%04x mode=0x%x\n",
PLCI & 0xff, PLCI, rbref, infoword);
if (get_ccbsnr_link(CCBSNR_TYPE_CCBS, PLCI, 0, rbref, NULL, &partybusy) == NULL) {
cc_log(LOG_WARNING, "capi CCBS status reference not found!\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME " CCBS status reference not found!\n");
}
capi_sendf(NULL, 0, CAPI_FACILITY_RESP, PLCI, HEADER_MSGNUM(CMSG),
"w(w(w))",
@ -719,8 +720,8 @@ int pbx_capi_ccpartybusy(struct ast_channel *c, char *data)
if (((ccbsnr->plci & 0xff) == ((linkid >> 16) & 0xff)) &&
(ccbsnr->id == (linkid & 0xffff))) {
ccbsnr->partybusy = partybusy;
cc_verbose(1, 1, VERBOSE_PREFIX_3 "CAPI: CCBS/NR id=0x%x busy set to %d\n",
linkid, partybusy);
cc_verbose(1, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
": CCBS/NR id=0x%x busy set to %d\n", linkid, partybusy);
break;
}
ccbsnr = ccbsnr->next;
@ -748,7 +749,7 @@ int pbx_capi_ccbsstop(struct ast_channel *c, char *data)
linkid = (unsigned int)strtoul(slinkageid, NULL, 0);
}
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi ccbsstop: '%d'\n",
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME " ccbsstop: '%d'\n",
linkid);
cc_mutex_lock(&ccbsnr_lock);
@ -776,8 +777,8 @@ int pbx_capi_ccbsstop(struct ast_channel *c, char *data)
ref /* CCBS reference */
);
} else {
cc_verbose(3, 1, VERBOSE_PREFIX_3, "capi ccbsstop: linkid %d not found in table.\n",
linkid);
cc_verbose(3, 1, VERBOSE_PREFIX_3, CC_MESSAGE_NAME
" ccbsstop: linkid %d not found in table.\n", linkid);
}
return 0;
@ -806,11 +807,13 @@ int pbx_capi_ccbs(struct ast_channel *c, char *data)
}
if ((!context) || (!exten) || (!priority)) {
cc_log(LOG_WARNING, "capi ccbs requires <context>|<exten>|<priority>\n");
cc_log(LOG_WARNING, CC_MESSAGE_NAME
" ccbs requires <context>|<exten>|<priority>\n");
return -1;
}
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi ccbs: '%d' '%s' '%s' '%s'\n",
cc_verbose(3, 1, VERBOSE_PREFIX_3 CC_MESSAGE_NAME
" ccbs: '%d' '%s' '%s' '%s'\n",
linkid, context, exten, priority);
handle = select_ccbsnr_id(linkid, CCBSNR_TYPE_CCBS,
@ -832,7 +835,7 @@ int pbx_capi_ccbs(struct ast_channel *c, char *data)
(void *)handle) != 0) {
/* we got a hangup */
cc_verbose(3, 1,
VERBOSE_PREFIX_3 "capi ccbs: hangup.\n");
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " ccbs: hangup.\n");
break;
}
}
@ -842,8 +845,8 @@ int pbx_capi_ccbs(struct ast_channel *c, char *data)
}
}
} else {
cc_verbose(3, 1, VERBOSE_PREFIX_3, "capi ccbs: linkid %d not found in table.\n",
linkid);
cc_verbose(3, 1, VERBOSE_PREFIX_3, CC_MESSAGE_NAME
" ccbs: linkid %d not found in table.\n", linkid);
}
pbx_builtin_setvar_helper(c, "CCBSSTATUS", result);

View File

@ -345,7 +345,7 @@ static MESSAGE_EXCHANGE_ERROR _capi_put_msg(unsigned char *msg)
_cmsg CMSG;
if (cc_mutex_lock(&capi_put_lock)) {
cc_log(LOG_WARNING, "Unable to lock capi put!\n");
cc_log(LOG_WARNING, "Unable to lock chan_capi put!\n");
return -1;
}
@ -355,7 +355,7 @@ static MESSAGE_EXCHANGE_ERROR _capi_put_msg(unsigned char *msg)
error = capi20_put_message(capi_ApplID, msg);
if (cc_mutex_unlock(&capi_put_lock)) {
cc_log(LOG_WARNING, "Unable to unlock capi put!\n");
cc_log(LOG_WARNING, "Unable to unlock chan_capi put!\n");
return -1;
}
@ -1023,8 +1023,8 @@ int cc_add_peer_link_id(struct ast_channel *c)
/* remove too old entries */
if ((peerlinkchannel[a].age + 60) < time(NULL)) {
peerlinkchannel[a].channel = NULL;
cc_verbose(3, 1, VERBOSE_PREFIX_4 "capi: peerlink %d timeout-erase\n",
a);
cc_verbose(3, 1, VERBOSE_PREFIX_4 CC_MESSAGE_NAME
": peerlink %d timeout-erase\n", a);
}
}
}
@ -1052,8 +1052,8 @@ struct ast_channel *cc_get_peer_link_id(const char *p)
chan = peerlinkchannel[id].channel;
peerlinkchannel[id].channel = NULL;
}
cc_verbose(3, 1, VERBOSE_PREFIX_4 "capi: peerlink %d allocated, peer is %s\n",
id, (chan)?chan->name:"unlinked");
cc_verbose(3, 1, VERBOSE_PREFIX_4 CC_MESSAGE_NAME
": peerlink %d allocated, peer is %s\n", id, (chan)?chan->name:"unlinked");
cc_mutex_unlock(&peerlink_lock);
return chan;
}