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
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,9 @@
#include "global.h" // for _debug
#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)
, _cid (0)
, _did (0)
......@@ -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());
// Create memory pool for application.
_pool = pj_pool_create (&caching_pool->factory, id.c_str(), 4000, 4000, NULL);
// Create memory pool for application, initialization value is based on empiric values.
_pool = pj_pool_create (&caching_pool->factory, id.c_str(), CALL_MEMPOOL_INIT_SIZE,
CALL_MEMPOOL_INC_SIZE, NULL);
_local_sdp = new Sdp (_pool);
}
......
......@@ -67,13 +67,13 @@ class SIPCall : public Call
/**
* Destructor
*/
~SIPCall();
~SIPCall ();
/**
* Call Identifier
* @return int SIP call id
*/
int getCid() {
int getCid () {
return _cid;
}
......@@ -82,7 +82,7 @@ class SIPCall : public Call
* @param cid SIP call id
*/
void setCid (int cid) {
_cid = cid ;
_cid = cid;
}
/**
......@@ -105,13 +105,10 @@ class SIPCall : public Call
* Transaction identifier
* @return int SIP transaction id
*/
int getTid() {
int getTid () {
return _tid;
}
/**
* Transaction identifier
* @param tid SIP transaction id
......@@ -120,10 +117,16 @@ class SIPCall : public Call
_tid = tid;
}
/**
* Set event subscription internal structure
*/
void setXferSub (pjsip_evsub* sub) {
_xferSub = sub;
}
/**
* Get event subscription internal structure
*/
pjsip_evsub *getXferSub() {
return _xferSub;
}
......@@ -136,36 +139,73 @@ class SIPCall : public Call
return _invSession;
}
/**
* Return the local SDP session
*/
Sdp* getLocalSDP (void) {
return _local_sdp;
}
/**
* Set the local SDP session
*/
void setLocalSDP (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) {
return _audiortp;
}
private:
int _cid;
int _did;
int _tid;
// Copy Constructor
SIPCall (const SIPCall& rh);
// Assignment Operator
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;
/**
* Event subscription structure
*/
pjsip_evsub *_xferSub;
/**
* The invite session to be reused in case of transfer
*/
pjsip_inv_session *_invSession;
/**
......@@ -174,7 +214,7 @@ class SIPCall : public Call
Sdp *_local_sdp;
/**
* The pool to allocate memory
* The pool to allocate memory, released once call hang up
*/
pj_pool_t *_pool;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment