[Freeswitch-branches] [commit] r4144 - freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia

Freeswitch SVN anthonyl at freeswitch.org
Wed Feb 7 02:26:45 EST 2007


Author: anthonyl
Date: Wed Feb  7 02:26:45 2007
New Revision: 4144

Modified:
   freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c

Log:
just toying around with some pointless code.. please ignore

Modified: freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c	Wed Feb  7 02:26:45 2007
@@ -239,6 +239,8 @@
 	int running;
 	int codec_ms;
 	int dtmf_duration;
+    int transport_udp; /* just for temp. testing now -anthonyl */
+    int transport_tcp; /* just for temp. testing now -anthonyl */
 	unsigned int flags;
 	unsigned int pflags;
 	uint32_t max_calls;
@@ -4791,11 +4793,8 @@
 	if (profile->pflags & PFLAG_PRESENCE) {
 		establish_presence(profile);
 	}
-
-
-
-
-	while(globals.running == 1) {
+	
+    while(globals.running == 1) {
 		if (++ireg_loops >= IREG_SECONDS) {
 			check_expire(db, profile, time(NULL));
 			ireg_loops = 0;
@@ -4820,6 +4819,20 @@
 		switch_event_fire(&s_event);
 	}
 
+    /* I am rather sure, not 100% that we need to unpublish tcp as well -anthonyl */
+    if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {
+        switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._tcp");
+        switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
+        switch_event_fire(&s_event);
+    }
+    
+    /* see what happens when we unpublish this as well -anthonyl */
+    if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {
+        switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._sctp");
+        switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
+        switch_event_fire(&s_event);
+    }
+
 	su_root_destroy(profile->s_root);
 	pool = profile->pool;
 	switch_core_destroy_memory_pool(&pool);
@@ -4998,7 +5011,19 @@
 						} else {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Duration out of bounds!\n");
 						}
-					}
+					} else if (!strcasecmp(var, "sip-transport-tcp")) { /* tcp tansport settings -anthonyl */
+                            if (!strcasecmp(val, "on")) {
+                                profile->transport_tcp = 1;
+                            } else {
+                                profile->transport_tcp = 0;
+                            }
+                    } else if (!strcasecmp(var, "sip-transport-udp")) { /* udp transport settings -anthonyl */
+                        if (!strcasecmp(val, "on")) {
+                            profile->transport_udp = 1;
+                        } else {
+                            profile->transport_udp = 0;
+                        }
+                    }
 				}
 
 				if (switch_test_flag(profile, TFLAG_TIMER) && !profile->timer_name) {



More information about the Freeswitch-branches mailing list