[sr-dev] git:master:5c1677ac: sca: onhold_blfag as a way to force onhold detection but fallback to previous behavior if not set

Victor Seva linuxmaniac at torreviejawireless.org
Mon Oct 24 17:57:35 CEST 2016


Module: kamailio
Branch: master
Commit: 5c1677acb36f20624cd2c6a3aaba19980c3451e2
URL: https://github.com/kamailio/kamailio/commit/5c1677acb36f20624cd2c6a3aaba19980c3451e2

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2016-10-24T17:54:58+02:00

sca: onhold_blfag as a way to force onhold detection but fallback to previous behavior if not set

---

Modified: modules/sca/doc/sca_admin.xml
Modified: modules/sca/sca_util.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5c1677acb36f20624cd2c6a3aaba19980c3451e2.diff
Patch: https://github.com/kamailio/kamailio/commit/5c1677acb36f20624cd2c6a3aaba19980c3451e2.patch

---

diff --git a/modules/sca/doc/sca_admin.xml b/modules/sca/doc/sca_admin.xml
index 6ff3944..f436332 100644
--- a/modules/sca/doc/sca_admin.xml
+++ b/modules/sca/doc/sca_admin.xml
@@ -266,8 +266,9 @@ modparam( "sca", "db_update_interval", 120 )
 	<section id="sca.p.onhold_bflag">
 		<title><varname>onhold_bflag</varname> (integer)</title>
 		<para>
-		Which branch flag should be used by the module to identify if the call
-		is on-hold instead of parsing the sdp.
+		When bflag is set the media will be treated as on-hold and sdp
+		parse will be skipped. If the bflag is not set the
+		sdp will be parsed to detect on-hold.
 		</para>
 		<para>
 		<emphasis>
diff --git a/modules/sca/sca_util.c b/modules/sca/sca_util.c
index 87ec2a1..f4df0ff 100644
--- a/modules/sca/sca_util.c
+++ b/modules/sca/sca_util.c
@@ -444,8 +444,10 @@ int sca_call_is_held(sip_msg_t *msg)
 	int rc;
 
 	if(sca->cfg->onhold_bflag >= 0) {
-		LM_DBG("sca_call_is_held: skip parse_sdp and use onhold_bflag\n");
-		return isbflagset(0, (flag_t)sca->cfg->onhold_bflag);
+		if (isbflagset(0, (flag_t)sca->cfg->onhold_bflag)==1) {
+			LM_DBG("onhold_bflag set, skip parse_sdp and set held\n");
+			return ( 1 );
+		}
 	}
 	rc = parse_sdp(msg);
 	if (rc < 0) {
@@ -464,6 +466,7 @@ int sca_call_is_held(sip_msg_t *msg)
 				stream != NULL;
 				n_str++, stream = get_sdp_stream(msg, n_sess, n_str)) {
 			if (stream->is_on_hold) {
+				LM_DBG("sca_call_is_held: parse_sdp detected stream is on hold\n");
 				is_held = 1;
 				goto done;
 			}




More information about the sr-dev mailing list