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

Method newSendEarlyError

SIP/SIP2Interface.cpp:447–460  ·  view source on GitHub ↗

Warning: This assumes the cause message is a SIP request, not a SIP response.

Source from the content-addressed store, hash-verified

445
446// Warning: This assumes the cause message is a SIP request, not a SIP response.
447void SipInterface::newSendEarlyError(SipMessage *cause, int code, const char * reason)
448{
449 // If the message that caused the error is a 400 class error response, we must not send
450 // a response error to prevent a fast infinite message loop with the peer.
451 // In fact, we will ignore any response, and only return errors to requests.
452 if (cause->smGetCode() != 0) { return; } // Ignore responses.
453
454 IPAddressSpec peer;
455 if (! peer.ipSet(cause->smGetProxy(),"incoming SIP message")) {
456 return; // If the peer address is invalid, not much else we can do about it.
457 }
458 SipMessageReply err(cause,code,string(reason),NULL);
459 siWrite(&peer.mipSockAddr,&err);
460}
461
462
463

Callers

nothing calls this directly

Calls 3

smGetCodeMethod · 0.80
ipSetMethod · 0.80
smGetProxyMethod · 0.80

Tested by

no test coverage detected