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
b492f77b
Commit
b492f77b
authored
16 years ago
by
Yun Liu
Browse files
Options
Downloads
Patches
Plain Diff
DTMF: sending INFO message continued.
parent
d02dab61
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sipvoiplink.cpp
+5
-1
5 additions, 1 deletion
src/sipvoiplink.cpp
src/useragent.cpp
+31
-23
31 additions, 23 deletions
src/useragent.cpp
with
36 additions
and
24 deletions
src/sipvoiplink.cpp
+
5
−
1
View file @
b492f77b
...
@@ -198,7 +198,8 @@ SIPVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl)
...
@@ -198,7 +198,8 @@ SIPVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl)
{
{
SIPCall
*
call
=
new
SIPCall
(
id
,
Call
::
Outgoing
);
SIPCall
*
call
=
new
SIPCall
(
id
,
Call
::
Outgoing
);
if
(
call
)
{
if
(
call
)
{
call
->
setPeerNumber
(
toUrl
);
//call->setPeerNumber(toUrl);
call
->
setPeerNumber
(
getSipTo
(
toUrl
));
_debug
(
"Try to make a call to: %s with call ID: %s
\n
"
,
toUrl
.
data
(),
id
.
data
());
_debug
(
"Try to make a call to: %s with call ID: %s
\n
"
,
toUrl
.
data
(),
id
.
data
());
// we have to add the codec before using it in SIPOutgoingInvite...
// we have to add the codec before using it in SIPOutgoingInvite...
call
->
setCodecMap
(
Manager
::
instance
().
getCodecDescriptorMap
());
call
->
setCodecMap
(
Manager
::
instance
().
getCodecDescriptorMap
());
...
@@ -360,6 +361,9 @@ SIPVoIPLink::refuse (const CallID& id)
...
@@ -360,6 +361,9 @@ SIPVoIPLink::refuse (const CallID& id)
bool
bool
SIPVoIPLink
::
carryingDTMFdigits
(
const
CallID
&
id
,
char
code
UNUSED
)
SIPVoIPLink
::
carryingDTMFdigits
(
const
CallID
&
id
,
char
code
UNUSED
)
{
{
SIPCall
*
call
=
getSIPCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exist
\n
"
);
return
false
;
}
int
duration
=
Manager
::
instance
().
getConfigInt
(
SIGNALISATION
,
PULSE_LENGTH
);
int
duration
=
Manager
::
instance
().
getConfigInt
(
SIGNALISATION
,
PULSE_LENGTH
);
const
int
body_len
=
1000
;
const
int
body_len
=
1000
;
char
*
dtmf_body
=
new
char
[
body_len
];
char
*
dtmf_body
=
new
char
[
body_len
];
...
...
This diff is collapsed.
Click to expand it.
src/useragent.cpp
+
31
−
23
View file @
b492f77b
...
@@ -1192,38 +1192,46 @@ bool UserAgent::refuse(SIPCall* call)
...
@@ -1192,38 +1192,46 @@ bool UserAgent::refuse(SIPCall* call)
bool
UserAgent
::
carryingDTMFdigits
(
SIPCall
*
call
,
char
*
msgBody
)
bool
UserAgent
::
carryingDTMFdigits
(
SIPCall
*
call
,
char
*
msgBody
)
{
{
pj_status_t
status
;
pj_status_t
status
;
pjsip_method
method
;
pj_str_t
methodName
;
pjsip_tx_data
*
tdata
;
pjsip_tx_data
*
tdata
;
pj_str_t
from
,
to
,
contact
,
body
;
pj_str_t
methodName
,
content
;
pjsip_method
method
;
AccountID
accId
=
Manager
::
instance
().
getAccountFromCall
(
call
->
getCallId
());
pjsip_media_type
ctype
;
SIPAccount
*
account
=
dynamic_cast
<
SIPAccount
*>
(
Manager
::
instance
().
getAccount
(
accId
));
pj_strdup2
(
_pool
,
&
methodName
,
"INFO"
);
pj_strdup2
(
_pool
,
&
methodName
,
"INFO"
);
std
::
string
fromStr
=
"sip:"
+
account
->
getUserName
()
+
"@"
+
account
->
getServer
();
pj_strdup2
(
_pool
,
&
from
,
fromStr
.
data
());
std
::
string
toStr
=
"sip:"
+
call
->
getPeerNumber
();
pj_strdup2
(
_pool
,
&
to
,
toStr
.
data
());
pj_strdup2
(
_pool
,
&
contact
,
account
->
getContact
().
data
());
pj_strdup2
(
_pool
,
&
body
,
msgBody
);
pjsip_method_init_np
(
&
method
,
&
methodName
);
pjsip_method_init_np
(
&
method
,
&
methodName
);
status
=
pjsip_endpt_create_request
(
_endpt
,
&
method
,
/* Create request message. */
&
to
,
&
from
,
&
to
,
&
contact
,
NULL
,
-
1
,
&
body
,
&
tdata
);
status
=
pjsip_dlg_create_request
(
call
->
getInvSession
()
->
dlg
,
&
method
,
if
(
status
!=
PJ_SUCCESS
)
{
-
1
,
&
tdata
);
_debug
(
"UserAgent: Can not create DTMF message!
\n
"
);
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to create INFO request -- %d
\n
"
,
status
);
return
false
;
return
false
;
}
/* Get MIME type */
pj_strdup2
(
_pool
,
&
ctype
.
type
,
"application"
);
pj_strdup2
(
_pool
,
&
ctype
.
subtype
,
"dtmf-relay"
);
/* Create "application/dtmf-relay" message body. */
pj_strdup2
(
_pool
,
&
content
,
msgBody
);
tdata
->
msg
->
body
=
pjsip_msg_body_create
(
tdata
->
pool
,
&
ctype
.
type
,
&
ctype
.
subtype
,
&
content
);
if
(
tdata
->
msg
->
body
==
NULL
)
{
_debug
(
"UserAgent: Unable to create msg body!
\n
"
);
pjsip_tx_data_dec_ref
(
tdata
);
return
false
;
}
}
status
=
pjsip_endpt_send_request
(
_endpt
,
tdata
,
-
1
,
NULL
,
NULL
);
/* Send the request. */
if
(
status
!=
PJ_SUCCESS
)
{
status
=
pjsip_dlg_send_request
(
call
->
getInvSession
()
->
dlg
,
tdata
,
_debug
(
"UserAgent: Can not send DTMF message!
\n
"
);
_mod
.
id
,
NULL
);
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to send MESSAGE request -- %d
\n
"
,
status
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
bool
UserAgent
::
transfer
(
SIPCall
*
call
,
const
std
::
string
&
to
)
bool
UserAgent
::
transfer
(
SIPCall
*
call
,
const
std
::
string
&
to
)
...
...
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