[asterisk-bugs] [JIRA] (ASTERISK-27448) Add ability to send progress inband by setting a channel variable instead of fixed config per endpoint

nappsoft (JIRA) noreply at issues.asterisk.org
Wed Nov 29 05:32:07 CST 2017


nappsoft created ASTERISK-27448:
-----------------------------------

             Summary: Add ability to send progress inband by setting a channel variable instead of fixed config per endpoint
                 Key: ASTERISK-27448
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27448
             Project: Asterisk
          Issue Type: Improvement
      Security Level: None
          Components: Channels/chan_pjsip
    Affects Versions: 13.18.2
            Reporter: nappsoft
            Severity: Minor
         Attachments: progressinband.diff

I faced a problem with several voip switches when using 180 Ringing messages after announcements sent over 183 Session Progress with SDP. The solution would be to use inband_progress=yes but this way progress will be sent as rtp for each call, so as well in cases in which it is not necessary.

So my idea was to set a channel variable PROGRESSINBAND to 1 in situations in which we use Progress() followed by Playback().

I've added some code to chan_pjsip.c which seems to work. I've opened a ticket here for two reasons: one: the "hack" could be usefull for someone else and second: I wanted to ask whether it is safe to do it the way I solved this or whether I'd need to lock channel->session->channel or something else first?

--- asterisk-13.18.0/channels/chan_pjsip.c	2017-10-30 16:33:07.000000000 +0100
+++ asterisk-13.18.0_mod/channels/chan_pjsip.c	2017-11-29 12:02:55.000000000 +0100
@@ -1335,6 +1335,15 @@
 				res = -1;
 			} else {
 				response_code = 180;
+
+				const char *ref_by_val;
+				ref_by_val = pbx_builtin_getvar_helper(channel->session->channel, "PROGRESSINBAND");
+				if (!ast_strlen_zero(ref_by_val)) {
+					if (ref_by_val[0]=='1') {
+						response_code = 183;
+						res = -1;
+					}
+				}
 			}
 		} else {
 			res = -1;




--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list