MCPcopy Create free account
hub / github.com/SIPp/sipp / check_peer_src

Method check_peer_src

src/call.cpp:4266–4301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4264}
4265
4266bool call::check_peer_src(char * msg, int search_index)
4267{
4268 char * L_ptr1, * L_ptr2, L_backup ;
4269
4270 L_ptr1 = strstr(msg, "From:");
4271 if (!L_ptr1) {
4272 return (false);
4273 }
4274 L_ptr1 += 5 ;
4275 while((*L_ptr1 == ' ') || (*L_ptr1 == '\t')) {
4276 L_ptr1++;
4277 }
4278 if (!(*L_ptr1)) {
4279 return (false);
4280 }
4281 L_ptr2 = L_ptr1;
4282 while((*L_ptr2) &&
4283 (*L_ptr2 != ' ') &&
4284 (*L_ptr2 != '\t') &&
4285 (*L_ptr2 != '\r') &&
4286 (*L_ptr2 != '\n')) {
4287 L_ptr2 ++;
4288 }
4289 if(!*L_ptr2) {
4290 return (false);
4291 }
4292 L_backup = *L_ptr2;
4293 *L_ptr2 = 0;
4294 if (strcmp(L_ptr1, call_scenario->messages[search_index] -> peer_src) == 0) {
4295 *L_ptr2 = L_backup;
4296 return(true);
4297 }
4298
4299 *L_ptr2 = L_backup;
4300 return (false);
4301}
4302
4303
4304void call::extract_cseq_method(char* method, const char* msg)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected