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

Function determine_source

prime_hash.c:109–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static int determine_source (struct sip_msg *msg, enum hash_source source,
110 str *source_string) {
111 source_string->s = NULL;
112 source_string->len = 0;
113
114 if(validate_msg(msg) < 0) {
115 return -1;
116 }
117
118 switch (source) {
119 case shs_call_id:
120 return determine_call_id (msg, source_string);
121 case shs_from_uri:
122 return determine_fromto_uri (get_from(msg), source_string);
123 case shs_from_user:
124 return determine_fromto_user (get_from(msg), source_string);
125 case shs_to_uri:
126 return determine_fromto_uri (get_to(msg), source_string);
127 case shs_to_user:
128 return determine_fromto_user (get_to(msg), source_string);
129 default:
130 LM_ERR("unknown hash source %i.\n",
131 (int) source);
132 return -1;
133 }
134}
135
136static int validate_msg(struct sip_msg * msg) {
137 if(!msg->callid && ((parse_headers(msg, HDR_CALLID_F, 0) == -1) || !msg->callid)) {

Callers 2

hash_funcFunction · 0.85
prime_hash_funcFunction · 0.85

Calls 4

validate_msgFunction · 0.85
determine_call_idFunction · 0.85
determine_fromto_uriFunction · 0.85
determine_fromto_userFunction · 0.85

Tested by

no test coverage detected