/* hash of sessions (I think a linked list suits better here, but FS does not have the data type) */
switch_hash_t *g_sessions_hash = NULL;
+/* global memory pool provided by FS */
+switch_memory_pool_t *g_pool = NULL;
+
typedef struct vocallo_codec_s {
int codec_id; /* vocallo codec ID */
int iana; /* IANA code to register in FS */
local_ip, rtp_port, codec_ip, codec_reply_leg->codec_udp_port, iana,
codec_reg_leg->sample_rate, codec_reg_leg->ms*1000, sess->sessid);
- /* create the RTP socket */
+ /* create the RTP socket, dont use the session pool since the session may go away while the RTP socket should linger around
+ * until sangoma_transcode decides to kill it */
rtp_session = switch_rtp_new(local_ip, rtp_port,
codec_ip, codec_reply_leg->codec_udp_port,
iana,
codec_reg_leg->ms*8, /* samples per interval, FIXME: do based on sampling rate */
codec_reg_leg->ms*1000, /* ms per packet */
- flags, NULL, &err, sess->pool);
+ flags, NULL, &err, g_pool);
if (!rtp_session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to create switch rtp session: %s\n", err);
return SWITCH_STATUS_FALSE;
}
+ g_pool = pool;
+
g_init_cfg.log = sangoma_logger;
g_init_cfg.create_rtp = sangoma_create_rtp;
g_init_cfg.destroy_rtp = sangoma_destroy_rtp;