Documentation
¶
Index ¶
- Constants
- Variables
- func NewTraceID() string
- func SafeDiagnosticError(err error) string
- func SafeDiagnosticString(value string) string
- func SetLogger(any)
- func WithTraceID(ctx context.Context, traceID string) context.Context
- type APDUAccess
- type CRSMAccess
- type DataplanePolicy
- type DiagnosticIMSRegisterResponseDecision
- type DiagnosticIMSRegistrationRecoveryState
- type DiagnosticIMSRegistrationResult
- type DiagnosticState
- type Event
- type EventDispatcher
- type EventLocalNumberLearned
- type EventLogNotify
- type EventRuntimeStateSnapshot
- type EventSMSReceived
- type EventSMSSent
- type EventUSSDUpdated
- type IMSMessagingRetryWorkerConfig
- type IMSRegisterResponseDecision
- type IMSRegisterTransportFactory
- type IMSRegistrar
- type IMSRegistrationConfig
- type IMSRegistrationRecoveryState
- type IMSRegistrationResult
- type IMSSMSTransportFactory
- type IMSUSSDTransportFactory
- type IMSVoiceTransportFactory
- type IdentityReader
- type Instance
- func (i *Instance) AddObserver(o Observer)
- func (i *Instance) CancelVoiceCall(ctx context.Context, info voicehost.DialogInfo) error
- func (i *Instance) CancelVoiceCallWithResult(ctx context.Context, info voicehost.DialogInfo) (voicehost.DialogInfoResult, error)
- func (i *Instance) DiagnosticState() DiagnosticState
- func (i *Instance) DrainIMSMessagingRetries(ctx context.Context, now time.Time, limit int) ([]messaging.IMSMessagingRetryReplayResult, error)
- func (i *Instance) EndVoiceCall(ctx context.Context, info voicehost.DialogInfo) error
- func (i *Instance) EndVoiceCallWithResult(ctx context.Context, info voicehost.DialogInfo) (voicehost.DialogInfoResult, error)
- func (i *Instance) GetSMSDeliveryStatus(messageID string) (*messaging.DeliveryStatus, error)
- func (i *Instance) HandleIMSBye(ctx context.Context, req voicehost.IMSByeRequest) (voicehost.IMSByeResult, error)
- func (i *Instance) HandleIMSInfo(ctx context.Context, req voicehost.IMSInfoRequest) (voicehost.IMSInfoResult, error)
- func (i *Instance) HandleIMSMessage(ctx context.Context, req voicehost.IMSMessageRequest) (voicehost.IMSMessageResult, error)
- func (i *Instance) HandleIncomingSMS(ctx context.Context, msg messaging.IncomingSMS) error
- func (i *Instance) HandleSMSDeliveryReport(ctx context.Context, report messaging.SMSDeliveryReport) (messaging.DeliveryPartMatch, error)
- func (i *Instance) Obs() map[string]interface{}
- func (i *Instance) SendDialogAutoDTMF(ctx context.Context, req voicehost.DialogDTMFRequest) (voicehost.DialogAutoDTMFResult, error)
- func (i *Instance) SendDialogDTMF(ctx context.Context, req voicehost.DialogDTMFRequest) (voicehost.DialogDTMFResult, error)
- func (i *Instance) SendDialogHold(ctx context.Context, req voicehost.DialogHoldRequest) (voicehost.DialogUpdateResult, error)
- func (i *Instance) SendDialogInfo(ctx context.Context, req voicehost.DialogInfoRequest) (voicehost.DialogInfoResult, error)
- func (i *Instance) SendDialogMessage(ctx context.Context, req voicehost.DialogMessageRequest) (voicehost.DialogMessageResult, error)
- func (i *Instance) SendDialogNotify(ctx context.Context, req voicehost.DialogNotifyRequest) (voicehost.DialogNotifyResult, error)
- func (i *Instance) SendDialogOptions(ctx context.Context, req voicehost.DialogOptionsRequest) (voicehost.DialogOptionsResult, error)
- func (i *Instance) SendDialogPrack(ctx context.Context, req voicehost.DialogPrackRequest) (voicehost.DialogPrackResult, error)
- func (i *Instance) SendDialogRefer(ctx context.Context, req voicehost.DialogReferRequest) (voicehost.DialogReferResult, error)
- func (i *Instance) SendDialogReinvite(ctx context.Context, req voicehost.DialogReinviteRequest) (voicehost.DialogReinviteResult, error)
- func (i *Instance) SendDialogResume(ctx context.Context, req voicehost.DialogResumeRequest) (voicehost.DialogUpdateResult, error)
- func (i *Instance) SendDialogSubscribe(ctx context.Context, req voicehost.DialogSubscribeRequest) (voicehost.DialogSubscribeResult, error)
- func (i *Instance) SendDialogUpdate(ctx context.Context, req voicehost.DialogUpdateRequest) (voicehost.DialogUpdateResult, error)
- func (i *Instance) SendSMSWithOptions(ctx context.Context, to, text string, opts messaging.SendOptions) (messaging.SendOutcome, error)
- func (i *Instance) Service() *messaging.Service
- func (i *Instance) SetNotifier(fn func(string))
- func (i *Instance) SetSMSNotifier(fn func(deviceID, sender, content string, ts time.Time))
- func (i *Instance) StartOutboundCall(ctx context.Context, req voicehost.OutboundCallRequest) (voicehost.OutboundCallResult, error)
- func (i *Instance) State() State
- func (i *Instance) Status() string
- func (i *Instance) Stop(ctx context.Context) error
- func (i *Instance) TriggerMOBIKE(oldIP, newIP string) error
- type Modem
- type ModemAccess
- type ModuleEvent
- type Observer
- type ObserverFunc
- type Phase
- type PrepareStartInput
- type ProxyConfig
- type SIMAccessRecoveryHook
- type SIMAccessRecoveryOptions
- type SIMAccessRecoveryRequest
- type SIMAdapter
- type SessionConfig
- type StartRequest
- type State
- type TunnelManagerFactory
- type WireIMSRegistrar
Constants ¶
const ( // IMSRegisterResponseActionNone means the status does not imply local registration recovery. IMSRegisterResponseActionNone = "none" // IMSRegisterResponseActionReauthenticate means the UE should obtain a fresh digest challenge. IMSRegisterResponseActionReauthenticate = "reauthenticate" // IMSRegisterResponseActionRefreshIdentity means local IMS identity material should be refreshed before retrying. IMSRegisterResponseActionRefreshIdentity = "refresh_identity" // IMSRegisterResponseActionRetryWithMinExpires means the UE should honor Min-Expires and retry. IMSRegisterResponseActionRetryWithMinExpires = "retry_with_min_expires" // IMSRegisterResponseActionBackoffRetry means the UE should retry registration conservatively after delay/backoff. IMSRegisterResponseActionBackoffRetry = "backoff_retry" // IMSRegisterResponseActionRefreshSecurity means the UE should rebuild Security-Agree state before retrying. IMSRegisterResponseActionRefreshSecurity = "refresh_security" )
const ( SIMAccessRecoveryOperationISIMIdentity = "isim_identity" SIMAccessRecoveryOperationIMEI = "imei" )
const StartModeMain = "main"
Variables ¶
var ErrAPDUBusy = errors.New("apdu busy")
Functions ¶
func NewTraceID ¶
func NewTraceID() string
func SafeDiagnosticError ¶
SafeDiagnosticError returns a redacted error string for logs, UI, and structured runtime status. It returns an empty string when err is nil.
func SafeDiagnosticString ¶
SafeDiagnosticString redacts subscriber identifiers, AKA/digest material, IPs, MACs, and local paths from free-form runtime diagnostic text.
Types ¶
type APDUAccess ¶
type CRSMAccess ¶
type CRSMAccess interface {
ReadCRSMBinary(fileID uint16, offset, length int, pathID string) (simtransport.CRSMResult, error)
ReadCRSMRecord(fileID uint16, record, length int, pathID string) (simtransport.CRSMResult, error)
}
type DataplanePolicy ¶
type DataplanePolicy struct {
Mode string
TUNName string
TUNMTU int
DisableTUNRouting bool
TUNAddresses []string
TUNEPDGExclusions []swu.EPDGRouteExclusion
TUNRoutes []swu.TUNRoute
TUNRules []swu.TUNRule
TunnelManager swu.TunnelManager
TunnelManagerFactory TunnelManagerFactory
}
type DiagnosticIMSRegisterResponseDecision ¶
type DiagnosticIMSRegisterResponseDecision struct {
StatusCode int
Action string
Recoverable bool
Retry bool
Reauthenticate bool
RefreshIdentity bool
RefreshSecurity bool
Backoff bool
RetryAfter time.Duration
Reason string
Redacted bool
}
DiagnosticIMSRegisterResponseDecision is a redacted view of an IMS REGISTER recovery decision. It is suitable for logs/UI because it carries the operational recovery action without exposing SIP identities or auth material from the response reason.
func SafeDiagnosticIMSRegisterResponseDecision ¶
func SafeDiagnosticIMSRegisterResponseDecision(decision IMSRegisterResponseDecision, reason string) DiagnosticIMSRegisterResponseDecision
SafeDiagnosticIMSRegisterResponseDecision returns a diagnostic view of an IMS REGISTER recovery decision with optional response reason text redacted.
type DiagnosticIMSRegistrationRecoveryState ¶
type DiagnosticIMSRegistrationRecoveryState struct {
Attempts int
ConsecutiveFailures int
LastReason string
LastError string
LastAttemptAt time.Time
LastSucceededAt time.Time
NextAttemptAt time.Time
LastSwitchedTarget bool
Redacted bool
}
DiagnosticIMSRegistrationRecoveryState is a redacted view of ongoing IMS registration recovery bookkeeping. It preserves retry counters and timestamps while removing sensitive text from the last reason/error fields.
func SafeDiagnosticIMSRegistrationRecoveryState ¶
func SafeDiagnosticIMSRegistrationRecoveryState(state IMSRegistrationRecoveryState) DiagnosticIMSRegistrationRecoveryState
SafeDiagnosticIMSRegistrationRecoveryState returns a diagnostic view of IMS registration recovery state with sensitive reason/error text redacted.
type DiagnosticIMSRegistrationResult ¶
type DiagnosticIMSRegistrationResult struct {
Registered bool
StatusCode int
Reason string
Server string
RegisteredAt time.Time
ExpiresAt time.Time
RefreshDelay time.Duration
NextRefreshAt time.Time
RecoveryState DiagnosticIMSRegistrationRecoveryState
VoiceTransportReady bool
SMSTransportReady bool
USSDTransportReady bool
Redacted bool
}
DiagnosticIMSRegistrationResult is a redacted view of an IMS registration result for support surfaces. It deliberately omits Profile and Binding, which can contain IMS identities, Contact URIs, security material, and route state.
func SafeDiagnosticIMSRegistrationResult ¶
func SafeDiagnosticIMSRegistrationResult(result IMSRegistrationResult) DiagnosticIMSRegistrationResult
SafeDiagnosticIMSRegistrationResult returns a diagnostic summary of IMS registration without exposing raw IMS profile, binding, or SIP route data.
type DiagnosticState ¶
type DiagnosticState struct {
DeviceID string
Phase Phase
DataplaneMode string
SIMReady bool
AccessReady bool
TunnelReady bool
IMSReady bool
SMSReady bool
RegStatus int
RegStatusText string
NetworkMode string
LastErrorClass string
LastError string
LastReason string
IMSRecoveryPending bool
IMSRecoveryRetryAfter time.Duration
IMSRecoveryNextAttemptAt time.Time
IMSRecoveryReason string
UpdatedAt time.Time
Redacted bool
}
DiagnosticState is a redacted runtime state view intended for logs, UI state, and support diagnostics. It preserves operational state while removing common subscriber identifiers, AKA/digest material, IPs, MACs, and local paths.
func SafeDiagnosticState ¶
func SafeDiagnosticState(state State) DiagnosticState
SafeDiagnosticState returns a diagnostic view of state with sensitive text fields redacted. It does not mutate the input State.
type EventDispatcher ¶
type EventDispatcher = eventhost.Dispatcher
type EventLocalNumberLearned ¶
type EventLocalNumberLearned = eventhost.LocalNumberLearned
type EventLogNotify ¶
type EventRuntimeStateSnapshot ¶
type EventRuntimeStateSnapshot = eventhost.RuntimeStateSnapshot
type EventSMSReceived ¶
type EventSMSReceived = eventhost.SMSReceived
type EventSMSSent ¶
type EventUSSDUpdated ¶
type EventUSSDUpdated = eventhost.USSDUpdated
type IMSRegisterResponseDecision ¶
type IMSRegisterResponseDecision struct {
StatusCode int
Action string
Recoverable bool
Retry bool
Reauthenticate bool
RefreshIdentity bool
RefreshSecurity bool
Backoff bool
RetryAfter time.Duration
}
IMSRegisterResponseDecision is a local recovery hint for a SIP REGISTER response.
func ClassifyIMSRegisterResponse ¶
func ClassifyIMSRegisterResponse(statusCode int, retryAfter time.Duration) IMSRegisterResponseDecision
ClassifyIMSRegisterResponse maps SIP REGISTER status codes to conservative local recovery hints.
type IMSRegisterTransportFactory ¶
type IMSRegisterTransportFactory func(IMSRegistrationConfig, voiceclient.IMSProfile, string, string) voiceclient.SIPRegisterTransport
type IMSRegistrar ¶
type IMSRegistrar interface {
RegisterIMS(context.Context, IMSRegistrationConfig) (IMSRegistrationResult, error)
}
type IMSRegistrationConfig ¶
type IMSRegistrationConfig struct {
DeviceID string
TraceID string
Profile identity.Profile
Prepared *identity.PreparedSession
SIM SIMAdapter
Access ModemAccess
NetworkMode string
Dataplane DataplanePolicy
Tunnel swu.TunnelResult
Proxy *ProxyConfig
}
type IMSRegistrationResult ¶
type IMSRegistrationResult struct {
Registered bool
StatusCode int
Reason string
Server string
Profile voiceclient.IMSProfile
Binding voiceclient.RegistrationBinding
RegisteredAt time.Time
ExpiresAt time.Time
RefreshDelay time.Duration
NextRefreshAt time.Time
RecoveryState IMSRegistrationRecoveryState
VoiceTransport voiceclient.SIPRequestTransport
SMSTransport messaging.SMSTransport
USSDTransport messaging.USSDTransport
Close func(context.Context) error
Recover func(context.Context) (IMSRegistrationResult, error)
}
type IMSSMSTransportFactory ¶
type IMSSMSTransportFactory func(IMSRegistrationConfig, voiceclient.IMSProfile, voiceclient.RegistrationBinding, voiceclient.SIPRequestTransport) messaging.SMSTransport
type IMSUSSDTransportFactory ¶
type IMSUSSDTransportFactory func(IMSRegistrationConfig, voiceclient.IMSProfile, voiceclient.RegistrationBinding, voiceclient.SIPRequestTransport) messaging.USSDTransport
type IMSVoiceTransportFactory ¶
type IMSVoiceTransportFactory func(IMSRegistrationConfig, voiceclient.IMSProfile, voiceclient.RegistrationBinding) voiceclient.SIPRequestTransport
type IdentityReader ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func (*Instance) AddObserver ¶
func (*Instance) CancelVoiceCall ¶
func (*Instance) CancelVoiceCallWithResult ¶
func (i *Instance) CancelVoiceCallWithResult(ctx context.Context, info voicehost.DialogInfo) (voicehost.DialogInfoResult, error)
func (*Instance) DiagnosticState ¶
func (i *Instance) DiagnosticState() DiagnosticState
func (*Instance) DrainIMSMessagingRetries ¶
func (*Instance) EndVoiceCall ¶
func (*Instance) EndVoiceCallWithResult ¶
func (i *Instance) EndVoiceCallWithResult(ctx context.Context, info voicehost.DialogInfo) (voicehost.DialogInfoResult, error)
func (*Instance) GetSMSDeliveryStatus ¶
func (i *Instance) GetSMSDeliveryStatus(messageID string) (*messaging.DeliveryStatus, error)
func (*Instance) HandleIMSBye ¶
func (i *Instance) HandleIMSBye(ctx context.Context, req voicehost.IMSByeRequest) (voicehost.IMSByeResult, error)
func (*Instance) HandleIMSInfo ¶
func (i *Instance) HandleIMSInfo(ctx context.Context, req voicehost.IMSInfoRequest) (voicehost.IMSInfoResult, error)
func (*Instance) HandleIMSMessage ¶
func (i *Instance) HandleIMSMessage(ctx context.Context, req voicehost.IMSMessageRequest) (voicehost.IMSMessageResult, error)
func (*Instance) HandleIncomingSMS ¶
func (*Instance) HandleSMSDeliveryReport ¶
func (i *Instance) HandleSMSDeliveryReport(ctx context.Context, report messaging.SMSDeliveryReport) (messaging.DeliveryPartMatch, error)
func (*Instance) SendDialogAutoDTMF ¶
func (i *Instance) SendDialogAutoDTMF(ctx context.Context, req voicehost.DialogDTMFRequest) (voicehost.DialogAutoDTMFResult, error)
func (*Instance) SendDialogDTMF ¶
func (i *Instance) SendDialogDTMF(ctx context.Context, req voicehost.DialogDTMFRequest) (voicehost.DialogDTMFResult, error)
func (*Instance) SendDialogHold ¶
func (i *Instance) SendDialogHold(ctx context.Context, req voicehost.DialogHoldRequest) (voicehost.DialogUpdateResult, error)
func (*Instance) SendDialogInfo ¶
func (i *Instance) SendDialogInfo(ctx context.Context, req voicehost.DialogInfoRequest) (voicehost.DialogInfoResult, error)
func (*Instance) SendDialogMessage ¶
func (i *Instance) SendDialogMessage(ctx context.Context, req voicehost.DialogMessageRequest) (voicehost.DialogMessageResult, error)
func (*Instance) SendDialogNotify ¶
func (i *Instance) SendDialogNotify(ctx context.Context, req voicehost.DialogNotifyRequest) (voicehost.DialogNotifyResult, error)
func (*Instance) SendDialogOptions ¶
func (i *Instance) SendDialogOptions(ctx context.Context, req voicehost.DialogOptionsRequest) (voicehost.DialogOptionsResult, error)
func (*Instance) SendDialogPrack ¶
func (i *Instance) SendDialogPrack(ctx context.Context, req voicehost.DialogPrackRequest) (voicehost.DialogPrackResult, error)
func (*Instance) SendDialogRefer ¶
func (i *Instance) SendDialogRefer(ctx context.Context, req voicehost.DialogReferRequest) (voicehost.DialogReferResult, error)
func (*Instance) SendDialogReinvite ¶
func (i *Instance) SendDialogReinvite(ctx context.Context, req voicehost.DialogReinviteRequest) (voicehost.DialogReinviteResult, error)
func (*Instance) SendDialogResume ¶
func (i *Instance) SendDialogResume(ctx context.Context, req voicehost.DialogResumeRequest) (voicehost.DialogUpdateResult, error)
func (*Instance) SendDialogSubscribe ¶
func (i *Instance) SendDialogSubscribe(ctx context.Context, req voicehost.DialogSubscribeRequest) (voicehost.DialogSubscribeResult, error)
func (*Instance) SendDialogUpdate ¶
func (i *Instance) SendDialogUpdate(ctx context.Context, req voicehost.DialogUpdateRequest) (voicehost.DialogUpdateResult, error)
func (*Instance) SendSMSWithOptions ¶
func (i *Instance) SendSMSWithOptions(ctx context.Context, to, text string, opts messaging.SendOptions) (messaging.SendOutcome, error)
func (*Instance) SetNotifier ¶
func (*Instance) SetSMSNotifier ¶
func (*Instance) StartOutboundCall ¶
func (i *Instance) StartOutboundCall(ctx context.Context, req voicehost.OutboundCallRequest) (voicehost.OutboundCallResult, error)
func (*Instance) TriggerMOBIKE ¶
type ModemAccess ¶
func NewModemAccessAdapter ¶
func NewModemAccessAdapter(m Modem) ModemAccess
func NewModemAccessAdapterWithRecovery ¶
func NewModemAccessAdapterWithRecovery(m Modem, recovery SIMAccessRecoveryOptions) ModemAccess
type ModuleEvent ¶
type ObserverFunc ¶
func (ObserverFunc) OnRuntimeEvent ¶
func (f ObserverFunc) OnRuntimeEvent(ctx context.Context, ev Event)
type PrepareStartInput ¶
type PrepareStartInput = identity.PrepareStartInput
type ProxyConfig ¶
type SIMAccessRecoveryHook ¶
type SIMAccessRecoveryHook interface {
RecoverSIMAccess(req SIMAccessRecoveryRequest) error
}
type SIMAccessRecoveryOptions ¶
type SIMAccessRecoveryOptions struct {
AllowVendorSpecific bool
ControlPortType string
DryRun bool
Delay simtransport.ATRecoveryDelayFunc
}
type SIMAccessRecoveryRequest ¶
type SIMAccessRecoveryRequest struct {
Operation string
Attempt int
Class simtransport.RecoveryClass
Err error
Decision simtransport.ControlPortRecoveryDecision
DestructiveAllowed bool
}
type SIMAdapter ¶
type SIMAdapter interface {
GetIMSI() (string, error)
CalculateAKA(rand16, autn16 []byte) (swusim.AKAResult, error)
Close() error
}
func NewReaderSIMAdapter ¶
func NewReaderSIMAdapter(provider swusim.AKAProvider) SIMAdapter
type SessionConfig ¶
type SessionConfig struct {
DeviceID string
TraceID string
Profile identity.Profile
Prepared *identity.PreparedSession
DataplaneMode string
Proxy *ProxyConfig
}
type StartRequest ¶
type StartRequest struct {
Mode string
DeviceID string
TraceID string
Profile identity.Profile
Prepared *identity.PreparedSession
NetworkMode string
VoiceGateway *voicehost.Gateway
SIM SIMAdapter
Access ModemAccess
Dataplane DataplanePolicy
Proxy *ProxyConfig
EAPReauthentication swu.EAPReauthenticationState
OnEAPReauthenticationState func(swu.EAPReauthenticationState)
TunnelManager swu.TunnelManager
TunnelManagerFactory TunnelManagerFactory
IMSRegistrar IMSRegistrar
VoiceTransport voiceclient.SIPRequestTransport
VoiceUserAgent string
VoiceSessionExpires int
VoiceMediaRelay *voicehost.RTPRelayConfig
SMSTransport messaging.SMSTransport
USSDTransport messaging.USSDTransport
DeliveryStore messaging.DeliveryStore
IMSMessagingRetryWorker IMSMessagingRetryWorkerConfig
Dispatch eventhost.Dispatcher
BeforeStart func(context.Context, SessionConfig) error
ShouldRun func() bool
}
type State ¶
type State struct {
DeviceID string
Phase Phase
DataplaneMode string
SIMReady bool
AccessReady bool
TunnelReady bool
IMSReady bool
SMSReady bool
RegStatus int
RegStatusText string
NetworkMode string
LastErrorClass string
LastError string
LastReason string
IMSRecoveryPending bool
IMSRecoveryRetryAfter time.Duration
IMSRecoveryNextAttemptAt time.Time
IMSRecoveryReason string
UpdatedAt time.Time
}
type TunnelManagerFactory ¶
type TunnelManagerFactory func(StartRequest) (swu.TunnelManager, error)
type WireIMSRegistrar ¶
type WireIMSRegistrar struct {
Transport voiceclient.SIPRegisterTransport
TransportFactory IMSRegisterTransportFactory
VoiceTransport voiceclient.SIPRequestTransport
VoiceFactory IMSVoiceTransportFactory
SMSTransport messaging.SMSTransport
SMSFactory IMSSMSTransportFactory
USSDTransport messaging.USSDTransport
USSDFactory IMSUSSDTransportFactory
RegistrarURI string
ContactURI string
ContactHost string
ContactPort int
Network string
ServerAddr string
LocalAddr string
Resolver voiceclient.SIPServerResolver
Timeout time.Duration
Expires int
DisableRefresh bool
RefreshInterval time.Duration
RefreshLead time.Duration
RefreshRetryInterval time.Duration
RecoveryBackoffInitial time.Duration
RecoveryBackoffMax time.Duration
DisableKeepalive bool
KeepaliveInterval time.Duration
UserAgent string
CallID string
CNonce string
RetransmitInterval time.Duration
MaxRetransmitInterval time.Duration
MaxRetransmits int
SecurityPlanInstaller voiceclient.SecurityPlanInstaller
}
func (WireIMSRegistrar) RegisterIMS ¶
func (r WireIMSRegistrar) RegisterIMS(ctx context.Context, cfg IMSRegistrationConfig) (IMSRegistrationResult, error)