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

Method lost

src/call.cpp:1407–1428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1405}
1406
1407bool call::lost(int index)
1408{
1409 static int inited = 0;
1410 double percent = global_lost;
1411
1412 if(!lose_packets) return false;
1413
1414 if (call_scenario->messages[index]->lost >= 0) {
1415 percent = call_scenario->messages[index]->lost;
1416 }
1417
1418 if (percent == 0) {
1419 return false;
1420 }
1421
1422 if(!inited) {
1423 srand((unsigned int) time(nullptr));
1424 inited = 1;
1425 }
1426
1427 return (((double)rand() / (double)RAND_MAX) < (percent / 100.0));
1428}
1429
1430int call::send_raw(const char * msg, int index, int len)
1431{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected