mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user