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

Method newSipDialogMOSMS

SIP/SIPDialog.cpp:118–143  ·  view source on GitHub ↗

Open an MOSMS [Mobile Originated Short Message Service] SIP Transaction and send the invite. We use a dialog for this even though it is just a message because it was easier to interface to the Control directory without changing anything.

Source from the content-addressed store, hash-verified

116// We use a dialog for this even though it is just a message because it was easier to interface
117// to the Control directory without changing anything.
118SipDialog *SipDialog::newSipDialogMOSMS(
119 TranEntryId tranid,
120 const FullMobileId &fromMsId, // caller imsi
121 const string &calledDigits, // number being called, or it may be config option SIP.SMSC
122 const string &body,
123 const string &contentType)
124{
125 LOG(DEBUG) <<LOGVAR(fromMsId)<<LOGVAR2("called",calledDigits); //<<LOGVAR2("tranid",wTranId);
126 // This is weird - use the local IP address as the domain of the remote user?
127 SipDialog *dialog = new SipDialog(SIPDTMOSMS,gConfig.getStr("SIP.Proxy.SMS"),"SIP.Proxy.SMS");
128 dialog->dsSetLocalMO(fromMsId,gPeerIsBuggySmqueue ? true : false);
129 string calledDomain = dialog->localIP();
130 dialog->dsSetRemoteUri(makeUri(calledDigits,calledDomain));
131
132 dialog->smsBody = body; // Temporary until smqueue is fixed.
133 dialog->smsContentType = contentType; // Temporary until smqueue is fixed.
134
135 // Must lock once we do dmAddCallDialog to prevent the SIPInterface threads from accessing this dialog
136 // while we finish construction.
137 ScopedLock lock(dialog->mDialogLock,__FILE__,__LINE__);
138 gSipInterface.dmAddCallDialog(dialog);
139 //dialog->MOSMSSendMESSAGE(calledDigits,calledDomain,body,contentType);
140 gNewTransactionTable.ttSetDialog(tranid,dialog); // Must do this before the dialog receives any messages.
141 dialog->MOSMSSendMESSAGE(body,contentType);
142 return dialog;
143}
144
145SipDialog *SipDialog::newSipDialogMOUssd(
146 TranEntryId tranid,

Callers

nothing calls this directly

Calls 7

makeUriFunction · 0.85
dsSetLocalMOMethod · 0.80
localIPMethod · 0.80
dsSetRemoteUriMethod · 0.80
dmAddCallDialogMethod · 0.80
ttSetDialogMethod · 0.80
MOSMSSendMESSAGEMethod · 0.80

Tested by

no test coverage detected