From 66562edbccb0dd9929d6d9fa9915ba8a7d8c35f4 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Fri, 5 Nov 2010 09:58:12 +0000 Subject: [PATCH] CapichatList is now a single source of information about conference members --- chan_capi_ami.c | 22 +++++++++++++++++++++- chan_capi_chat.c | 9 +++++++++ chan_capi_chat.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/chan_capi_ami.c b/chan_capi_ami.c index 97b2aa9..019e8e8 100644 --- a/chan_capi_ami.c +++ b/chan_capi_ami.c @@ -158,6 +158,7 @@ static int pbx_capi_ami_capichat_list(struct mansession *s, const struct message { unsigned int roomNumber = pbx_capi_chat_get_room_number(capiChatRoom); struct ast_channel *c = pbx_capi_chat_get_room_channel(capiChatRoom); + const struct capi_pvt* i = pbx_capi_chat_get_room_interface_c(capiChatRoom); int isMemberOperator = pbx_capi_chat_is_member_operator(capiChatRoom); int isCapiChatRoomMuted = pbx_capi_chat_is_room_muted(capiChatRoom); int isCapiChatMemberMuted = pbx_capi_chat_is_member_muted(capiChatRoom); @@ -167,6 +168,9 @@ static int pbx_capi_ami_capichat_list(struct mansession *s, const struct message char* cidVisual; char* callerNameVisual; + if ((c == NULL) || (i == NULL)) + continue; + cidVisual = ast_strdup(pbx_capi_get_cid (c, "")); callerNameVisual = ast_strdup(pbx_capi_get_callername (c, "")); @@ -195,6 +199,14 @@ static int pbx_capi_ami_capichat_list(struct mansession *s, const struct message "MarkedUser: %s\r\n" "Muted: %s\r\n" "Talking: %s\r\n" + "Domain: %s\r\n" + "DTMF: %s\r\n" + "EchoCancel: %s\r\n" + "NoiseSupp: %s\r\n" + "RxAGC: %s\r\n" + "TxAGC: %s\r\n" + "RxGain: %.1f%s\r\n" + "TxGain: %.1f%s\r\n" "\r\n", idText, roomName, @@ -207,7 +219,15 @@ static int pbx_capi_ami_capichat_list(struct mansession *s, const struct message (isCapiChatMemberListener != 0) ? "Listen only" : "Talk and listen" /* "Talk only" */, (isCapiChatMostRecentMember != 0) ? "Yes" : "No", mutedVisualName, - /* "Yes" "No" */ "Not monitored"); + /* "Yes" "No" */ "Not monitored", + (i->channeltype == CAPI_CHANNELTYPE_B) ? "TDM" : "IP", + (i->isdnstate & CAPI_ISDN_STATE_DTMF) ? "Y" : "N", + (i->isdnstate & CAPI_ISDN_STATE_EC) ? "Y" : "N", + (i->divaAudioFlags & 0x0080) ? "Y" : "N", /* Noise supression */ + (i->divaAudioFlags & 0x0008) ? "Y" : "N", /* Rx AGC */ + (i->divaAudioFlags & 0x0004) ? "Y" : "N", /* Tx AGC */ + i->divaDigitalRxGainDB, "dB", + i->divaDigitalTxGainDB, "dB"); ast_free (cidVisual); ast_free (callerNameVisual); diff --git a/chan_capi_chat.c b/chan_capi_chat.c index 1f7f4b4..9e08ed4 100644 --- a/chan_capi_chat.c +++ b/chan_capi_chat.c @@ -1241,6 +1241,15 @@ struct ast_channel *pbx_capi_chat_get_room_channel(const struct capichat_s * roo return (c); } +/*! + * \brief Get room interface + * + * \note called unter protection of chat_lock + */ +const struct capi_pvt* pbx_capi_chat_get_room_interface_c(const struct capichat_s * room) { + return (room->i); +} + /*! * \brief Is user operator * diff --git a/chan_capi_chat.h b/chan_capi_chat.h index 10502d3..b131af2 100644 --- a/chan_capi_chat.h +++ b/chan_capi_chat.h @@ -34,6 +34,7 @@ const char* pbx_capi_chat_get_room_name(const struct capichat_s * room); unsigned int pbx_capi_chat_get_room_number(const struct capichat_s * room); unsigned int pbx_capi_chat_get_room_members(const struct capichat_s * room); struct ast_channel *pbx_capi_chat_get_room_channel(const struct capichat_s * room); +const struct capi_pvt* pbx_capi_chat_get_room_interface_c(const struct capichat_s * room); int pbx_capi_chat_is_member_operator(const struct capichat_s * room); int pbx_capi_chat_is_room_muted(const struct capichat_s * room); int pbx_capi_chat_is_member_muted(const struct capichat_s * room);