MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / siDrive2

Method siDrive2

SIP/SIP2Interface.cpp:652–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650
651
652void SipInterface::siDrive2()
653{
654 // All inbound SIP messages go here for processing.
655
656 LOG(DEBUG) << "blocking on socket";
657 int numRead = mSIPSocket->read(mReadBuffer);
658 if (numRead<0) {
659 LOG(ALERT) << "cannot read SIP socket.";
660 return;
661 }
662 if (numRead<10) {
663 LOG(WARNING) << "malformed packet (" << numRead << " bytes) on SIP socket";
664 return;
665 }
666 mReadBuffer[numRead] = '\0';
667 if (random()%100 < gConfig.getNum("Test.SIP.SimulatedPacketLoss")) {
668 LOG(NOTICE) << "simulating dropped inbound SIP packet: " << mReadBuffer;
669 return;
670 }
671
672 newDriveIncoming(mReadBuffer);
673}
674
675static void driveLoop2( SipInterface * si)
676{

Callers 1

driveLoop2Function · 0.80

Calls 1

readMethod · 0.45

Tested by

no test coverage detected