MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / get_uri_port

Function get_uri_port

parser/parse_uri.h:104–124  ·  view source on GitHub ↗

Gets (in a SIP wise manner) the SIP port from a SIP URI ; if the port is not explicitly set in the URI, it returns the default port corresponding to the used transport protocol (if protocol misses, we assume the default protos according to the URI schema) */

Source from the content-addressed store, hash-verified

102 to the used transport protocol (if protocol misses, we assume the default
103 protos according to the URI schema) */
104static inline unsigned short get_uri_port(struct sip_uri* _uri,
105 unsigned short *_proto)
106{
107 unsigned short port;
108 unsigned short proto;
109
110 /* known protocol? */
111 if ((proto=_uri->proto)==PROTO_NONE) {
112 /* use UDP as default proto, but TLS for secure schemas */
113 proto = (_uri->type==SIPS_URI_T || _uri->type==TELS_URI_T)?
114 PROTO_TLS : PROTO_UDP ;
115 }
116
117 /* known port? */
118 if ((port=_uri->port_no)==0)
119 port = protos[proto].default_rfc_port;
120
121 if (_proto) *_proto = proto;
122
123 return port;
124}
125
126
127/**

Callers 6

pv_get_xuri_attrFunction · 0.85
pv_get_dsturi_attrFunction · 0.85
get_uri_hash_keysFunction · 0.85
contact_rportFunction · 0.85
is_myselfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected