- added description and CLI command for 'chat'.

This commit is contained in:
MelwareDE 2007-04-30 14:02:22 +00:00
parent 1b50367e34
commit 1b4680f969
5 changed files with 83 additions and 6 deletions

View File

@ -7,6 +7,7 @@ HEAD
- added 'x' option to capicommand(ect) to have real 'explicit call transfer'
(needed by some ISDN lines)
- support CCBS (call completion on busy subscriber)
- added capicommand(chat) for CAPI based MeetMe/Conference using onboard DSPs.
chan_capi-1.0.1

32
README
View File

@ -69,6 +69,7 @@ This chan_capi version includes:
- Asterisk 1.4 jitterbuffer configuration.
- some QSIG extensions (see README.qsig)
- CCBS (call completion on busy subscriber)
- CAPI CHAT (CAPI MeetMe using onboard DSPs)
The Dial string
@ -108,6 +109,27 @@ The Dial string
capi.conf has been removed. The callerID is also taken from the calling channel.
CLI commands
============
capi info:
Show chan-capi version info.
Show status of available B-channels.
capi debug:
Enable CAPI message verbosity.
capi no debug:
Disable CAPI message verbosity.
capi show channels:
Display detailed information on CAPI B-channels.
(Description see below)
capi chatinfo:
Show status of CAPI CHAT.
CAPI command application
========================
chan_capi provides an additional Asterisk application
@ -256,6 +278,13 @@ Deactivate CCBS:
Example:
exten => s,1,capicommand(ccbsstop|${CCLINKAGEID})
Chat (MeetMe/Conference):
If the CAPI card/driver supports it, the caller can be put into a chat-room:
exten => s,1,capicommand(chat|<roomname>|<controller>|<options>)
Example:
exten => s,1,capicommand(chat|salesmeeting|1)
Using CLIR
==========
Use the SetCallerPres() application before you dial:
@ -292,6 +321,7 @@ you:
For normal PBX usage you would use the "b" option, always early B3.
Overlap sending (a.k.a. real dialtone)
======================================
When you dial an empty number, and have early B3 enabled, with:
@ -301,6 +331,7 @@ local exchange.
At this point the channel is like a legacy phone, now you can send DTMF digits
to dial.
Example context for incoming calls on MSN 12345678:
===================================================
@ -389,6 +420,7 @@ Column description:
ton : type of number value
number : the caller-number and destination-number
Asterisk variables used/set by chan_capi
========================================

View File

@ -585,7 +585,7 @@ static int local_queue_frame(struct capi_pvt *i, struct ast_frame *f)
int wbuflen;
if (chan == NULL) {
cc_log(LOG_ERROR, "No owner in local_queue_frame for %s\n",
cc_log(LOG_WARNING, "No owner in local_queue_frame for %s\n",
i->vname);
return -1;
}
@ -5090,6 +5090,10 @@ static char no_debug_usage[] =
"Usage: capi no debug\n"
" Disables dumping of CAPI packets for debugging purposes\n";
static char chatinfo_usage[] =
"Usage: capi chatinfo\n"
" Show info about chat status.\n";
/*
* define commands
*/
@ -5101,6 +5105,8 @@ static struct ast_cli_entry cli_debug =
{ { "capi", "debug", NULL }, pbxcli_capi_do_debug, "Enable CAPI debugging", debug_usage };
static struct ast_cli_entry cli_no_debug =
{ { "capi", "no", "debug", NULL }, pbxcli_capi_no_debug, "Disable CAPI debugging", no_debug_usage };
static struct ast_cli_entry cli_chatinfo =
{ { "capi", "chatinfo", NULL }, pbxcli_capi_chatinfo, "Show CAPI chat info", chatinfo_usage };
const struct ast_channel_tech capi_tech = {
.type = channeltype,
@ -5623,6 +5629,7 @@ int unload_module(void)
ast_cli_unregister(&cli_show_channels);
ast_cli_unregister(&cli_debug);
ast_cli_unregister(&cli_no_debug);
ast_cli_unregister(&cli_chatinfo);
#ifdef CC_AST_HAS_VERSION_1_4
ast_module_user_hangup_all();
@ -5726,6 +5733,7 @@ int load_module(void)
ast_cli_register(&cli_show_channels);
ast_cli_register(&cli_debug);
ast_cli_register(&cli_no_debug);
ast_cli_register(&cli_chatinfo);
ast_register_application(commandapp, pbx_capicommand_exec, commandsynopsis, commandtdesc);

View File

@ -27,7 +27,6 @@
struct capichat_s {
char name[CAPI_MAX_MEETME_NAME];
unsigned int number;
struct ast_channel *chan;
struct capi_pvt *i;
struct capichat_s *next;
};
@ -73,6 +72,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);
}
room = room->next;
}
@ -96,6 +97,9 @@ static void update_capi_mixer(int remove, unsigned int roomnumber, struct capi_p
datapath |= 0x0000000c;
}
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi 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))",
FACILITYSELECTOR_LINE_INTERCONNECT,
@ -140,8 +144,7 @@ static void del_chat_member(struct capichat_s *room)
/*
* add a new chat member
*/
static struct capichat_s *add_chat_member(char *roomname,
struct ast_channel *chan, struct capi_pvt *i)
static struct capichat_s *add_chat_member(char *roomname, struct capi_pvt *i)
{
struct capichat_s *room = NULL;
struct capichat_s *tmproom;
@ -156,7 +159,6 @@ static struct capichat_s *add_chat_member(char *roomname,
strncpy(room->name, roomname, sizeof(room->name));
room->name[sizeof(room->name) - 1] = 0;
room->chan = chan;
room->i = i;
cc_mutex_lock(&chat_lock);
@ -309,7 +311,7 @@ int pbx_capi_chat(struct ast_channel *c, char *param)
goto out;
}
room = add_chat_member(roomname, c, i);
room = add_chat_member(roomname, i);
if (!room) {
cc_log(LOG_WARNING, "Unable to open capi chat room.\n");
return -1;
@ -331,3 +333,36 @@ out:
return 0;
}
/*
* do command capi chatinfo
*/
int pbxcli_capi_chatinfo(int fd, int argc, char *argv[])
{
struct capichat_s *room = NULL;
struct ast_channel *c;
if (argc != 2)
return RESULT_SHOWUSAGE;
if (chat_list == NULL) {
ast_cli(fd, "There are no members in CAPI CHAT.\n");
return RESULT_SUCCESS;
}
ast_cli(fd, "CAPI CHAT\n");
ast_cli(fd, "Room# Roomname Member Caller\n");
cc_mutex_lock(&chat_lock);
room = chat_list;
while (room) {
c = room->i->owner;
ast_cli(fd, "%3d %-12s%-30s\"%s\" <%s>\n",
room->number, room->name, c->name,
(c->cid.cid_name) ? c->cid.cid_name:"", c->cid.cid_num);
room = room->next;
}
cc_mutex_unlock(&chat_lock);
return RESULT_SUCCESS;
}

View File

@ -18,5 +18,6 @@
* prototypes
*/
extern int pbx_capi_chat(struct ast_channel *c, char *param);
extern int pbxcli_capi_chatinfo(int fd, int argc, char *argv[]);
#endif