n8n-nodes-sip-trunk
v1.0.0
Published
n8n custom node for SIP client functionality with Asterisk/Starface PBX integration
Maintainers
Readme
n8n-nodes-sip-client

An n8n community node for SIP client functionality, enabling integration with Asterisk/Starface PBX systems and other SIP-based telephony solutions.
Features
- SIP Registration: Register/unregister with SIP servers
- Call Management: Make calls, answer calls, hang up, and get call status
- Messaging: Send SIP messages with custom content types
- Asterisk/Starface Compatible: Tested with Asterisk-based PBX systems
- Multiple Transport Protocols: UDP, TCP, TLS, WSS support
- Secure Connections: TLS encryption support
- Custom Headers: Add custom SIP headers for advanced scenarios
- JSON Workflow Integration: Full n8n JSON workflow support
Installation
Community Nodes (Recommended)
- Go to Settings > Community Nodes in your n8n instance
- Enter
n8n-nodes-sip-clientin the npm package name field - Click Install
Manual Installation
# Install in your n8n installation directory
npm install n8n-nodes-sip-client
# For Docker installations
docker build --build-arg N8N_VERSION=<version> --build-arg ADDITIONAL_PACKAGES=n8n-nodes-sip-client .Configuration
Credentials Setup
Add new credentials of type "SIP Client API"
Configure the following required fields:
- Server Address: Your PBX server domain or IP address
- Port: SIP server port (default: 5060)
- Username: Your SIP account username
- Password: Your SIP account password
Optional configuration:
- Domain: SIP domain (if different from server address)
- Transport Protocol: UDP, TCP, TLS, or WSS
- Secure Connection: Enable TLS encryption
- Display Name: Display name for outgoing calls
Example Starface Configuration
Server Address: your-starface-server.com
Port: 5060
Username: your_extension
Password: your_password
Domain: your-starface-server.com
Transport Protocol: UDPUsage Examples
Register with SIP Server
{
"resource": "registration",
"operation": "register"
}Make a Call
{
"resource": "call",
"operation": "makeCall",
"targetUri": "sip:[email protected]"
}Send SIP Message
{
"resource": "message",
"operation": "sendMessage",
"targetUri": "sip:[email protected]",
"messageContent": "Hello from n8n!",
"contentType": "text/plain"
}Get Registration Status
{
"resource": "registration",
"operation": "getRegistrationStatus"
}Operations
Registration Operations
- Register: Register with the SIP server
- Unregister: Unregister from the SIP server
- Get Registration Status: Check current registration status
Call Operations
- Make Call: Initiate an outbound call
- Answer Call: Answer an incoming call (requires call ID)
- Hang Up: Terminate an active call
- Get Call Status: Get the status of a specific call
Message Operations
- Send Message: Send SIP MESSAGE with custom content
Advanced Options
- Timeout: Set operation timeout in seconds
- Auto Answer: Automatically answer incoming calls
- Record Call: Enable call recording (PBX dependent)
- Custom Headers: Add custom SIP headers for advanced scenarios
Compatibility
Tested PBX Systems
- ✅ Asterisk (all recent versions)
- ✅ Starface (Asterisk-based)
- ✅ FreePBX
- ✅ 3CX (SIP mode)
- ✅ Generic SIP servers
Transport Protocols
- ✅ UDP (default)
- ✅ TCP
- ✅ TLS (secure)
- ✅ WSS (WebSocket Secure)
Troubleshooting
Common Issues
Registration Failed
- Verify server address, port, username, and password
- Check firewall settings for SIP ports
- Ensure the PBX allows registration from your IP
Calls Not Connecting
- Verify target URI format:
sip:extension@domain - Check if the target extension exists
- Ensure proper codec support
- Verify target URI format:
Network Issues
- SIP typically uses port 5060 (UDP/TCP) or 5061 (TLS)
- RTP ports (audio) typically range 10000-20000
- Configure NAT/firewall accordingly
Debug Mode
Enable debug logging in your n8n instance to see detailed SIP protocol messages.
Development
Building from Source
git clone https://github.com/ADH-GH/n8n-nodes-sip-client.git
cd n8n-nodes-sip-client
npm install
npm run buildTesting
npm run lint
npm run formatDependencies
- sip.js: Modern SIP library for JavaScript/TypeScript
- n8n-workflow: n8n workflow engine
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
Changelog
v1.0.0
- Initial release
- Full SIP.js integration with comprehensive error handling
- SIP registration with auto-renewal and timeout management
- Complete call management (make, answer, hangup, status)
- SIP messaging with validation and timeout handling
- Asterisk/Starface PBX compatibility
- Multiple transport protocol support (UDP, TCP, TLS, WSS)
- Enhanced error messages and connection monitoring
- Real-time call state tracking
- Custom headers support
- Comprehensive test configuration examples
