Hey Daniel,<br><br>Ok I worked it out. In the async callback before I call tmb.t_continue you need to restore the transaction avp lists before trying to add an AVP to be used in the &quot;continue route&quot; of the cfg file. do for example:<br>
<br><span style="font-family:courier new,monospace">set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, &amp;t-&gt;uri_avps_from );</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, &amp;t-&gt;uri_avps_to );</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER, &amp;t-&gt;user_avps_from );</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">set_avp_list(AVP_TRACK_TO | AVP_CLASS_USER, &amp;t-&gt;user_avps_to );</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">set_avp_list(AVP_TRACK_FROM | AVP_CLASS_DOMAIN, &amp;t-&gt;domain_avps_from );</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">set_avp_list(AVP_TRACK_TO | AVP_CLASS_DOMAIN, &amp;t-&gt;domain_avps_to );</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">...</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">code to add my AVP to be made available to cfg file</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">...    </span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">tmb.t_continue(data-&gt;tindex, data-&gt;tlabel, data-&gt;act);</span><br>
<br>Hopefully this make more sense?<br><br>Cheers<br>Jason<br>On Tue, Oct 2, 2012 at 2:45 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    not clear now what you try to do, but have in mind that avps are
    attached to a sip message or transaction. You cannot access it if it
    is set  in other process for a transaction you don&#39;t have access to
    it anymore. Use some other sort of shared memory structure.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 10/2/12 2:12 PM, Jason Penton wrote:<br>
    </div>
    <blockquote type="cite">Hey Daniel, <br>
      <br>
      plse see inline:<br>
      <br>
      <div class="gmail_quote">On Tue, Oct 2, 2012 at 2:02 PM,
        Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> Hello,
            <div><br>
              <br>
              <div>On 10/2/12 1:58 PM, Jason Penton wrote:<br>
              </div>
              <blockquote type="cite">Okay I solved this by using the
                uas-&gt;request structure ;)<br>
              </blockquote>
            </div>
            indeed, this is the right way -- forgot to answer this
            email...
            <div><br>
            </div>
          </div>
        </blockquote>
        <div>np, thanks!<br>
           <br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000">
            <div> <br>
              <blockquote type="cite"><br>
                One more question re. async &quot;pattern&quot; Daniel:<br>
                In the &quot;continued&quot; code, prior to executing the config
                file actions, can you add an avp (ie from within the
                code prior to calling t_continue, can we add an avp and
                have it available to the config file in the &quot;continued&quot;
                route block)?<br>
              </blockquote>
              <br>
            </div>
            IIRC, at that moment you have to add it to the list that is
            stored in transaction. Maybe you can use a $var() and then
            move it in avp list inside the continued route block.<br>
          </div>
        </blockquote>
        <div><br>
          Im not sure I understand you here? Just to make sure I am
          clear. I am effectively trying to do this:<br>
          <br>
          longrunningfunction();  #this is where the async will happen,
          so the next line will be run by another process<br>
          if ($avp(s:return_val_from_longrunningfunction) &gt; 0) {<br>
             blah;<br>
          }<br>
          <br>
          So, I am asking how I can set the
          $avp(s:return_val_from_longrunningfunction). I can tell you
          from practice that it doesnt work using the default add_avp
          from within my async callback process. I have not researched
          yet how the avps are stored, architected, etc. But I am
          imagineing that right now the process I am in has no &quot;access&quot;
          to avp &quot;storage&quot;. Either that or the avp &quot;storage&quot; is
          overwritten with the t_continue code? Would be great if you
          could shed some light?<br>
          <br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> <br>
            Cheers,<br>
            Daniel<br>
            <br>
            <blockquote type="cite">
              <div> <br>
                cheers<br>
                Jason<br>
                <br>
                <div class="gmail_quote">On Mon, Oct 1, 2012 at 3:46 PM,
                  Jason Penton <span dir="ltr">&lt;<a href="mailto:jason.penton@gmail.com" target="_blank">jason.penton@gmail.com</a>&gt;</span>
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
                    (Daniel this may be for you re. async)<br>
                    <br>
                    Is it possible to get the sip message from a
                    transaction after using t_continue. The reason I ask
                    is that using the async &quot;pattern&quot;, how would one be
                    able to use transactional replies in code using
                    t_reply(code, message). Is the only way to store the
                    sip_msg in shm for later use, because if I look at
                    TM I see there is no storage for the original SIP
                    request?<br>
                    <br>
                    Cheers<span><font color="#888888"><br>
                        Jason<br>
                      </font></span></blockquote>
                </div>
                <br>
                <br>
                <fieldset></fieldset>
                <br>
              </div>
              <pre>_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><span><font color="#888888">
</font></span></pre>
              <span><font color="#888888"> </font></span></blockquote>
            <span><font color="#888888"> <br>
                <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a></pre>
              </font></span></div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a></pre>
  </div></div></div>

</blockquote></div><br>