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

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 17 18:43:28 CEST 2011


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

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 |  116 ++++++++++++++++++++--------------------
 modules/dialplan/dp_db.c    |  122 +++++++++++++++++++++----------------------
 modules/dialplan/dp_repl.c  |  108 +++++++++++++++++++++-----------------
 3 files changed, 178 insertions(+), 168 deletions(-)

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



More information about the sr-dev mailing list