[Freeswitch-svn] [commit] r4087 - in freeswitch/trunk: libs/libdingaling/src src/mod/endpoints/mod_dingaling

Freeswitch SVN anthm at freeswitch.org
Mon Jan 29 17:22:29 EST 2007


Author: anthm
Date: Mon Jan 29 17:22:29 2007
New Revision: 4087

Modified:
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c
   freeswitch/trunk/libs/libdingaling/src/libdingaling.h
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c

Log:
fix dingaling reject

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Mon Jan 29 17:22:29 2007
@@ -366,6 +366,8 @@
 				}
 			} else if (!strcasecmp(type, "transport-accept")) {
 				dl_signal = LDL_SIGNAL_TRANSPORT_ACCEPT;
+			} else if (!strcasecmp(type, "reject")) {
+				dl_signal = LDL_SIGNAL_REJECT;
 			} else if (!strcasecmp(type, "transport-info")) {
 				char *tid = iks_find_attrib(xml, "id");
 				dl_signal = LDL_SIGNAL_CANDIDATES;

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.h	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.h	Mon Jan 29 17:22:29 2007
@@ -142,7 +142,8 @@
 	LDL_SIGNAL_LOGIN_SUCCESS,
 	LDL_SIGNAL_LOGIN_FAILURE,
 	LDL_SIGNAL_CONNECTED,
-	LDL_SIGNAL_TRANSPORT_ACCEPT
+	LDL_SIGNAL_TRANSPORT_ACCEPT,
+	LDL_SIGNAL_REJECT
 } ldl_signal_t;
 
 typedef enum {

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Mon Jan 29 17:22:29 2007
@@ -1616,10 +1616,10 @@
 
 		switch_channel_set_flag(channel, CF_OUTBOUND);
 		switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND);
-		
+
 		switch_stun_random_string(sess_id, 10, "0123456789");
-		tech_pvt->us = switch_core_session_strdup(session, user);
-		tech_pvt->them = switch_core_session_strdup(session, full_id);
+		tech_pvt->us = switch_core_session_strdup(*new_session, user);
+		tech_pvt->them = switch_core_session_strdup(*new_session, full_id);
 		ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user, LDL_FLAG_OUTBOUND);
 		tech_pvt->profile = mdl_profile;
 		ldl_session_set_private(dlsession, *new_session);
@@ -2685,11 +2685,18 @@
 			}
 		}
 		break;
+	case LDL_SIGNAL_REJECT:
+        if (channel) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "reject %s\n", switch_channel_get_name(channel));
+			terminate_session(&session,  __LINE__, SWITCH_CAUSE_CALL_REJECTED);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "End Call (Rejected)\n");
+			goto done;
+		}
+        break;
 	case LDL_SIGNAL_ERROR:
 	case LDL_SIGNAL_TERMINATE:
 		if (channel) {
-			switch_channel_state_t state = switch_channel_get_state(channel);
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hungup %s %u %d\n", switch_channel_get_name(channel), state, CS_INIT);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hungup %s %u %d\n", switch_channel_get_name(channel));
 			terminate_session(&session,  __LINE__, SWITCH_CAUSE_NORMAL_CLEARING);
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "End Call\n");
 			goto done;



More information about the Freeswitch-svn mailing list