Would you be able to test with master branch? I pushed there a commit that prints the method id inside options reply if there is a mismatch with OPTIONS.

I also exposed the KSR.siputils.options_reply() function directly, in the future releases it should be preferred instead of KSR.x.modf("options_reply").

Cheers,
Daniel

On Tue, Jul 16, 2019 at 3:15 PM Alexandru Covalschi <568691@gmail.com> wrote:
... in request route 
       KSR.xlog.xinfo("\n!!!\nBefore options_reply (before route_reqinit) $rm valus is " + KSR.pv.get("$rm") + "\n!!!\n")
        self.ksr_route_reqinit(msg);
_________

... in reqinit
        KSR.xlog.xinfo("\n!!!\nBefore options_reply (before is_options) $rm valus is " + KSR.pv.get("$rm") + "\n!!!\n")
        if KSR.is_OPTIONS() and KSR.is_myself_ruri():
            KSR.xlog.xinfo("\n!!!\nBefore options_reply (after is_options) $rm valus is " + KSR.pv.get("$rm") + "\n!!!\n")
            KSR.x.modf("options_reply");
            exit();
__________


 2(494) INFO: <script>:
!!!
Before options_reply (before route_reqinit) OPTIONS valus is OPTIONS
!!!
 2(494) INFO: <script>: IN ksr_route_reqinit
 2(494) INFO: <script>:
!!!
Before options_reply (before is_options) OPTIONS valus is OPTIONS
!!!
 2(494) INFO: <script>:
!!!
Before options_reply (after is_options) OPTIONS valus is OPTIONS
!!!
 2(494) ERROR: siputils [options.c:50]: opt_reply(): called for non-OPTIONS request

________________________________
Regards,
Alexandru Covalschi
VoIP Engineer and System Administrator
tel: +37367367850

15 июля 2019 г., в 17:35, Daniel-Constantin Mierla <miconda@gmail.com> написал(а):

Hello,

quite strange, I looked a bit over the code and I couldn't spot anything wrong. Can you print the value of the pseudo-variable $rm from python (get it via KSR.pv.get(...)) and see what it reports?

Cheers,
Daniel

On Mon, Jul 15, 2019 at 9:16 AM Alexandru Covalschi <568691@gmail.com> wrote:
It's in route_reqinit, I only to couple of checks before calling it

    def ksr_request_route(self, msg):
        received_port = KSR.pv.get("$Rp");
        proto = KSR.pv.get("$proto");
        if ((received_port == MY_WS_PORT) or (received_port == MY_WSS_PORT) and
            (proto != "ws") and (proto != "wss")):
            KSR.xlog.xwarn("SIP request received on " + received_port + "\n");
            KSR.sl.send_reply(403, "Forbidden");
            exit();

        if not KSR.is_method_in("IABCRO"):
            KSR.sl.sl_send_reply(405, "Method not allowed");
            exit();

        if KSR.is_INVITE():
            KSR.rr.record_route();
            KSR.dialog.dlg_manage();

        self.ksr_route_reqinit(msg);

    def ksr_route_reqinit(self, msg):
        KSR.xlog.xinfo("IN ksr_route_reqinit\n");
        if KSR.maxfwd.process_maxfwd(10) < 0:
            KSR.sl.sl_send_reply(483, "Too many hops");
            exit();

        if KSR.is_OPTIONS() and KSR.is_myself_ruri():
            KSR.x.modf("options_reply");
            exit();

        if KSR.sanity.sanity_check(1511, 7) < 0:
            KSR.xlog.xinfo("Malformed SIP message from " + str(KSR.pv.get("$si")) + ":" + str(KSR.pv.get("$sp")) + "\n");
            exit();

        return 1;
________________________________
Regards,
Alexandru Covalschi
VoIP Engineer and System Administrator
tel: +37367367850

15 июля 2019 г., в 9:20, Daniel-Constantin Mierla <miconda@gmail.com> написал(а):

Hello,
do you have that piece of code in the request route function (or a function executed from there)?

Any other functions from KSR executed before, or it is just at the top?

Cheers,
Daniel

On Mon, Jul 15, 2019 at 12:31 AM Alexandru Covalschi <568691@gmail.com> wrote:
Hello list,

        if KSR.is_OPTIONS() and KSR.is_myself_ruri():
            KSR.x.modf("options_reply");
            exit();

with a valid URI (no username) gives the subj output (opt_reply(): called for non-OPTIONS request)
How could that be? 
Python KEMI, 5.2.3, docker.

________________________________
Regards,
Alexandru Covalschi
VoIP Engineer and System Administrator
tel: +37367367850

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda