HLR Lookup and Call Simulator - User Guide
Overview
Diagnostic tools to help operations staff troubleshoot call routing. The HLR Lookup and Call Simulator are read-only and do not affect live traffic. The Echo Test Call is different — it places a real MT call (see its own section).
HLR Lookup Tool
Purpose
The HLR Lookup tool queries the Home Location Register (HLR) via SS7 MAP protocol to retrieve real-time subscriber routing information.
Access
Navigate to /hlr or click "HLR" in the navigation menu.
What It Shows
For any phone number, the HLR Lookup displays:
-
MSRN (Mobile Station Roaming Number)
- Temporary routing number assigned when subscriber roams to 2G/3G network
- Only present if subscriber is currently roaming
- Used by the dialplan to route calls to roaming subscriber's current location
-
Call Forwarding Settings
- Real-time call forwarding configuration from HLR
- Types: Unconditional, Busy, No-Reply, Not-Reachable
- Shows forwarding destination number
- Shows if notification is enabled
-
Dialplan Variables
- Exactly which channel variables will be set
- Variables match those used in actual call processing
- Shows how HLR data overrides Sh data
Use Cases
Diagnosing Roaming Issues
Scenario: Incoming call to roaming subscriber fails or routes incorrectly
Steps:
- Open HLR Lookup page
- Enter the subscriber's phone number
- Click "Lookup HLR Data"
- Check for MSRN in results
- If MSRN present: Subscriber is roaming, verify MSRN is valid
- If no MSRN: Subscriber may be in LTE/VoLTE (no MSRN needed)
Verifying Call Forwarding
Scenario: Call forwarding not working as expected
Steps:
- Open HLR Lookup page
- Enter the subscriber's phone number
- Click "Lookup HLR Data"
- Look for "Call Forwarding" in results
- Verify forwarding type (Unconditional, Busy, etc.)
- Verify forwarding destination number
- Note: HLR data overrides any Sh/HSS data
Testing HLR Connectivity
Scenario: Verify SS7 MAP gateway is working
Steps:
- Open HLR Lookup page
- Enter any known subscriber number
- Click "Lookup HLR Data"
- Check for "Error" in results
- If error: Check SS7 MAP gateway connectivity
- Common errors:
- "SS7 MAP is disabled" - Check configuration
- "Timeout" - Network issue to HLR
- "No VLR Number" - Subscriber offline or doesn't exist
Information Box
The HLR Lookup page includes educational information explaining:
- What MSRN is and when it's used
- How call forwarding works in HLR
- How this integrates with call processing
- SS7 MAP protocol basics
Call Simulator Tool
Purpose
The Call Simulator allows you to simulate complete call routing without actually placing a call or affecting live traffic.
Access
Navigate to /simulator or click "Simulator" in the navigation menu.
Features
Input Parameters
-
Source Number (Caller)
- Phone number of calling party
- For MT calls: Can be any number
- For MO calls: Must be provisioned subscriber
-
Destination Number (Called Party)
- Phone number of called party
- For MT calls: Must be provisioned subscriber
- For MO calls: Can be any number
- For Emergency: Use "urn:service:sos" or similar
-
Source IP Address
- IP address of SIP signaling source
- Must be in
allowed_sbc_source_ips(for MT) orallowed_cscf_ips(for MO) - Determines call disposition (MT vs MO)
-
Force Disposition
- Auto: Determine from IP address (normal behavior)
- MT: Force Mobile Terminating (incoming)
- MO: Force Mobile Originating (outgoing)
- Emergency: Force emergency call processing
-
Options
- Skip OCS Authorization: Bypass online charging (faster simulation)
- Skip HLR Lookup: Bypass SS7 MAP query (faster simulation)
Output
The simulator shows comprehensive results:
-
Call Type Banner
- MT, MO, or Emergency
- Color-coded for quick identification
- Shows source and destination numbers
-
Processing Steps (Left Column)
- Subscriber Data: Results from Sh interface (HSS)
- HLR Data: Results from SS7 MAP lookup (MT only)
- OCS Authorization: Results from online charging (MO only)
- On-Net Status: Whether destination is on your network (MO only)
-
Dialplan Variables (Right Column)
- Every variable that would be set on the channel
- Sorted alphabetically for easy reading
- Color-coded values (green for normal, red for errors)
-
Processing Notes
- Step-by-step explanation of what happened
- Describes data flow and decision points
- Helps understand why certain variables were set
Use Cases
Pre-Flight Testing
Scenario: Testing configuration change before deploying to production
Steps:
- Make configuration change in dev/test environment
- Open Call Simulator
- Test multiple scenarios:
- MT call from your SBC
- MO call from your CSCF
- Emergency call
- On-net destination
- Off-net destination
- Verify all variables are correct
- Check processing notes for any issues
- Deploy to production with confidence
Debugging MT Call Issues
Scenario: Incoming calls to subscriber failing
Steps:
- Open Call Simulator
- Enter destination as the problem subscriber
- Enter source as test number
- Set source IP to your SBC IP
- Leave Force Disposition as "Auto"
- Click "Simulate Call"
- Check Subscriber Data section for Sh lookup success
- Check HLR Data section for MSRN or forwarding
- Check Final Variables for
hangup_case - If
hangup_caseis "UNALLOCATED_NUMBER": Subscriber not provisioned - If variables look correct: Issue may be in dialplan template
Debugging MO Call Issues
Scenario: Outgoing calls from subscriber failing
Steps:
- Open Call Simulator
- Enter source as the problem subscriber
- Enter destination as test number
- Set source IP to your CSCF IP
- Uncheck "Skip OCS Authorization" if testing charging
- Click "Simulate Call"
- Check Caller Data section for Sh lookup success
- Check OCS Authorization section for success/failure
- Check On-Net Status to verify correct routing
- Check Final Variables for
allocated_timeorhangup_case - If
hangup_caseis "OUTGOING_CALL_BARRED": OCS denied the call
Testing Emergency Call Handling
Scenario: Verify emergency calls work correctly
Steps:
- Open Call Simulator
- Enter source as test subscriber
- Enter destination as "urn:service:sos"
- Set any source IP (emergency calls bypass IP auth)
- Click "Simulate Call"
- Verify Call Type shows "Emergency (SOS)"
- Verify
hangup_caseis "none" (emergency calls always proceed) - Check that OCS and HLR were bypassed
- Verify caller data was retrieved for location info
Training Staff
Scenario: Teaching operations staff how call routing works
Steps:
- Open Call Simulator
- Run various scenarios and explain each section:
- Show MT call and explain Sh + HLR lookups
- Show MO call and explain OCS authorization
- Show Emergency call and explain bypass behavior
- Show unauthorized IP and explain rejection
- Have staff try different combinations
- Use Processing Notes to explain each decision
- Compare variables between different scenarios
Comparing Sh vs HLR Data
Scenario: Understanding how HLR overrides Sh data
Steps:
- Open Call Simulator for MT call
- Uncheck "Skip HLR Lookup"
- Click "Simulate Call"
- Compare Subscriber Data variables vs HLR Data variables
- Check Final Variables to see which values won
- Note: HLR data always takes precedence for:
- MSRN
call_forward_all_destinationcall_forward_not_reachable_destination
Tips
- Use "Skip OCS Authorization" and "Skip HLR Lookup" for faster simulations when testing other aspects
- Copy/paste phone numbers from logs into simulator for quick testing
- Use "Force Disposition" to test specific call types regardless of IP
- Check Processing Notes if you're unsure why certain variables were set
- Run simulation multiple times to verify consistency
- Compare simulation results to actual call logs
Limitations
The simulator:
- Does NOT actually place calls
- Does NOT affect the call routing system
- Does NOT consume OCS quota (even if OCS is queried)
- Does NOT generate CDRs
- Is safe to use on production systems
The simulator DOES:
- Query actual Sh interface (HSS) if not skipped
- Query actual HLR via SS7 MAP if not skipped
- Query actual OCS if not skipped
- Show exactly what would happen in real call
- Use real configuration values
Echo Test Call (real MT call)
Unlike the Call Simulator above, this places a real call. It rings the destination subscriber and runs them through the full terminating path (Sh lookup, OCS, CDR, media).
Purpose
Start a real Mobile Terminating call to a subscriber that connects them to a FreeSWITCH echo application, so they hear their own audio back. Useful for end-to-end verification of the MT path and the media/codec leg without a real upstream caller.
API
POST /simulator/echo_call
| Field | Required | Description |
|---|---|---|
destination | Yes | MSISDN to ring — the terminating subscriber (must be provisioned/registered). Digits, optional leading +. |
source | No | MSISDN shown as the caller ID. Digits, optional leading +. |
curl -k -X POST https://<tas>:8444/simulator/echo_call \
-H 'content-type: application/json' \
-d '{"destination":"99988037866","source":"61400000001"}'
Response (issued via bgapi, returns immediately):
{
"ok": true,
"command": "bgapi originate {tas_call_reason=echo_test,ignore_early_media=true,origination_caller_id_number=61400000001,origination_caller_id_name=61400000001}sofia/internal/99988037866@10.8.82.60 &echo",
"result": "+OK Job-UUID: <uuid>"
}
How it works
It issues a FreeSWITCH originate that loops the call back into the local internal profile
(sofia/internal/<destination>@<tas_ip>). Because the INVITE then arrives from the TAS's own
IP — which is in allowed_sbc_source_ips — it is classified as MT (as if delivered by the
upstream SBC) and runs the real MT dialplan, routing out to the subscriber via the IMS core.
The originate's &echo answers, so the rung subscriber hears their own audio.
The loopback target is taken server-side from the Diameter listen IP (the local box); it is not a request parameter.
What it does / doesn't do
Unlike the dry-run simulator, the echo call DOES:
- Place a real call and ring the destination subscriber
- Run Sh lookup, OCS authorization, and generate a CDR / Ro CCRs
- Exercise the real MT dialplan and media path
It is safe against MO / toll fraud:
- Always MT, never MO — the loopback arrives from the local IP, which can never be a CSCF source IP (the only thing that yields MO).
- It cannot dial an arbitrary outbound number — the MT bridge target comes from the Sh
subscriber lookup (
NokiaCSCF/+<msisdn>), not the rawdestination; an unknown destination has no MSISDN and the bridge fails. It can only ring provisioned on-net subscribers. - The loopback IP is server-side only, so the call can never be aimed at an external
gateway.
source/destinationare validated as phone numbers before reaching the ESL command (no command injection).
Caller ID (source) is shown to the rung subscriber as provided — keep the endpoint behind
your normal API access control, as it does place real calls.
Integration with Monitoring
Both tools integrate with Prometheus metrics:
- HLR lookups via the tool are counted in
hlr_lookups_total - Call simulations are counted in
call_simulations_total{call_type, source} - Processing times are tracked in respective duration metrics
This helps:
- Track diagnostic tool usage
- Monitor performance of diagnostic queries
- Identify heavy users of diagnostic tools
For complete metrics documentation: See metrics.md for all available metrics, query examples, and monitoring setup.
Best Practices
-
Use Call Simulator First
- Before making configuration changes
- When troubleshooting subscriber-specific issues
- To understand call flow for training
-
Use HLR Lookup For
- Quick check of roaming status
- Verifying call forwarding from HLR
- Testing SS7 MAP connectivity
-
Document Findings
- Take screenshots of simulator results
- Note any unexpected behavior
- Share results with team for analysis
-
Compare to Logs
- Run simulation with same parameters as failed call
- Compare simulator variables to actual call logs
- Identify discrepancies
-
Regular Testing
- Weekly spot checks with simulator
- Test each call type (MT/MO/Emergency)
- Verify OCS and HLR integration
Troubleshooting the Tools
HLR Lookup Issues
Tool shows "SS7 MAP is disabled"
- Check
config/runtime.exsforss7_map.enabled - Restart application after config change
Tool shows timeout errors
- Check SS7 MAP gateway is reachable
- Check network connectivity to HLR
- Check
ss7_map.timeout_msin configuration
Tool shows "No VLR Number"
- Subscriber is offline or doesn't exist in HLR
- Normal for subscribers who are powered off
- Normal for non-existent numbers
Call Simulator Issues
Simulator shows "No Sh data"
- Subscriber not provisioned in HSS
- HSS is unreachable
- Check
diameter.sh_applicationconfiguration
Simulator shows "Source IP is not authorized"
- IP not in
allowed_sbc_source_ipsorallowed_cscf_ips - Use "Force Disposition" to override IP-based auth
Simulator shows "Missing required parameters"
- All fields are required except options
- Enter valid phone numbers
- Enter valid IP address
Simulator takes too long
- Uncheck "Skip OCS Authorization" if not testing OCS
- Uncheck "Skip HLR Lookup" if not testing HLR
- Check actual system performance (Sh/HLR/OCS response times)
Support
For issues with these tools:
- Check application logs for errors
- Verify configuration (Sh, HLR, OCS)
- Test connectivity to external systems
- Contact support team with screenshots and error messages