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

Method newCheckInvite

SIP/SIP2Interface.cpp:618–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

616}
617
618bool SipInterface::newCheckInvite(SipMessage *msg)
619{
620 // Check for INVITE or MESSAGE methods.
621 // Check channel availability now, too,
622 // even if we are not actually assigning the channel yet.
623 if (msg->isINVITE()) {
624 gReports.incr("OpenBTS.SIP.INVITE.In");
625 handleInvite(msg,true);
626 return true;
627 } else if (msg->isMESSAGE()) {
628 gReports.incr("OpenBTS.SIP.MESSAGE.In");
629 handleInvite(msg,false);
630 return true;
631 } else {
632
633 // Is this a message for an existing INVITE transaction, ie, that part of the INVITE before ACK?
634 // The findDialogMsg also finds a matching MESSAGE dialog or REGISTER dialog, but we are subsequently
635 // testing against the INVITE via-branch, which will find only INVITE transactions.
636 if (SipDialog *existing = findDialogByMsg(msg)) {
637 // The ACK and CANCEL message are sent to the INVITE server transaction.
638 // Other messages (BYE, INFO, etc) would be sent to the TU created for them.
639 if (msg->smGetCode() ? msg->smGetBranch() == existing->mInviteViaBranch : msg->isACK() || msg->isCANCEL()) {
640 WATCH("SIP Sending message to existing dialog"<<LOGVAR2("state",existing->getSipState()));
641 LOG(DEBUG) << "Sending message to existing dialog"<<LOGVAR(msg->smGetCode()) <<LOGVAR(msg->smGetBranch()) << LOGVAR(existing->mInviteViaBranch) << LOGVAR(msg->smGetMethodName()) << existing->dialogText();
642 if (! existing->dgWriteHighSide(msg)) {
643 LOG(ERR) << "Confusing SIP message not handled, to dialog:" <<existing->dialogText(false)<< " message was:"<<msg;
644 }
645 return true; // We handled it or threw it away.
646 }
647 }
648 }
649}
650
651
652void SipInterface::siDrive2()

Callers

nothing calls this directly

Calls 10

isINVITEMethod · 0.80
isMESSAGEMethod · 0.80
smGetCodeMethod · 0.80
smGetBranchMethod · 0.80
isACKMethod · 0.80
isCANCELMethod · 0.80
smGetMethodNameMethod · 0.80
dialogTextMethod · 0.80
dgWriteHighSideMethod · 0.80
getSipStateMethod · 0.45

Tested by

no test coverage detected