From c7ea108e02a03728f4c0eef4506678b81a22159c Mon Sep 17 00:00:00 2001 From: Richard Mudgett <rmudgett@digium.com> Date: Mon, 12 Jan 2015 18:09:27 +0000 Subject: [PATCH] Revert -r430452 It needs to be redone for the next major AMI version change instead. ASTERISK-24049 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_agent_pool.c | 2 +- apps/app_confbridge.c | 4 ++-- apps/app_meetme.c | 4 ++-- apps/app_queue.c | 4 ++-- apps/app_voicemail.c | 2 +- channels/chan_dahdi.c | 4 ++-- channels/chan_iax2.c | 6 +++--- channels/chan_sip.c | 6 +++--- channels/chan_skinny.c | 4 ++-- include/asterisk/manager.h | 3 ++- main/bridge.c | 2 +- main/db.c | 2 +- main/manager.c | 8 ++++---- main/manager_bridges.c | 4 ++-- main/pbx.c | 4 ++-- res/parking/parking_manager.c | 6 +++--- res/res_fax.c | 2 +- res/res_manager_devicestate.c | 2 +- res/res_manager_presencestate.c | 2 +- res/res_mwi_external_ami.c | 2 +- res/res_pjsip/pjsip_configuration.c | 6 ++++-- res/res_pjsip_outbound_registration.c | 3 ++- res/res_pjsip_pubsub.c | 9 ++++++--- res/res_pjsip_registrar.c | 3 ++- 24 files changed, 51 insertions(+), 43 deletions(-) diff --git a/apps/app_agent_pool.c b/apps/app_agent_pool.c index 0e8a1b1994..a36c771430 100644 --- a/apps/app_agent_pool.c +++ b/apps/app_agent_pool.c @@ -2532,7 +2532,7 @@ static int action_agents(struct mansession *s, const struct message *m) } else { id_text[0] = '\0'; } - astman_send_listack(s, m, "Agents will follow"); + astman_send_listack(s, m, "Agents will follow", "start"); iter = ao2_iterator_init(agents, 0); for (; (agent = ao2_iterator_next(&iter)); ao2_ref(agent, -1)) { diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index 53bd0e8fa8..b5d48452d4 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -2883,7 +2883,7 @@ static int action_confbridgelist(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "Confbridge user list will follow"); + astman_send_listack(s, m, "Confbridge user list will follow", "start"); ao2_lock(conference); AST_LIST_TRAVERSE(&conference->active_list, user, list) { @@ -2920,7 +2920,7 @@ static int action_confbridgelistrooms(struct mansession *s, const struct message return 0; } - astman_send_listack(s, m, "Confbridge conferences will follow"); + astman_send_listack(s, m, "Confbridge conferences will follow", "start"); /* Traverse the conference list */ iter = ao2_iterator_init(conference_bridges, 0); diff --git a/apps/app_meetme.c b/apps/app_meetme.c index c449ba0f8d..907770e225 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -5530,7 +5530,7 @@ static int action_meetmelist(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "Meetme user list will follow"); + astman_send_listack(s, m, "Meetme user list will follow", "start"); /* Find the right conference */ AST_LIST_LOCK(&confs); @@ -5603,7 +5603,7 @@ static int action_meetmelistrooms(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "Meetme conferences will follow"); + astman_send_listack(s, m, "Meetme conferences will follow", "start"); now = time(NULL); diff --git a/apps/app_queue.c b/apps/app_queue.c index e3d86992d8..d41641c625 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -9472,7 +9472,7 @@ static int manager_queues_summary(struct mansession *s, const struct message *m) struct ao2_iterator queue_iter; struct ao2_iterator mem_iter; - astman_send_listack(s, m, "Queue summary will follow"); + astman_send_listack(s, m, "Queue summary will follow", "start"); time(&now); idText[0] = '\0'; if (!ast_strlen_zero(id)) { @@ -9549,7 +9549,7 @@ static int manager_queues_status(struct mansession *s, const struct message *m) struct ao2_iterator queue_iter; struct ao2_iterator mem_iter; - astman_send_listack(s, m, "Queue status will follow"); + astman_send_listack(s, m, "Queue status will follow", "start"); time(&now); idText[0] = '\0'; if (!ast_strlen_zero(id)) { diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 92b6ddd2fa..6311263a4d 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -13065,7 +13065,7 @@ static int manager_list_voicemail_users(struct mansession *s, const struct messa return RESULT_SUCCESS; } - astman_send_listack(s, m, "Voicemail user list will follow"); + astman_send_listack(s, m, "Voicemail user list will follow", "start"); AST_LIST_TRAVERSE(&users, vmu, list) { char dirname[256]; diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 7537074d8c..10b6295cd2 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -16082,7 +16082,7 @@ static int action_dahdishowchannels(struct mansession *s, const struct message * snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id); } - astman_send_listack(s, m, "DAHDI channel status will follow"); + astman_send_listack(s, m, "DAHDI channel status will follow", "start"); ast_mutex_lock(&iflock); @@ -16176,7 +16176,7 @@ static int action_prishowspans(struct mansession *s, const struct message *m) action_id[0] = '\0'; } - astman_send_listack(s, m, "Span status will follow"); + astman_send_listack(s, m, "Span status will follow", "start"); count = 0; for (idx = 0; idx < ARRAY_LEN(pris); ++idx) { diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index a6b4f0aa69..bb65df4600 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -7252,7 +7252,7 @@ static int manager_iax2_show_peers(struct mansession *s, const struct message *m if (!ast_strlen_zero(id)) snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id); - astman_send_listack(s, m, "Peer status list will follow"); + astman_send_listack(s, m, "Peer status list will follow", "start"); /* List the peers in separate manager events */ __iax2_show_peers(-1, &total, s, 3, a); @@ -7288,7 +7288,7 @@ static int manager_iax2_show_peer_list(struct mansession *s, const struct messag snprintf(cont.idtext, sizeof(cont.idtext), "ActionID: %s\r\n", id); } - astman_send_listack(s, m, "IAX Peer status list will follow"); + astman_send_listack(s, m, "IAX Peer status list will follow", "start"); i = ao2_iterator_init(peers, 0); for (; (peer = ao2_iterator_next(&i)); peer_unref(peer)) { @@ -7378,7 +7378,7 @@ static int manager_iax2_show_registry(struct mansession *s, const struct message if (!ast_strlen_zero(id)) snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id); - astman_send_listack(s, m, "Registrations will follow"); + astman_send_listack(s, m, "Registrations will follow", "start"); AST_LIST_LOCK(®istrations); AST_LIST_TRAVERSE(®istrations, reg, entry) { diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a8d4eac150..1a0ff94b74 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -19223,7 +19223,7 @@ static int manager_show_registry(struct mansession *s, const struct message *m) if (!ast_strlen_zero(id)) snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id); - astman_send_listack(s, m, "Registrations will follow"); + astman_send_listack(s, m, "Registrations will follow", "start"); iter = ao2_iterator_init(registry_list, 0); while ((iterator = ao2_t_iterator_next(&iter, "manager_show_registry iter"))) { @@ -19275,7 +19275,7 @@ static int manager_sip_show_peers(struct mansession *s, const struct message *m) if (!ast_strlen_zero(id)) snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id); - astman_send_listack(s, m, "Peer status list will follow"); + astman_send_listack(s, m, "Peer status list will follow", "start"); /* List the peers in separate manager events */ _sip_show_peers(-1, &total, s, m, 3, a); @@ -20067,7 +20067,7 @@ static int manager_sip_peer_status(struct mansession *s, const struct message *m } } - astman_send_listack(s, m, "Peer status will follow"); + astman_send_listack(s, m, "Peer status will follow", "start"); if (!peer) { struct ao2_iterator i = ao2_iterator_init(peers, 0); diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 3d68ac66f2..aabac57a3a 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -4138,7 +4138,7 @@ static int manager_skinny_show_devices(struct mansession *s, const struct messag const char *a[] = {"skinny", "show", "devices"}; int total = 0; - astman_send_listack(s, m, "Device status list will follow"); + astman_send_listack(s, m, "Device status list will follow", "start"); /* List the devices in separate manager events */ _skinny_show_devices(-1, &total, s, m, 3, a); @@ -4380,7 +4380,7 @@ static int manager_skinny_show_lines(struct mansession *s, const struct message const char *a[] = {"skinny", "show", "lines"}; int total = 0; - astman_send_listack(s, m, "Line status list will follow"); + astman_send_listack(s, m, "Line status list will follow", "start"); /* List the lines in separate manager events */ _skinny_show_lines(-1, &total, s, m, 3, a); diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h index 908d4972ca..31f31b7f07 100644 --- a/include/asterisk/manager.h +++ b/include/asterisk/manager.h @@ -305,13 +305,14 @@ void astman_send_ack(struct mansession *s, const struct message *m, char *msg); * \param s - AMI session control struct. * \param m - AMI action request that started the list. * \param msg - Message contents describing the list to follow. + * \param listflag - Not used. Historically always set to "start". * * \note You need to call astman_send_list_complete_start() and * astman_send_list_complete_end() to send the AMI list completion event. * * \return Nothing */ -void astman_send_listack(struct mansession *s, const struct message *m, char *msg); +void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag); /*! * \brief Start the list complete event. diff --git a/main/bridge.c b/main/bridge.c index e1f2d1eebb..6b4778f5d1 100644 --- a/main/bridge.c +++ b/main/bridge.c @@ -5209,7 +5209,7 @@ static int manager_bridge_tech_list(struct mansession *s, const struct message * ast_str_set(&id_text, 0, "ActionID: %s\r\n", id); } - astman_send_listack(s, m, "Bridge technology listing will follow"); + astman_send_listack(s, m, "Bridge technology listing will follow", "start"); AST_RWLIST_RDLOCK(&bridge_technologies); AST_RWLIST_TRAVERSE(&bridge_technologies, cur, entry) { diff --git a/main/db.c b/main/db.c index 28e548814b..4bb9355c66 100644 --- a/main/db.c +++ b/main/db.c @@ -864,7 +864,7 @@ 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_listack(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" diff --git a/main/manager.c b/main/manager.c index 137e50a3a6..4410cd7c58 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2919,7 +2919,7 @@ static void astman_start_ack(struct mansession *s, const struct message *m) astman_send_response_full(s, m, "Success", MSG_MOREDATA, NULL); } -void astman_send_listack(struct mansession *s, const struct message *m, char *msg) +void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag) { astman_send_response_full(s, m, "Success", msg, "Start"); } @@ -4203,7 +4203,7 @@ static int action_hangup(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "Channels hung up will follow"); + astman_send_listack(s, m, "Channels hung up will follow", "start"); iter = ast_channel_iterator_all_new(); if (iter) { @@ -4481,7 +4481,7 @@ static int action_status(struct mansession *s, const struct message *m) } } - astman_send_listack(s, m, "Channel status will follow"); + astman_send_listack(s, m, "Channel status will follow", "start"); if (!ast_strlen_zero(id)) { snprintf(id_text, sizeof(id_text), "ActionID: %s\r\n", id); @@ -5908,7 +5908,7 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m return 0; } - astman_send_listack(s, m, "Channels will follow"); + astman_send_listack(s, m, "Channels will follow", "start"); it_chans = ao2_iterator_init(channels, 0); for (; (msg = ao2_iterator_next(&it_chans)); ao2_ref(msg, -1)) { diff --git a/main/manager_bridges.c b/main/manager_bridges.c index 8ed4d89691..10a5046d94 100644 --- a/main/manager_bridges.c +++ b/main/manager_bridges.c @@ -414,7 +414,7 @@ static int manager_bridges_list(struct mansession *s, const struct message *m) return -1; } - astman_send_listack(s, m, "Bridge listing will follow"); + astman_send_listack(s, m, "Bridge listing will follow", "start"); if (!ast_strlen_zero(type_filter)) { char *type_filter_dup = ast_strdupa(type_filter); @@ -506,7 +506,7 @@ static int manager_bridge_info(struct mansession *s, const struct message *m) return -1; } - astman_send_listack(s, m, "Bridge channel listing will follow"); + astman_send_listack(s, m, "Bridge channel listing will follow", "start"); list_data.id_text = ast_str_buffer(id_text); list_data.count = 0; diff --git a/main/pbx.c b/main/pbx.c index 7f914d4f10..b2c365a9b7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -8147,7 +8147,7 @@ static char *handle_debug_dialplan(struct ast_cli_entry *e, int cmd, struct ast_ /*! \brief Send ack once */ static void manager_dpsendack(struct mansession *s, const struct message *m) { - astman_send_listack(s, m, "DialPlan list will follow"); + astman_send_listack(s, m, "DialPlan list will follow", "start"); } /*! \brief Show dialplan extensions @@ -12010,7 +12010,7 @@ static int action_extensionstatelist(struct mansession *s, const struct message return 0; } - astman_send_listack(s, m, "Extension Statuses will follow"); + astman_send_listack(s, m, "Extension Statuses will follow", "start"); ao2_lock(hints); it_hints = ao2_iterator_init(hints, 0); diff --git a/res/parking/parking_manager.c b/res/parking/parking_manager.c index 0e8f50dea3..74b455928d 100644 --- a/res/parking/parking_manager.c +++ b/res/parking/parking_manager.c @@ -255,7 +255,7 @@ static void manager_parking_status_single_lot(struct mansession *s, const struct return; } - astman_send_listack(s, m, "Parked calls will follow"); + astman_send_listack(s, m, "Parked calls will follow", "start"); iter_users = ao2_iterator_init(curlot->parked_users, 0); while ((curuser = ao2_iterator_next(&iter_users))) { @@ -308,7 +308,7 @@ static void manager_parking_status_all_lots(struct mansession *s, const struct m return; } - astman_send_listack(s, m, "Parked calls will follow"); + astman_send_listack(s, m, "Parked calls will follow", "start"); iter_lots = ao2_iterator_init(lot_container, 0); while ((curlot = ao2_iterator_next(&iter_lots))) { @@ -422,7 +422,7 @@ static int manager_parking_lot_list(struct mansession *s, const struct message * return 0; } - astman_send_listack(s, m, "Parking lots will follow"); + astman_send_listack(s, m, "Parking lots will follow", "start"); list_data.id_text = id_text; list_data.count = 0; diff --git a/res/res_fax.c b/res/res_fax.c index d20bce6151..5f2798ab4d 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -4200,7 +4200,7 @@ static int manager_fax_sessions(struct mansession *s, const struct message *m) snprintf(id_text, sizeof(id_text), "ActionID: %s\r\n", action_id); } - astman_send_listack(s, m, "FAXSessionsEntry event list will follow"); + astman_send_listack(s, m, "FAXSessionsEntry event list will follow", "Start"); iter = ao2_iterator_init(faxregistry.container, 0); while ((session = ao2_iterator_next(&iter))) { diff --git a/res/res_manager_devicestate.c b/res/res_manager_devicestate.c index bc2e4f23d6..3d1f1ab104 100644 --- a/res/res_manager_devicestate.c +++ b/res/res_manager_devicestate.c @@ -85,7 +85,7 @@ static int action_devicestatelist(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "Device State Changes will follow"); + astman_send_listack(s, m, "Device State Changes will follow", "start"); it_states = ao2_iterator_init(device_states, 0); for (; (msg = ao2_iterator_next(&it_states)); ao2_ref(msg, -1)) { diff --git a/res/res_manager_presencestate.c b/res/res_manager_presencestate.c index 1b5c540a39..bb9e63ab92 100644 --- a/res/res_manager_presencestate.c +++ b/res/res_manager_presencestate.c @@ -85,7 +85,7 @@ static int action_presencestatelist(struct mansession *s, const struct message * return 0; } - astman_send_listack(s, m, "Presence State Changes will follow"); + astman_send_listack(s, m, "Presence State Changes will follow", "start"); it_states = ao2_iterator_init(presence_states, 0); for (; (msg = ao2_iterator_next(&it_states)); ao2_ref(msg, -1)) { diff --git a/res/res_mwi_external_ami.c b/res/res_mwi_external_ami.c index 2efefa60e0..87ce411e61 100644 --- a/res/res_mwi_external_ami.c +++ b/res/res_mwi_external_ami.c @@ -197,7 +197,7 @@ static int mwi_mailbox_get(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "Mailboxes will follow"); + astman_send_listack(s, m, "Mailboxes will follow", "start"); id = astman_get_header(m, "ActionID"); if (!ast_strlen_zero(id)) { diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index fb554fd899..7dad58c153 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -1162,7 +1162,8 @@ static int ami_show_endpoint(struct mansession *s, const struct message *m) return -1; } - astman_send_listack(s, m, "Following are Events for each object associated with the the Endpoint"); + astman_send_listack(s, m, "Following are Events for each object associated with the the Endpoint", + "start"); /* the endpoint detail needs to always come first so apply as such */ if (format_ami_endpoint(endpoint, &ami) || @@ -1245,7 +1246,8 @@ static int ami_show_endpoints(struct mansession *s, const struct message *m) return 0; } - astman_send_listack(s, m, "A listing of Endpoints follows, presented as EndpointList events"); + astman_send_listack(s, m, "A listing of Endpoints follows, presented as EndpointList events", + "start"); ao2_callback(endpoints, OBJ_NODATA, format_ami_endpoints, &ami); diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index fe9f0b5881..3a01a9426f 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -1420,7 +1420,8 @@ static int ami_show_outbound_registrations(struct mansession *s, return -1; } - astman_send_listack(s, m, "Following are Events for each Outbound registration"); + astman_send_listack(s, m, "Following are Events for each Outbound registration", + "start"); ao2_callback(regs, OBJ_NODATA, ami_outbound_registration_detail, &ami_outbound); diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index 1b2f39dd1e..3f3fb9b9c4 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -3262,7 +3262,8 @@ static int ami_show_subscriptions_inbound(struct mansession *s, const struct mes struct ast_sip_ami ami = { .s = s, .m = m, .action_id = astman_get_header(m, "ActionID"), }; int num; - astman_send_listack(s, m, "Following are Events for each inbound Subscription"); + astman_send_listack(s, m, "Following are Events for each inbound Subscription", + "start"); num = for_each_subscription(ami_subscription_detail_inbound, &ami); @@ -3276,7 +3277,8 @@ static int ami_show_subscriptions_outbound(struct mansession *s, const struct me struct ast_sip_ami ami = { .s = s, .m = m, .action_id = astman_get_header(m, "ActionID"), }; int num; - astman_send_listack(s, m, "Following are Events for each outbound Subscription"); + astman_send_listack(s, m, "Following are Events for each outbound Subscription", + "start"); num = for_each_subscription(ami_subscription_detail_outbound, &ami); @@ -3320,7 +3322,8 @@ static int ami_show_resource_lists(struct mansession *s, const struct message *m return 0; } - astman_send_listack(s, m, "A listing of resource lists follows, presented as ResourceListDetail events"); + astman_send_listack(s, m, "A listing of resource lists follows, presented as ResourceListDetail events", + "start"); ao2_callback(lists, OBJ_NODATA, format_ami_resource_lists, &ami); diff --git a/res/res_pjsip_registrar.c b/res/res_pjsip_registrar.c index f0d1f500da..daeeec9b89 100644 --- a/res/res_pjsip_registrar.c +++ b/res/res_pjsip_registrar.c @@ -767,7 +767,8 @@ static int ami_show_registrations(struct mansession *s, const struct message *m) int count = 0; struct ast_sip_ami ami = { .s = s, .m = m, .arg = &count, .action_id = astman_get_header(m, "ActionID"), }; - astman_send_listack(s, m, "Following are Events for each Inbound registration"); + astman_send_listack(s, m, "Following are Events for each Inbound registration", + "start"); ami_registrations_endpoints(&ami); -- GitLab