System32
System32

Reputation: 3

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.

Upvotes: 0

Views: 7688

Answers (2)

suren
suren

Reputation: 385

Please use this code block that will surely help you:

if (!is_method("REGISTER")) { save("location","0x02"); }

And before relay use, only for register message:

rewritehostport("192.168.1.90:5060");

Upvotes: 0

os11k
os11k

Reputation: 1358

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

Upvotes: 1

Related Questions