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

Freeswitch SVN anthm at freeswitch.org
Thu Nov 16 11:10:39 EST 2006


Author: anthm
Date: Thu Nov 16 11:10:39 2006
New Revision: 3385

Modified:
   freeswitch/trunk/libs/libdingaling/.update
   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:
update

Modified: freeswitch/trunk/libs/libdingaling/.update
==============================================================================
--- freeswitch/trunk/libs/libdingaling/.update	(original)
+++ freeswitch/trunk/libs/libdingaling/.update	Thu Nov 16 11:10:39 2006
@@ -1 +1 @@
-Wed Nov 15 20:20:53 UTC 2006
+Thu Nov 16 16:09:31 UTC 2006

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Thu Nov 16 11:10:39 2006
@@ -250,7 +250,7 @@
 }
 
 
-ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me)
+ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me, ldl_user_flag_t flags)
 {
 	ldl_session_t *session = NULL;
 	
@@ -264,10 +264,10 @@
 	session->id = apr_pstrdup(session->pool, id);
 	session->them = apr_pstrdup(session->pool, them);
 	
-	if (me) {
-		session->initiator = apr_pstrdup(session->pool, me);
-	} 
+	
+	session->initiator = apr_pstrdup(session->pool, (flags & LDL_FLAG_OUTBOUND) ? me : them);
 
+
 	if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
 		session->login = apr_pstrdup(session->pool, me);
 	} else {
@@ -298,7 +298,7 @@
 	char *msg = NULL;
 
 	if (!(session = apr_hash_get(handle->sessions, id, APR_HASH_KEY_STRING))) {
-		ldl_session_create(&session, handle, id, from, to);
+		ldl_session_create(&session, handle, id, from, to, LDL_FLAG_NONE);
 		if (!session) {
 			return LDL_STATUS_MEMERR;
 		}

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.h	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.h	Thu Nov 16 11:10:39 2006
@@ -110,10 +110,12 @@
 } ldl_flag_t;
 
 typedef enum {
+	LDL_FLAG_NONE = 0,
 	LDL_FLAG_TLS = (1 << 10),
 	LDL_FLAG_SASL_PLAIN = (1 << 11),
 	LDL_FLAG_SASL_MD5 = (1 << 12),
 	LDL_FLAG_COMPONENT = (1 << 13),
+	LDL_FLAG_OUTBOUND = (1 << 14)
 } ldl_user_flag_t;
 
 typedef enum {
@@ -253,9 +255,10 @@
   \param id the id to use for the session
   \param them the id of the other end of the call
   \param me the id of our end of the call
+  \param flags user flags
   \return SUCCESS OR FAILURE
 */
-ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me);
+ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me, ldl_user_flag_t flags);
 
 /*!
   \brief get the id of a session

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	Thu Nov 16 11:10:39 2006
@@ -1565,7 +1565,7 @@
 		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);
-		ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user);
+		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);
 		//ldl_session_set_value(dlsession, "dnis", dnis);



More information about the Freeswitch-svn mailing list