| 370 | } |
| 371 | |
| 372 | void 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. |
no test coverage detected