[sr-dev] git:master: sca: fix private hold handling

Andrew Mortensen admorten at isc.upenn.edu
Thu Mar 14 21:50:48 CET 2013


Module: sip-router
Branch: master
Commit: 81b5473f5a191a5aa81295acf0d96a22160f7f31
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=81b5473f5a191a5aa81295acf0d96a22160f7f31

Author: Andrew Mortensen <admorten at isc.upenn.edu>
Committer: Andrew Mortensen <admorten at isc.upenn.edu>
Date:   Fri Mar  1 16:33:59 2013 -0500

sca: fix private hold handling

- private hold call-info was being ignored in hold reINVITEs, causing
  inaccurate "active" notifications to go to subscribers.

---

 modules/sca/sca_appearance.h |    3 +++
 modules/sca/sca_call_info.c  |    7 ++++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/modules/sca/sca_appearance.h b/modules/sca/sca_appearance.h
index 0d0abd8..63f2a78 100644
--- a/modules/sca/sca_appearance.h
+++ b/modules/sca/sca_appearance.h
@@ -38,6 +38,9 @@ enum {
     SCA_APPEARANCE_STATE_HELD_PRIVATE,
     SCA_APPEARANCE_STATE_UNKNOWN = 0xff,
 }; 
+#define sca_appearance_is_held( app1 ) \
+	((app1) && ((app1)->state == SCA_APPEARANCE_STATE_HELD || \
+		   (app1)->state == SCA_APPEARANCE_STATE_HELD_PRIVATE))
 
 enum {
     SCA_APPEARANCE_FLAG_DEFAULT = 0,
diff --git a/modules/sca/sca_call_info.c b/modules/sca/sca_call_info.c
index baea8bd..0195b0e 100644
--- a/modules/sca/sca_call_info.c
+++ b/modules/sca/sca_call_info.c
@@ -982,6 +982,11 @@ sca_call_info_invite_request_handler( sip_msg_t *msg, sca_call_info *call_info,
 
     if ( sca_call_is_held( msg )) {
 	state = SCA_APPEARANCE_STATE_HELD;
+	if ( call_info->state == SCA_APPEARANCE_STATE_HELD_PRIVATE ) {
+	    state = SCA_APPEARANCE_STATE_HELD_PRIVATE;
+	} else {
+	    state = SCA_APPEARANCE_STATE_HELD;
+	}
     } else if ( !SCA_STR_EMPTY( &to->tag_value )) {
 	/* this is a reINVITE from an SCA line that put the call on hold */
 	state = SCA_APPEARANCE_STATE_ACTIVE;
@@ -1237,7 +1242,7 @@ sca_call_info_invite_reply_200_handler( sip_msg_t *msg,
 	goto done;
     }
 
-    if ( app->state != SCA_APPEARANCE_STATE_HELD ) {
+    if ( !sca_appearance_is_held( app )) {
 	state = SCA_APPEARANCE_STATE_ACTIVE;
     }
     /* if a Call-Info header is present, app-index goes to Contact */




More information about the sr-dev mailing list