<p><a href="https://github.com/miconda" class="user-mention">@miconda</a> more info</p>
<p>it seems that the <code>faked_env( t, 0, 1);</code> call (restore original environent) will discard the avps xavps that can be added during processing of the script block. in this use case,  registrar save (which calls reply) is called, which creates the xavps that are not being released.</p>
<p>from t_suspend.c</p>
<pre><code>         faked_env( t, faked_req, 1);

                route_type_bk = get_route_type();
                set_route_type(FAILURE_ROUTE);
                /* execute the pre/post -script callbacks based on original route block */
                if (exec_pre_script_cb(faked_req, cb_type)>0) {
                        if (run_top_route(route, faked_req, 0)<0)
                                LM_ERR("failure inside run_top_route\n");
                        exec_post_script_cb(faked_req, cb_type);
                }
                set_route_type(route_type_bk);

                /* TODO: save_msg_lumps should clone the lumps to shm mem */

                /* restore original environment */
                faked_env( t, 0, 1);
</code></pre>

<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/pull/1111#issuecomment-301510892">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZaLK0VHS6sD5ABrzvvezJ14f69K-ks5r6G8tgaJpZM4NOAPn">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZcI-bV4ZCUorsfHQL50uWQe6lAKdks5r6G8tgaJpZM4NOAPn.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/1111#issuecomment-301510892"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@lazedo in #1111: @miconda more info\r\n\r\nit seems that the `faked_env( t, 0, 1);` call (restore original environent) will discard the avps xavps that can be added during processing of the script block. in this use case,  registrar save (which calls reply) is called, which creates the xavps that are not being released.\r\n\r\nfrom t_suspend.c\r\n```\r\n\t\tfaked_env( t, faked_req, 1);\r\n\r\n\t\troute_type_bk = get_route_type();\r\n\t\tset_route_type(FAILURE_ROUTE);\r\n\t\t/* execute the pre/post -script callbacks based on original route block */\r\n\t\tif (exec_pre_script_cb(faked_req, cb_type)\u003e0) {\r\n\t\t\tif (run_top_route(route, faked_req, 0)\u003c0)\r\n\t\t\t\tLM_ERR(\"failure inside run_top_route\\n\");\r\n\t\t\texec_post_script_cb(faked_req, cb_type);\r\n\t\t}\r\n\t\tset_route_type(route_type_bk);\r\n\r\n\t\t/* TODO: save_msg_lumps should clone the lumps to shm mem */\r\n\r\n\t\t/* restore original environment */\r\n\t\tfaked_env( t, 0, 1);\r\n```\r\n"}],"action":{"name":"View Pull Request","url":"https://github.com/kamailio/kamailio/pull/1111#issuecomment-301510892"}}}</script>