From 5ca495ed2f60fe8907503196ae50a2cfba9ff1fd Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Fri, 6 Jun 2014 21:44:16 +0000 Subject: chan_sip: Fix order of variables specified in SIPNotify action Prior to this patch, sequential variables would be ordered in reverse from the order specified in the manager action. Review: https://reviewboard.asterisk.org/r/3588/ ........ Merged revisions 415359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415390 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415410 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415411 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/manager.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main/manager.c') diff --git a/main/manager.c b/main/manager.c index cb2b0bbe2..09d49f002 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2389,6 +2389,12 @@ static struct ast_variable *man_do_variable_value(struct ast_variable *head, con } struct ast_variable *astman_get_variables(const struct message *m) +{ + return astman_get_variables_order(m, ORDER_REVERSE); +} + +struct ast_variable *astman_get_variables_order(const struct message *m, + enum variable_orders order) { int varlen; int x; @@ -2405,6 +2411,10 @@ struct ast_variable *astman_get_variables(const struct message *m) head = man_do_variable_value(head, m->headers[x] + varlen); } + if (order == ORDER_NATURAL) { + head = ast_variables_reverse(head); + } + return head; } -- cgit v1.2.3