I took a look at source for siputils module. This function returns -1 so the python syntax I'm using won't work here.

'if not' expects 0/false as return value.
-dan


From: Daniel W. Graham via sr-users <sr-users@lists.kamailio.org>
Sent: Tuesday, November 12, 2024 19:13
To: sr-users@lists.kamailio.org <sr-users@lists.kamailio.org>
Cc: Daniel W. Graham <dan@cmsinter.net>
Subject: [SR-Users] Re: KEMI / Python Issues
 
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe

Return yields the same results. I previously used return but changed to sys.exit() based on KEMI documentation page, I may have mis-interpreted the direction there. The comma was a typo in the email.

Thanks for the pointers.
-dan

From: Ricardo Castillo via sr-users <sr-users@lists.kamailio.org>
Sent: Tuesday, November 12, 2024 18:00
To: sr-users@lists.kamailio.org <sr-users@lists.kamailio.org>
Cc: Ricardo Castillo <pkecastillo@gmail.com>
Subject: [SR-Users] Re: KEMI / Python Issues
 
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe


Daniel, first check and fix sys.exit) ->  sys.exit()   and sys,exit() -> sys.exit()

Replace sys.exit() with `return` to avoid abruptly stopping the Kamailio process.

try it:

if not ksr.siputils.has_totag():
    ksr.info("has to tag")
    return

if ksr.is_method("ACK"):
    if ksr.tm.t_check_trans():
        ksr.relay()
        return
    else:
        return
ksr.sl.send_reply(404, "Not here")
return

regards!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: