diff --git a/kamailio/dispatcher-role.cfg b/kamailio/dispatcher-role.cfg index a9bfaa2..1a34794 100644 --- a/kamailio/dispatcher-role.cfg +++ b/kamailio/dispatcher-role.cfg @@ -221,7 +221,12 @@ route[DISPATCHER_CHECK_MEDIA_SERVER] if($var(Zone) != "MY_AMQP_ZONE") { $var(SetId) = 2; } - sql_query("exec", "insert into dispatcher (setid, destination) select $var(SetId), \"$var(MediaUrl)\" where not exists(select * from dispatcher where destination = \"$var(MediaUrl)\")"); + if ("KAZOO_DB_URL" =~ "^mysql") { + sql_query("exec", "insert into dispatcher (setid, destination) select $var(SetId), \"$var(MediaUrl)\" from DUAL where not exists(select * from dispatcher where destination = \"$var(MediaUrl)\")"); + } + else { + sql_query("exec", "insert into dispatcher (setid, destination) select $var(SetId), \"$var(MediaUrl)\" where not exists(select * from dispatcher where destination = \"$var(MediaUrl)\")"); + } if($sqlrows(exec) > 0) { xlog("L_WARNING", "reloading dispatcher table\n"); ds_reload();