[Freeswitch-users] Subscribe for MWI

Spencer Thomason spencer at 5ninesolutions.com
Fri Jul 13 19:29:02 MSD 2012


Here's how I did it:

in the main route block of kamailio.cfg:

    if (is_method("SUBSCRIBE")) {
        subst('/^Contact:(.*)sip:(.*)@[a-zA-Z0-9.:]+(.*)$/Contact:\1sip:$au@$Ri:
$Rp\3/ig');
        $du = "sip:" + "<FREESWITCH IP>" + ":" + "<FREESWITCH PORT>";
        if (!t_relay()) {
            sl_reply_error();
        }
        exit;
    }


That wil rewrite the contact on SUBSCRIBEs to the public IP and port of the kamailio instance that received the message.
You can then handle the NOTIFYs from FreeSWITCH with lookup("<REGISTRATION TABLE>") and route them to the registered endpoint.



On Jul 13, 2012, at 1:24 AM, hiryu23 wrote:

> Thanks Spencer. 
> 
> May i know how do you write the contact header before passing it to
> FreeSwitch?
> 
> --
> View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Subscribe-for-MWI-tp7557448p7580806.html
> Sent from the freeswitch-users mailing list archive at Nabble.com.
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> Join Us At ClueCon - Aug 7-9, 2012
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
> 




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list