Thank your for clarifying that.

Connected by DROID on Verizon Wireless


-----Original message-----
From: Alex Balashov <abalashov@evaristesys.com>
To:
sr-users@lists.sip-router.org
Sent:
Fri, Jan 27, 2012 21:14:08 GMT+00:00
Subject:
Re: [SR-Users] AVPs vs Variables

Hi Spencer,

On 01/27/2012 04:08 PM, Spencer Thomason wrote:

> I'm a little confused as to the difference between avps and vars and
> when I would use one or the other. I'm currently using sqlops to
> populate a few avps. Would vars be more suitable?

Your question straddles a generational boundary. AVPs are an older
concept that go back to a time before OpenSER had really generic
database interfaces or endless ways to craft custom business logic,
many variables facilities, etc.

At this point, the only real difference between them is that $var()s
only exist for the duration of the processing of a given SIP message
in the config script. AVPs are transaction-persistent, so, for
instance, if you set one in an initial request route, you can also
access it in the onreply_route, which is often necessary to do CDR
accounting, etc. Also, some modules still require use of AVPs.

If you're pulling data out of SQL queries and using it immediately, in
the course of processing the same SIP message, just use $var()s.

--
Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/

_______________________________________________
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