aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-06 16:39:20 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-06 16:39:20 +0000
commit8ed6031aad5c1b5f0d3cce3b427715829e45285f (patch)
tree63f870a38eefe1f503971d9139807da3ddb7cfa9 /channels/chan_sip.c
parenteee2e227c9df2492521d7a4ed1ea0b987d88d1b8 (diff)
Correction to commmit 120863, make sure proper destructor function is called as well define two thread storage local variables.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@120885 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 50a7f4381..278528c80 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1194,7 +1194,10 @@ static void temp_pvt_cleanup(void *);
/*! \brief A per-thread temporary pvt structure */
AST_THREADSTORAGE_CUSTOM(ts_temp_pvt, temp_pvt_init, temp_pvt_cleanup);
-AST_THREADSTORAGE(ast_rtp_buf, ast_rtp_buf_init);
+static void ts_ast_rtp_destroy(void *);
+
+AST_THREADSTORAGE_CUSTOM(ts_audio_rtp, ts_audio_rtp_init, ts_ast_rtp_destroy);
+AST_THREADSTORAGE_CUSTOM(ts_video_rtp, ts_video_rtp_init, ts_ast_rtp_destroy);
/*! \todo Move the sip_auth list to AST_LIST */
static struct sip_auth *authl = NULL; /*!< Authentication list for realm authentication */
@@ -5063,7 +5066,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
/* Initialize the temporary RTP structures we use to evaluate the offer from the peer */
#ifdef LOW_MEMORY
- newaudiortp = ast_threadstorage_get(&ast_rtp_buf, ast_rtp_alloc_size());
+ newaudiortp = ast_threadstorage_get(&ts_audio_rtp, ast_rtp_alloc_size());
#else
newaudiortp = alloca(ast_rtp_alloc_size());
#endif
@@ -5072,7 +5075,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
ast_rtp_pt_clear(newaudiortp);
#ifdef LOW_MEMORY
- newvideortp = ast_threadstorage_get(&ast_rtp_buf, ast_rtp_alloc_size());
+ newvideortp = ast_threadstorage_get(&ts_video_rtp, ast_rtp_alloc_size());
#else
newvideortp = alloca(ast_rtp_alloc_size());
#endif
@@ -5607,6 +5610,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
return 0;
}
+static void ts_ast_rtp_destroy(void *data)
+{
+ struct ast_rtp *tmp = data;
+ ast_rtp_destroy(tmp);
+}
/*! \brief Add header to SIP message */
static int add_header(struct sip_request *req, const char *var, const char *value)