Kamailio module dispatcher
Overview
Kamailio dispatcher 모듈 내용 정리
Parameters
ds_ping_reply_codes
This parameter defines the valid response codes, which are accepted as a valid reply to the PING-Method. It is a list separated by colons, where you may define either a single code (e.g. "code=202" would accept 202 as an additional, valid response) or a class of responses, you want to accept(e.g. "class=2" would accept everything from 200 to 299 as valid response). This parameter can be modified via config framework.
Please note that the response codes the module accepts as valid reply to the PING-Method are not only ones generated from the remote servers, but also those that are generated locally. E.g.:setting code=408 or class=400 will never set a backend down even if it is, because internally the Kamailio transactio layer generates a 408 in the case of no response from the remote server, and this internal code 408 is accepted as valid value.
Default value is ""(Only 200 OK is accepted).
modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=403;code=488;class=3")
ds_probing_mode
Controls what gateways are tested to see if they are reachable.
modparam("dispatcher", "ds_probing_mode", 3)
ETC
dispatcher tcp
LB balancer
GCP 의 로드 밸런서를 이용해서 Dispatcher 모듈을 대체하고자 했다. 하지만 kamailio 가 TCP request 를 보낼때마다 계속 같은 connection(같은 Send IP/Port)만을 사용하는 문제가 있었다. 같은 Send IP/PORT 로 Request 를 보낼 경우, LB 의 Session affinity 에 의해 같은 목적지로만 트래픽이가는 현상이 발생했다. 결국 다시 dispatcher 모듈을 사용하기로 결정...
kamailio 소스도 살펴보았으나, Sender IP 를 마음대로 바꾸는 로직은 아직 구현되지 않았었음.(src/core/forward.c, get_send_socket2())