[SR-Users] exit stop procesing or not after a conditional? based on "exit" core docs seems does not explain behaviour

Henning Westerholt hw at skalatan.de
Mon Aug 26 20:56:45 CEST 2019


Hello,

exit will stop the execution of the kamailio cfg script, so no code from the cfg file that comes after that statement will be executed. Just to be complete, Kamailio might execute other, implicit actions not related to the cfg script, e.g. if you send out a request etc..

Cheers,

Henning

Am 26.08.19 um 14:45 schrieb PICCORO McKAY Lenz:
in my kamailio-asterisk integration i have a exit after the authentication logic, BUT; there's another conditional after the "exit" sentence,

so my ask, if there's a exit in that piece of code .. that next conditional will not be executed?
Docs seems said "stop execution of script" so all the rest of the logic in file will not be routed?

The documentation seems does not explain in good behavior what happened or the kamailio-asterisk wiki page does not have good explanations for that! it's that an error?

https://www.kamailio.org/wiki/cookbooks/4.3.x/core#exit

  *
  *

```
if (from_uri==myself)
                {
#!ifdef WITH_ASTERISK
                        if (!proxy_authorize("$fd", "sipusers")) {
#!else
                        if (!proxy_authorize("$fd", "subscriber")) {
#!endif
                                proxy_challenge("$fd", "0");
                                exit;
                        }
                        if (is_method("PUBLISH"))
                        {
                                if ($au!=$tU) {
                                        sl_send_reply("403","Forbidden auth ID");
                                        exit;
                                }
                        } else {
                                if ($au!=$fU) {
                                        sl_send_reply("403","Forbidden auth ID");
                                        exit;
                                }
                        }

                        consume_credentials();
                        # caller authenticated
                } else {
                        # caller is not local subscriber, then check if it calls
                        # a local destination, otherwise deny, not an open relay here
                        if (!uri==myself)
                        {
                                sl_send_reply("403","Not relaying");
                                exit;
                        }
                }
        }


#!endif
        return;
}

```

 8:52 am



Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com



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


--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190826/c8895de8/attachment.html>


More information about the sr-users mailing list