Browse Source

dialplan: specific reply for translation failure

- 404 no translation returned if dp_translate MI command fails to do
  dialplan translate
- added extra debug message
Daniel-Constantin Mierla 14 years ago
parent
commit
4abe2eec53
1 changed files with 3 additions and 1 deletions
  1. 3 1
      modules/dialplan/dialplan.c

+ 3 - 1
modules/dialplan/dialplan.c

@@ -532,10 +532,12 @@ static struct mi_root * mi_translate(struct mi_root *cmd, void *param)
 		return init_mi_tree(404, "Empty input parameter", 21);
 		return init_mi_tree(404, "Empty input parameter", 21);
 	}
 	}
 
 
+	LM_DBG("trying to translate %.*s with dpid %i\n",
+			input.len, input.s, idp->dp_id);
 	if (translate(NULL, input, &output, idp, &attrs)!=0){
 	if (translate(NULL, input, &output, idp, &attrs)!=0){
 		LM_DBG("could not translate %.*s with dpid %i\n", 
 		LM_DBG("could not translate %.*s with dpid %i\n", 
 			input.len, input.s, idp->dp_id);
 			input.len, input.s, idp->dp_id);
-		return 0;
+		return init_mi_tree(404, "No translation", 14);
 	}
 	}
 	LM_DBG("input %.*s with dpid %i => output %.*s\n",
 	LM_DBG("input %.*s with dpid %i => output %.*s\n",
 			input.len, input.s, idp->dp_id, output.len, output.s);
 			input.len, input.s, idp->dp_id, output.len, output.s);