فهرست منبع

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

Victor Seva 9 سال پیش
والد
کامیت
5c1677acb3
2فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 3 2
      modules/sca/doc/sca_admin.xml
  2. 5 2
      modules/sca/sca_util.c

+ 3 - 2
modules/sca/doc/sca_admin.xml

@@ -266,8 +266,9 @@ modparam( "sca", "db_update_interval", 120 )
 	<section id="sca.p.onhold_bflag">
 	<section id="sca.p.onhold_bflag">
 		<title><varname>onhold_bflag</varname> (integer)</title>
 		<title><varname>onhold_bflag</varname> (integer)</title>
 		<para>
 		<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>
 		<para>
 		<para>
 		<emphasis>
 		<emphasis>

+ 5 - 2
modules/sca/sca_util.c

@@ -444,8 +444,10 @@ int sca_call_is_held(sip_msg_t *msg)
 	int rc;
 	int rc;
 
 
 	if(sca->cfg->onhold_bflag >= 0) {
 	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);
 	rc = parse_sdp(msg);
 	if (rc < 0) {
 	if (rc < 0) {
@@ -464,6 +466,7 @@ int sca_call_is_held(sip_msg_t *msg)
 				stream != NULL;
 				stream != NULL;
 				n_str++, stream = get_sdp_stream(msg, n_sess, n_str)) {
 				n_str++, stream = get_sdp_stream(msg, n_sess, n_str)) {
 			if (stream->is_on_hold) {
 			if (stream->is_on_hold) {
+				LM_DBG("sca_call_is_held: parse_sdp detected stream is on hold\n");
 				is_held = 1;
 				is_held = 1;
 				goto done;
 				goto done;
 			}
 			}