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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
033fe283
Commit
033fe283
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Plain Diff
Merge branch 'sip_dev' into stable
parents
10c79d3f
c3c978d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sipvoiplink.cpp
+12
-3
12 additions, 3 deletions
src/sipvoiplink.cpp
src/useragent.cpp
+43
-2
43 additions, 2 deletions
src/useragent.cpp
src/useragent.h
+2
-2
2 additions, 2 deletions
src/useragent.h
with
57 additions
and
7 deletions
src/sipvoiplink.cpp
+
12
−
3
View file @
033fe283
...
@@ -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
());
...
@@ -363,7 +364,15 @@ SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code UNUSED)
...
@@ -363,7 +364,15 @@ SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code UNUSED)
SIPCall
*
call
=
getSIPCall
(
id
);
SIPCall
*
call
=
getSIPCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exist
\n
"
);
return
false
;
}
if
(
call
==
0
)
{
_debug
(
"Call doesn't exist
\n
"
);
return
false
;
}
Manager
::
instance
().
getUserAgent
()
->
carryingDTMFdigits
(
call
);
int
duration
=
Manager
::
instance
().
getConfigInt
(
SIGNALISATION
,
PULSE_LENGTH
);
const
int
body_len
=
1000
;
char
*
dtmf_body
=
new
char
[
body_len
];
snprintf
(
dtmf_body
,
body_len
-
1
,
"Signal=%c
\r\n
Duration=%d
\r\n
"
,
code
,
duration
);
return
Manager
::
instance
().
getUserAgent
()
->
carryingDTMFdigits
(
call
,
dtmf_body
);
//int duration = Manager::instance().getConfigInt(SIGNALISATION, PULSE_LENGTH);
//int duration = Manager::instance().getConfigInt(SIGNALISATION, PULSE_LENGTH);
// TODO Add DTMF with pjsip - INFO method
// TODO Add DTMF with pjsip - INFO method
...
...
This diff is collapsed.
Click to expand it.
src/useragent.cpp
+
43
−
2
View file @
033fe283
...
@@ -1189,9 +1189,50 @@ bool UserAgent::refuse(SIPCall* call)
...
@@ -1189,9 +1189,50 @@ bool UserAgent::refuse(SIPCall* call)
return
true
;
return
true
;
}
}
bool
UserAgent
::
carryingDTMFdigits
(
SIPCall
*
call
)
bool
UserAgent
::
carryingDTMFdigits
(
SIPCall
*
call
,
char
*
msgBody
)
{
{
pj_status_t
status
;
pjsip_tx_data
*
tdata
;
pj_str_t
methodName
,
content
;
pjsip_method
method
;
pjsip_media_type
ctype
;
pj_strdup2
(
_pool
,
&
methodName
,
"INFO"
);
pjsip_method_init_np
(
&
method
,
&
methodName
);
/* Create request message. */
status
=
pjsip_dlg_create_request
(
call
->
getInvSession
()
->
dlg
,
&
method
,
-
1
,
&
tdata
);
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to create INFO request -- %d
\n
"
,
status
);
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
;
}
/* Send the request. */
status
=
pjsip_dlg_send_request
(
call
->
getInvSession
()
->
dlg
,
tdata
,
_mod
.
id
,
NULL
);
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to send MESSAGE request -- %d
\n
"
,
status
);
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.
src/useragent.h
+
2
−
2
View file @
033fe283
...
@@ -135,7 +135,7 @@ public:
...
@@ -135,7 +135,7 @@ public:
bool
makeOutgoingCall
(
const
std
::
string
&
to
,
SIPCall
*
call
,
const
AccountID
&
id
);
bool
makeOutgoingCall
(
const
std
::
string
&
to
,
SIPCall
*
call
,
const
AccountID
&
id
);
bool
carryingDTMFdigits
(
SIPCall
*
call
);
bool
carryingDTMFdigits
(
SIPCall
*
call
,
char
*
msgBody
);
pj_pool_t
*
getAppPool
()
{
return
_pool
;}
pj_pool_t
*
getAppPool
()
{
return
_pool
;}
static
pj_bool_t
mod_on_rx_request
(
pjsip_rx_data
*
rdata
);
static
pj_bool_t
mod_on_rx_request
(
pjsip_rx_data
*
rdata
);
...
...
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