[SR-Users] Need help in routing configuration

Nelson Pereira npereira at protus.com
Wed May 19 19:41:48 CEST 2010


I have the bellow setup for openser, yet this wont work in Kamilio.
Wondering if anyone could help to make this routing code work?

What Im looking to do is receive Invites in UDP and relaying it via TCP....

route{
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                exit;
        };
        if (msg:len >=  2048 ) {
                sl_send_reply("513", "Message too big");
                exit;
        };
        if (loose_route()) {
                append_hf("P-hint: rr-enforced\r\n");
                route(1);
        };
        if (!uri==myself) {
                append_hf("P-hint: outbound\r\n");
                route(1);
        };
        route(1);
}

route[1]
{
        if (src_ip==10.98.6.5) {
                if (dst_port==5060) {
                        t_relay("tcp:10.98.118.20:5060");
                }
                if (dst_port==5065) {
                        t_relay("tcp:10.98.118.20:5065");
                }
                else if (dst_port==5066) {
                        t_relay("tcp:10.98.118.20:5066");
                }
                else if (dst_port==5067) {
                        t_relay("tcp:10.98.118.20:5067");
                }
#                else {
#                       t_relay("tcp:10.98.118.20:5060");
#               }
        }
        else {
                t_relay("udp:10.98.6.5:5060");
        };
}

Nelson Pereira
Senior Network Specialist

Protus<http://www.protus.com/>
npereira at protus.com<mailto:name at protus.com>
phone: 613.733.0000 ext.528
MyFax: 613.822.5083

MyFax.com<http://www.myfax.com/> | my1voice.com<http://www.my1voice.com/> | Campaigner.com<http://www.campaigner.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100519/be15fd6f/attachment.htm>


More information about the sr-users mailing list