Hi,
I’ve asterisk-certified-16.8 connecting two PSTN endpoints and would like Asterisk not handling the MOH so adjusted both pjsip endpoints with moh_passthrough=yes
but both PSTN are supporting INACTIVE only not (sendonly/recvonly)
I’ve this code in res_pjsip_sdp_rtp.c which controls that scenario and I tried replacing sendonly with inactive like shown below which works fine in the hold but when getting off hold with the remote stream sending sendrecv , Asterisk is sending INACTIVE which still putting the call on hold.
What code change/patch to fix this situation ? I only need to pass inactive both legs when getting onhold and sendrecv both legs when getting off hold (I know Asterisk isn’t a sip proxy)
attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
if (session_media->locally_held || ast_stream_get_state(stream) == AST_STREAM_STATE_SENDONLY) {
// attr->name = STR_SENDONLY; /* Send sendonly to initate a local hold */
attr->name = STR_INACTIVE; /* Send custom INACTIVE to initate a local hold */
} else if (ast_stream_get_state(stream) == AST_STREAM_STATE_RECVONLY) {
attr->name = STR_RECVONLY; /* Stream has requested recvonly */
} else if (ast_stream_get_state(stream) == AST_STREAM_STATE_INACTIVE) {
attr->name = STR_INACTIVE; /* Stream has requested inactive */
} else {
attr->name = STR_SENDRECV; /* No hold in either direction */
}
media->attr[media->attr_count++] = attr;