[Freeswitch-svn] [commit] r4950 - in freeswitch/trunk/src: . mod/endpoints/mod_wanpipe

Freeswitch SVN anthm at freeswitch.org
Mon Apr 16 16:51:19 EDT 2007


Author: anthm
Date: Mon Apr 16 16:51:19 2007
New Revision: 4950

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
   freeswitch/trunk/src/switch_core_session.c

Log:
...

Modified: freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Mon Apr 16 16:51:19 2007
@@ -1433,7 +1433,7 @@
 static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent)
 {
 	char name[128];
-	switch_core_session_t *session;
+	switch_core_session_t *session = NULL;
 	switch_channel_t *channel;
 	struct channel_map *chanmap;
 	int ret = 0;
@@ -1441,7 +1441,7 @@
 	switch_mutex_lock(globals.channel_mutex);
 
 	chanmap = spri->private_info;
-	if (switch_core_session_locate(chanmap->map[pevent->ring.channel])) {
+	if ((session = switch_core_session_locate(chanmap->map[pevent->ring.channel]))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--Duplicate Ring on channel s%dc%d (ignored)\n",
 							  spri->span, pevent->ring.channel);
 		switch_core_session_rwunlock(session);

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Mon Apr 16 16:51:19 2007
@@ -225,22 +225,24 @@
 			}
 		}
 
-		if ((cause = endpoint_interface->io_routines->outgoing_channel(session, outgoing_profile, new_session, pool)) == SWITCH_CAUSE_SUCCESS) {
-			if (session) {
-				for (ptr = session->event_hooks.outgoing_channel; ptr; ptr = ptr->next) {
-					if ((status = ptr->outgoing_channel(session, caller_profile, *new_session)) != SWITCH_STATUS_SUCCESS) {
-						break;
-					}
+		if ((cause = endpoint_interface->io_routines->outgoing_channel(session, outgoing_profile, new_session, pool)) != SWITCH_CAUSE_SUCCESS) {
+			return cause;
+		}
+
+		if (session) {
+			for (ptr = session->event_hooks.outgoing_channel; ptr; ptr = ptr->next) {
+				if ((status = ptr->outgoing_channel(session, caller_profile, *new_session)) != SWITCH_STATUS_SUCCESS) {
+					break;
 				}
 			}
-		} else {
-			return cause;
 		}
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not locate outgoing channel interface for %s\n", endpoint_name);
 		return SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED;
 	}
 
+	assert(*new_session != NULL);
+	
 	if (*new_session) {
 		switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
 		switch_event_t *event;



More information about the Freeswitch-svn mailing list