[Freeswitch-dev] multicast presence, mwi and some registrations thoughts
Hi all, as promised, I've created a small patch to handle PRESENCE_IN and MWI events over multicast (using mod event multicast). When used along registrations sharing with multicast, you can send presence info over the mcast-bus :) and deliver the information to the phones, even if the call is not handled on the same switch the phone sent the subscription to. To make it work, the sip domain must be the all for all the machines and on the phones, otherwise the phones will ignore them. This allows distributed BLF and MWI notifications :) BUT doing that I noticed a issue that must be addressed imho, which arises when you handle NAT. "distributed blf" works behind nat right now, since the event will get sent to all switches, but delivered only to the phone were fs knows about the subscription. Which is the one where the phone registers to. "distributed mwi" results into sending N copies of same MWI notifications , where N is the number of switches. Behind NAT the phone will receive only the one sent by the switch where it's registered to. We can avoid sending multiple event if we're able to know which is the "original" server where the phone registered to. This is also needed to call the phone: think about a distributed registration cluster. if Alice (reg'ed on FS1) calls Bob on (reg'ed on FS2), right now the call is routed from FS1 to Bob, since FS1 knows where Bob is. This works ok without NAT. But with NAT FS1 cannot contact Bob, because Bob is on FS2 "really" and can receive calls from FS2 (nat pinhole). The solution is to check where Bob is (looking to registration table), get the "real" server and route the call from FS1 to FS2 then to Bob. But right now, sofia registration does not have a field holding the "original" server. If we want to leverage on distributed registration using multicast, I think knowing the original server is "a must". the patch is pretty trivial, but we must add a field onto the db. Doing that, we can also filter MWI notification, and send them only if the phone is "really" registered on the server which receives the MWI event over the mcast-bus . What do you think about it? Regards, mat P.S. this is my first patch to FS, so please be kind on my mistakes :)
Please post this on a bug on jira.freeswitch.org for further discussion. Mike On Dec 9, 2009, at 5:23 AM, Matteo wrote:
Hi all,
as promised, I've created a small patch to handle PRESENCE_IN and MWI events over multicast (using mod event multicast).
When used along registrations sharing with multicast, you can send presence info over the mcast-bus :) and deliver the information to the phones, even if the call is not handled on the same switch the phone sent the subscription to. To make it work, the sip domain must be the all for all the machines and on the phones, otherwise the phones will ignore them.
This allows distributed BLF and MWI notifications :)
BUT doing that I noticed a issue that must be addressed imho, which arises when you handle NAT.
"distributed blf" works behind nat right now, since the event will get sent to all switches, but delivered only to the phone were fs knows about the subscription. Which is the one where the phone registers to.
"distributed mwi" results into sending N copies of same MWI notifications , where N is the number of switches. Behind NAT the phone will receive only the one sent by the switch where it's registered to.
We can avoid sending multiple event if we're able to know which is the "original" server where the phone registered to.
This is also needed to call the phone: think about a distributed registration cluster. if Alice (reg'ed on FS1) calls Bob on (reg'ed on FS2), right now the call is routed from FS1 to Bob, since FS1 knows where Bob is. This works ok without NAT.
But with NAT FS1 cannot contact Bob, because Bob is on FS2 "really" and can receive calls from FS2 (nat pinhole).
The solution is to check where Bob is (looking to registration table), get the "real" server and route the call from FS1 to FS2 then to Bob.
But right now, sofia registration does not have a field holding the "original" server. If we want to leverage on distributed registration using multicast, I think knowing the original server is "a must".
the patch is pretty trivial, but we must add a field onto the db.
Doing that, we can also filter MWI notification, and send them only if the phone is "really" registered on the server which receives the MWI event over the mcast-bus .
What do you think about it?
Regards, mat
P.S. this is my first patch to FS, so please be kind on my mistakes :)
<sofia.c.diff>_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Hi, ----- "Michael Jerris" <mike@jerris.com> ha scritto:
Please post this on a bug on jira.freeswitch.org for further discussion.
Here we go: http://jira.freeswitch.org/browse/MODSOFIA-46 Regards, mat
Please post it on http://jira.freeswitch.org Thanks, Brian On Dec 9, 2009, at 4:23 AM, Matteo wrote:
Hi all,
as promised, I've created a small patch to handle PRESENCE_IN and MWI events over multicast (using mod event multicast).
When used along registrations sharing with multicast, you can send presence info over the mcast-bus :) and deliver the information to the phones, even if the call is not handled on the same switch the phone sent the subscription to. To make it work, the sip domain must be the all for all the machines and on the phones, otherwise the phones will ignore them.
This allows distributed BLF and MWI notifications :)
BUT doing that I noticed a issue that must be addressed imho, which arises when you handle NAT.
"distributed blf" works behind nat right now, since the event will get sent to all switches, but delivered only to the phone were fs knows about the subscription. Which is the one where the phone registers to.
"distributed mwi" results into sending N copies of same MWI notifications , where N is the number of switches. Behind NAT the phone will receive only the one sent by the switch where it's registered to.
We can avoid sending multiple event if we're able to know which is the "original" server where the phone registered to.
This is also needed to call the phone: think about a distributed registration cluster. if Alice (reg'ed on FS1) calls Bob on (reg'ed on FS2), right now the call is routed from FS1 to Bob, since FS1 knows where Bob is. This works ok without NAT.
But with NAT FS1 cannot contact Bob, because Bob is on FS2 "really" and can receive calls from FS2 (nat pinhole).
The solution is to check where Bob is (looking to registration table), get the "real" server and route the call from FS1 to FS2 then to Bob.
But right now, sofia registration does not have a field holding the "original" server. If we want to leverage on distributed registration using multicast, I think knowing the original server is "a must".
the patch is pretty trivial, but we must add a field onto the db.
Doing that, we can also filter MWI notification, and send them only if the phone is "really" registered on the server which receives the MWI event over the mcast-bus .
What do you think about it?
Regards, mat
P.S. this is my first patch to FS, so please be kind on my mistakes :)
<sofia.c.diff>_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
I'm open to the idea as long as the patch properly deals with the new col to make it upgrade itself. On Wed, Dec 9, 2009 at 4:23 AM, Matteo <mbrancaleoni@voismart.it> wrote:
Hi all,
as promised, I've created a small patch to handle PRESENCE_IN and MWI events over multicast (using mod event multicast).
When used along registrations sharing with multicast, you can send presence info over the mcast-bus :) and deliver the information to the phones, even if the call is not handled on the same switch the phone sent the subscription to. To make it work, the sip domain must be the all for all the machines and on the phones, otherwise the phones will ignore them.
This allows distributed BLF and MWI notifications :)
BUT doing that I noticed a issue that must be addressed imho, which arises when you handle NAT.
"distributed blf" works behind nat right now, since the event will get sent to all switches, but delivered only to the phone were fs knows about the subscription. Which is the one where the phone registers to.
"distributed mwi" results into sending N copies of same MWI notifications , where N is the number of switches. Behind NAT the phone will receive only the one sent by the switch where it's registered to.
We can avoid sending multiple event if we're able to know which is the "original" server where the phone registered to.
This is also needed to call the phone: think about a distributed registration cluster. if Alice (reg'ed on FS1) calls Bob on (reg'ed on FS2), right now the call is routed from FS1 to Bob, since FS1 knows where Bob is. This works ok without NAT.
But with NAT FS1 cannot contact Bob, because Bob is on FS2 "really" and can receive calls from FS2 (nat pinhole).
The solution is to check where Bob is (looking to registration table), get the "real" server and route the call from FS1 to FS2 then to Bob.
But right now, sofia registration does not have a field holding the "original" server. If we want to leverage on distributed registration using multicast, I think knowing the original server is "a must".
the patch is pretty trivial, but we must add a field onto the db.
Doing that, we can also filter MWI notification, and send them only if the phone is "really" registered on the server which receives the MWI event over the mcast-bus .
What do you think about it?
Regards, mat
P.S. this is my first patch to FS, so please be kind on my mistakes :)
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Hi, ----- "Anthony Minessale" <anthony.minessale@gmail.com> ha scritto:
I'm open to the idea as long as the patch properly deals with the new col to make it upgrade itself.
I've checked mod sofia, and no table updates occur right now. What do you think can be the best approach ? Write a test sql in sofia_glue_init_sql and if failed alter the table with the new col ? of course the create will have the new col by default. is this the right way to go ? thanks, mat
There are certainly things in there to create the tables right if they have changed. grep for test_reactive Mike On Dec 9, 2009, at 1:56 PM, Matteo wrote:
Hi,
----- "Anthony Minessale" <anthony.minessale@gmail.com> ha scritto:
I'm open to the idea as long as the patch properly deals with the new col to make it upgrade itself.
I've checked mod sofia, and no table updates occur right now.
What do you think can be the best approach ? Write a test sql in sofia_glue_init_sql and if failed alter the table with the new col ?
of course the create will have the new col by default.
is this the right way to go ?
thanks, mat
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
yes just mix the new col into the statement that it tests with then that will make it fail and recreate the tables. On Wed, Dec 9, 2009 at 1:36 PM, Michael Jerris <mike@jerris.com> wrote:
There are certainly things in there to create the tables right if they have changed. grep for test_reactive
Mike
On Dec 9, 2009, at 1:56 PM, Matteo wrote:
Hi,
----- "Anthony Minessale" <anthony.minessale@gmail.com> ha scritto:
I'm open to the idea as long as the patch properly deals with the new col to make it upgrade itself.
I've checked mod sofia, and no table updates occur right now.
What do you think can be the best approach ? Write a test sql in sofia_glue_init_sql and if failed alter the table with the new col ?
of course the create will have the new col by default.
is this the right way to go ?
thanks, mat
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Hi, ----- "Anthony Minessale" <anthony.minessale@gmail.com> ha scritto:
yes just mix the new col into the statement that it tests with then that will make it fail and recreate the tables.
ok, I just finished a patch where the db is updated correctly and mcast registration stores the original server_host and original hostname. Now I'm adding the possibility to tell sofia to dial user@original_server_host instead to real user contact (useful for nat). Hope to finish soon :) regards, mat
Hi, final(?) patch on jira, along with "what changed" http://jira.freeswitch.org/browse/MODSOFIA-46 patch => mod_sofia.diff, 11/Dec/09 03:54 AM regards, matteo
participants (4)
-
Anthony Minessale
-
Brian West
-
Matteo
-
Michael Jerris