Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
d845a8cc
Commit
d845a8cc
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#5211] Use individual memory pool for dtmfs
parent
aa41a3be
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/sip/sipvoiplink.cpp
+16
-16
16 additions, 16 deletions
sflphone-common/src/sip/sipvoiplink.cpp
with
16 additions
and
16 deletions
sflphone-common/src/sip/sipvoiplink.cpp
+
16
−
16
View file @
d845a8cc
...
...
@@ -1432,16 +1432,24 @@ SIPVoIPLink::dtmfSipInfo (SIPCall *call, char code)
pj_str_t
methodName
,
content
;
pjsip_method
method
;
pjsip_media_type
ctype
;
pj_pool_t
*
tmp_pool
;
_debug
(
"UserAgent: Send DTMF %c"
,
code
);
// Create a temporary memory pool
tmp_pool
=
pj_pool_create
(
&
_cp
->
factory
,
"tmpdtmf10"
,
1000
,
1000
,
NULL
);
if
(
tmp_pool
==
NULL
)
{
_debug
(
"UserAgent: Could not initialize memory pool while sending DTMF"
);
return
false
;
}
duration
=
Manager
::
instance
().
voipPreferences
.
getPulseLength
();
dtmf_body
=
new
char
[
body_len
];
snprintf
(
dtmf_body
,
body_len
-
1
,
"Signal=%c
\r\n
Duration=%d
\r\n
"
,
code
,
duration
);
pj_strdup2
(
_pool
,
&
methodName
,
"INFO"
);
pj_strdup2
(
tmp
_pool
,
&
methodName
,
"INFO"
);
pjsip_method_init_np
(
&
method
,
&
methodName
);
/* Create request message. */
...
...
@@ -1453,12 +1461,12 @@ SIPVoIPLink::dtmfSipInfo (SIPCall *call, char code)
}
/* Get MIME type */
pj_strdup2
(
_pool
,
&
ctype
.
type
,
"application"
);
pj_strdup2
(
tmp
_pool
,
&
ctype
.
type
,
"application"
);
pj_strdup2
(
_pool
,
&
ctype
.
subtype
,
"dtmf-relay"
);
pj_strdup2
(
tmp
_pool
,
&
ctype
.
subtype
,
"dtmf-relay"
);
/* Create "application/dtmf-relay" message body. */
pj_strdup2
(
_pool
,
&
content
,
dtmf_body
);
pj_strdup2
(
tmp
_pool
,
&
content
,
dtmf_body
);
tdata
->
msg
->
body
=
pjsip_msg_body_create
(
tdata
->
pool
,
&
ctype
.
type
,
&
ctype
.
subtype
,
&
content
);
...
...
@@ -1476,6 +1484,8 @@ SIPVoIPLink::dtmfSipInfo (SIPCall *call, char code)
return
false
;
}
pj_pool_release
(
tmp_pool
);
return
true
;
}
...
...
@@ -2446,15 +2456,11 @@ int SIPVoIPLink::createUdpTransport (AccountID id)
return
!
PJ_SUCCESS
;
}
//strcpy (tmpIP, listeningAddress.data());
/* Init published name */
pj_bzero
(
&
a_name
,
sizeof
(
pjsip_host_port
));
pj_cstr
(
&
a_name
.
host
,
listeningAddress
.
c_str
());
a_name
.
port
=
listeningPort
;
//pj_strdup2 (_pool, &a_name.host, tmpIP);
//a_name.port = (pj_uint16_t) listeningPort;
status
=
pjsip_udp_transport_start
(
_endpt
,
&
bound_addr
,
&
a_name
,
1
,
&
transport
);
// Print info from transport manager associated to endpoint
...
...
@@ -2462,20 +2468,14 @@ int SIPVoIPLink::createUdpTransport (AccountID id)
pjsip_tpmgr_dump_transports
(
tpmgr
);
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: (%d) Unable to start UDP transport on %s:%d"
,
status
,
listeningAddress
.
data
(),
listeningPort
);
return
status
;
}
else
{
_debug
(
"UserAgent: UDP transport initialized successfully on %s:%d"
,
listeningAddress
.
c_str
(),
listeningPort
);
if
(
account
==
NULL
)
{
_debug
(
"UserAgent: Use transport as local UDP server"
);
_localUDPTransport
=
transport
;
}
else
{
_debug
(
"UserAgent: bind transport to account %s"
,
account
->
getAccountID
().
c_str
());
account
->
setAccountTransport
(
transport
);
}
...
...
@@ -2490,8 +2490,6 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
pjsip_transport_type_e
transportType
;
pjsip_tpselector
*
tp_sel
;
_debug
(
"SIP: Find local address from URI"
);
// Find the transport that must be used with the given uri
pj_str_t
tmp
;
pj_strdup2_with_null
(
_pool
,
&
tmp
,
uri
.
c_str
());
...
...
@@ -2572,6 +2570,8 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
_debug
(
"SIP: Local address discovered from attached transport: %s"
,
localaddr
.
c_str
());
// pj_pool_release(tmp_pool);
return
localaddr
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment