Browse code

@ruri.params["foo"] checks also the original sip: URI parameters

This patch increases the compatibility with non-standard implementations when the parameters are added to the end of the sip: URI
instead of the userinfo part in case of a tel: URI embedded in a sip: URI.
For example:
sip:123@domain;foo=bar;user=phone
instead of
sip:123;foo=bar@domain;user=phone

Miklos Tirpak authored on 13/05/2009 12:57:26
Showing 1 changed files
... ...
@@ -806,6 +806,7 @@ int select_uri_proto(str* res, select_t* s, struct sip_msg* msg)
806 806
 
807 807
 int select_uri_params(str* res, select_t* s, struct sip_msg* msg)
808 808
 {
809
+	int	ret;
809 810
 	if (!msg || !res) {
810 811
 		return select_any_params(res, s, msg);
811 812
 	}
... ...
@@ -817,7 +818,16 @@ int select_uri_params(str* res, select_t* s, struct sip_msg* msg)
817 817
 		RETURN0_res(uri.params);
818 818
 
819 819
 	*res=uri.params;
820
-	return select_any_params(res, s, msg);
820
+	ret = select_any_params(res, s, msg);
821
+	if ((ret < 0)
822
+		&& (uri.sip_params.s != NULL)
823
+		&& (uri.sip_params.s != uri.params.s)
824
+	) {
825
+		/* Search also in the original sip: uri parameters. */
826
+		*res = uri.sip_params;
827
+		ret = select_any_params(res, s, msg);
828
+	}
829
+	return ret;
821 830
 }
822 831
 
823 832
 int select_any_params(str* res, select_t* s, struct sip_msg* msg)