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

Author: Peter Dunkley <[email protected]>
Committer: Peter Dunkley <[email protected]>
Date:   Sun May 12 13:57:44 2013 +0100

modules/msrp: Use "msrps://" URIs for the server when TLS is loaded. TLS is 
mandatory for MSRP relays.

---

 modules/msrp/msrp_cmap.c |    3 ++-
 modules/msrp/msrp_vars.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/msrp/msrp_cmap.c b/modules/msrp/msrp_cmap.c
index 3e4c351..5ae3b0c 100644
--- a/modules/msrp/msrp_cmap.c
+++ b/modules/msrp/msrp_cmap.c
@@ -31,6 +31,7 @@
 #include "../../lib/srutils/sruid.h"
 #include "../../rpc.h"
 #include "../../rpc_lookup.h"
+#include "../../sr_module.h"
 
 #include "msrp_netio.h"
 #include "msrp_env.h"
@@ -211,7 +212,7 @@ int msrp_cmap_save(msrp_frame_t *mf)
        idx = msrp_get_slot(hid, _msrp_cmap_head->mapsize);
 
        srcaddr.s = sbuf;;
-       if(mf->tcpinfo->rcv->proto==PROTO_TLS || 
mf->tcpinfo->rcv->proto==PROTO_WSS)
+       if (module_loaded("tls"))
        {
                memcpy(srcaddr.s, "msrps://", 8);
                srcaddr.s+=8;
diff --git a/modules/msrp/msrp_vars.c b/modules/msrp/msrp_vars.c
index 939cfb2..673b20d 100644
--- a/modules/msrp/msrp_vars.c
+++ b/modules/msrp/msrp_vars.c
@@ -31,6 +31,7 @@
 #include "../../trim.h"
 #include "../../ut.h"
 #include "../../pvapi.h"
+#include "../../sr_module.h"
 
 #include "msrp_parser.h"
 #include "msrp_vars.h"
@@ -273,7 +274,7 @@ int pv_get_msrp(sip_msg_t *msg,  pv_param_t *param, 
pv_value_t *res)
                                return pv_get_null(msg, param, res);
                        s.s = pv_get_buffer();
                        p = s.s;
-                       if(mf->tcpinfo->rcv->proto==PROTO_TLS || 
mf->tcpinfo->rcv->proto==PROTO_WSS)
+                       if (module_loaded("tls"))
                        {
                                memcpy(p, "msrps://", 8);
                                p+=8;


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to