[sr-dev] git:master:29a81852: parse_uri : added new function proto type int to str

Henning Westerholt hw at skalatan.de
Mon Nov 25 20:33:37 CET 2019


Module: kamailio
Branch: master
Commit: 29a818525572e19510cafb7aef9ed62eab98a369
URL: https://github.com/kamailio/kamailio/commit/29a818525572e19510cafb7aef9ed62eab98a369

Author: root <root at localhost.localdomain>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-11-25T20:33:30+01:00

parse_uri : added new function proto type int to str

added new function proto type int to str

---

Modified: src/core/parser/parse_uri.c
Modified: src/core/parser/parse_uri.h

---

Diff:  https://github.com/kamailio/kamailio/commit/29a818525572e19510cafb7aef9ed62eab98a369.diff
Patch: https://github.com/kamailio/kamailio/commit/29a818525572e19510cafb7aef9ed62eab98a369.patch

---

diff --git a/src/core/parser/parse_uri.c b/src/core/parser/parse_uri.c
index ec39ea7cf2..283443dacd 100644
--- a/src/core/parser/parse_uri.c
+++ b/src/core/parser/parse_uri.c
@@ -1439,3 +1439,26 @@ void proto_type_to_str(unsigned short type, str *s) {
 		*s = s_null;
 	}
 }
+
+void proto_type_int_to_str(int type, str *s) {
+       switch (type) {
+       case PROTO_UDP:
+               *s = s_udp;
+               break;
+       case PROTO_TCP:
+               *s = s_tcp;
+               break;
+       case PROTO_TLS:
+               *s = s_tls;
+               break;
+       case PROTO_SCTP:
+               *s = s_sctp;
+               break;
+       case PROTO_WS:
+       case PROTO_WSS:
+               *s = s_ws;
+               break;
+       default:
+               *s = s_null;
+       }
+}
diff --git a/src/core/parser/parse_uri.h b/src/core/parser/parse_uri.h
index a3c8c7142c..8a8dfac258 100644
--- a/src/core/parser/parse_uri.h
+++ b/src/core/parser/parse_uri.h
@@ -47,5 +47,5 @@ int parse_orig_ruri(struct sip_msg* msg);
 int normalize_tel_user(char* res, str* src);
 void uri_type_to_str(uri_type type, str *s);
 void proto_type_to_str(unsigned short type, str *s);
-
+void proto_type_int_to_str(int type, str *s);
 #endif /* PARSE_URI_H */




More information about the sr-dev mailing list