[sr-dev] git:3.1: dialplan: fix usage of avps in replacement expression

Daniel-Constantin Mierla miconda at gmail.com
Wed Nov 30 19:24:44 CET 2011


Module: sip-router
Branch: 3.1
Commit: 8371befc51d8a0db7e57e686a77d9e700f609239
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8371befc51d8a0db7e57e686a77d9e700f609239

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Oct 17 18:27:42 2011 +0200

dialplan: fix usage of avps in replacement expression

- clone the replacement expression to shared memory before parsing it in
  order to have variables names available at runtime
- most of variables should be safe to use now in replacement
  expressions, including avps with string name. This fixes FS#153
  reported by Andrew Pogrebennyk
- variables with dynamic name have no easy way to clone at this moment,
  thus avoid using them directly. Use instead avps or script vars
  ($var(...)), copying the value from initial variable to it. Variables
  pointing to sip message attributes are safe to use.

---

 modules/dialplan/dialplan.c |  101 ++++++++++++++++++------------------
 modules/dialplan/dp_db.c    |  122 +++++++++++++++++++++----------------------
 modules/dialplan/dp_repl.c  |  108 +++++++++++++++++++++-----------------
 3 files changed, 170 insertions(+), 161 deletions(-)

Diff:   http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=8371befc51d8a0db7e57e686a77d9e700f609239



More information about the sr-dev mailing list