Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
f8a85260
Commit
f8a85260
authored
5 years ago
by
Kevin Harwell
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res/res_pjsip_sdp_rtp: Fix MOH transitions"
parents
8a8253e5
77c9ba8e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/asterisk/res_pjsip_session.h
+2
-0
2 additions, 0 deletions
include/asterisk/res_pjsip_session.h
res/res_pjsip_sdp_rtp.c
+22
-11
22 additions, 11 deletions
res/res_pjsip_sdp_rtp.c
with
24 additions
and
11 deletions
include/asterisk/res_pjsip_session.h
+
2
−
0
View file @
f8a85260
...
...
@@ -89,6 +89,8 @@ struct ast_sip_session_media {
int
timeout_sched_id
;
/*! \brief Stream is on hold by remote side */
unsigned
int
remotely_held
:
1
;
/*! \brief Stream is held by remote side changed during this negotiation*/
unsigned
int
remotely_held_changed
:
1
;
/*! \brief Stream is on hold by local side */
unsigned
int
locally_held
:
1
;
/*! \brief Does remote support rtcp_mux */
...
...
This diff is collapsed.
Click to expand it.
res/res_pjsip_sdp_rtp.c
+
22
−
11
View file @
f8a85260
...
...
@@ -1406,6 +1406,20 @@ static int negotiate_incoming_sdp_stream(struct ast_sip_session *session,
/* If ICE support is enabled find all the needed attributes */
check_ice_support
(
session
,
session_media
,
stream
);
/* Check if incomming SDP is changing the remotely held state */
if
(
ast_sockaddr_isnull
(
addrs
)
||
ast_sockaddr_is_any
(
addrs
)
||
pjmedia_sdp_media_find_attr2
(
stream
,
"sendonly"
,
NULL
)
||
pjmedia_sdp_media_find_attr2
(
stream
,
"inactive"
,
NULL
))
{
if
(
!
session_media
->
remotely_held
)
{
session_media
->
remotely_held
=
1
;
session_media
->
remotely_held_changed
=
1
;
}
}
else
if
(
session_media
->
remotely_held
)
{
session_media
->
remotely_held
=
0
;
session_media
->
remotely_held_changed
=
1
;
}
if
(
set_caps
(
session
,
session_media
,
session_media_transport
,
stream
,
1
,
asterisk_stream
))
{
return
0
;
}
...
...
@@ -1997,22 +2011,19 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session,
return
1
;
}
if
(
ast_sockaddr_isnull
(
addrs
)
||
ast_sockaddr_is_any
(
addrs
)
||
pjmedia_sdp_media_find_attr2
(
remote_stream
,
"sendonly"
,
NULL
)
||
pjmedia_sdp_media_find_attr2
(
remote_stream
,
"inactive"
,
NULL
))
{
if
(
!
session_media
->
remotely_held
)
{
if
(
session_media
->
remotely_held_changed
)
{
if
(
session_media
->
remotely_held
)
{
/* The remote side has put us on hold */
ast_queue_hold
(
session
->
channel
,
session
->
endpoint
->
mohsuggest
);
ast_rtp_instance_stop
(
session_media
->
rtp
);
ast_queue_frame
(
session
->
channel
,
&
ast_null_frame
);
session_media
->
remotely_held
=
1
;
session_media
->
remotely_held_changed
=
0
;
}
else
{
/* The remote side has taken us off hold */
ast_queue_unhold
(
session
->
channel
);
ast_queue_frame
(
session
->
channel
,
&
ast_null_frame
);
session_media
->
remotely_held_changed
=
0
;
}
}
else
if
(
session_media
->
remotely_held
)
{
/* The remote side has taken us off hold */
ast_queue_unhold
(
session
->
channel
);
ast_queue_frame
(
session
->
channel
,
&
ast_null_frame
);
session_media
->
remotely_held
=
0
;
}
else
if
((
pjmedia_sdp_neg_was_answer_remote
(
session
->
inv_session
->
neg
)
==
PJ_FALSE
)
&&
(
session
->
inv_session
->
state
==
PJSIP_INV_STATE_CONFIRMED
))
{
ast_queue_control
(
session
->
channel
,
AST_CONTROL_UPDATE_RTP_PEER
);
...
...
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