]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Move evaluation of set_var options in pjsip to the end of channel initialization.
authorMark Michelson <mmichelson@digium.com>
Wed, 20 Aug 2014 20:02:56 +0000 (20:02 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 20 Aug 2014 20:02:56 +0000 (20:02 +0000)
This allows for set_var to override certain defaults such as caller ID and codec
values. This also fixes a test suite regression. The "set_var" test suite test attempted
to use set_var to override caller ID, but a recent change caused that to no longer work.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@421565 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_pjsip.c

index 1640ca0c794958ed57bcdf4681968fc3cfb5f05d..c8a0e0bdcaeeaadb1d8c9f65942c16827e866739 100644 (file)
@@ -393,12 +393,6 @@ static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int s
                return NULL;
        }
 
-       for (var = session->endpoint->channel_vars; var; var = var->next) {
-               char buf[512];
-               pbx_builtin_setvar_helper(chan, var->name, ast_get_encoded_str(
-                                                 var->value, buf, sizeof(buf)));
-       }
-
        ast_channel_stage_snapshot(chan);
 
        ast_channel_tech_pvt_set(chan, channel);
@@ -446,6 +440,12 @@ static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int s
                ast_channel_zone_set(chan, zone);
        }
 
+       for (var = session->endpoint->channel_vars; var; var = var->next) {
+               char buf[512];
+               pbx_builtin_setvar_helper(chan, var->name, ast_get_encoded_str(
+                                                 var->value, buf, sizeof(buf)));
+       }
+
        ast_channel_stage_snapshot_done(chan);
        ast_channel_unlock(chan);