diff options
author | Jonathan Rose <jrose@digium.com> | 2014-06-06 21:44:16 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2014-06-06 21:44:16 +0000 |
commit | 5ca495ed2f60fe8907503196ae50a2cfba9ff1fd (patch) | |
tree | b711478b90599d2457f905c3d4d444864a4e6d13 /main/manager.c | |
parent | 4308aa5648ef4d7332dd14f920b944b0806ec8fb (diff) |
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
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c index cb2b0bbe2..09d49f002 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2390,6 +2390,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; struct ast_variable *head = NULL; @@ -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; } |