<p></p>
<p>The code looks ok for setting the variable. Can you provide all logs printed by kamailio with debug=3 in config, from the moment of receiving the sip message till its end of processing, when this case is reproduce?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2382#issuecomment-651869375">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNUQUMRULAZCUAOU7TRZIAK5ANCNFSM4OMJVS2Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZLAFBIX5W76VJRCHLTRZIAK5A5CNFSM4OMJVS22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE3NLZPY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2382#issuecomment-651869375",
"url": "https://github.com/kamailio/kamailio/issues/2382#issuecomment-651869375",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>