[Asterisk-code-review] res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough (asterisk[13])
Torrey Searle
asteriskteam at digium.com
Wed Feb 12 10:07:37 CST 2020
Torrey Searle has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13802 )
Change subject: res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough
......................................................................
res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough
When moh_passthrough is used, asterisk is only generating invites
of type sendonly and sendrecv instead of taking fully into account
the on hold state of the local and remote parties
ASTERISK-28738 #close
Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/02/13802/1
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 36b6044..843bafc 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1188,6 +1188,8 @@
static const pj_str_t STR_IP6 = { "IP6", 3};
static const pj_str_t STR_SENDRECV = { "sendrecv", 8 };
static const pj_str_t STR_SENDONLY = { "sendonly", 8 };
+ static const pj_str_t STR_INACTIVE = { "inactive", 8 };
+ static const pj_str_t STR_RECVONLY = { "recvonly", 8 };
pjmedia_sdp_media *media;
const char *hostip = NULL;
struct ast_sockaddr addr;
@@ -1371,9 +1373,20 @@
media->attr[media->attr_count++] = attr;
}
- /* Add the sendrecv attribute - we purposely don't keep track because pjmedia-sdp will automatically change our offer for us */
attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
- attr->name = !session_media->locally_held ? STR_SENDRECV : STR_SENDONLY;
+ if (session_media->locally_held) {
+ if (session_media->remotely_held) {
+ attr->name = STR_INACTIVE;
+ } else {
+ attr->name = STR_SENDONLY;
+ }
+ } else {
+ if (session_media->remotely_held) {
+ attr->name = STR_RECVONLY;
+ } else {
+ attr->name = STR_SENDRECV;
+ }
+ }
media->attr[media->attr_count++] = attr;
/* If we've got rtcp-mux enabled, add it unless we received an offer without it */
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13802
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761
Gerrit-Change-Number: 13802
Gerrit-PatchSet: 1
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200212/a6c84001/attachment.html>
More information about the asterisk-code-review
mailing list