Re: [SR-Users] JS Kemi TypeError: undefined not callable (property 'ifdef' of [object Object])

2022-01-18 Thread Huseyin Kaan Koyukan
Hello again,

From the e-mail thread, 
(https://www.mail-archive.com/sr-users@lists.kamailio.org/msg15732.html) I 
found out that, as I suspected, kx.ifdef was rather recently added. (July 14, 
2021) whereas my kamailio was compiled on June 3rd 2021 

I replicated the functions from the commit 
(https://github.com/kamailio/kamailio/commit/851a8c0f0c8f7cc7ab22cb905bdb3987e9fa461b)
 and recompiled the kex module and now my kamailio starts without an issue.

Thanks,
Kaan
[https://opengraph.githubassets.com/7dc2f5cb07221b2c682c5765f27d38713beb3405f6b88f6bcc1c361f39d2e531/kamailio/kamailio/commit/851a8c0f0c8f7cc7ab22cb905bdb3987e9fa461b]
kemix: added KSR.kx.ifdef() and KSR.kx.ifndef() · 
kamailio/kamailio@851a8c0
- return true/false if a specified id is defined or not
github.com



[https://opengraph.githubassets.com/7dc2f5cb07221b2c682c5765f27d38713beb3405f6b88f6bcc1c361f39d2e531/kamailio/kamailio/commit/851a8c0f0c8f7cc7ab22cb905bdb3987e9fa461b]
kemix: added KSR.kx.ifdef() and KSR.kx.ifndef() · 
kamailio/kamailio@851a8c0
- return true/false if a specified id is defined or not
github.com



From: Huseyin Kaan Koyukan
Sent: Tuesday, January 18, 2022 10:14 AM
To: sr-users@lists.kamailio.org 
Subject: JS Kemi TypeError: undefined not callable (property 'ifdef' of [object 
Object])

Hello Everyone,

First of all, this is my first ever e-mail to the group so I'd like to thank 
all the developers who built this great product and thank everyone for the kind 
and helpful community. I've been using Kamailio for the past 8 months, I've had 
lots of fun with it.

My issue is I'm trying to set-up JS Kemi interpreter for my Kamailio-Asterisk 
box. I translated the config file to JS kemi, which wasn't too bad but I'm 
getting a type error for the "KSR.kx.ifdef("WITH_ASTERISK")" statement that I 
used.

Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) DEBUG: app_jsdt 
[app_jsdt_api.c:1478]: dukopen_KSR(): module 'KSR' has been initialized
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) DEBUG: app_jsdt 
[app_jsdt_api.c:473]: jsdt_sr_init_child(): loading js script file: 
/usr/local/etc/kamailio/kamailio-basic-kemi-jsdt.js
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) ERROR: app_jsdt 
[app_jsdt_api.c:447]: jsdt_kemi_load_script(): failed running: TypeError: 
undefined not callable (property 'ifdef' of [object Object])
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) ERROR:  
[core/sr_module.c:865]: init_mod_child(): error while initializing module 
app_jsdt (/usr/local/lib64/kamailio/modules/app_jsdt.so) (idx: 0 rank: -127 
desc: [main])
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) ERROR:  [main.c:1671]: 
main_loop(): error in init_child(PROC_INT) -- exiting

In syslog I can see that  kex.so module is loaded successfully and 'KSR' has 
been initialized. I don't know what I'm doing wrong. A few sample JS Kemi code 
that I could find did not use the kx.ifdef function. Was this a new addition to 
the interpreter? Perhaps my Kamailio version (kamailio 5.5.0 x86_64/linux) does 
not support it?

Thank you all in advance.

Kaan.
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] JS Kemi TypeError: undefined not callable (property 'ifdef' of [object Object])

2022-01-18 Thread Huseyin Kaan Koyukan
Hello Everyone,

First of all, this is my first ever e-mail to the group so I'd like to thank 
all the developers who built this great product and thank everyone for the kind 
and helpful community. I've been using Kamailio for the past 8 months, I've had 
lots of fun with it.

My issue is I'm trying to set-up JS Kemi interpreter for my Kamailio-Asterisk 
box. I translated the config file to JS kemi, which wasn't too bad but I'm 
getting a type error for the "KSR.kx.ifdef("WITH_ASTERISK")" statement that I 
used.

Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) DEBUG: app_jsdt 
[app_jsdt_api.c:1478]: dukopen_KSR(): module 'KSR' has been initialized
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) DEBUG: app_jsdt 
[app_jsdt_api.c:473]: jsdt_sr_init_child(): loading js script file: 
/usr/local/etc/kamailio/kamailio-basic-kemi-jsdt.js
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) ERROR: app_jsdt 
[app_jsdt_api.c:447]: jsdt_kemi_load_script(): failed running: TypeError: 
undefined not callable (property 'ifdef' of [object Object])
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) ERROR:  
[core/sr_module.c:865]: init_mod_child(): error while initializing module 
app_jsdt (/usr/local/lib64/kamailio/modules/app_jsdt.so) (idx: 0 rank: -127 
desc: [main])
Jan 17 15:11:26 anayurt kamailio[8261]:  0(8261) ERROR:  [main.c:1671]: 
main_loop(): error in init_child(PROC_INT) -- exiting

In syslog I can see that  kex.so module is loaded successfully and 'KSR' has 
been initialized. I don't know what I'm doing wrong. A few sample JS Kemi code 
that I could find did not use the kx.ifdef function. Was this a new addition to 
the interpreter? Perhaps my Kamailio version (kamailio 5.5.0 x86_64/linux) does 
not support it?

Thank you all in advance.

Kaan.
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Handling special characters - KEMI lua redis_ndb

2022-01-18 Thread Muhammad Danish Moosa
Hi Guys,

I am trying to do following code


 KSR.ndb_redis.redis_cmd("srvN", "SET var " .. testvar, "r");

it works fine but if testvar has special character like SPACE or % , it
does not work. For example when testvar="asdsada%Dasda"; it starts
considering %D as place holder and does not add key to redis (does not
raise error as well)

With Space I tried to use delimeters like "" or '' but none of them work.

For now I have got it working through , search and replace but thats not a
clean solution.

Any suggestions?

-- 
Muhammad Danish Moosa

" The core of mans' spirit comes from new experiences. "___ Christopher
McCandless
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Question about siptrace destination/source port capture in HEPv3 mode

2022-01-18 Thread Karsten Horsmann
Hello List,

I observe an interesting behavior. We use siptrace as an active capture
agent for QXIP HOMER/HEPIC installations.
The destination port and the source port in the HEPv3 Header are not
correct if you use transport tcp for example.

My Question: is that intended or a bug and i should fill up an issue?

On udp, it's filled with 5060 or whatever your listening directive says.

I tested that with kamailio 5.5 and kamailio master.

I attached an HEPv3 capture from two kamailios (master) speaking with each
other.
You need the https://github.com/sipcapture/hep-wireshark lua dissector to
read the capture.

10.0.2.15 (kamailio with uacreg and sipcapture/HEPv3 mode)
192.168.50.4 (kamailio as registrar)

Frame 1 shows an tcp transport register Request from 10.0.2.15 to
192.168.50.4 in HEPv3.
The Source Port in the HEP3 Protocol is not correct (its an highport /
45419).

Frame 4 shows the 401 answer and the Destination port is 0.
Frame 7 also had this behavior.


- params (nearly at the end):
modparam("siptrace", "duplicate_uri", "MY_HOMER_CAPTURE")
modparam("siptrace", "hep_mode_on", 1)
modparam("siptrace", "hep_version", 3)
modparam("siptrace", "hep_capture_id", MY_HOMER_CAPTURE_ID) # capture agent
id Limitation: 32-bit for HEPv3.
modparam("siptrace", "trace_to_database", 0)
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "trace_mode", 1) # default 0, if 1 then you dont need
call siptrace flag or sip_trace()



-- 
Mit freundlichen Grüßen / Kind Regards
*Karsten Horsmann*


dumphep3.pcap
Description: Binary data
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Issues running mongodb command from kamailio

2022-01-18 Thread Henning Westerholt
Thanks for reporting back, good that its solved.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Edo 
Sent: Sunday, January 16, 2022 2:07 AM
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Issues running mongodb command from kamailio

All,
Issue resolved. It must have been my notepad application added some invisible 
characters to my command. I did a regular copy and paste from the tutorial and 
changed the parameters as needed and all is well now.

Thanks

On Fri, Jan 14, 2022 at 11:25 AM Edo 
mailto:edo.eku...@gmail.com>> wrote:

The lines are


#Start of change



Line 878if (mongodb_find_one("mongodbsrv1", “telephone", “cXXX", " { 
\'did\': \'2X\' } ", "mgr1")) {



Line 879   xlog("response from mongodb is 
[[$mongodb(mgr1=>value)]]\n");



   }

#End of change


On Thu, Jan 13, 2022 at 12:42 AM Henning Westerholt 
mailto:h...@gilawa.com>> wrote:
Hello,

which lines are the line 878 and 879, reported in the error message in your cfg?

Try to simplify this line, e.g., by removing or substitute some parameters or 
function calls to find out the cause.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of Edo
Sent: Thursday, January 13, 2022 6:27 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] Issues running mongodb command from kamailio

Hi All,

Please help!
I am getting an error when trying to start kamailio after making some changes 
to the configuration file.

Error is :


rse error in config file /etc/kamailio/kamailio.cfg, line 878, column 47-57: 
'('')' expected (function call)



rse error in config file /etc/kamailio/kamailio.cfg, line 878, column 102: bad 
expression



rse error in config file /etc/kamailio/kamailio.cfg, line 878, column 102: bad 
command



atus=255/EXCEPTION



rse error in config file /etc/kamailio/kamailio.cfg, line 878, column 103: bad 
command



rse error in config file /etc/kamailio/kamailio.cfg, line 878, column 105: bad 
command

 used inside params of another function: xlog



rse error in config file /etc/kamailio/kamailio.cfg, line 879, column 28: use 
of function execution inside params not allowed



Server.
Changes made is :


# Routing to foreign domains



route[SIPOUT] {



if (uri==myself) return;



#Start of change



if (mongodb_find_one("mongodbsrv1", “telephone", “cXXX", " { \'did\': 
\'2X\' } ", "mgr1")) {



   xlog("response from mongodb is 
[[$mongodb(mgr1=>value)]]\n");



   }

#End of change



append_hf("P-hint: outbound\r\n");



route(RELAY);



exit;



}
Please can someone tell me what I am doing wrong. Error says syntax but I have 
tried many permutations of the suggested syntax with no luck.

Please help

Thanks
--
-
Ekunwe
EDO Network Services, Inc.
Tel: 601.497.3932


--
-
Ekunwe
EDO Network Services, Inc.
Tel: 601.497.3932
Fax: 601.979.5931


--
-
Ekunwe
EDO Network Services, Inc.
Tel: 601.497.3932
Fax: 601.979.5931
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] REGISTER for MS Teams

2022-01-18 Thread Henning Westerholt
Hello,

not sure if I understood your question correctly. MS Teams will not send you 
any REGISTER request, this works differently.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: sr-users  On Behalf Of Lucian Romi
Sent: Sunday, January 16, 2022 6:28 PM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] REGISTER for MS Teams

Hi, can register send from ms teams or I have to use Kamailio to send to my PBX.
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users