Hi Sebastian,

thanks for reporting back the results. On a second thought I updated the patch a bit to use a local variable for backup in order to allow nested execution of event_route[tm:local-request] which can be triggered by sending local generated requests. The commit was:

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=08798a6d06b628fa5888ded867c5d18416b9f013

I will backport to 3.1 soon.

Cheers.
Daniel

On 8/2/11 9:32 AM, Sebastian Damm wrote:
Hi Daniel,

thanks for looking into it again.

On Mon, Aug 1, 2011 at 2:51 PM, Daniel-Constantin Mierla
<miconda@gmail.com> wrote:
> thanks for further investigation. Indeed, the avps were not backed up/restored when sending self-generated request.
>
> I just committed a patch to tm module in master branch. If you can give it a try and report if it works ok, then I will backport to 3.1.

OK, I took a default config, added this uac part in RELAY route:

      xlog("BEFORE UAC: avp(s:testavp) = $avp(s:testavp)\n");
       avp_print();

       $uac_req(method)="SPAM";
       $uac_req(ruri)="sip:store@127.0.0.1:5160";
       $uac_req(furi)="sip:kamailio@sipgate.net";
       $uac_req(hdrs)="Content-Type: text/csv\r\n";
       $uac_req(body)="foo bar baz";
       uac_req_send();

       xlog("AFTER UAC: avp(s:testavp) = $avp(s:testavp)\n");
       avp_print();

And with an unpatched 3.1.4 looks like this:

Aug  2 09:09:10 flake /usr/sbin/kamailio[20378]: ERROR: <script>: BEFORE UAC: avp(s:testavp) = ThisIsJustATest
Aug  2 09:09:10 flake /usr/sbin/kamailio[20378]: INFO: avpops [avpops_impl.c:1328]: p=0x7f7c0c0e95e8, flags=0x0113
Aug  2 09:09:10 flake /usr/sbin/kamailio[20378]: INFO: avpops [avpops_impl.c:1332]: #011#011#011name=<testavp>
Aug  2 09:09:10 flake /usr/sbin/kamailio[20378]: INFO: avpops [avpops_impl.c:1340]: #011#011#011val_str=<ThisIsJustATest / 15>
Aug  2 09:09:10 flake /usr/sbin/kamailio[20378]: ERROR: <script>: AFTER UAC: avp(s:testavp) = <null>
Aug  2 09:09:10 flake /usr/sbin/kamailio[20379]: ERROR: <script>: DEFAULT REPLY ROUTE: avp(s:testavp) = <null>
Aug  2 09:09:10 flake /usr/sbin/kamailio[20380]: ERROR: <script>: REPLY ROUTE REPLY_ONE: avp(s:testavp) = <null>
Aug  2 09:09:13 flake /usr/sbin/kamailio[20379]: ERROR: <script>: FAILURE ROUTE FAIL_ONE: avp(s:testavp) = <null>


Then I installed the nightly build (Ubuntu Lucid), and tried that again:

Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: ERROR: <script>: BEFORE UAC: avp(s:testavp) = ThisIsJustATest
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1328]: p=0x7f04261307f8, flags=0x0113
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1332]: #011#011#011name=<testavp>
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1340]: #011#011#011val_str=<ThisIsJustATest / 15>
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: ERROR: <script>: AFTER UAC: avp(s:testavp) = ThisIsJustATest
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1328]: p=0x7f04261307f8, flags=0x0113
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1332]: #011#011#011name=<testavp>
Aug  2 09:26:52 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1340]: #011#011#011val_str=<ThisIsJustATest / 15>
Aug  2 09:26:52 flake /usr/sbin/kamailio[22675]: ERROR: <script>: DEFAULT REPLY ROUTE: avp(s:testavp) = <null>
Aug  2 09:26:52 flake /usr/sbin/kamailio[22674]: ERROR: <script>: REPLY ROUTE REPLY_ONE: avp(s:testavp) = ThisIsJustATest
Aug  2 09:26:52 flake /usr/sbin/kamailio[22674]: INFO: avpops [avpops_impl.c:1328]: p=0x7f04261307f8, flags=0x0113
Aug  2 09:26:52 flake /usr/sbin/kamailio[22674]: INFO: avpops [avpops_impl.c:1332]: #011#011#011name=<testavp>
Aug  2 09:26:52 flake /usr/sbin/kamailio[22674]: INFO: avpops [avpops_impl.c:1340]: #011#011#011val_str=<ThisIsJustATest / 15>
Aug  2 09:26:54 flake /usr/sbin/kamailio[22676]: ERROR: <script>: FAILURE ROUTE FAIL_ONE: avp(s:testavp) = ThisIsJustATest
Aug  2 09:26:54 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1328]: p=0x7f04261307f8, flags=0x0113
Aug  2 09:26:54 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1332]: #011#011#011name=<testavp>
Aug  2 09:26:54 flake /usr/sbin/kamailio[22676]: INFO: avpops [avpops_impl.c:1340]: #011#011#011val_str=<ThisIsJustATest / 15>


Looks exactly as expected. Thanks! I think you can go ahead and
backport it to 3.1.

Best Regards,
Sebastian

--
Dipl.-Inf.
Sebastian Damm - VoIP-Engineer - damm@sipgate.de

sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf
HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois
Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391

www.sipgate.de - www.sipgate.at - www.sipgate.co.uk


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda