Hi Spencer I am configuring something similar. May i know what is your configuration for Kamailio for routing packets to FreeSwitch? Sorry i am pretty new here. Thanks in advance -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Subscribe-for-MWI-tp7557448p75... Sent from the freeswitch-users mailing list archive at Nabble.com.
Hello, Our setup is as follows: Kamailio and FreeSWITCH run on the same machine on different ports. User accounts are managed with a custom Django application and stored in a Postgresql database. Kamailio handles registrations, auth, and NAT traversal using rtpproxy. Freeswitch is used for voicemail and CDR accounting. The cdrs are POSTed back to the local webserver using mod_json_cdr where the Django app performs rating and billing. We use 4 profiles for FreeSWITCH: Inbound(from PSTN), Outbound(to PSTN), Onnet(user to user), and Media(voicemail). Kamailio does all the necessary routing to the individual profiles and then we use mod_xml_curl to get the user info to FreeSWITCH for voicemail settings, etc. We then send the call back to Kamailio for routing either to another user, the PSTN or a failover destination. The reason for this complexity is so that when we need to scale, each piece can be scaled independently as needed(i.e. web server, database, cdr collection webserver, inbound proxy, outbound proxy, b2bua, and media server. To more concisely answer your original question, the basics are this: UAC sends a SUBSCRIBE to FreeSWITCH. Auth is performed by the proxy and the credentials are then stripped and the message is forwarded to the media profile. The proxy is authed by ACL. If the UAC is behind NAT, we replace the Contact header host with the IP of the Proxy so that the NOTIFYs get sent back to the proxy to handle NAT. FreeSWITCH will then send the NOTIFY to the proxy where we lookup the real contact address from the registration table and forward the packet to that URI. I hope this helps. Best, Spencer On May 29, 2012, at 2:13 AM, hiryu23 wrote:
Hi Spencer
I am configuring something similar. May i know what is your configuration for Kamailio for routing packets to FreeSwitch?
Sorry i am pretty new here.
Thanks in advance
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Subscribe-for-MWI-tp7557448p75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Sorry its late here. This should read:
UAC sends a SUBSCRIBE to FreeSWITCH. UAC sends a SUBSCRIBE to Kamailio (or other proxy). On May 30, 2012, at 10:59 PM, Spencer Thomason wrote:
Hello, Our setup is as follows: Kamailio and FreeSWITCH run on the same machine on different ports. User accounts are managed with a custom Django application and stored in a Postgresql database. Kamailio handles registrations, auth, and NAT traversal using rtpproxy. Freeswitch is used for voicemail and CDR accounting. The cdrs are POSTed back to the local webserver using mod_json_cdr where the Django app performs rating and billing. We use 4 profiles for FreeSWITCH: Inbound(from PSTN), Outbound(to PSTN), Onnet(user to user), and Media(voicemail). Kamailio does all the necessary routing to the individual profiles and then we use mod_xml_curl to get the user info to FreeSWITCH for voicemail settings, etc. We then send the call back to Kamailio for routing either to another user, the PSTN or a failover destination. The reason for this complexity is so that when we need to scale, each piece can be scaled independently as needed(i.e. web server, database, cdr collection webserver, inbound proxy, outbound proxy, b2bua, and media server. To more concisely answer your original question, the basics are this:
UAC sends a SUBSCRIBE to FreeSWITCH. Auth is performed by the proxy and the credentials are then stripped and the message is forwarded to the media profile. The proxy is authed by ACL. If the UAC is behind NAT, we replace the Contact header host with the IP of the Proxy so that the NOTIFYs get sent back to the proxy to handle NAT. FreeSWITCH will then send the NOTIFY to the proxy where we lookup the real contact address from the registration table and forward the packet to that URI.
I hope this helps.
Best, Spencer
On May 29, 2012, at 2:13 AM, hiryu23 wrote:
Hi Spencer
I am configuring something similar. May i know what is your configuration for Kamailio for routing packets to FreeSwitch?
Sorry i am pretty new here.
Thanks in advance
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Subscribe-for-MWI-tp7557448p75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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-tp7557448p75... Sent from the freeswitch-users mailing list archive at Nabble.com.
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-tp7557448p75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I notice when i register with UDP/TCP, i am able to receive the NOTIFY packet from FreeSwitch. However, when i register with TLS, I do not see FreeSwitch generating any NOTIFY packet. any help? -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Subscribe-for-MWI-tp7557448p75... Sent from the freeswitch-users mailing list archive at Nabble.com.
participants (2)
-
hiryu23
-
Spencer Thomason