Revision
17194
Author
math.parent
Date
2010-04-02 05:15:33 -0500 (Fri, 02 Apr 2010)

Log Message

Skinny:

- don't force session location (not needed)
- Correct Skinny-Station-Instance event header and log if profile or
  device is not found

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c (17193 => 17194)


--- freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c	2010-04-02 10:14:41 UTC (rev 17193)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c	2010-04-02 10:15:33 UTC (rev 17194)
@@ -242,8 +242,7 @@
 	uuid = skinny_profile_find_session_uuid(profile, listener, line_instance_p, call_id);
 
 	if(!zstr(uuid)) {
-		/* TODO Why should we force? */
-		result = switch_core_session_force_locate(uuid);
+		result = switch_core_session_locate(uuid);
 		if(!result) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
 				"Unable to find session %s on %s:%d, line %d\n",
@@ -1578,7 +1577,7 @@
 	} else if ((subclass = switch_event_get_header_nil(event, "Event-Subclass")) && !strcasecmp(subclass, SKINNY_EVENT_CALL_STATE)) {
 		char *profile_name = switch_event_get_header_nil(event, "Skinny-Profile-Name");
 		char *device_name = switch_event_get_header_nil(event, "Skinny-Device-Name");
-		uint32_t device_instance = atoi(switch_event_get_header_nil(event, "Skinny-Device-Instance"));
+		uint32_t device_instance = atoi(switch_event_get_header_nil(event, "Skinny-Station-Instance"));
 		uint32_t line_instance = atoi(switch_event_get_header_nil(event, "Skinny-Line-Instance"));
 		uint32_t call_id = atoi(switch_event_get_header_nil(event, "Skinny-Call-Id"));
 		uint32_t call_state = atoi(switch_event_get_header_nil(event, "Skinny-Call-State"));
@@ -1618,7 +1617,13 @@
 			    }
 			    switch_safe_free(line_instance_condition);
 			    switch_safe_free(call_id_condition);
+			} else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
+					"Device %s:%d in profile '%s' not found.\n", device_name, device_instance, profile_name);
 			}
+		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
+				"Profile '%s' not found.\n", profile_name);
 		}
 	}
 }