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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@415410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2014-06-06 21:35:09 +00:00
parent 913110770a
commit 9608543a7a
5 changed files with 58 additions and 2 deletions

View File

@@ -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;
}