Tools: Dinstar GSM Gateway Integration with ViciDial/Asterisk (2026)

Tools: Dinstar GSM Gateway Integration with ViciDial/Asterisk (2026)

Dinstar GSM Gateway Integration with ViciDial/Asterisk

Table of Contents

1. Why GSM Gateways?

Cost Reduction

Local Presence

Regulatory Compliance

Redundancy

Inbound Flexibility

2. Hardware Overview: Dinstar UC2000-VE

Key Concepts

Physical Setup

3. Network Architecture and NAT Scenarios

Typical Deployment

Three NAT Scenarios

Ports That Must Be Open

4. Prerequisites

Placeholder Reference

5. ViciDial Server Configuration

5.1 Firewall Rules

5.2 SIP Peer (Carrier) Configuration

Account Entry — Scenario A: IP Peer Mode (Static Public IP)

Account Entry — Scenario B: Registration Mode (Dynamic Public IP)

Parameter Explanation

5.3 Outbound Dialplan Entry

5.4 Inbound DID Routing

5.5 Inbound Group Setup

6. Dinstar Gateway Configuration

6.1 SIP Profile (Codecs, DTMF, NAT)

6.2 SIP Trunk to ViciDial

Mode A: IP Peer Mode (Recommended for Static Public IP)

Mode B: Registration Mode (For Dynamic Public IP)

6.3 Port Group Configuration

6.4 Outbound Routing: IP to Tel

6.5 Inbound Routing: Tel to IP

6.6 Number Manipulation

Outbound (IP to Tel) Manipulation

Inbound (Tel to IP) Manipulation

7. Applying Configuration and Reloading

On ViciDial

On the Dinstar

8. Testing

8.1 Connectivity Test

8.2 Outbound Call Test

8.3 Inbound Call Test

8.4 Audio Quality Verification

9. Troubleshooting

9.1 Common Problems and Fixes

9.2 Asterisk Debug Commands

9.3 Dinstar Debug Commands

9.4 fail2ban Considerations

10. Multi-SIM and Scaling

Adding More SIMs to the Same Port Group

Multiple Port Groups for Different Purposes

Multiple Dinstar Gateways

Capacity Planning

11. Production Tips

Signal Strength

Caller ID Management

SIM Card Management

Monitoring Integration

Security

12. Quick Reference Checklist

Pre-Installation

ViciDial Server

Dinstar Gateway

Verification

Summary Connect a physical GSM gateway to your ViciDial call center for making and receiving calls over cellular networks — complete with NAT traversal, inbound/outbound routing, and production troubleshooting. A GSM gateway is a physical device that bridges the gap between your VoIP/SIP infrastructure and the cellular (GSM/LTE) network. It holds one or more SIM cards and appears to Asterisk as a standard SIP trunk, while on the other side it communicates with the mobile network like a regular phone. There are several practical reasons to add a GSM gateway to a ViciDial call center: Mobile-to-mobile calls are often cheaper than landline-to-mobile calls in many countries. If your agents are calling mobile numbers (which in most markets is 70-90% of all numbers), routing those calls through a local SIM card can dramatically reduce per-minute costs. In some markets, operators offer unlimited mobile-to-mobile plans for a flat monthly fee, effectively making your outbound calls free. Calls placed through a local SIM card show a local mobile number as the Caller ID. Recipients are far more likely to answer a call from a local mobile number than from an international VoIP number or a blocked/anonymous caller. In markets like Albania, Italy, or Eastern Europe, this difference in answer rates can be 30-50%. Some countries restrict or tax VoIP-originated calls to mobile networks. Routing through a GSM gateway means the call enters the mobile network as a native GSM call, avoiding these restrictions entirely. If your SIP trunks go down (provider outage, internet routing issue, DDoS), a GSM gateway on a separate network connection gives you an emergency outbound path. Agents can still reach customers while you resolve the primary trunk issue. You can receive calls on mobile numbers and route them directly into your ViciDial inbound queue. This is useful when you distribute mobile numbers on business cards, flyers, or local advertisements, and want those calls handled by your call center agents. The Dinstar UC2000 series is a family of GSM/WCDMA/LTE VoIP gateways widely used in call center environments. The UC2000-VE is the mid-range model with the following specifications: Understanding the network topology is critical because GSM gateways are almost always behind NAT, while ViciDial servers are typically on public IPs. NAT causes problems for SIP because SIP embeds IP addresses inside its message bodies (SDP), and NAT rewrites only the outer IP header, not the payload. Scenario A is the most common in office deployments with a business internet connection. Scenario B is necessary when the gateway is on a residential or mobile connection. This tutorial covers both. Note on RTP: ViciDial typically has a wide RTP range (10000-20000 or 10000-65000) already open to all IPs. The Dinstar's RTP range is configurable (default 8000-8100 for 8 ports). With nat=force_rport,comedia on ViciDial and NAT traversal enabled on the Dinstar, RTP usually works through NAT without explicit port forwarding, because both sides learn the correct address from the actual packets rather than the SDP. Before starting, you need: Throughout this tutorial, replace these placeholders with your actual values: All steps in this section are performed on your ViciDial server. ViciDial servers typically use iptables with a whitelist approach for SIP traffic — UDP 5060 is blocked by default, and only known SIP provider IPs are allowed. You must add the Dinstar's public IP. Find the Dinstar's public IP first. From a computer on the same LAN as the Dinstar, visit https://whatismyip.com or run: Add the firewall rule on ViciDial: If your server uses ipset (common on ViciBox setups with many SIP providers): Important: If the gateway's public IP changes (dynamic NAT, Scenario B), you will need to update this firewall rule each time. In that case, consider either: (a) allowing the entire ISP subnet, (b) using a VPN tunnel, or (c) implementing a dynamic DNS solution with a script that updates iptables. In ViciDial, SIP trunks are managed as "Carriers." Navigate to: ViciDial Admin -> Admin -> Carriers -> Add A New Carrier Paste this into the Account Entry field: If the gateway's public IP is not static, use registration mode instead: The Dialplan Entry field in the carrier configuration defines how ViciDial routes outbound calls to the Dinstar. You need a dial prefix pattern so that only calls intended for the GSM gateway are sent there. Paste this into the Dialplan Entry field: How the prefix works: Choosing a prefix: The prefix (88 in this example) must not conflict with any real phone number patterns or other carrier prefixes in your dialplan. Common choices are 88, 77, 55, or any two-digit combination not used by your other carriers. Each GSM carrier can have its own unique prefix. After saving the carrier: When someone calls the SIM card's mobile number, the Dinstar forwards the call to ViciDial via SIP. ViciDial needs a DID entry to match and route this call. Navigate to: ViciDial Admin -> Admin -> Inbound DID -> Add New DID Critical detail: The DID Extension must exactly match the value the Dinstar sends as the called number (the SIP To/RURI). This is configured on the Dinstar as "To VOIP Hotline" in the Port Group settings (Section 6.3). You must set both to the same value. If you are unsure what the Dinstar sends, set up SIP debug on Asterisk (sip set debug peer dinstar_gsm) and make a test inbound call to see the INVITE URI. Alternative: Wildcard DID If you want all unmatched inbound calls from the Dinstar to go to a single group, you can create a DID with extension _X. or use ViciDial's default DID routing. However, explicit DID entries are recommended for clarity and control. If you do not already have an inbound group for GSM calls, create one: Navigate to: ViciDial Admin -> Admin -> Inbound Groups -> Add New Group Configure agent assignments, call handling, and other settings according to your operational needs. The key point is that this group must be referenced by the DID entry from the previous step. Access the Dinstar web interface by browsing to: http://GATEWAY_PRIVATE_IP Default credentials are typically admin / admin. Change these after initial setup. Firmware note: Menu labels and layout may vary slightly between firmware versions. The Dinstar UC2000-VE has been through several firmware revisions. Look for equivalent settings if the exact menu names in this tutorial do not match your unit. The core concepts (SIP profile, trunk, port group, routing) are the same across all versions. Navigate to: Call Configuration -> SIP Configuration (or SIP Profile) This defines the SIP behavior for the entire gateway. Codec Selection Rationale: The GSM network uses its own codec (GSM-FR, AMR, or AMR-WB depending on the carrier). The Dinstar transcodes GSM audio to whatever codec you select in the SIP profile. G.711 (PCMA/PCMU) at 64 kbps is the best choice because: Avoid G.729 unless bandwidth is severely constrained, because the call would be double-transcoded (GSM -> G.729 on the Dinstar, then G.729 -> G.711 on Asterisk if the agent phone uses G.711), resulting in noticeable quality degradation. Since the Dinstar sits on a private LAN, it does not know its own public IP. Without NAT traversal, it would embed its private IP (192.168.x.x) in SIP Contact and SDP headers, causing the ViciDial server to send RTP to an unreachable address (one-way or no audio). Saving this page may restart the Dinstar's SIP service. Existing calls will drop. Plan configuration changes during maintenance windows. Navigate to: Call Configuration -> SIP Trunk Configuration This defines the connection to your ViciDial server. When using registration mode, the Port Group (next step) must include the matching username and password, and the ViciDial carrier must use host=dynamic with a secret (see Section 5.2, Scenario B). Navigate to: Call Configuration -> Port Group Configuration A port group bundles one or more physical SIM ports under a single SIP identity. Calls from ViciDial are distributed across the ports in the group. Understanding "To VOIP Hotline": This is the most commonly misconfigured setting. When an external caller dials the SIM's mobile number, the Dinstar receives the GSM call and must forward it to ViciDial via SIP. The "To VOIP Hotline" value becomes the Request-URI (called number) in the SIP INVITE sent to ViciDial. ViciDial's DID matching logic compares this value against your DID entries to determine where to route the call. If the "To VOIP Hotline" is 393331234567, then ViciDial must have a DID with extension 393331234567. If they do not match, the call will fail with "no matching DID" or route to the wrong destination. Port Selection Modes: Navigate to: Call Configuration -> IP to Tel Routing This tells the Dinstar what to do when a SIP call arrives from ViciDial: send it out through a GSM port. Multiple routes: If you have multiple port groups (e.g., different SIMs for different countries), you can create multiple IP-to-Tel routes with different source prefixes. For example, route numbers starting with 39 through an Italian SIM and numbers starting with 355 through an Albanian SIM. Navigate to: Call Configuration -> Tel to IP Routing This tells the Dinstar what to do when a GSM call arrives on a SIM: forward it to ViciDial via SIP. Navigate to: Call Configuration -> Manipulation (or Number Manipulation) Number manipulation rules modify the caller or callee number before the call is placed. This is often necessary because: Testing tip: Make a test call before and after adding manipulation rules. Check the Asterisk CLI (sip set debug peer dinstar_gsm) to see exactly what number arrives in the SIP INVITE. Adjust manipulation rules until the number format matches what your ViciDial campaigns and DIDs expect. After completing all configuration on both sides, you need to apply changes. Most Dinstar configuration changes take effect immediately or after clicking "Save" on each page. Some changes (notably codec changes and SIP profile modifications) trigger an automatic SIP service restart, which will drop any active calls. If changes do not seem to take effect: Check SIP peer status from Asterisk: Expected output for a healthy peer: If it shows UNREACHABLE: Check SIM status on the Dinstar: In the Dinstar web UI, navigate to Status -> Port Status (or GSM Status). Each port should show: If the SIM shows "Not Registered" or "No SIM," see Troubleshooting (Section 9). Test a call from ViciDial through the GSM gateway to a mobile phone. Method 1: Manual Dial from Agent Interface Method 2: Asterisk CLI Originate Method 3: Campaign Test Monitor the call in real time: You should see an INVITE going out, a 100 Trying, 180 Ringing, and 200 OK (call answered) in the SIP debug. You should see an INVITE arriving from the Dinstar with the "To VOIP Hotline" value as the called number. ViciDial will match this against your DID entries and route accordingly. After connecting calls in both directions, verify: For detailed audio debugging: These commands are run on the ViciDial server via SSH: Access the Dinstar CLI via SSH/Telnet (if enabled in the web UI under System -> Access Control) or via the web-based console: This is one of the most common gotchas. ViciDial servers typically run fail2ban with an Asterisk jail that monitors /var/log/asterisk/messages for failed SIP authentication attempts. The Dinstar's heartbeat (SIP OPTIONS) packets can trigger fail2ban if: Check if the Dinstar IP is banned: Whitelist the Dinstar IP permanently: Edit /etc/fail2ban/jail.local (or /etc/fail2ban/jail.d/asterisk.local): Then restart fail2ban: Important: Always whitelist your GSM gateway's IP in fail2ban after confirming the carrier is working. SIP OPTIONS heartbeats every 30 seconds can accumulate "failed" log entries if there is even a momentary config mismatch, leading to a ban that makes the peer go UNREACHABLE. The UC2000-VE supports up to 8 SIMs. Here is how to scale beyond a single SIM: If all SIMs are from the same carrier and serve the same purpose: Each SIM supports 1 concurrent call. With 8 SIMs, you get 8 concurrent calls. If you have SIMs from different carriers or countries: Each port group gets its own SIP User ID, its own ViciDial carrier, and its own dial prefix. Create separate IP-to-Tel routes with prefix filtering to direct calls to the correct port group. For more than 8 concurrent GSM channels, deploy additional gateways: SIM rotation: Some mobile carriers detect gateway usage patterns (many short calls from one SIM) and may block or throttle the SIM. With multiple SIMs in round-robin mode, the call volume is spread across SIMs, reducing the per-SIM call frequency and lowering the risk of carrier detection. GSM call quality depends entirely on signal strength. The Dinstar web UI shows signal in a 0-5 scale: For office installations where the gateway is inside a building: By default, outbound GSM calls show the SIM's own mobile number as caller ID. This is usually desirable (local mobile number = higher answer rates). However: If you run Prometheus/Grafana for monitoring (recommended), add checks for: Use this checklist when deploying a new Dinstar GSM gateway: Integrating a Dinstar GSM gateway with ViciDial gives your call center a direct path to the cellular network — local mobile caller IDs, lower costs for mobile-to-mobile calls, and an additional redundancy layer independent of your SIP trunk providers. The key configuration touchpoints are: The most common issues are NAT-related (one-way audio, peer unreachable) and fail2ban banning the gateway IP. Both are solved by the configuration patterns in this tutorial. Always test both call directions and verify two-way audio before going live. This tutorial is based on production deployment experience with the Dinstar UC2000-VE series connecting to ViciDial/Asterisk servers. Configuration specifics may vary with different Dinstar firmware versions and Asterisk/ViciDial releases. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

INTERNET | ┌──────────────────┼──────────────────────┐ | | | | ViciDial | | | VICIDIAL_IP | | | (Public IP) | | | UDP 5060 SIP | | | UDP 10000- | | | 20000 RTP | | | | | └──────────────────┘ | NAT Router/Firewall GATEWAY_PUBLIC_IP | ┌──────┴──────┐ | LAN | | e.g. | | 192.168.1.0 | | /24 | | | | Dinstar | | GATEWAY_ | | PRIVATE_IP | | UC2000-VE | | Ports 1-8 | └──────────────┘ | GSM Network | Mobile Phones INTERNET | ┌──────────────────┼──────────────────────┐ | | | | ViciDial | | | VICIDIAL_IP | | | (Public IP) | | | UDP 5060 SIP | | | UDP 10000- | | | 20000 RTP | | | | | └──────────────────┘ | NAT Router/Firewall GATEWAY_PUBLIC_IP | ┌──────┴──────┐ | LAN | | e.g. | | 192.168.1.0 | | /24 | | | | Dinstar | | GATEWAY_ | | PRIVATE_IP | | UC2000-VE | | Ports 1-8 | └──────────────┘ | GSM Network | Mobile Phones INTERNET | ┌──────────────────┼──────────────────────┐ | | | | ViciDial | | | VICIDIAL_IP | | | (Public IP) | | | UDP 5060 SIP | | | UDP 10000- | | | 20000 RTP | | | | | └──────────────────┘ | NAT Router/Firewall GATEWAY_PUBLIC_IP | ┌──────┴──────┐ | LAN | | e.g. | | 192.168.1.0 | | /24 | | | | Dinstar | | GATEWAY_ | | PRIVATE_IP | | UC2000-VE | | Ports 1-8 | └──────────────┘ | GSM Network | Mobile Phones curl -s https://ifconfig.me curl -s https://ifconfig.me curl -s https://ifconfig.me # SSH to your ViciDial server ssh root@VICIDIAL_IP # Check current iptables rules to find the right insertion point # Look for the line number of the final DROP/REJECT rule for UDP 5060 iptables -L INPUT -n --line-numbers | grep -E "5060|DROP" # Insert an ACCEPT rule BEFORE the DROP rule # Replace LINE_NUMBER with the position before the DROP # Replace GATEWAY_PUBLIC_IP with the actual public IP iptables -I INPUT LINE_NUMBER -p udp -s GATEWAY_PUBLIC_IP -j ACCEPT # Verify the rule was added correctly iptables -L INPUT -n --line-numbers | grep GATEWAY_PUBLIC_IP # Save the rules so they persist after reboot # On CentOS/ViciBox (openSUSE): iptables-save > /etc/sysconfig/iptables # On Debian/Ubuntu: iptables-save > /etc/iptables/rules.v4 # SSH to your ViciDial server ssh root@VICIDIAL_IP # Check current iptables rules to find the right insertion point # Look for the line number of the final DROP/REJECT rule for UDP 5060 iptables -L INPUT -n --line-numbers | grep -E "5060|DROP" # Insert an ACCEPT rule BEFORE the DROP rule # Replace LINE_NUMBER with the position before the DROP # Replace GATEWAY_PUBLIC_IP with the actual public IP iptables -I INPUT LINE_NUMBER -p udp -s GATEWAY_PUBLIC_IP -j ACCEPT # Verify the rule was added correctly iptables -L INPUT -n --line-numbers | grep GATEWAY_PUBLIC_IP # Save the rules so they persist after reboot # On CentOS/ViciBox (openSUSE): iptables-save > /etc/sysconfig/iptables # On Debian/Ubuntu: iptables-save > /etc/iptables/rules.v4 # SSH to your ViciDial server ssh root@VICIDIAL_IP # Check current iptables rules to find the right insertion point # Look for the line number of the final DROP/REJECT rule for UDP 5060 iptables -L INPUT -n --line-numbers | grep -E "5060|DROP" # Insert an ACCEPT rule BEFORE the DROP rule # Replace LINE_NUMBER with the position before the DROP # Replace GATEWAY_PUBLIC_IP with the actual public IP iptables -I INPUT LINE_NUMBER -p udp -s GATEWAY_PUBLIC_IP -j ACCEPT # Verify the rule was added correctly iptables -L INPUT -n --line-numbers | grep GATEWAY_PUBLIC_IP # Save the rules so they persist after reboot # On CentOS/ViciBox (openSUSE): iptables-save > /etc/sysconfig/iptables # On Debian/Ubuntu: iptables-save > /etc/iptables/rules.v4 # Check if there's an existing ipset for SIP providers ipset list -name # If there's a set like 'sip-providers', add the IP to it: ipset add sip-providers GATEWAY_PUBLIC_IP # Save ipset so it persists: ipset save > /etc/ipset.conf # Check if there's an existing ipset for SIP providers ipset list -name # If there's a set like 'sip-providers', add the IP to it: ipset add sip-providers GATEWAY_PUBLIC_IP # Save ipset so it persists: ipset save > /etc/ipset.conf # Check if there's an existing ipset for SIP providers ipset list -name # If there's a set like 'sip-providers', add the IP to it: ipset add sip-providers GATEWAY_PUBLIC_IP # Save ipset so it persists: ipset save > /etc/ipset.conf [dinstar_gsm] type=peer host=GATEWAY_PUBLIC_IP port=5060 context=trunkinbound disallow=all allow=alaw allow=ulaw insecure=port,invite dtmfmode=rfc2833 qualify=yes nat=force_rport,comedia directmedia=no [dinstar_gsm] type=peer host=GATEWAY_PUBLIC_IP port=5060 context=trunkinbound disallow=all allow=alaw allow=ulaw insecure=port,invite dtmfmode=rfc2833 qualify=yes nat=force_rport,comedia directmedia=no [dinstar_gsm] type=peer host=GATEWAY_PUBLIC_IP port=5060 context=trunkinbound disallow=all allow=alaw allow=ulaw insecure=port,invite dtmfmode=rfc2833 qualify=yes nat=force_rport,comedia directmedia=no [dinstar_gsm] type=friend host=dynamic secret=PEER_PASSWORD context=trunkinbound disallow=all allow=alaw allow=ulaw insecure=port,invite dtmfmode=rfc2833 qualify=yes nat=force_rport,comedia directmedia=no [dinstar_gsm] type=friend host=dynamic secret=PEER_PASSWORD context=trunkinbound disallow=all allow=alaw allow=ulaw insecure=port,invite dtmfmode=rfc2833 qualify=yes nat=force_rport,comedia directmedia=no [dinstar_gsm] type=friend host=dynamic secret=PEER_PASSWORD context=trunkinbound disallow=all allow=alaw allow=ulaw insecure=port,invite dtmfmode=rfc2833 qualify=yes nat=force_rport,comedia directmedia=no ; Outbound via Dinstar GSM Gateway ; Prefix 88 is stripped before sending to the gateway ; Example: agent dials 88393331234567 -> sends 393331234567 to Dinstar -> GSM exten => _88X.,1,AGI(agi://127.0.0.1:4577/call_log) exten => _88X.,n,Dial(SIP/dinstar_gsm/${EXTEN:2},,tTo) exten => _88X.,n,Hangup() ; Outbound via Dinstar GSM Gateway ; Prefix 88 is stripped before sending to the gateway ; Example: agent dials 88393331234567 -> sends 393331234567 to Dinstar -> GSM exten => _88X.,1,AGI(agi://127.0.0.1:4577/call_log) exten => _88X.,n,Dial(SIP/dinstar_gsm/${EXTEN:2},,tTo) exten => _88X.,n,Hangup() ; Outbound via Dinstar GSM Gateway ; Prefix 88 is stripped before sending to the gateway ; Example: agent dials 88393331234567 -> sends 393331234567 to Dinstar -> GSM exten => _88X.,1,AGI(agi://127.0.0.1:4577/call_log) exten => _88X.,n,Dial(SIP/dinstar_gsm/${EXTEN:2},,tTo) exten => _88X.,n,Hangup() # Option 1: Reload the carrier from ViciDial Admin # Go to Admin -> Carriers -> DINSTAR_GSM -> click "RELOAD CARRIER" # Option 2: Force a full config rebuild and reload via CLI ssh root@VICIDIAL_IP # Trigger ViciDial config rebuild mysql -e "UPDATE servers SET rebuild_conf_files='Y' WHERE server_ip='VICIDIAL_IP';" asterisk # Wait 30-60 seconds for the keepalive process to pick up the change, then: asterisk -rx "sip reload" asterisk -rx "dialplan reload" # Option 1: Reload the carrier from ViciDial Admin # Go to Admin -> Carriers -> DINSTAR_GSM -> click "RELOAD CARRIER" # Option 2: Force a full config rebuild and reload via CLI ssh root@VICIDIAL_IP # Trigger ViciDial config rebuild mysql -e "UPDATE servers SET rebuild_conf_files='Y' WHERE server_ip='VICIDIAL_IP';" asterisk # Wait 30-60 seconds for the keepalive process to pick up the change, then: asterisk -rx "sip reload" asterisk -rx "dialplan reload" # Option 1: Reload the carrier from ViciDial Admin # Go to Admin -> Carriers -> DINSTAR_GSM -> click "RELOAD CARRIER" # Option 2: Force a full config rebuild and reload via CLI ssh root@VICIDIAL_IP # Trigger ViciDial config rebuild mysql -e "UPDATE servers SET rebuild_conf_files='Y' WHERE server_ip='VICIDIAL_IP';" asterisk # Wait 30-60 seconds for the keepalive process to pick up the change, then: asterisk -rx "sip reload" asterisk -rx "dialplan reload" ssh root@VICIDIAL_IP # Show the Dinstar peer details asterisk -rx "sip show peer dinstar_gsm" # Quick status check — look for OK (latency) or UNREACHABLE asterisk -rx "sip show peers" | grep dinstar # If using registration mode, check registration status asterisk -rx "sip show registry" ssh root@VICIDIAL_IP # Show the Dinstar peer details asterisk -rx "sip show peer dinstar_gsm" # Quick status check — look for OK (latency) or UNREACHABLE asterisk -rx "sip show peers" | grep dinstar # If using registration mode, check registration status asterisk -rx "sip show registry" ssh root@VICIDIAL_IP # Show the Dinstar peer details asterisk -rx "sip show peer dinstar_gsm" # Quick status check — look for OK (latency) or UNREACHABLE asterisk -rx "sip show peers" | grep dinstar # If using registration mode, check registration status asterisk -rx "sip show registry" dinstar_gsm GATEWAY_PUBLIC_IP 5060 OK (45 ms) dinstar_gsm GATEWAY_PUBLIC_IP 5060 OK (45 ms) dinstar_gsm GATEWAY_PUBLIC_IP 5060 OK (45 ms) # From the ViciDial server, originate a test call asterisk -rx "channel originate SIP/dinstar_gsm/MOBILE_NUMBER application Playback hello-world" # From the ViciDial server, originate a test call asterisk -rx "channel originate SIP/dinstar_gsm/MOBILE_NUMBER application Playback hello-world" # From the ViciDial server, originate a test call asterisk -rx "channel originate SIP/dinstar_gsm/MOBILE_NUMBER application Playback hello-world" # Watch SIP signaling for the Dinstar peer asterisk -rx "sip set debug peer dinstar_gsm" # In another terminal, watch active channels watch -n 1 'asterisk -rx "core show channels" | grep -i dinstar' # Watch SIP signaling for the Dinstar peer asterisk -rx "sip set debug peer dinstar_gsm" # In another terminal, watch active channels watch -n 1 'asterisk -rx "core show channels" | grep -i dinstar' # Watch SIP signaling for the Dinstar peer asterisk -rx "sip set debug peer dinstar_gsm" # In another terminal, watch active channels watch -n 1 'asterisk -rx "core show channels" | grep -i dinstar' # Watch for the inbound call asterisk -rx "sip set debug peer dinstar_gsm" # Check active channels asterisk -rx "core show channels" | grep -i dinstar # Watch for the inbound call asterisk -rx "sip set debug peer dinstar_gsm" # Check active channels asterisk -rx "core show channels" | grep -i dinstar # Watch for the inbound call asterisk -rx "sip set debug peer dinstar_gsm" # Check active channels asterisk -rx "core show channels" | grep -i dinstar # Enable RTP debugging to check for audio packet flow asterisk -rx "rtp set debug on" # After testing, disable it (very verbose) asterisk -rx "rtp set debug off" # Enable RTP debugging to check for audio packet flow asterisk -rx "rtp set debug on" # After testing, disable it (very verbose) asterisk -rx "rtp set debug off" # Enable RTP debugging to check for audio packet flow asterisk -rx "rtp set debug on" # After testing, disable it (very verbose) asterisk -rx "rtp set debug off" # Enable SIP debugging for the Dinstar peer only (less noise than global debug) asterisk -rx "sip set debug peer dinstar_gsm" # Disable SIP debug asterisk -rx "sip set debug off" # Show full peer configuration and status asterisk -rx "sip show peer dinstar_gsm" # Quick peer status (one-line summary) asterisk -rx "sip show peers" | grep dinstar # Show all SIP registrations (for registration mode) asterisk -rx "sip show registry" # Show active channels (calls in progress) asterisk -rx "core show channels" # Show channels filtered by Dinstar asterisk -rx "core show channels" | grep -i dinstar # Enable RTP debugging (very verbose — use briefly) asterisk -rx "rtp set debug on" asterisk -rx "rtp set debug off" # Show dialplan for the carrier prefix pattern asterisk -rx "dialplan show _88X.@vicidial-auto-external" # Reload SIP configuration without restarting Asterisk asterisk -rx "sip reload" # Reload dialplan without restarting Asterisk asterisk -rx "dialplan reload" # Enable SIP debugging for the Dinstar peer only (less noise than global debug) asterisk -rx "sip set debug peer dinstar_gsm" # Disable SIP debug asterisk -rx "sip set debug off" # Show full peer configuration and status asterisk -rx "sip show peer dinstar_gsm" # Quick peer status (one-line summary) asterisk -rx "sip show peers" | grep dinstar # Show all SIP registrations (for registration mode) asterisk -rx "sip show registry" # Show active channels (calls in progress) asterisk -rx "core show channels" # Show channels filtered by Dinstar asterisk -rx "core show channels" | grep -i dinstar # Enable RTP debugging (very verbose — use briefly) asterisk -rx "rtp set debug on" asterisk -rx "rtp set debug off" # Show dialplan for the carrier prefix pattern asterisk -rx "dialplan show _88X.@vicidial-auto-external" # Reload SIP configuration without restarting Asterisk asterisk -rx "sip reload" # Reload dialplan without restarting Asterisk asterisk -rx "dialplan reload" # Enable SIP debugging for the Dinstar peer only (less noise than global debug) asterisk -rx "sip set debug peer dinstar_gsm" # Disable SIP debug asterisk -rx "sip set debug off" # Show full peer configuration and status asterisk -rx "sip show peer dinstar_gsm" # Quick peer status (one-line summary) asterisk -rx "sip show peers" | grep dinstar # Show all SIP registrations (for registration mode) asterisk -rx "sip show registry" # Show active channels (calls in progress) asterisk -rx "core show channels" # Show channels filtered by Dinstar asterisk -rx "core show channels" | grep -i dinstar # Enable RTP debugging (very verbose — use briefly) asterisk -rx "rtp set debug on" asterisk -rx "rtp set debug off" # Show dialplan for the carrier prefix pattern asterisk -rx "dialplan show _88X.@vicidial-auto-external" # Reload SIP configuration without restarting Asterisk asterisk -rx "sip reload" # Reload dialplan without restarting Asterisk asterisk -rx "dialplan reload" # Show all SIP messages (INVITE, ACK, BYE, etc.) deb sip msg all # Stop SIP message debug deb sip msg off # Show GSM port status (SIM registration, signal strength) show port status # Show SIP trunk status (connected, heartbeat OK, etc.) show sip trunk status # Show active calls show call status # Show routing table show route # Show all SIP messages (INVITE, ACK, BYE, etc.) deb sip msg all # Stop SIP message debug deb sip msg off # Show GSM port status (SIM registration, signal strength) show port status # Show SIP trunk status (connected, heartbeat OK, etc.) show sip trunk status # Show active calls show call status # Show routing table show route # Show all SIP messages (INVITE, ACK, BYE, etc.) deb sip msg all # Stop SIP message debug deb sip msg off # Show GSM port status (SIM registration, signal strength) show port status # Show SIP trunk status (connected, heartbeat OK, etc.) show sip trunk status # Show active calls show call status # Show routing table show route # Check all fail2ban jails fail2ban-client status # Check the Asterisk jail specifically fail2ban-client status asterisk # Look for the gateway's public IP in the banned list fail2ban-client status asterisk | grep GATEWAY_PUBLIC_IP # Check all fail2ban jails fail2ban-client status # Check the Asterisk jail specifically fail2ban-client status asterisk # Look for the gateway's public IP in the banned list fail2ban-client status asterisk | grep GATEWAY_PUBLIC_IP # Check all fail2ban jails fail2ban-client status # Check the Asterisk jail specifically fail2ban-client status asterisk # Look for the gateway's public IP in the banned list fail2ban-client status asterisk | grep GATEWAY_PUBLIC_IP fail2ban-client set asterisk unbanip GATEWAY_PUBLIC_IP fail2ban-client set asterisk unbanip GATEWAY_PUBLIC_IP fail2ban-client set asterisk unbanip GATEWAY_PUBLIC_IP [asterisk] ignoreip = 127.0.0.1/8 GATEWAY_PUBLIC_IP [asterisk] ignoreip = 127.0.0.1/8 GATEWAY_PUBLIC_IP [asterisk] ignoreip = 127.0.0.1/8 GATEWAY_PUBLIC_IP systemctl restart fail2ban systemctl restart fail2ban systemctl restart fail2ban # Example Prometheus alerting rules groups: - name: gsm_gateway rules: - alert: DinstarPeerDown expr: asterisk_sip_peer_status{peer="dinstar_gsm"} == 0 for: 5m labels: severity: critical annotations: summary: "Dinstar GSM gateway SIP peer is UNREACHABLE" - alert: DinstarHighLatency expr: asterisk_sip_peer_latency_ms{peer="dinstar_gsm"} > 200 for: 10m labels: severity: warning annotations: summary: "Dinstar GSM gateway SIP latency is high ({{ $value }}ms)" # Example Prometheus alerting rules groups: - name: gsm_gateway rules: - alert: DinstarPeerDown expr: asterisk_sip_peer_status{peer="dinstar_gsm"} == 0 for: 5m labels: severity: critical annotations: summary: "Dinstar GSM gateway SIP peer is UNREACHABLE" - alert: DinstarHighLatency expr: asterisk_sip_peer_latency_ms{peer="dinstar_gsm"} > 200 for: 10m labels: severity: warning annotations: summary: "Dinstar GSM gateway SIP latency is high ({{ $value }}ms)" # Example Prometheus alerting rules groups: - name: gsm_gateway rules: - alert: DinstarPeerDown expr: asterisk_sip_peer_status{peer="dinstar_gsm"} == 0 for: 5m labels: severity: critical annotations: summary: "Dinstar GSM gateway SIP peer is UNREACHABLE" - alert: DinstarHighLatency expr: asterisk_sip_peer_latency_ms{peer="dinstar_gsm"} > 200 for: 10m labels: severity: warning annotations: summary: "Dinstar GSM gateway SIP latency is high ({{ $value }}ms)" - Why GSM Gateways? - Hardware Overview: Dinstar UC2000-VE - Network Architecture and NAT Scenarios - Prerequisites - ViciDial Server Configuration Firewall Rules SIP Peer (Carrier) Configuration Outbound Dialplan Entry Inbound DID Routing Inbound Group Setup - Firewall Rules - SIP Peer (Carrier) Configuration - Outbound Dialplan Entry - Inbound DID Routing - Inbound Group Setup - Dinstar Gateway Configuration SIP Profile (Codecs, DTMF, NAT) SIP Trunk to ViciDial Port Group Configuration Outbound Routing: IP to Tel Inbound Routing: Tel to IP Number Manipulation - SIP Profile (Codecs, DTMF, NAT) - SIP Trunk to ViciDial - Port Group Configuration - Outbound Routing: IP to Tel - Inbound Routing: Tel to IP - Number Manipulation - Applying Configuration and Reloading - Testing Connectivity Test Outbound Call Test Inbound Call Test Audio Quality Verification - Connectivity Test - Outbound Call Test - Inbound Call Test - Audio Quality Verification - Troubleshooting Common Problems and Fixes Asterisk Debug Commands Dinstar Debug Commands fail2ban Considerations - Common Problems and Fixes - Asterisk Debug Commands - Dinstar Debug Commands - fail2ban Considerations - Multi-SIM and Scaling - Production Tips - Quick Reference Checklist - Firewall Rules - SIP Peer (Carrier) Configuration - Outbound Dialplan Entry - Inbound DID Routing - Inbound Group Setup - SIP Profile (Codecs, DTMF, NAT) - SIP Trunk to ViciDial - Port Group Configuration - Outbound Routing: IP to Tel - Inbound Routing: Tel to IP - Number Manipulation - Connectivity Test - Outbound Call Test - Inbound Call Test - Audio Quality Verification - Common Problems and Fixes - Asterisk Debug Commands - Dinstar Debug Commands - fail2ban Considerations - Port: A physical SIM slot. Port 1 holds SIM 1, Port 2 holds SIM 2, etc. - Port Group: A logical grouping of one or more ports. You assign a SIP identity (username) to a port group, not to individual ports. - SIP Trunk: The connection to your ViciDial/Asterisk server. Defined by IP address, port, and optional credentials. - IP-to-Tel Route: Outbound direction — a call arrives from SIP (ViciDial) and exits through GSM (a SIM card). - Tel-to-IP Route: Inbound direction — a call arrives from GSM (someone called the SIM number) and is forwarded via SIP to ViciDial. - Mount the gateway in a location with good GSM signal (near a window, or use external antennas with extension cables) - Insert SIM cards — ensure PIN lock is disabled on each SIM before inserting (put the SIM in a phone first and disable PIN if needed) - Connect Ethernet to your LAN - Connect power — the gateway boots in about 60 seconds - Access the web interface at the gateway's IP address (default: DHCP, or check your router's DHCP leases) - ViciDial prepends 88 to the phone number before dialing (configured per-campaign in the Dial Prefix field) - Asterisk matches the pattern _88X. (starts with 88, followed by one or more digits) - ${EXTEN:2} strips the first 2 characters (the 88 prefix), passing only the actual phone number to the Dinstar - The Dinstar receives the number and places the call through the GSM network - Click Submit Carrier - Return to the carrier page and click RELOAD CARRIER - Or restart Asterisk for a clean reload - It introduces the least additional quality loss (only one transcoding step: GSM -> G.711) - It is universally supported by all SIP devices - Bandwidth is not a concern for 8 simultaneous calls (8 x 87 kbps with overhead = ~700 kbps) - STUN (Session Traversal Utilities for NAT): The gateway queries a STUN server on the internet to discover its public IP and port mapping. Simple and automatic, but may be unreliable if the NAT is symmetric. - Static NAT IP: You manually tell the gateway its public IP. More reliable but requires a static IP. If both STUN and Static NAT IP are configured, static takes precedence. - ViciDial may send numbers in international format (+39333... or 39333...) but the local GSM network expects national format (333...) - Inbound calls from GSM may arrive with national caller IDs, and you want international format in ViciDial - Try the "Apply" or "Save & Apply" button (firmware-dependent) - Reboot the gateway from: System -> Reboot (or power cycle) - Verify the firewall rule allows the gateway's public IP - Check that the Dinstar's heartbeat is enabled (sends OPTIONS packets) - Look for fail2ban bans (see Section 9.4) - Log into ViciDial as an agent - Click "Manual Dial" or use the dial pad - Enter: DIAL_PREFIX + COUNTRY_CODE + MOBILE_NUMBER (e.g., 88393331234567) - The call should ring the mobile phone - Create a test campaign or use an existing one - Set the Dial Prefix to your chosen prefix (e.g., 88) - Set the carrier to DINSTAR_GSM - Load a test lead and let the dialer call it - From any mobile phone, call the SIM card's number (SIM_MOBILE_NUMBER) - The call should arrive at ViciDial and route to the configured inbound group - An agent assigned to that inbound group should see the call ringing - The peer is not yet configured on ViciDial (OPTIONS from unknown IP) - There is a brief period during reload where the peer config is not loaded - The Dinstar sends credentials that do not match - Insert additional SIMs into empty ports - Edit the Port Group (Section 6.3) and check the additional port boxes - Set the Mode to Round-Robin for even distribution - No changes needed on ViciDial — it sends calls to the same SIP peer, and the Dinstar distributes them - Each gateway gets its own IP, its own ViciDial carrier, and its own dial prefix - Use ViciDial's carrier load balancing (multiple carriers per campaign) to distribute calls - Or use Asterisk's Dial() with failover: Dial(SIP/dinstar1/${EXTEN:2}&SIP/dinstar2/${EXTEN:2}) - Use the included external GSM antennas - Mount antennas near windows facing a cell tower - Use SMA extension cables to place antennas optimally while keeping the gateway in a rack - In severe cases, use a directional Yagi antenna aimed at the nearest tower - Anonymous calls: If outbound calls show "Anonymous" or "Private Number," check the Dinstar's caller ID settings and the SIM's CLIR (Calling Line Identification Restriction) status. Some SIMs have CLIR enabled by default — contact the carrier to disable it. - Custom caller ID: You cannot set an arbitrary caller ID on GSM calls — the mobile network enforces the SIM's own number. This is different from SIP trunks where you can set any caller ID. - Balance monitoring: If using prepaid SIMs, monitor credit regularly. The Dinstar may support USSD commands (e.g., *100#) to check balance — configure under SMS/USSD settings. - PIN lock: Always disable PIN before inserting. If a SIM locks due to wrong PIN attempts, you will need the PUK code from the carrier. - Data plans: SIMs in GSM gateways do not need data plans — only voice/SMS. Choose the cheapest voice plan. - SIM lifespan: SIMs used in gateways with high call volumes may wear out faster than normal. Keep spare SIMs on hand. - Change default credentials on the Dinstar web UI immediately after setup - Restrict web UI access to management VLANs or VPN — do not expose port 80/443 of the gateway to the internet - Use registration mode with a strong password if the gateway's public IP is dynamic — this adds SIP-level authentication - Keep firmware updated — Dinstar periodically releases firmware updates with security fixes and bug fixes - [ ] SIM card(s) active with voice credit/plan - [ ] SIM PIN lock disabled (test in a phone first) - [ ] Dinstar powered on, connected to LAN, web UI accessible at GATEWAY_PRIVATE_IP - [ ] Gateway's public IP identified (GATEWAY_PUBLIC_IP) - [ ] Network path confirmed: gateway can reach VICIDIAL_IP on UDP 5060 - [ ] Firewall rule added allowing GATEWAY_PUBLIC_IP on UDP 5060 - [ ] Carrier created: DINSTAR_GSM with SIP peer [dinstar_gsm] - [ ] Carrier account entry configured (IP peer or registration mode) - [ ] Dialplan entry configured with chosen dial prefix (_88X. pattern) - [ ] Carrier reloaded (RELOAD CARRIER or sip reload + dialplan reload) - [ ] DID entry created matching Dinstar's "To VOIP Hotline" value - [ ] Inbound group created and assigned to DID - [ ] fail2ban whitelist updated with GATEWAY_PUBLIC_IP - [ ] SIP Profile: codecs set to PCMA first, DTMF to RFC2833, NAT traversal enabled - [ ] SIP Trunk: points to VICIDIAL_IP:5060, heartbeat enabled - [ ] Port Group: SIP User ID matches ViciDial peer name, "To VOIP Hotline" matches DID - [ ] IP-to-Tel route: SIP trunk -> Port group (outbound) - [ ] Tel-to-IP route: Port group -> SIP trunk (inbound) - [ ] Number manipulation rules configured (if needed) - [ ] Port/SIM status shows "Registered" with good signal - [ ] sip show peers | grep dinstar shows OK with latency - [ ] Outbound test call: ViciDial -> GSM -> mobile phone rings and connects - [ ] Inbound test call: mobile phone -> SIM number -> ViciDial agent receives call - [ ] Two-way audio confirmed on both outbound and inbound - [ ] DTMF works (press digits during test call) - [ ] Call stays connected for more than 60 seconds (no session timer drops) - [ ] Caller ID displays correctly in both directions - ViciDial side: Firewall rule, SIP carrier with NAT-aware settings (nat=force_rport,comedia, directmedia=no), dialplan with a unique prefix, DID for inbound, fail2ban whitelist - Dinstar side: SIP profile (codecs, DTMF, NAT traversal), SIP trunk pointing to ViciDial, port group linking SIMs to the trunk, bidirectional routing rules, and number manipulation