[SR-Users] Read $fd from mysql?

Mihai Cezar mihai at mokalife.ro
Sun Dec 27 13:18:49 CET 2020


Hello,

I am redirecting the agents/reps to their asterisk server based on the
hostname which they connect, and, i wonder if it's possible to read from db
instead of the file cause it's getting big ;)

# Dispatch requests
route[DISPATCH] {
        switch ($fd){
                        case "oro.streamlinepbx.nl":
                                if (!ds_select_dst("1", "4")) {
                                        send_reply(503, "Service
Unavailable $fd");
                                        exit;
                                }
                                break;
                        case "oro3.streamlinepbx.nl":
                                if (!ds_select_dst("2", "4")) {
                                        send_reply(503, "Service
Unavailable $fd");
                                        exit;
                                }
                                break;
                      ............
                        default:
                            log("unknow destination?");
                            send_reply(503, "No service defined");
                            xlog("--- SCRIPT: going to <$ru> via <$du>
...Exiting");
                            exit;
                }

        xlog("--- SCRIPT: going to <$ru> via <$du> (attrs:
$xavp(_dsdst_=>attrs))\n");
        t_on_failure("RTF_DISPATCH");
        route(RELAY);
        exit;
}

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


More information about the sr-users mailing list