← Back to Work
Project · Telephony Integration

SocketDialer — Click-to-Dial Bridge for Asterisk

A Windows desktop service that turns UDP dial packets from business software into phone calls through the Asterisk REST Interface.

Focus: socket networking, REST integration with a PBX, async C#, and an operator-friendly live log.

Platform
Windows / WPF
Input
UDP packets
Phone system
Asterisk ARI

Problem

A client's business software could send a small network message with a user's extension and the number to call, but nothing on the phone side was listening, so calls were still dialed by hand.

The office ran an Asterisk phone system, so the goal was a small, reliable bridge: catch the message, ring the right desk phone, connect the call, and show what happened.

What I built

  • UDP listener: an async socket server that accepts packets in the form extension,number,suffix on a configurable address and port, IPv4 or IPv6.
  • Asterisk integration: each valid packet becomes an authenticated REST call to the Asterisk REST Interface, which rings the caller's PJSIP extension and connects the outbound number. The caller's name is read back from the response for the log.
  • Duplicate protection: repeat clicks for the same call are ignored while the first dial is still in progress, so one impatient double-click never places two calls.
  • Live, color-coded log: info, warnings, and failures (bad packets, phone system errors, timeouts) show in the window as they happen, with a line cap so it can run for weeks without growing memory.
  • Always on: keeps the PC from sleeping while the server runs, and every setting (address, port, dial prefix, timeout, credentials) lives in one config file.

Screenshot

Shown in test mode, which replays scripted traffic against simulated phone system responses so every outcome can be demonstrated without a live PBX. Phone numbers are masked.

How it's built

The app is MVVM WPF on .NET Framework, wired with Microsoft.Extensions dependency injection, options-bound configuration, and structured logging. The logger's console output is redirected into the window, so the same log lines work in a console or the UI.

The server and dialer sit behind interfaces, which is how test mode swaps in a simulated dialer and traffic generator with no change to the real code path.

Stack

C#, WPF, .NET Framework 4.7.2, UDP sockets, Asterisk REST Interface (ARI), RestSharp, Newtonsoft.Json, Microsoft.Extensions DI, Configuration, and Logging.