Microsip Api Documentation //free\\ Info

MicroSIP does not currently have a comprehensive, natively published public API for general remote control. However, developers and advanced users typically interact with it through command line arguments, configuration file manipulation, or by leveraging the underlying PJSIP stack. 1. Command Line Interface (CLI)

MicroSIP supports basic command line switches for automation and deployment:

Configuration Loading: Use /i:.ini to specify a custom configuration file.

Dialing: You can initiate calls by passing a SIP URI or number directly (e.g., microsip.exe ).

Automation Wishlist: Note that advanced CLI functions like "pick-up" or "explicit video start" are frequently requested community features but are not part of the standard stable release. 2. Configuration & Integration

For deeper integration, you can programmatically modify the application's behavior:

microsip.ini: Most settings, including account details, codecs, and behavior, are stored in this file.

Provisioning API: For organizations, MicroSIP offers a Custom Build service that supports a REST API for provisioning. Your server can return SIP credentials and settings in JSON format to the client.

Event Handling: While it lacks a "push" API, users often handle incoming calls by configuring "Auto Answer" or using third-party tools to monitor the application window for specific events. 3. PJSIP Library (For Developers)

Because MicroSIP is an open-source project based on the PJSIP library, developers looking for full programmatic control over SIP functions often use the PJSIP API directly rather than the MicroSIP GUI application. 4. Third-Party Wrappers dtremp007/Microsip-API - GitHub

MicroSIP primarily interacts with external systems through command-line arguments and event-driven execution defined in the microsip.ini configuration file.

Command Line Control: You can launch specific actions or specify configuration files via the command line (e.g., MicroSIP.exe /i:custom.ini).

Event-Driven Commands: The MicroSIP online help details several settings (often not visible in the UI) that trigger external scripts or programs when call events occur:

cmdCallStart: Runs a command when a connection is established. cmdCallEnd: Runs a command when a call finishes. cmdIncomingCall: Triggers a command upon receiving a call. microsip api documentation

cmdCallAnswer: Executes when a user answers an incoming call.

Note: In each case, the Caller ID is passed as a parameter to the external command. Third-Party and Custom API Projects

Because the native API is limited to local command execution, developers have created wrappers to expose more standard API endpoints:

Python MicroSIP-API: A project found on GitHub (dtremp007) provides an endpoint server for MicroSIP. It allows direct access to the MicroSIP database (FirebirdSQL) and uses uvicorn to host an API service for fetching article/SKU data.

PyPI Library: A microsip-api package exists on the Python Package Index, though it is largely a source distribution for specific integration needs. Core Architecture (PJSIP)

For deep integration or creating a custom build, MicroSIP is open-source and built on the PJSIP stack.

Source Code: The full source is available under the GPL v2 license on the official site or various GitHub mirrors.

Customization: Organizations can request a Custom Build from the developers for specific branding or feature requirements. MicroSIP source code

MicroSip is one of the most popular open-source SIP softphones for Windows, valued for its lightweight footprint and high performance. For developers looking to integrate VoIP functionality into their own applications, the MicroSip API provides a powerful way to automate dialing, manage calls, and handle messaging without building a SIP stack from scratch.

This guide explores the MicroSip API documentation, covering integration methods, common commands, and practical implementation. Understanding the MicroSip API Architecture

Unlike cloud-based platforms that use REST APIs, MicroSip is a local Windows application. Its "API" is primarily exposed through Command Line Interface (CLI) arguments and a Windows messaging protocol. This allows external programs—like CRMs, helpdesk software, or custom scripts—to "talk" to a running instance of MicroSip. Key capabilities include: Automated outbound dialing (Click-to-Call). Answering or hanging up calls programmatically. Sending SMS or instant messages.

Controlling the app window state (hidden, minimized, or active). Integration Method 1: Command Line Arguments

The simplest way to interact with MicroSip is via the executable commands. This method is ideal for simple "Click-to-Call" features in web browsers or desktop shortcuts. MicroSIP does not currently have a comprehensive, natively

Basic Syntax:microsip.exe [number] [-exit] [-minimized] [-hide] Common CLI Examples:

Initiate a Call:Simply pass the phone number as an argument.microsip.exe 123456789 Hang Up Current Call:microsip.exe -hangup Answer an Incoming Call:microsip.exe -answer Send an SMS:microsip.exe -sendmess "number" "message text"

Integration Method 2: The URL Protocol (Browser Integration)

To enable dialing directly from a CRM or a website, MicroSip registers several URI schemes during installation. This is the most common "API" use case for web developers. Supported protocols include: sip:number sips:number tel:number callto:number HTML Example:Call Support

When a user clicks this link, Windows passes the number to MicroSip, which initiates the call immediately. Integration Method 3: Windows Messaging (Advanced)

For deep integration where your app needs to know the status of a call (e.g., is it ringing, connected, or ended?), you must use Windows Messages (WM_COPYDATA). This allows bidirectional communication:

Commands: Your app sends a data structure to the MicroSip window handle.

Events: MicroSip can be configured to send notifications back to your application's window. Common Action Commands: action=ready: Checks if MicroSip is active. action=call&number=123: Starts a call. action=hangup: Ends the session. Best Practices for Implementation

To ensure a smooth user experience when working with the MicroSip API, follow these technical tips:

Check Path Variables: Ensure microsip.exe is in the system PATH, or use the absolute path (usually C:\Program Files\MicroSip\microsip.exe) in your scripts.

Handle Instances: MicroSip is designed to be a single-instance app. Sending a new command usually interacts with the already running process rather than opening a second window.

Security: If using the URL protocol, ensure your application sanitizes input to prevent "command injection" through specially crafted phone number strings.

Error Handling: Since MicroSip doesn't return traditional HTTP status codes, your wrapper should check if the process is running before attempting to send commands. Conclusion Enable Logging MicroSIP

The MicroSip API documentation reveals a tool that is simple yet effective for desktop-level automation. By leveraging CLI arguments for basic tasks or Windows Messaging for complex integrations, developers can bridge the gap between their custom software and professional-grade VoIP communication.

Whether you are building a custom CRM dialer or a simple notification script, MicroSip provides the necessary hooks to turn a lightweight softphone into a programmable communication engine. If you'd like to build a specific integration, tell me: Programming language (e.g., Python, C#, JavaScript) Desired action (e.g., logging call duration, auto-dialing) Host environment (e.g., web-based CRM, local desktop app)


Enable Logging

MicroSIP.exe --debug sip.log --log calls.csv

1. Startup Layer (Command Line)

When you launch MicroSIP.exe, you can pass arguments that define the initial state: account credentials, auto-answer behavior, dial plan, or even an immediate call.

8. Documentation Quality Assessment

| Criteria | Score (1–5) | Comments | | :--- | :--- | :--- | | Availability | 4 | CLI help available via /?. WM_COPYDATA only in source comments. | | Completeness | 2 | Missing return codes, error scenarios, multiple call handling. | | Examples | 2 | No official examples for WM_COPYDATA. Only third-party blog posts. | | Accuracy | 4 | What is documented matches actual behavior. | | Up-to-date | 3 | Last major API update 2018. Still works on Win11. |

4. Web Integration (URL Handler)

MicroSIP registers a URL Protocol Handler (sip:) with Windows upon installation. This allows browsers and email clients to launch MicroSIP automatically.

HTML Example (Click-to-Call):

<a href="sip:18005551234">Call Support</a>

When a user clicks this link, Windows launches MicroSIP.exe with the argument sip:18005551234.

Forcing Specific Domains:

<a href="sip:101@192.168.1.50">Call Extension 101</a>

Option B: Window Title Parsing

MicroSIP changes its window title based on the state. You can write a script to monitor the window title text.

Python Example:

import win32gui
import time
def monitor_status():
    while True:
        hwnd = win32gui.FindWindow(None, "MicroSIP")
        if hwnd:
            title = win32gui.GetWindowText(hwnd)
            if "Incoming" in title:
                print("Status: Incoming Call")
            elif ":" in title: # Matches time format HH:MM:SS
                print("Status: In Call")
            else:
                print("Status: Idle")
        time.sleep(1)

Available Commands

| Command | Argument | Description | Example | | :--- | :--- | :--- | :--- | | (None) | number | Launches MicroSIP and immediately dials the number. | microsip.exe 1001 | | call | number | Dials the number (same as default behavior). | microsip.exe call 1001 | | chat | sip_address | Opens the chat window for a specific SIP address. | microsip.exe chat sip:user@domain.com |

Usage Notes:


Scenario 3: DTMF Automation for IVR Navigation

# PowerShell script to dial a conference bridge
Start-Process "MicroSIP.exe" -ArgumentList "callto:5551234567"
Start-Sleep -Seconds 5
Start-Process "MicroSIP.exe" -ArgumentList "dtmf:123456#"
Start-Sleep -Seconds 2
Start-Process "MicroSIP.exe" -ArgumentList "dtmf:1"

7. Complete Workflow Example

Scenario: You want to build a Python script that auto-configures a SIP account, waits for a call, and logs the duration.

  1. Setup: Script writes user credentials to %APPDATA%\MicroSIP\microsip.ini.
  2. Launch: Script runs microsip.exe.
  3. Monitor: Script enters a loop using win32gui to check the window title every second.
  4. Event: Title changes to a time format (Call Start). Script records timestamp.
  5. Event: Title changes back to "MicroSIP" (Call End). Script calculates duration and writes to a database.