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

Method findDialogByMsg

SIP/SIP2Interface.cpp:100–113  ·  view source on GitHub ↗

Find a dialog from an incoming Message. An outgoing INVITE has a local tag immediately, which is returned by the peer. An incoming INVITE does not have a local tag yet until the ACK is received, so ACK must be handled specially.

Source from the content-addressed store, hash-verified

98// An outgoing INVITE has a local tag immediately, which is returned by the peer.
99// An incoming INVITE does not have a local tag yet until the ACK is received, so ACK must be handled specially.
100SipDialog *SipDialogMap::findDialogByMsg(SipMessage *msg)
101{
102 // This is an incoming message, so if there is a code then it is a reply so the Dialog was outbound.
103 string callid = msg->smGetCallId(), localtag = msg->smGetLocalTag();
104 string key = makeTagKey(callid,localtag);
105 SipDialog *dialog = mDialogMap.readNoBlock(key);
106 if (! dialog && msg->isACK()) {
107 // For ACK try without the local tag.
108 // The ACK and all subsequent messages from the peer include our local tag that it regurgitates.
109 key = makeTagKey(callid,"");
110 dialog = mDialogMap.readNoBlock(key);
111 }
112 return dialog;
113}
114
115// Add the local tag to the lookup key for this dialog.
116void SipDialogMap::dmAddLocalTag(SipDialog *dialog)

Callers

nothing calls this directly

Calls 3

smGetCallIdMethod · 0.80
smGetLocalTagMethod · 0.80
isACKMethod · 0.80

Tested by

no test coverage detected