Search code examples
proxyasterisksipkamailioregistrar

forward REGISTER message with kamailio


There is kamailio on centos box and my scheme looks like this:

sip client ---> Kamailio ---> PBX (not asterisk)

and i need to know how i can just forward REGISTER and all MESSAGE from sip client via kamailio to PBX, except SUBSCRIBE.

i googled and i tried many times and i dont know what i am doing wrong

example : rewritehost and send

there is a default kamailio.cfg and i am tring to add handle SIP registration method

if(is_method("REGISTER"))
 {
 send("udp:ip address:5060");
 };

and also i tried

rewritehost("ip address");

but it does not work.


Solution

  • Please check path module.

    route[REGISTRAR] {
        if(!is_method("REGISTER"))
            return;
        add_path_received();
            route(DISPATCH);
    }
    

    I have created sample config, which works with Freeswitch and should work with any PBX which support PATH.

    https://github.com/os11k/dispatcher/blob/master/kamailio.cfg