[sr-dev] git:master:3f6e25ec: app_ruby: proper push of int values to Ruby for xval function return

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 6 16:45:36 CEST 2019


Module: kamailio
Branch: master
Commit: 3f6e25ecb0ac64f8c0d534e4390d43afc49d5ae0
URL: https://github.com/kamailio/kamailio/commit/3f6e25ecb0ac64f8c0d534e4390d43afc49d5ae0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-08-06T16:44:25+02:00

app_ruby: proper push of int values to Ruby for xval function return

---

Modified: src/modules/app_ruby/app_ruby_api.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3f6e25ecb0ac64f8c0d534e4390d43afc49d5ae0.diff
Patch: https://github.com/kamailio/kamailio/commit/3f6e25ecb0ac64f8c0d534e4390d43afc49d5ae0.patch

---

diff --git a/src/modules/app_ruby/app_ruby_api.c b/src/modules/app_ruby/app_ruby_api.c
index 8a4679d775..dcc645d13c 100644
--- a/src/modules/app_ruby/app_ruby_api.c
+++ b/src/modules/app_ruby/app_ruby_api.c
@@ -236,7 +236,7 @@ int ruby_sr_initialized(void)
  */
 int sr_kemi_ruby_return_int(sr_kemi_t *ket, int rc)
 {
-	if(ket->rtype==SR_KEMIP_INT) {
+	if(ket->rtype==SR_KEMIP_INT || ket->rtype==SR_KEMIP_XVAL) {
 		return INT2NUM(rc);
 	}
 	if(ket->rtype==SR_KEMIP_BOOL && rc!=SR_KEMI_FALSE) {
@@ -426,7 +426,7 @@ VALUE sr_kemi_ruby_return_xval(sr_kemi_t *ket, sr_kemi_xval_t *rx)
 		case SR_KEMIP_NONE:
 			return Qnil;
 		case SR_KEMIP_INT:
-			return sr_kemi_ruby_return_int(ket, rx->v.n);
+			return INT2NUM(rx->v.n);
 		case SR_KEMIP_STR:
 			return rb_str_new(rx->v.s.s, rx->v.s.len);
 		case SR_KEMIP_BOOL:




More information about the sr-dev mailing list