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

@@ -562,6 +562,30 @@ struct ast_variable *ast_variables_dup(struct ast_variable *var)
return cloned;
}
struct ast_variable *ast_variables_reverse(struct ast_variable *var)
{
struct ast_variable *var1, *var2;
var1 = var;
if (!var1 || !var1->next) {
return var1;
}
var2 = var1->next;
var1->next = NULL;
while (var2) {
struct ast_variable *next = var2->next;
var2->next = var1;
var1 = var2;
var2 = next;
}
return var1;
}
void ast_variables_destroy(struct ast_variable *v)
{
struct ast_variable *vn;