[sr-dev] git:master: app_python: Bugfix for rewrite_ruri

Konstantin Mosesov ez at voipgroup.org.ua
Thu Feb 21 23:59:54 CET 2013


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

Author: Konstantin Mosesov <ez at voipgroup.org.ua>
Committer: Konstantin Mosesov <ez at voipgroup.org.ua>
Date:   Fri Feb 22 00:51:33 2013 +0200

app_python: Bugfix for rewrite_ruri

*) Fixed a bug in msg_rewrite_ruri discovered by "V Tone" <vtone001 at gmail.com>.
*) Removed 'python exception' when do_action returns error. Reason: it is not an exception.
*) Removed abort() if first_line type is invalid.

---

 modules/app_python/python_msgobj.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/app_python/python_msgobj.c b/modules/app_python/python_msgobj.c
index c1cac57..fec4d14 100644
--- a/modules/app_python/python_msgobj.c
+++ b/modules/app_python/python_msgobj.c
@@ -95,14 +95,13 @@ static PyObject *msg_rewrite_ruri(msgobject *self, PyObject *args)
     memset(&act, '\0', sizeof(act));
 
     act.type = SET_URI_T;
-    act.val[0].type = STR_ST;
+    act.val[0].type = STRING_ST;
     act.val[0].u.str.s = ruri;
     act.val[0].u.str.len = strlen(ruri);
 
     init_run_actions_ctx(&ra_ctx);
     if (do_action(&ra_ctx, &act, self->msg) < 0) {
         LM_ERR("Error in do_action\n");
-        PyErr_SetString(PyExc_RuntimeError, "Error in do_action\n");
     }
 
     Py_INCREF(Py_None);
@@ -302,8 +301,8 @@ static PyObject *msg_getType(msgobject *self, PyObject *unused)
 	    break;
 
 	default:
-    	    /* Shouldn't happen */
-	    abort();
+            rval = "SIP_INVALID";
+            break;
     }
 
     return PyString_FromString(rval);




More information about the sr-dev mailing list