]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add some stuff for zrtp
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 May 2009 18:19:55 +0000 (18:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 May 2009 18:19:55 +0000 (18:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13426 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_core.h
src/include/switch_frame.h
src/include/switch_types.h
src/switch_core_memory.c
src/switch_core_session.c

index 47ee84caf3fc919f8f39730713012484c00b84b7..9d0623de0605996b5db91f95bdde3ef205530452 100644 (file)
@@ -448,6 +448,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(_Inout_
 */
 #define switch_core_destroy_memory_pool(p) switch_core_perform_destroy_memory_pool(p, __FILE__, __SWITCH_FUNC__, __LINE__)
 
+
+SWITCH_DECLARE(void) switch_core_memory_pool_set_data(switch_memory_pool_t *pool, const char *key, void *data);
+SWITCH_DECLARE(void *) switch_core_memory_pool_get_data(switch_memory_pool_t *pool, const char *key);
+
+
 /*! 
   \brief Start the session's state machine
   \param session the session on which to start the state machine
index 19701374d8fb836d24568e06047e7d3a1cb12fe7..b00b54aa911727c62bda457317a5b9868ebae1fa 100644 (file)
@@ -46,9 +46,11 @@ SWITCH_BEGIN_EXTERN_C
        /*! the originating source of the frame */
        const char *source;
        /*! the raw packet */
-       void *packet;
+       void *packet;   
        /*! the size of the raw packet when applicable */
        uint32_t packetlen;
+       /*! the extra frame data */
+       void *extra_data;
        /*! the frame data */
        void *data;
        /*! the size of the buffer that is in use */
index f4d92e83df1e8c697da0fd87c91526cc512a4353..c165baed812d0a280243d5686685e289fb1096a1 100644 (file)
@@ -920,7 +920,8 @@ typedef enum {
        SFF_PLC = (1 << 3),
        SFF_RFC2833 = (1 << 4),
        SFF_PROXY_PACKET = (1 << 5),
-       SFF_DYNAMIC = (1 << 6)
+       SFF_DYNAMIC = (1 << 6),
+       SFF_ZRTP = (1 << 7)
 } switch_frame_flag_enum_t;
 typedef uint32_t switch_frame_flag_t;
 
index 28c87337c312aa8c603337443b4e0205a955884a..177abc1dca167dea90478889a3cf91827758948f 100644 (file)
@@ -304,6 +304,20 @@ SWITCH_DECLARE(char *) switch_core_perform_strdup(switch_memory_pool_t *pool, co
        return duped;
 }
 
+SWITCH_DECLARE(void) switch_core_memory_pool_set_data(switch_memory_pool_t *pool, const char *key, void *data)
+{
+       apr_pool_userdata_set(data, key, NULL, pool);
+}
+
+SWITCH_DECLARE(void *) switch_core_memory_pool_get_data(switch_memory_pool_t *pool, const char *key)
+{
+       void *data = NULL;
+
+       apr_pool_userdata_get(&data, key, pool);
+
+       return data;
+}
+
 SWITCH_DECLARE(void) switch_core_memory_pool_tag(switch_memory_pool_t *pool, const char *tag)
 {
        apr_pool_tag(pool, tag);
index a70caa7c41595e730dc9d59945b104caa2d463de..a9a95470a639c8a5c7102d1db410e2c20ff785fe 100644 (file)
@@ -1206,6 +1206,8 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
 
        session = switch_core_alloc(usepool, sizeof(*session));
        session->pool = usepool;
+
+       switch_core_memory_pool_set_data(session->pool, "__session", session);
        
        if (switch_channel_alloc(&session->channel, direction, session->pool) != SWITCH_STATUS_SUCCESS) {
                abort();