summaryrefslogtreecommitdiff
path: root/main/db.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-01-09 17:54:49 +0000
committerRichard Mudgett <rmudgett@digium.com>2015-01-09 17:54:49 +0000
commit4b363688d4fb16f2f5cfdcffb43df28a84f1d99b (patch)
treec70c4a0ac2eded6ae2371fed848a97ea680248c7 /main/db.c
parenteb9ce791d8e59d2aa63fe13518436f46b61b4a44 (diff)
AMI: Make AMI actions that generate event lists consistent.
* Made the following AMI actions use list API calls for consistency: Agents BridgeInfo BridgeList BridgeTechnologyList ConfbridgeLIst ConfbridgeLIstRooms CoreShowChannels DAHDIShowChannels DBGet DeviceStateList ExtensionStateList FAXSessions Hangup IAXpeerlist IAXpeers IAXregistry MeetmeList MeetmeListRooms MWIGet ParkedCalls Parkinglots PJSIPShowEndpoint PJSIPShowEndpoints PJSIPShowRegistrationsInbound PJSIPShowRegistrationsOutbound PJSIPShowResourceLists PJSIPShowSubscriptionsInbound PJSIPShowSubscriptionsOutbound PresenceStateList PRIShowSpans QueueStatus QueueSummary ShowDialPlan SIPpeers SIPpeerstatus SIPshowregistry SKINNYdevices SKINNYlines Status VoicemailUsersList * Incremented the AMI version to 2.7.0. * Changed astman_send_listack() to not use the listflag parameter and always set the value to "Start" so the start capitalization is consistent. i.e., The FAXSessions used "Start" while the rest of the system used "start". The corresponding complete event always used "Complete". * Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the AMI ActionID for all of its list events. * Fixed off-nominal AMI protocol error in manager_bridge_info(), manager_parking_status_single_lot(), and manager_parking_status_all_lots(). Use of astman_send_error() after responding to the original AMI action request violates the action response pattern by sending two responses. * Fixed minor protocol error in action_getconfig() when no requested categories are found. Each line needs to be formatted as "Header: text". * Fixed off-nominal memory leak in manager_build_parked_call_string(). * Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail(). ASTERISK-24049 #close Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/4315/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/db.c')
-rw-r--r--main/db.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/main/db.c b/main/db.c
index 5a0f17434..4bb9355c6 100644
--- a/main/db.c
+++ b/main/db.c
@@ -841,7 +841,7 @@ static int manager_dbput(struct mansession *s, const struct message *m)
static int manager_dbget(struct mansession *s, const struct message *m)
{
const char *id = astman_get_header(m,"ActionID");
- char idText[256] = "";
+ char idText[256];
const char *family = astman_get_header(m, "Family");
const char *key = astman_get_header(m, "Key");
char tmp[MAX_DB_FIELD];
@@ -856,6 +856,7 @@ static int manager_dbget(struct mansession *s, const struct message *m)
return 0;
}
+ idText[0] = '\0';
if (!ast_strlen_zero(id))
snprintf(idText, sizeof(idText) ,"ActionID: %s\r\n", id);
@@ -863,7 +864,8 @@ static int manager_dbget(struct mansession *s, const struct message *m)
if (res) {
astman_send_error(s, m, "Database entry not found");
} else {
- astman_send_ack(s, m, "Result will follow");
+ astman_send_listack(s, m, "Result will follow", "start");
+
astman_append(s, "Event: DBGetResponse\r\n"
"Family: %s\r\n"
"Key: %s\r\n"
@@ -871,10 +873,9 @@ static int manager_dbget(struct mansession *s, const struct message *m)
"%s"
"\r\n",
family, key, tmp, idText);
- astman_append(s, "Event: DBGetComplete\r\n"
- "%s"
- "\r\n",
- idText);
+
+ astman_send_list_complete_start(s, m, "DBGetComplete", 1);
+ astman_send_list_complete_end(s);
}
return 0;
}