Browse Source

modules/lcr: Fixed to/from_gw tests when proto parameter is 0 (ANY)

- Also, updated README regarding handling of NULL value in lcr_gw
  transport column.
Juha Heinanen 13 years ago
parent
commit
1382c30da7
3 changed files with 5 additions and 7 deletions
  1. 2 2
      modules/lcr/README
  2. 1 1
      modules/lcr/doc/lcr_admin.xml
  3. 2 4
      modules/lcr/lcr_mod.c

+ 2 - 2
modules/lcr/README

@@ -268,8 +268,8 @@ Chapter 1. Admin Guide
    scheme, IP address, port, and transport protocol.
 
    Valid URI scheme values are NULL = sip, 1 = sip and 2 = sips. Currently
-   valid transport protocol values are NULL = none, 1 = udp, 2 = tcp, 3 =
-   tls, and 4 = sctp.
+   valid transport protocol values are NULL and 0 = none, 1 = udp, 2 =
+   tcp, 3 = tls, and 4 = sctp.
 
    As a side effect of gateway selection, selected gateway's tag and flags
    (that may contain information about the gateway and its capabilities)

+ 1 - 1
modules/lcr/doc/lcr_admin.xml

@@ -103,7 +103,7 @@
 	</para>
         <para>
         Valid URI scheme values are NULL = sip, 1 = sip and 2
-	= sips.  Currently valid transport protocol values are NULL =
+	= sips.  Currently valid transport protocol values are NULL and 0 =
 	none, 1 = udp, 2 = tcp, 3 = tls, and 4 = sctp.
 	</para>
 	<para>

+ 2 - 4
modules/lcr/lcr_mod.c

@@ -2309,8 +2309,7 @@ static int do_from_gw(struct sip_msg* _m, unsigned int lcr_id,
 
     /* Store tag and flags and return result */
     if ((res != NULL) &&
-	((res->transport == transport) ||
-	 ((res->transport == PROTO_NONE) && (transport == PROTO_UDP)))) {
+  	((transport == PROTO_NONE) || (res->transport == transport))) {
 	LM_DBG("request game from gw\n");
 	if (tag_avp_param) {
 	    val.s.s = res->tag;
@@ -2499,8 +2498,7 @@ static int do_to_gw(struct sip_msg* _m, unsigned int lcr_id,
 
     /* Return result */
     if ((res != NULL) &&
-	((res->transport == transport) ||
-	 ((transport == PROTO_NONE) && (res->transport == PROTO_UDP)))) {
+  	((transport == PROTO_NONE) || (res->transport == transport))) {
 	LM_DBG("request goes to gw\n");
 	return 1;
     } else {