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

Function writePrivateHeaders

SIP/SIPBase.cpp:372–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372void writePrivateHeaders(SipMessage *msg, const L3LogicalChannel *l3chan)
373{
374 // P-PHY-Info
375 // This is a non-standard private header in OpenBTS.
376 // TODO: If we add the MSC params to this, especially L3TI, the SIP message will completely encapsulate handover.
377 // TA=<timing advance> TE=<TA error> UpRSSI=<uplink RSSI> TxPwr=<MS tx power> DnRSSIdBm=<downlink RSSI>
378 // Get the values.
379 if (l3chan) {
380 char phy_info[200];
381 // (pat) TODO: This is really cheating.
382 const GSM::L2LogicalChannel *chan = l3chan->getL2Channel();
383 MSPhysReportInfo *phys = chan->getPhysInfo();
384 snprintf(phy_info,200,"OpenBTS; TA=%d TE=%f UpRSSI=%f TxPwr=%d DnRSSIdBm=%d time=%9.3lf",
385 phys->actualMSTiming(), phys->timingError(),
386 phys->RSSI(), phys->actualMSPower(),
387 chan->measurementResults().RXLEV_FULL_SERVING_CELL_dBm(),
388 phys->timestamp());
389 static const string cPhyInfoString("P-PHY-Info");
390 msg->smAddHeader(cPhyInfoString,phy_info);
391 }
392
393 // P-Access-Network-Info
394 // See 3GPP 24.229 7.2. This is a genuine specified header.
395 char cgi_3gpp[256];
396 snprintf(cgi_3gpp,256,"3GPP-GERAN; cgi-3gpp=%s%s%04x%04x",
397 gConfig.getStr("GSM.Identity.MCC").c_str(),gConfig.getStr("GSM.Identity.MNC").c_str(),
398 (unsigned)gConfig.getNum("GSM.Identity.LAC"),(unsigned)gConfig.getNum("GSM.Identity.CI"));
399 static const string cAccessNetworkInfoString("P-Access-Network-Info");
400 msg->smAddHeader(cAccessNetworkInfoString, cgi_3gpp);
401
402 // FIXME -- Use the subscriber registry to look up the E.164
403 // and make a second P-Preferred-Identity header.
404}
405
406
407// Like this: Note no via branch, but registrar added one.

Callers 4

makeRegisterMsgMethod · 0.85
MOUssdSendINVITEMethod · 0.85
MOCSendINVITEMethod · 0.85
MTCSendOKMethod · 0.85

Calls 9

actualMSTimingMethod · 0.80
actualMSPowerMethod · 0.80
timestampMethod · 0.80
smAddHeaderMethod · 0.80
getL2ChannelMethod · 0.45
getPhysInfoMethod · 0.45
timingErrorMethod · 0.45
RSSIMethod · 0.45

Tested by

no test coverage detected