Wiki -VoIP Topics

SIP AI CLI


JVoIP as a command-line SIP application turns any server into an AI voice endpoint. Launched from cron, systemd, ansible or any automation tool\ it registers as a SIP extension, answers calls, streams audio to an AI service (or a local STS LLM), and plays back the response -all without a GUI, a web interface, or a single line of code.

The entire JVoIP tool is a single JAR file (~2 MB), runs wherever a Java (JDK or JRE) is available, and can be controlled via command-line arguments, environment variables or a simple configuration file. Download from here.

Primary use cases:

  • SIP extension with AI: Add a new extension to your PBX that is answered by an AI agent.
  • Add AI to existing PBX in 10 minutes: Download JVoIP, set your API key, and route a DID to the new extension.
  • AI phone assistant for legacy PBX: Works with Asterisk, FreeSWITCH, Cisco, 3CX, or any SIP-compatible PBX.
  • On-premise zero-code AI receptionist: No cloud PBX, no programming. Run JVoIP locally, keep all audio on your network.
  • CLI as a full AI telephone operator: The app auto-answers, speaks, listens, and can transfer calls via DTMF or REFER.
  • IVR replacement: Replace touch-tone menus with natural conversation using OpenAI Realtime or a local LLM.
  • Scheduled outbound notifications: Trigger JVoIP from cron to place appointment reminders, payment alerts, or broadcast messages.
  • VoIP MCP server: Use JVoIP as a backend for Model Context Protocol (MCP) – an AI tool can request a call be made.
  • Tool-calling interface: Your application (Python, Node, Go) launches JVoIP with specific parameters per call.
  • Custom AI capabilities: Contact us with any requirements

Quick Start

java -jar JVoIP.jar serveraddress=pbx.example.com username=ai_agent password=secret enableautoaccept=3 ai_provider=1 ai_api_key=x useaudiodevicerecord=false useaudiodeviceplayback=false enablesounds=0

That’s it. The JVoIP app registers to your PBX, waits for calls, and answers each one with an AI voice agent using OpenAI's Realtime API.

Integration examples for popular PBX / SIP Servers

All examples assume you have already installed a JRE or JDK on the machine where JVoIP will run. 
If your PBX is on a Linux distribution, you can install the JRE via apt install default-jre-headless (Debian/Ubuntu) or yum install java-11-openjdk-headless (RHEL/CentOS). For Windows just download and launch the installer executable. 

Asterisk (including FreePBX and others)

1. Create SIP extension (add a user to be used by JVoIP AI)
In /etc/asterisk/sip.conf (or pjsip.conf):
[ai_agent]
type=friend
host=dynamic
secret=strongpass
context=ai_context
qualify=yes

2. Configure JVoIP to auto-start, auto-register and auto-answer
Create a startup script or a systemd service. Example command line:
java -jar /opt/jvoip/JVoIP.jar serveraddress=127.0.0.1 username=ai_agent password=strongpass enableautoaccept=3 ai_provider=1 ai_api_key="YOUR_OPENAI_KEY"  useaudiodevicerecord=false useaudiodeviceplayback=false enablesounds=0 loglevel=5

3. Route calls to this extension (dial-plan)
In /etc/asterisk/extensions.conf:
[ai_context]
exten => 987654321,1,Dial(SIP/ai_agent,30)
exten => 987654321,n,Hangup()

Now any call to DID 987654321 will be answered by the AI agent.

FreeSWITCH

1. Create SIP extension (add a user to be used by JVoIP AI)
In conf/directory/default/ai_agent.xml:
<user id="ai_agent">
  <params>
    <param name="password" value="strongpass"/>
  </params>
  <variables>
    <variable name="user_context" value="public"/>
  </variables>
</user>

2. Configure JVoIP to auto-start, auto-register and auto-answer
Create a startup script or a systemd service. Example command line:
java -jar /opt/jvoip/JVoIP.jar serveraddress=127.0.0.1 username=ai_agent password=strongpass enableautoaccept=3 ai_provider=1 ai_api_key="YOUR_OPENAI_KEY"  useaudiodevicerecord=false useaudiodeviceplayback=false enablesounds=0 loglevel=5

3. Route calls to this extension (dial-plan)
In conf/dialplan/default.xml:
<extension name="AI_DID">
  <condition field="destination_number" expression="^987654321$">
    <action application="bridge" data="user/ai_agent"/>
  </condition>
</extension>

Now any call to DID 987654321 will be answered by the AI agent.


OpenSIPS (as a proxy / registrar)

OpenSIPS does not terminate calls itself, but you can route calls to a separate JVoIP instance.

1. Ensure JVoIP registers - same command as above, pointing to OpenSIPS as registrar.

2. OpenSIPS routing script (opensips.cfg):

route {
  if (uri =~ "sip:987654321@.*") {
    rewritehost("jvoip-host.local");
    t_relay();
    exit;
  }
}

You can create an AI extension in a similar way for any other SIP server or IP-PBX, including Kamailio (configuration is similar to OpenSIPS), Cisco ( add a third-party SIP device extension with digest authentication and point it to the JVoIP IP), 3CX (create a generic SIP trunk or extension / bridge that points to JVoIP), Yate (add a SIP user account with context=ai) and many others

Running JVoIP on a Separate Machine

If your PBX cannot run a JRE (e.g., an embedded appliance), launch JVoIP on any Linux, Windows, or macOS machine that has network access to the PBX. Use the same command-line arguments but point serveraddress to your PBX IP.

Standalone Mode - no PBX required

JVoIP can act as its own SIP server (UAS). In this mode, it listens directly for incoming calls on a port and answers them without any external SIP server.

Example: listen on port 5070, auto-answer with AI: 
java JVoIP.jar isserver=1 signalingport=5070 registrar=9 enableautoaccept=3 ai_api_key="YOUR_OPENAI_KEY"

Any softphone can now call sip:anyuser@your-machine-ip:5070 and speak to the AI.

Configuration options

There are more then 200 configurable SIP and AI parameters. 
See the documentation for the full list of available settings, especially the "Parameters" chapter and the "Built-in AI integration" FAQ point.

Customization and professional services

The current command-line flags cover the most common scenarios: registration, auto-answer, built-in AI provider (OpenAI, with others soon), media streaming, and call transfer. However, every deployment has unique requirements.

We offer custom development for JVoIP included in the license for no extra cost or on a commercial basis:

  • New AI provider integration: Google Gemini Live, Deepgram Voice Agent, Azure GPT Realtime, or any WebSocket/HTTP AI API.
  • Extended system prompts: caller-id conversation history, session storage, custom tool or function calling
  • Additional command-line parameters: e.g., custom DTMF triggers, per-call prompts, advanced call routing based on caller ID.
  • Integration with local LLMs: run a local model (Ollama, Llama.cpp) and pipe audio to it.
  • Intgegration with your infrastructure, API, CRM, etc.
  • Custom media processing: VAD (voice activity detection), insert custom greetings before AI answers, etc.
  • Scriptable actions: execute any custom scripts, depending on your business logic.
  • Binary packaging: produce a native executable or a docker image for even easier distribution.
  • Any many more. Contact us with your idea or requirements: info@mizu-voip.com