Skip to content
Snippets Groups Projects
Commit 5c9e5edf authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#5211] Initialize sip call memory pool using 16 kb

parent 27cbe91f
Branches
Tags
No related merge requests found
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#include "global.h" // for _debug #include "global.h" // for _debug
#include "sdp.h" #include "sdp.h"
const int SIPCall::CALL_MEMPOOL_INIT_SIZE = 16000;
const int SIPCall::CALL_MEMPOOL_INC_SIZE = 4000;
SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_caching_pool *caching_pool) : Call (id, type) SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_caching_pool *caching_pool) : Call (id, type)
, _cid (0) , _cid (0)
, _did (0) , _did (0)
...@@ -46,8 +49,9 @@ SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_caching_pool *cachin ...@@ -46,8 +49,9 @@ SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_caching_pool *cachin
{ {
_debug ("SIPCall: Create new call %s", id.c_str()); _debug ("SIPCall: Create new call %s", id.c_str());
// Create memory pool for application. // Create memory pool for application, initialization value is based on empiric values.
_pool = pj_pool_create (&caching_pool->factory, id.c_str(), 4000, 4000, NULL); _pool = pj_pool_create (&caching_pool->factory, id.c_str(), CALL_MEMPOOL_INIT_SIZE,
CALL_MEMPOOL_INC_SIZE, NULL);
_local_sdp = new Sdp (_pool); _local_sdp = new Sdp (_pool);
} }
......
...@@ -109,9 +109,6 @@ class SIPCall : public Call ...@@ -109,9 +109,6 @@ class SIPCall : public Call
return _tid; return _tid;
} }
/** /**
* Transaction identifier * Transaction identifier
* @param tid SIP transaction id * @param tid SIP transaction id
...@@ -120,10 +117,16 @@ class SIPCall : public Call ...@@ -120,10 +117,16 @@ class SIPCall : public Call
_tid = tid; _tid = tid;
} }
/**
* Set event subscription internal structure
*/
void setXferSub (pjsip_evsub* sub) { void setXferSub (pjsip_evsub* sub) {
_xferSub = sub; _xferSub = sub;
} }
/**
* Get event subscription internal structure
*/
pjsip_evsub *getXferSub() { pjsip_evsub *getXferSub() {
return _xferSub; return _xferSub;
} }
...@@ -136,36 +139,73 @@ class SIPCall : public Call ...@@ -136,36 +139,73 @@ class SIPCall : public Call
return _invSession; return _invSession;
} }
/**
* Return the local SDP session
*/
Sdp* getLocalSDP (void) { Sdp* getLocalSDP (void) {
return _local_sdp; return _local_sdp;
} }
/**
* Set the local SDP session
*/
void setLocalSDP (Sdp *local_sdp) { void setLocalSDP (Sdp *local_sdp) {
_local_sdp = local_sdp; _local_sdp = local_sdp;
} }
/** Returns a pointer to the AudioRtp object */ /**
* Returns a pointer to the AudioRtp object
*/
inline sfl::AudioRtpFactory * getAudioRtp (void) { inline sfl::AudioRtpFactory * getAudioRtp (void) {
return _audiortp; return _audiortp;
} }
private: private:
int _cid;
int _did;
int _tid;
// Copy Constructor // Copy Constructor
SIPCall (const SIPCall& rh); SIPCall (const SIPCall& rh);
// Assignment Operator // Assignment Operator
SIPCall& operator= (const SIPCall& rh); SIPCall& operator= (const SIPCall& rh);
/** Starting sound */ /**
* Call specific memory pool initialization size (based on empirical data)
*/
static const int CALL_MEMPOOL_INIT_SIZE;
/**
* Call specific memory pool incrementation size
*/
static const int CALL_MEMPOOL_INC_SIZE;
/**
* Call identifier
*/
int _cid;
/**
* Domain identifier
*/
int _did;
/**
* Transaction identifier
*/
int _tid;
/**
* Audio Rtp Session factory
*/
sfl::AudioRtpFactory * _audiortp; sfl::AudioRtpFactory * _audiortp;
/**
* Event subscription structure
*/
pjsip_evsub *_xferSub; pjsip_evsub *_xferSub;
/**
* The invite session to be reused in case of transfer
*/
pjsip_inv_session *_invSession; pjsip_inv_session *_invSession;
/** /**
...@@ -174,7 +214,7 @@ class SIPCall : public Call ...@@ -174,7 +214,7 @@ class SIPCall : public Call
Sdp *_local_sdp; Sdp *_local_sdp;
/** /**
* The pool to allocate memory * The pool to allocate memory, released once call hang up
*/ */
pj_pool_t *_pool; pj_pool_t *_pool;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment