Module: sip-router
Branch: master
Commit: f7b5a333d29579a700d636787550ff1430a58189
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f7b5a33…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Sun Feb 27 06:54:44 2011 +0200
modules/dialplan: change in dp_translate return code
- dp_translate now returns -2 (instead of -1) if dp with given id does
not exist.
---
modules/dialplan/README | 3 +++
modules/dialplan/dialplan.c | 2 +-
modules/dialplan/doc/dialplan_admin.xml | 4 ++++
3 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/modules/dialplan/README b/modules/dialplan/README
index cf9d9d5..e03067d 100644
--- a/modules/dialplan/README
+++ b/modules/dialplan/README
@@ -334,6 +334,9 @@ modparam("dialplan", "fetch_rows", 4000)
with dialplan ID equal to id. If dest is missing, only matching and
storing of matching rule's attributes is done.
+ Returns 1, if translation succeeded, -1 in case of some error occurred,
+ and -2 if dialplan with ID equal to id does not exist.
+
Meaning of the parameters is as follows:
* id -the dialplan id of the possible matching rules. This parameter
can have the following types:
diff --git a/modules/dialplan/dialplan.c b/modules/dialplan/dialplan.c
index 4c86778..16050cc 100644
--- a/modules/dialplan/dialplan.c
+++ b/modules/dialplan/dialplan.c
@@ -326,7 +326,7 @@ static int dp_translate_f(struct sip_msg* msg, char* str1, char*
str2)
if ((idp = select_dpid(dpid)) ==0 ){
LM_DBG("no information available for dpid %i\n", dpid);
- return -1;
+ return -2;
}
repl_par = (str2!=NULL)? ((dp_param_p)str2):default_par2;
diff --git a/modules/dialplan/doc/dialplan_admin.xml
b/modules/dialplan/doc/dialplan_admin.xml
index ac9a84d..43c418b 100644
--- a/modules/dialplan/doc/dialplan_admin.xml
+++ b/modules/dialplan/doc/dialplan_admin.xml
@@ -365,6 +365,10 @@ modparam("dialplan", "fetch_rows", 4000)
missing, only matching and storing of matching rule's
attributes is done.
</para>
+ <para>
+ Returns 1, if translation succeeded, -1 in case of some error
+ occurred, and -2 if dialplan with ID equal to id does not exist.
+ </para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>