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
9130109e
Commit
9130109e
authored
Jun 23, 2009
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#1714] Missing true
parent
2f3b9ae3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/sipvoiplink.cpp
+23
-4
23 additions, 4 deletions
sflphone-common/src/sipvoiplink.cpp
with
23 additions
and
4 deletions
sflphone-common/src/sipvoiplink.cpp
+
23
−
4
View file @
9130109e
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#define CAN_REINVITE 1
#define CAN_REINVITE 1
const
pj_str_t
STR_USER_AGENT
=
{
(
char
*
)
"User-Agent"
,
10
};
const
pj_str_t
STR_USER_AGENT
=
{
(
char
*
)
"User-Agent"
,
10
};
/**************** EXTERN VARIABLES AND FUNCTIONS (callbacks) **************************/
/**************** EXTERN VARIABLES AND FUNCTIONS (callbacks) **************************/
...
@@ -572,6 +573,7 @@ SIPVoIPLink::answer ( const CallID& id )
...
@@ -572,6 +573,7 @@ SIPVoIPLink::answer ( const CallID& id )
if
(
status
==
PJ_SUCCESS
)
if
(
status
==
PJ_SUCCESS
)
{
{
_debug
(
"SIPVoIPLink::answer:UserAgent: Negociation success! : call %s
\n
"
,
call
->
getCallId
().
c_str
()
);
_debug
(
"SIPVoIPLink::answer:UserAgent: Negociation success! : call %s
\n
"
,
call
->
getCallId
().
c_str
()
);
// Create and send a 200(OK) response
// Create and send a 200(OK) response
status
=
pjsip_inv_answer
(
inv_session
,
PJSIP_SC_OK
,
NULL
,
NULL
,
&
tdata
);
status
=
pjsip_inv_answer
(
inv_session
,
PJSIP_SC_OK
,
NULL
,
NULL
,
&
tdata
);
...
@@ -581,6 +583,8 @@ SIPVoIPLink::answer ( const CallID& id )
...
@@ -581,6 +583,8 @@ SIPVoIPLink::answer ( const CallID& id )
call
->
setConnectionState
(
Call
::
Connected
);
call
->
setConnectionState
(
Call
::
Connected
);
call
->
setState
(
Call
::
Active
);
call
->
setState
(
Call
::
Active
);
return
true
;
}
}
else
else
{
{
...
@@ -621,7 +625,6 @@ SIPVoIPLink::hangup ( const CallID& id )
...
@@ -621,7 +625,6 @@ SIPVoIPLink::hangup ( const CallID& id )
return
true
;
return
true
;
// _debug("Some tdata info: %",);
// _debug("Some tdata info: %",);
status
=
pjsip_inv_send_msg
(
call
->
getInvSession
(),
tdata
);
status
=
pjsip_inv_send_msg
(
call
->
getInvSession
(),
tdata
);
if
(
status
!=
PJ_SUCCESS
)
if
(
status
!=
PJ_SUCCESS
)
return
false
;
return
false
;
...
@@ -749,6 +752,7 @@ int SIPVoIPLink::inv_session_reinvite ( SIPCall *call, std::string direction )
...
@@ -749,6 +752,7 @@ int SIPVoIPLink::inv_session_reinvite ( SIPCall *call, std::string direction )
pjmedia_sdp_media_add_attr
(
local_sdp
->
media
[
0
],
attr
);
pjmedia_sdp_media_add_attr
(
local_sdp
->
media
[
0
],
attr
);
// Build the reinvite request
// Build the reinvite request
status
=
pjsip_inv_reinvite
(
call
->
getInvSession
(),
NULL
,
status
=
pjsip_inv_reinvite
(
call
->
getInvSession
(),
NULL
,
local_sdp
,
&
tdata
);
local_sdp
,
&
tdata
);
if
(
status
!=
PJ_SUCCESS
)
if
(
status
!=
PJ_SUCCESS
)
...
@@ -1878,6 +1882,8 @@ void SIPVoIPLink::handle_reinvite ( SIPCall *call )
...
@@ -1878,6 +1882,8 @@ void SIPVoIPLink::handle_reinvite ( SIPCall *call )
void
call_on_state_changed
(
pjsip_inv_session
*
inv
,
pjsip_event
*
e
)
void
call_on_state_changed
(
pjsip_inv_session
*
inv
,
pjsip_event
*
e
)
{
{
_debug
(
"--------------------- call_on_state_changed --------------------- %i
\n
"
,
inv
->
state
);
SIPCall
*
call
;
SIPCall
*
call
;
AccountID
accId
;
AccountID
accId
;
SIPVoIPLink
*
link
;
SIPVoIPLink
*
link
;
...
@@ -1987,6 +1993,9 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
...
@@ -1987,6 +1993,9 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
else
if
(
inv
->
state
==
PJSIP_INV_STATE_DISCONNECTED
)
else
if
(
inv
->
state
==
PJSIP_INV_STATE_DISCONNECTED
)
{
{
int
count
=
0
;
_debug
(
"------------------- Call disconnected ---------------------
\n
"
);
_debug
(
"State: %i, Disconnection cause: %i
\n
"
,
inv
->
state
,
inv
->
cause
);
switch
(
inv
->
cause
)
switch
(
inv
->
cause
)
{
{
/* The call terminates normally - BYE / CANCEL */
/* The call terminates normally - BYE / CANCEL */
...
@@ -2009,6 +2018,7 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
...
@@ -2009,6 +2018,7 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
case
PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE
:
case
PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE
:
case
PJSIP_SC_UNSUPPORTED_MEDIA_TYPE
:
case
PJSIP_SC_UNSUPPORTED_MEDIA_TYPE
:
case
PJSIP_SC_UNAUTHORIZED
:
case
PJSIP_SC_UNAUTHORIZED
:
case
PJSIP_SC_REQUEST_PENDING
:
accId
=
Manager
::
instance
().
getAccountFromCall
(
call
->
getCallId
()
);
accId
=
Manager
::
instance
().
getAccountFromCall
(
call
->
getCallId
()
);
link
=
dynamic_cast
<
SIPVoIPLink
*>
(
Manager
::
instance
().
getAccountLink
(
accId
)
);
link
=
dynamic_cast
<
SIPVoIPLink
*>
(
Manager
::
instance
().
getAccountLink
(
accId
)
);
if
(
link
)
if
(
link
)
...
@@ -2016,7 +2026,6 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
...
@@ -2016,7 +2026,6 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
link
->
SIPCallServerFailure
(
call
);
link
->
SIPCallServerFailure
(
call
);
}
}
break
;
break
;
default
:
default
:
_debug
(
"sipvoiplink.cpp - line 1635 : Unhandled call state. This is probably a bug.
\n
"
);
_debug
(
"sipvoiplink.cpp - line 1635 : Unhandled call state. This is probably a bug.
\n
"
);
break
;
break
;
...
@@ -2030,6 +2039,8 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
...
@@ -2030,6 +2039,8 @@ void call_on_state_changed ( pjsip_inv_session *inv, pjsip_event *e )
void
call_on_media_update
(
pjsip_inv_session
*
inv
,
pj_status_t
status
)
void
call_on_media_update
(
pjsip_inv_session
*
inv
,
pj_status_t
status
)
{
{
_debug
(
"--------------------- call_on_media_update ---------------------
\n
"
);
AccountID
accId
;
AccountID
accId
;
SIPVoIPLink
*
link
;
SIPVoIPLink
*
link
;
...
@@ -2050,6 +2061,9 @@ void call_on_media_update ( pjsip_inv_session *inv, pj_status_t status )
...
@@ -2050,6 +2061,9 @@ void call_on_media_update ( pjsip_inv_session *inv, pj_status_t status )
call
->
getLocalSDP
()
->
clean_session_media
();
call
->
getLocalSDP
()
->
clean_session_media
();
// Set the fresh negociated one
// Set the fresh negociated one
call
->
getLocalSDP
()
->
set_negociated_offer
(
r_sdp
);
call
->
getLocalSDP
()
->
set_negociated_offer
(
r_sdp
);
// call->getLocalSDP()->fetch_media_transport_info_from_remote_sdp( r_sdp );
// call->getLocalSDP()->fetch_remote_ip_from_sdp( r_sdp );
// call->getLocalSDP()->fetch_remote_audio_port_from_sdp( r_sdp );
accId
=
Manager
::
instance
().
getAccountFromCall
(
call
->
getCallId
()
);
accId
=
Manager
::
instance
().
getAccountFromCall
(
call
->
getCallId
()
);
link
=
dynamic_cast
<
SIPVoIPLink
*>
(
Manager
::
instance
().
getAccountLink
(
accId
)
);
link
=
dynamic_cast
<
SIPVoIPLink
*>
(
Manager
::
instance
().
getAccountLink
(
accId
)
);
...
@@ -2078,6 +2092,8 @@ void call_on_forked ( pjsip_inv_session *inv, pjsip_event *e )
...
@@ -2078,6 +2092,8 @@ void call_on_forked ( pjsip_inv_session *inv, pjsip_event *e )
void
call_on_tsx_changed
(
pjsip_inv_session
*
inv
,
pjsip_transaction
*
tsx
,
pjsip_event
*
e
)
void
call_on_tsx_changed
(
pjsip_inv_session
*
inv
,
pjsip_transaction
*
tsx
,
pjsip_event
*
e
)
{
{
_debug
(
"--------------------- call_on_state_changed --------------------- %i
\n
"
,
tsx
->
state
);
if
(
tsx
->
role
==
PJSIP_ROLE_UAS
&&
tsx
->
state
==
PJSIP_TSX_STATE_TRYING
&&
if
(
tsx
->
role
==
PJSIP_ROLE_UAS
&&
tsx
->
state
==
PJSIP_TSX_STATE_TRYING
&&
pjsip_method_cmp
(
&
tsx
->
method
,
&
pjsip_refer_method
)
==
0
)
pjsip_method_cmp
(
&
tsx
->
method
,
&
pjsip_refer_method
)
==
0
)
{
{
...
@@ -2150,6 +2166,7 @@ pj_bool_t
...
@@ -2150,6 +2166,7 @@ pj_bool_t
mod_on_rx_request
(
pjsip_rx_data
*
rdata
)
mod_on_rx_request
(
pjsip_rx_data
*
rdata
)
{
{
pj_status_t
status
;
pj_status_t
status
;
pj_str_t
reason
;
pj_str_t
reason
;
unsigned
options
=
0
;
unsigned
options
=
0
;
...
@@ -2344,6 +2361,7 @@ mod_on_rx_request ( pjsip_rx_data *rdata )
...
@@ -2344,6 +2361,7 @@ mod_on_rx_request ( pjsip_rx_data *rdata )
return
true
;
return
true
;
}
}
// Specify media capability during invite session creation
// Specify media capability during invite session creation
status
=
pjsip_inv_create_uas
(
dialog
,
rdata
,
call
->
getLocalSDP
()
->
get_local_sdp_session
(),
0
,
&
inv
);
status
=
pjsip_inv_create_uas
(
dialog
,
rdata
,
call
->
getLocalSDP
()
->
get_local_sdp_session
(),
0
,
&
inv
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
...
@@ -2354,6 +2372,7 @@ mod_on_rx_request ( pjsip_rx_data *rdata )
...
@@ -2354,6 +2372,7 @@ mod_on_rx_request ( pjsip_rx_data *rdata )
// Send a 180/Ringing response
// Send a 180/Ringing response
status
=
pjsip_inv_initial_answer
(
inv
,
rdata
,
PJSIP_SC_RINGING
,
NULL
,
NULL
,
&
tdata
);
status
=
pjsip_inv_initial_answer
(
inv
,
rdata
,
PJSIP_SC_RINGING
,
NULL
,
NULL
,
&
tdata
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
status
=
pjsip_inv_send_msg
(
inv
,
tdata
);
status
=
pjsip_inv_send_msg
(
inv
,
tdata
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
...
...
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