<p>I am having problem enabling the dialog module If I load dialogso, opensips crashes when it receives an INVITE message My configuration is bellow I think it is because I call async function twice</p>

<p>-------------------------------------------------------   opensipscfg  ----------------------------------------------------</p>

<p>route{  #main</p>

<pre><code>  if (is_method("INVITE")) {
        route("authenticate");
  }
</code></pre>

<p>}</p>

<p>route[authenticate] {<br>
    async(rest_get("http://localhost:8090/ws/callrouter/authenticate?fU=$fU&amp;aU=$aU&amp;fd=$fd&amp;si=$si", "$avp(routing_result)", "$avp(routing_retcode)"), resume_auth);<br>
}</p>

<p>route[resume_auth] {<br>
    if ($rc &lt; 0) {<br>
        xlog("Error code $var(rcode) in HTTP GET!\n");<br>
        send_reply("501", "Internal server error");<br>
        exit;<br>
    }<br>
    else {<br>
        $json(routing_result) := $avp(routing_result);<br>
        xlog("HTTP Request success with result: $json(routing_result) $json(msg_data) \n");<br>
        if ($rm == 'INVITE') {<br>
            async(rest_get("http://localhost:8090/ws/callrouter/route_invite?fU=$fU&amp;rU=$rU&amp;si=$si", "$avp(routing_result)", "$avp(routing_retcode)"), resume_invite);<br>
        }<br>
    }<br>
    exit;<br>
}</p>

<p>route [resume_invite] {<br>
    if ($rc &lt; 0) {<br>
        xlog("Error code $var(rcode) in HTTP GET!\n");<br>
        send_reply("403", "GET Forbidden");<br>
        exit;<br>
     }<br>
     xlog("resumed_invite got called");<br>
}</p>

<p>-------------------------------------------------------   Back Trace  ----------------------------------------------------</p>

<blockquote>
<p>Program terminated with signal SIGSEGV, Segmentation fault<br>
#0  0x00000000004269e5 in context_get_ptr (pos=0, ctx=0x0, type=CONTEXT_GLOBAL) at contextc:251<br>
251     contextc: No such file or directory<br>
(gdb) bt<br>
#0  0x00000000004269e5 in context_get_ptr (pos=0, ctx=0x0, type=CONTEXT_GLOBAL) at contextc:251<br>
<a href="https://github.com/OpenSIPS/opensips/issues/1" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/1" data-id="14713992" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#1</a>  context_destroy (ctxtype=ctxtype@entry=CONTEXT_GLOBAL, ctx=0x0) at contextc:115<br>
<a href="https://github.com/OpenSIPS/opensips/issues/2" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/2" data-id="15125423" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#2</a>  0x00007efce275d951 in t_resume_async (fd=, param=) at asyncc:155<br>
<a href="https://github.com/OpenSIPS/opensips/pull/3" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/3" data-id="15303208" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#3</a>  0x000000000058c965 in handle_io (fm=0x7efce2e09ed8, fm=0x7efce2e09ed8, fm=0x7efce2e09ed8, idx=, event_type=2) at net/net_udpc:268<br>
<a href="https://github.com/OpenSIPS/opensips/pull/4" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/4" data-id="15307798" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#4</a>  io_wait_loop_epoll (h=, t=, repeat=) at net//io_wait_looph:215<br>
<a href="https://github.com/OpenSIPS/opensips/pull/5" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/5" data-id="15471911" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#5</a>  udp_rcv_loop (si=si@entry=0x7efce2db5f68) at net/net_udpc:308<br>
<a href="https://github.com/OpenSIPS/opensips/issues/6" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/6" data-id="15524941" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#6</a>  0x000000000058e1e8 in udp_start_nofork () at net/net_udpc:387<br>
<a href="https://github.com/OpenSIPS/opensips/pull/7" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/7" data-id="15713961" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#7</a>  0x000000000041af9c in main_loop () at mainc:671<br>
<a href="https://github.com/OpenSIPS/opensips/issues/8" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/8" data-id="15931593" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#8</a>  main (argc=, argv=) at mainc:1261</p>
</blockquote>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/780">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcidIanHB8NrVxUV-aDm1SI72eAAcRks5pgJE6gaJpZM4HRZ7U.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/OpenSIPS/opensips/issues/780"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>