浏览代码

Merge branch 'master' of ssh://git.sip-router.org/sip-router

Richard Good 11 年之前
父节点
当前提交
5b21e976ee

+ 2 - 2
modules/db_cluster/dbcl_data.c

@@ -249,7 +249,7 @@ int dbcl_cls_set_connections(dbcl_cls_t *cls, str *cons)
 			goto error;
 		}
 		i = s.s[0] - '0';
-		if(s.s[1]!='s' && s.s[1]!='S' && s.s[1]!='r' && s.s[1]!='r')
+		if(s.s[1]!='s' && s.s[1]!='S' && s.s[1]!='r' && s.s[1]!='R')
 		{
 			LM_ERR("invalid parameter [%.*s] for connection id [%.*s]\n",
 					pit->body.len, pit->body.s,
@@ -277,7 +277,7 @@ int dbcl_cls_set_connections(dbcl_cls_t *cls, str *cons)
 			goto error;
 		}
 		i = s.s[2] - '0';
-		if(s.s[3]!='s' && s.s[3]!='S' && s.s[3]!='r' && s.s[3]!='r'
+		if(s.s[3]!='s' && s.s[3]!='S' && s.s[3]!='r' && s.s[3]!='R'
 				 && s.s[3]!='p' && s.s[3]!='P')
 		{
 			LM_ERR("invalid parameter [%.*s] for connection id [%.*s]\n",

+ 1 - 1
modules/db_mysql/my_uri.c

@@ -113,7 +113,7 @@ static int parse_mysql_uri(struct my_uri* res, str* uri)
 
 	prev_token = 0;
 
-	if (!res || !res) {
+	if (!res || !uri) {
 		goto err;
 	}
 	

+ 1 - 1
modules/db_postgres/pg_uri.c

@@ -118,7 +118,7 @@ static int parse_postgres_uri(struct pg_uri* res, str* uri)
 
 	prev_token = 0;
 
-	if (!res || !res) {
+	if (!res || !uri) {
 		goto err;
 	}
 	

+ 2 - 0
modules/sca/sca.c

@@ -59,6 +59,8 @@ static cmd_export_t	cmds[] = {
     { "sca_handle_subscribe", sca_handle_subscribe, 0, NULL, REQUEST_ROUTE },
     { "sca_call_info_update", sca_call_info_update, 0, NULL,
 	REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE },
+    { "sca_call_info_update", sca_call_info_update, 1, fixup_var_int_1,
+	REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE },
     { NULL, NULL, -1, 0, 0 },
 };
 

+ 32 - 6
modules/sca/sca_call_info.c

@@ -1288,11 +1288,9 @@ sca_call_info_invite_reply_200_handler( sip_msg_t *msg,
 		"parse_uri <%.*s> failed", STR_FMT( contact_uri ));
 	goto done;
     }
-    if ( sca_aor_create_from_info( &app_uri_aor, c_uri.type, &c_uri.user,
-		&GET_TO_PURI( msg )->host, &GET_TO_PURI( msg )->port ) < 0 ) {
+    if ( sca_create_canonical_aor( msg, &app_uri_aor ) < 0 ) {
 	LM_ERR( "sca_call_info_invite_200_reply_handler: "
-		"sca_aor_create_from_info %.*s and %.*s failed",
-		STR_FMT( contact_uri ), STR_FMT( &to->uri ));
+		"sca_create_canonical_aor failed" );
 	goto done;
     }
 
@@ -1885,6 +1883,7 @@ sca_call_info_update( sip_msg_t *msg, char *p1, char *p2 )
     int			i;
     int			method;
     int			rc = -1;
+    int			update_mask = SCA_CALL_INFO_SHARED_BOTH;
 
     method = sca_get_msg_method( msg );
 
@@ -1905,6 +1904,29 @@ sca_call_info_update( sip_msg_t *msg, char *p1, char *p2 )
 	return( -1 );
     }
 
+    if ( p1 != NULL ) {
+	if ( get_int_fparam( &update_mask, msg, (fparam_t *)p1 ) < 0 ) {
+	    LM_ERR( "sca_call_info_update: argument 1: bad value "
+		    "(integer expected)" );
+	    return( -1 );
+	}
+
+	switch ( update_mask ) {
+	case SCA_CALL_INFO_SHARED_NONE:
+	    update_mask = SCA_CALL_INFO_SHARED_BOTH;
+	    break;
+
+	case SCA_CALL_INFO_SHARED_CALLER:
+	case SCA_CALL_INFO_SHARED_CALLEE:
+	    break;
+
+	default:
+	    LM_ERR( "sca_call_info_update: argument 1: invalid value "
+		    "(0, 1 or 2 expected)" );
+	    return( -1 );
+	}
+    }
+
     memset( &call_info, 0, sizeof( sca_call_info ));
     call_info_hdr = sca_call_info_header_find( msg->headers );
     if ( !SCA_HEADER_EMPTY( call_info_hdr )) {
@@ -1967,10 +1989,14 @@ sca_call_info_update( sip_msg_t *msg, char *p1, char *p2 )
 
     /* early check to see if we're dealing with any SCA endpoints */
     if ( sca_uri_is_shared_appearance( sca, &from_aor )) {
-	call_info.ua_shared |= SCA_CALL_INFO_SHARED_CALLER;
+	if (( update_mask & SCA_CALL_INFO_SHARED_CALLER )) {
+	    call_info.ua_shared |= SCA_CALL_INFO_SHARED_CALLER;
+	}
     }
     if ( sca_uri_is_shared_appearance( sca, &to_aor )) {
-	call_info.ua_shared |= SCA_CALL_INFO_SHARED_CALLEE;
+	if (( update_mask & SCA_CALL_INFO_SHARED_CALLEE )) {
+	    call_info.ua_shared |= SCA_CALL_INFO_SHARED_CALLEE;
+	}
     }
 
     if ( call_info_hdr == NULL ) {

+ 2 - 0
modules/sca/sca_call_info.h

@@ -35,6 +35,8 @@ enum {
     SCA_CALL_INFO_SHARED_CALLER = (1 << 0),
     SCA_CALL_INFO_SHARED_CALLEE = (1 << 1),
 };
+#define SCA_CALL_INFO_SHARED_BOTH \
+	(SCA_CALL_INFO_SHARED_CALLER | SCA_CALL_INFO_SHARED_CALLEE)
 
 struct _sca_call_info {
     str		sca_uri;

+ 1 - 1
modules/xhttp/xhttp_trans.c

@@ -65,7 +65,7 @@ int xhttp_tr_eval_xhttpurl(struct sip_msg *msg, tr_param_t *tp, int subtype,
 		_httpurl_str.len = val->rs.len;
 		memcpy(_httpurl_str.s, val->rs.s, val->rs.len);
 
-		while (val->rs.s[pos] != '?' && pos < val->rs.len) pos++;
+		while (pos < val->rs.len && val->rs.s[pos] != '?') pos++;
 		_httpurl_querystring_pos = (pos >= val->rs.len) ? 0 : pos + 1;
 	}
 

+ 1 - 1
parser/parse_methods.c

@@ -40,7 +40,7 @@ static int token_char(char _c)
  		(_c >= 48 && _c <= 57) ||        /* digits */
  		(_c == '-') || (_c == '.') || (_c == '!') || (_c == '%') ||
  		(_c == '*') || (_c == '_') || (_c == '+') || (_c == '`') ||
- 		(_c == '\'') || (_c == '~') || (_c == '+') || (_c == '`');
+ 		(_c == '\'') || (_c == '~');
  }
 
 

+ 1 - 1
pkg/kamailio/deb/debian/control

@@ -433,7 +433,7 @@ Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends},
          ${shlibs:Depends},
-         gjc-jre,
+         gcj-jre,
          kamailio (= ${binary:Version})
 Description: contains the app_java module
  Kamailio is a very fast and flexible SIP (RFC3261)

+ 1 - 1
pkg/kamailio/deb/jessie/control

@@ -433,7 +433,7 @@ Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends},
          ${shlibs:Depends},
-         gjc-jre,
+         gcj-jre,
          kamailio (= ${binary:Version})
 Description: contains the app_java module
  Kamailio is a very fast and flexible SIP (RFC3261)

+ 1 - 1
pkg/kamailio/deb/wheezy/control

@@ -418,7 +418,7 @@ Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends},
          ${shlibs:Depends},
-         gjc-jre,
+         gcj-jre,
          kamailio (= ${binary:Version})
 Description: contains the app_java module
  Kamailio is a very fast and flexible SIP (RFC3261)

+ 1 - 1
tcp_main.c

@@ -4404,7 +4404,7 @@ static ticks_t tcpconn_main_timeout(ticks_t t, struct timer_ln* tl, void* data)
 			c->wbuf_q.queued);
 	
 	tcp_async=cfg_get(tcp, tcp_cfg, async);
-	if (likely(TICKS_LT(t, c->timeout) && ( !tcp_async | _wbufq_empty(c) |
+	if (likely(TICKS_LT(t, c->timeout) && ( !tcp_async || _wbufq_empty(c) ||
 					TICKS_LT(t, c->wbuf_q.wr_timeout)) )){
 		if (unlikely(tcp_async && _wbufq_non_empty(c)))
 			return (ticks_t)MIN_unsigned(c->timeout-t, c->wbuf_q.wr_timeout-t);