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

Method handleSetupMsg

Control/L3CallControl.cpp:361–426  ·  view source on GitHub ↗

GSM 04.08 5.2.1.2 This is where we set the TI [Transaction Identifier] in the TranEntry to what the MS sent us in the L3Setup message. We also start the SIP dialog now.

Source from the content-addressed store, hash-verified

359// This is where we set the TI [Transaction Identifier] in the TranEntry to what the MS sent us in the L3Setup message.
360// We also start the SIP dialog now.
361MachineStatus MOCMachine::handleSetupMsg(const L3Setup *setup)
362{
363 // pat fixed. See comments at MOCInitiated. setGSMState(CCState::MOCInitiated);
364
365 PROCLOG(INFO) << *setup;
366 gReports.incr("OpenBTS.GSM.CC.MOC.Setup");
367 if (setup->mFacility.mExtant) WATCH(setup); // USSD DEBUG!
368
369 // See GSM 04.07 11.2.3.1.3.
370 // Set the high bit, since this TI came from the MS.
371 // Set l3ti before calling any aborts so we will handle the response to the MS properly.
372 // (pat) The MS will continue to use the original TI (without the high bit set) when it communicates with us,
373 // and We need to set the high bit only when we send an L3TI to the MS.
374 tran()->setL3TI(setup->TI() | 0x08);
375 tran()->setCodecs(setup->getCodecSet());
376 string calledNumber;
377 {
378 if (!setup->haveCalledPartyBCDNumber()) {
379 // FIXME -- This is quick-and-dirty, not following GSM 04.08 5.
380 // (pat) I disagree: this exactly follows GSM 4.08 5.4.2
381 PROCLOG(WARNING) << "MOC setup with no number";
382 return closeCall(L3Cause::InvalidMandatoryInformation);
383 }
384 const L3CalledPartyBCDNumber& calledPartyIE = setup->calledPartyBCDNumber();
385 tran()->setCalled(calledPartyIE);
386 calledNumber = calledPartyIE.digits();
387 }
388
389 /* early RLLP request */
390 /* this seems to need to be sent after initial call setup
391 -kurtis */
392 if (gConfig.getBool("Control.Call.QueryRRLP.Early")) {
393 // Query for RRLP
394#if ORIGINAL_CODE
395 if (!sendRRLP(mobileID, LCH)) {
396 PROCLOG(INFO) << "RRLP request failed";
397 }
398#else
399 // TODO: RRLPServer.start(mobileID);
400#endif
401 }
402
403
404 // Start a new SIP Dialog, which sends an INVITE.
405 PROCLOG(DEBUG) << "SIP start engine";
406 //getDialog()->dialogOpen(tran()->subscriberIMSI());
407 //const char * imsi = tran()->subscriberIMSI(); // someday these will be a strings already
408 // The sipDialogMOC creates the SIP Dialog and sends the INVITE.
409 // The setDialog associates the new dialog with this transaction.
410 SipDialog *dialog = SipDialog::newSipDialogMOC(tran()->tranID(),tran()->subscriber(),calledNumber,tran()->getCodecs(), channel());
411 if (dialog == NULL) {
412 // We failed to create the SIP session for some reason. I dont think this can happen, but dont crash here.
413 LOG(ERR) << "Failed to create SIP Dialog, dropping connection";
414 return closeChannel(L3RRCause::Unspecified,RELEASE);
415 }
416 //setDialog(dialog); Moved into newSipDialogMOC to eliminate a race.
417
418

Callers

nothing calls this directly

Calls 12

sendRRLPFunction · 0.85
L3CallProceedingClass · 0.85
setL3TIMethod · 0.80
setCodecsMethod · 0.80
getCodecSetMethod · 0.80
setCalledMethod · 0.80
getCodecsMethod · 0.80
TIMethod · 0.45
digitsMethod · 0.45
tranIDMethod · 0.45
l3sendmMethod · 0.45

Tested by

no test coverage detected