[SR-Users] return 0 is not equivalent to exit

Patrick Karton patrickarton at hotmail.com
Mon Jul 4 10:52:22 CEST 2022


on 5.5 kamailio wiki for core it is stated that return (0) is the same as exit. but that's not true

request_route {

    if (route(POS)){
        xlog("POS PASS\r\n");
    }

    if (!route(NEG)){
        xlog("NEG PASS\r\n");
    }

    if (!route(ZERO)) {
        xlog("ZERO PASS\r\n");
    }

    xlog("AFTER ZERO\r\n");
    send_reply("400","Error");
    return;
}



route[POS]{
    return 1;
}

route[NEG]{
    return -1;
}

route[ZERO] {
    return 0;
}


for example from the config above not only ZERO PASS will be printed but also all the actions after route(ZERO) are still executed.

instead if i replace return 0 with exit in route[ZERO]. this work as expected.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220704/0a036444/attachment.htm>


More information about the sr-users mailing list