Quote:
"
- $var has local route block scope.
- $avp has SIP transaction scope.

- Both $avp and $var are automatically freed."

If I call sql_xquery( "dbConn", "SELECT * from some_table;", "ra" );
inside a rtimer route, causing $xavp(ra) to contain many rows and
columns each time it's run, would the $xavp(ra) be freed, and when?

Since this is done on an rtimer route for some DB maintainance rather
than on a transaction created for some incoming message so I am not sure
whether this will cause some memory leak. I would appreciate some hints.

Yufei

On 19/04/13 16:00, sr-users-requ...@lists.sip-router.org wrote:
> Date: Fri, 19 Apr 2013 11:00:25 -0400
> From: Carlos Ruiz D?az <carlos.ruizd...@gmail.com>
> Subject: Re: [SR-Users] var vs avp...
> To: "Kamailio (SER) - Users Mailing List"
>       <sr-users@lists.sip-router.org>
> Message-ID:
>       <CA+3gBcmmZyBCCRCyCY=vomziykgzu2upsmccd3y6530jnre...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Use $var when you want to manipulate values inside a route block, for
> example, when you want to store a value that will live only in the scope of
> that route block. When the route block exits, it will be automatically
> deallocated.
>
> Use $avp when you want to store a value that you want to read anywhere. It
> will live as long as the SIP transaction lives.
>
> - $var is stored in private memory, it is per process. This means that only
> the process that created it can read it.
> - $avp is stored in shared memory. It can be accessed from any process in
> kamailio's process list (childs)
>
> - $var has local route block scope.
> - $avp has SIP transaction scope.
>
> - Both $avp and $var are automatically freed.
>

--
Yufei Tao
Red Embedded

This E-mail and any attachments hereto are strictly confidential and intended 
solely for the addressee. If you are not the intended addressee please notify 
the sender by return and delete the message.

You must not disclose, forward or copy this E-mail or attachments to any third 
party without the prior consent of the sender.

Red Embedded Design, Company Number 06688253 Registered in England: The 
Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ

_______________________________________________
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

Reply via email to