mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2751,12 +2751,12 @@ static int admin_exec(struct ast_channel *chan, void *data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int meetmemute(struct mansession *s, struct message *m, int mute)
|
||||
static int meetmemute(struct mansession *s, const struct message *m, int mute)
|
||||
{
|
||||
struct ast_conference *conf;
|
||||
struct ast_conf_user *user;
|
||||
char *confid = astman_get_header(m, "Meetme");
|
||||
char *userid = astman_get_header(m, "Usernum");
|
||||
const char *confid = astman_get_header(m, "Meetme");
|
||||
char *userid = ast_strdupa(astman_get_header(m, "Usernum"));
|
||||
int userno;
|
||||
|
||||
if (ast_strlen_zero(confid)) {
|
||||
@@ -2812,12 +2812,12 @@ static int meetmemute(struct mansession *s, struct message *m, int mute)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_meetmemute(struct mansession *s, struct message *m)
|
||||
static int action_meetmemute(struct mansession *s, const struct message *m)
|
||||
{
|
||||
return meetmemute(s, m, 1);
|
||||
}
|
||||
|
||||
static int action_meetmeunmute(struct mansession *s, struct message *m)
|
||||
static int action_meetmeunmute(struct mansession *s, const struct message *m)
|
||||
{
|
||||
return meetmemute(s, m, 0);
|
||||
}
|
||||
|
@@ -401,7 +401,7 @@ struct call_queue {
|
||||
|
||||
static AST_LIST_HEAD_STATIC(queues, call_queue);
|
||||
|
||||
static int set_member_paused(char *queuename, char *interface, int paused);
|
||||
static int set_member_paused(const char *queuename, const char *interface, int paused);
|
||||
|
||||
static void rr_dep_warning(void)
|
||||
{
|
||||
@@ -613,7 +613,7 @@ static int statechange_queue(const char *dev, int state, void *ign)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct member *create_queue_member(char *interface, const char *membername, int penalty, int paused)
|
||||
static struct member *create_queue_member(const char *interface, const char *membername, int penalty, int paused)
|
||||
{
|
||||
struct member *cur;
|
||||
|
||||
@@ -686,7 +686,7 @@ static void clear_queue(struct call_queue *q)
|
||||
q->wrapuptime = 0;
|
||||
}
|
||||
|
||||
static int add_to_interfaces(char *interface)
|
||||
static int add_to_interfaces(const char *interface)
|
||||
{
|
||||
struct member_interface *curint;
|
||||
|
||||
@@ -713,7 +713,7 @@ static int add_to_interfaces(char *interface)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int interface_exists_global(char *interface)
|
||||
static int interface_exists_global(const char *interface)
|
||||
{
|
||||
struct call_queue *q;
|
||||
struct member *mem;
|
||||
@@ -735,7 +735,7 @@ static int interface_exists_global(char *interface)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int remove_from_interfaces(char *interface)
|
||||
static int remove_from_interfaces(const char *interface)
|
||||
{
|
||||
struct member_interface *curint;
|
||||
|
||||
@@ -1100,7 +1100,7 @@ static struct call_queue *find_queue_by_name_rt(const char *queuename, struct as
|
||||
return q;
|
||||
}
|
||||
|
||||
static struct call_queue *load_realtime_queue(char *queuename)
|
||||
static struct call_queue *load_realtime_queue(const char *queuename)
|
||||
{
|
||||
struct ast_variable *queue_vars;
|
||||
struct ast_config *member_config = NULL;
|
||||
@@ -2686,7 +2686,7 @@ static int wait_a_bit(struct queue_ent *qe)
|
||||
return ast_waitfordigit(qe->chan, retrywait);
|
||||
}
|
||||
|
||||
static struct member *interface_exists(struct call_queue *q, char *interface)
|
||||
static struct member *interface_exists(struct call_queue *q, const char *interface)
|
||||
{
|
||||
struct member *mem;
|
||||
|
||||
@@ -2741,7 +2741,7 @@ static void dump_queue_members(struct call_queue *pm_queue)
|
||||
ast_db_del(pm_family, pm_queue->name);
|
||||
}
|
||||
|
||||
static int remove_from_queue(char *queuename, char *interface)
|
||||
static int remove_from_queue(const char *queuename, const char *interface)
|
||||
{
|
||||
struct call_queue *q;
|
||||
struct member *last_member, *look;
|
||||
@@ -2795,7 +2795,7 @@ static int remove_from_queue(char *queuename, char *interface)
|
||||
}
|
||||
|
||||
|
||||
static int add_to_queue(char *queuename, char *interface, char *membername, int penalty, int paused, int dump)
|
||||
static int add_to_queue(const char *queuename, const char *interface, const char *membername, int penalty, int paused, int dump)
|
||||
{
|
||||
struct call_queue *q;
|
||||
struct member *new_member;
|
||||
@@ -2846,7 +2846,7 @@ static int add_to_queue(char *queuename, char *interface, char *membername, int
|
||||
return res;
|
||||
}
|
||||
|
||||
static int set_member_paused(char *queuename, char *interface, int paused)
|
||||
static int set_member_paused(const char *queuename, const char *interface, int paused)
|
||||
{
|
||||
int found = 0;
|
||||
struct call_queue *q;
|
||||
@@ -4027,7 +4027,7 @@ static char *complete_queue(const char *line, const char *word, int pos, int sta
|
||||
/*!\brief callback to display queues status in manager
|
||||
\addtogroup Group_AMI
|
||||
*/
|
||||
static int manager_queues_show( struct mansession *s, struct message *m )
|
||||
static int manager_queues_show(struct mansession *s, const struct message *m)
|
||||
{
|
||||
char *a[] = { "queue", "show" };
|
||||
|
||||
@@ -4038,13 +4038,13 @@ static int manager_queues_show( struct mansession *s, struct message *m )
|
||||
}
|
||||
|
||||
/* Dump queue status */
|
||||
static int manager_queues_status( struct mansession *s, struct message *m )
|
||||
static int manager_queues_status(struct mansession *s, const struct message *m)
|
||||
{
|
||||
time_t now;
|
||||
int pos;
|
||||
char *id = astman_get_header(m,"ActionID");
|
||||
char *queuefilter = astman_get_header(m,"Queue");
|
||||
char *memberfilter = astman_get_header(m,"Member");
|
||||
const char *id = astman_get_header(m,"ActionID");
|
||||
const char *queuefilter = astman_get_header(m,"Queue");
|
||||
const char *memberfilter = astman_get_header(m,"Member");
|
||||
char idText[256] = "";
|
||||
struct call_queue *q;
|
||||
struct queue_ent *qe;
|
||||
@@ -4128,9 +4128,9 @@ static int manager_queues_status( struct mansession *s, struct message *m )
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int manager_add_queue_member(struct mansession *s, struct message *m)
|
||||
static int manager_add_queue_member(struct mansession *s, const struct message *m)
|
||||
{
|
||||
char *queuename, *interface, *penalty_s, *paused_s, *membername;
|
||||
const char *queuename, *interface, *penalty_s, *paused_s, *membername;
|
||||
int paused, penalty = 0;
|
||||
|
||||
queuename = astman_get_header(m, "Queue");
|
||||
@@ -4181,9 +4181,9 @@ static int manager_add_queue_member(struct mansession *s, struct message *m)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int manager_remove_queue_member(struct mansession *s, struct message *m)
|
||||
static int manager_remove_queue_member(struct mansession *s, const struct message *m)
|
||||
{
|
||||
char *queuename, *interface;
|
||||
const char *queuename, *interface;
|
||||
|
||||
queuename = astman_get_header(m, "Queue");
|
||||
interface = astman_get_header(m, "Interface");
|
||||
@@ -4212,9 +4212,9 @@ static int manager_remove_queue_member(struct mansession *s, struct message *m)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int manager_pause_queue_member(struct mansession *s, struct message *m)
|
||||
static int manager_pause_queue_member(struct mansession *s, const struct message *m)
|
||||
{
|
||||
char *queuename, *interface, *paused_s;
|
||||
const char *queuename, *interface, *paused_s;
|
||||
int paused;
|
||||
|
||||
interface = astman_get_header(m, "Interface");
|
||||
|
@@ -94,10 +94,10 @@ static char mandescr_playdtmf[] =
|
||||
" Channel: Channel name to send digit to\n"
|
||||
" Digit: The dtmf digit to play\n";
|
||||
|
||||
static int manager_play_dtmf(struct mansession *s, struct message *m)
|
||||
static int manager_play_dtmf(struct mansession *s, const struct message *m)
|
||||
{
|
||||
char *channel = astman_get_header(m, "Channel");
|
||||
char *digit = astman_get_header(m, "Digit");
|
||||
const char *channel = astman_get_header(m, "Channel");
|
||||
const char *digit = astman_get_header(m, "Digit");
|
||||
struct ast_channel *chan = ast_get_channel_by_name_locked(channel);
|
||||
|
||||
if (!chan) {
|
||||
|
@@ -73,12 +73,12 @@ static char *appendcdruserfield_app = "AppendCDRUserField";
|
||||
static char *appendcdruserfield_synopsis = "Append to the CDR user field";
|
||||
|
||||
|
||||
static int action_setcdruserfield(struct mansession *s, struct message *m)
|
||||
static int action_setcdruserfield(struct mansession *s, const struct message *m)
|
||||
{
|
||||
struct ast_channel *c = NULL;
|
||||
char *userfield = astman_get_header(m, "UserField");
|
||||
char *channel = astman_get_header(m, "Channel");
|
||||
char *append = astman_get_header(m, "Append");
|
||||
const char *userfield = astman_get_header(m, "UserField");
|
||||
const char *channel = astman_get_header(m, "Channel");
|
||||
const char *append = astman_get_header(m, "Append");
|
||||
|
||||
if (ast_strlen_zero(channel)) {
|
||||
astman_send_error(s, m, "No Channel specified");
|
||||
|
Reference in New Issue
Block a user