Crear troncal SIP
curl --request POST \
--url https://app.famulor.de/api/user/phone-numbers/sip-trunks \
--header 'Content-Type: application/json' \
--data '
{
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"nickname": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"allowed_inbound_ips": [
{}
],
"country_code": "<string>",
"outbound_proxy": true
}
'import requests
url = "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload = {
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"nickname": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"allowed_inbound_ips": [{}],
"country_code": "<string>",
"outbound_proxy": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sip_trunk_type: '<string>',
phone_number: '<string>',
nickname: '<string>',
sip_username: '<string>',
sip_password: '<string>',
sip_address: '<string>',
sip_calling_format: '<string>',
inbound_authorization_type: '<string>',
allowed_inbound_ips: [{}],
country_code: '<string>',
outbound_proxy: true
})
};
fetch('https://app.famulor.de/api/user/phone-numbers/sip-trunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.famulor.de/api/user/phone-numbers/sip-trunks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sip_trunk_type' => '<string>',
'phone_number' => '<string>',
'nickname' => '<string>',
'sip_username' => '<string>',
'sip_password' => '<string>',
'sip_address' => '<string>',
'sip_calling_format' => '<string>',
'inbound_authorization_type' => '<string>',
'allowed_inbound_ips' => [
[
]
],
'country_code' => '<string>',
'outbound_proxy' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload := strings.NewReader("{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"nickname\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"allowed_inbound_ips\": [\n {}\n ],\n \"country_code\": \"<string>\",\n \"outbound_proxy\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.famulor.de/api/user/phone-numbers/sip-trunks")
.header("Content-Type", "application/json")
.body("{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"nickname\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"allowed_inbound_ips\": [\n {}\n ],\n \"country_code\": \"<string>\",\n \"outbound_proxy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.famulor.de/api/user/phone-numbers/sip-trunks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"nickname\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"allowed_inbound_ips\": [\n {}\n ],\n \"country_code\": \"<string>\",\n \"outbound_proxy\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "SIP trunk created successfully.",
"data": {
"id": 42,
"phone_number": "1000",
"nickname": "Provider X — Main",
"sip_username": "myuser",
"sip_address": "sip.provider.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"message": "SIP trunk created successfully.",
"data": {
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "trunk_user",
"sip_address": "sip.provider.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"error": "A SIP trunk with the same phone number, username, and address already exists."
}
{
"message": "The given data was invalid.",
"errors": {
"sip_address": ["SIP server address is required."],
"sip_calling_format": ["SIP calling format must be one of: +e164, e164, national."]
}
}
{
"error": "Failed to create SIP trunk. Please try again or contact support."
}
Trunks SIP
Crear troncal SIP
Crea una nueva troncal SIP con credenciales, dirección y configuración de proxy
POST
/
api
/
user
/
phone-numbers
/
sip-trunks
Crear troncal SIP
curl --request POST \
--url https://app.famulor.de/api/user/phone-numbers/sip-trunks \
--header 'Content-Type: application/json' \
--data '
{
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"nickname": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"allowed_inbound_ips": [
{}
],
"country_code": "<string>",
"outbound_proxy": true
}
'import requests
url = "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload = {
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"nickname": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"allowed_inbound_ips": [{}],
"country_code": "<string>",
"outbound_proxy": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sip_trunk_type: '<string>',
phone_number: '<string>',
nickname: '<string>',
sip_username: '<string>',
sip_password: '<string>',
sip_address: '<string>',
sip_calling_format: '<string>',
inbound_authorization_type: '<string>',
allowed_inbound_ips: [{}],
country_code: '<string>',
outbound_proxy: true
})
};
fetch('https://app.famulor.de/api/user/phone-numbers/sip-trunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.famulor.de/api/user/phone-numbers/sip-trunks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sip_trunk_type' => '<string>',
'phone_number' => '<string>',
'nickname' => '<string>',
'sip_username' => '<string>',
'sip_password' => '<string>',
'sip_address' => '<string>',
'sip_calling_format' => '<string>',
'inbound_authorization_type' => '<string>',
'allowed_inbound_ips' => [
[
]
],
'country_code' => '<string>',
'outbound_proxy' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload := strings.NewReader("{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"nickname\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"allowed_inbound_ips\": [\n {}\n ],\n \"country_code\": \"<string>\",\n \"outbound_proxy\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.famulor.de/api/user/phone-numbers/sip-trunks")
.header("Content-Type", "application/json")
.body("{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"nickname\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"allowed_inbound_ips\": [\n {}\n ],\n \"country_code\": \"<string>\",\n \"outbound_proxy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.famulor.de/api/user/phone-numbers/sip-trunks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"nickname\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"allowed_inbound_ips\": [\n {}\n ],\n \"country_code\": \"<string>\",\n \"outbound_proxy\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "SIP trunk created successfully.",
"data": {
"id": 42,
"phone_number": "1000",
"nickname": "Provider X — Main",
"sip_username": "myuser",
"sip_address": "sip.provider.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"message": "SIP trunk created successfully.",
"data": {
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "trunk_user",
"sip_address": "sip.provider.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"error": "A SIP trunk with the same phone number, username, and address already exists."
}
{
"message": "The given data was invalid.",
"errors": {
"sip_address": ["SIP server address is required."],
"sip_calling_format": ["SIP calling format must be one of: +e164, e164, national."]
}
}
{
"error": "Failed to create SIP trunk. Please try again or contact support."
}
API de Famulor 1.0 (legado). Esta página se aplica únicamente a Famulor 1.0 (
app.famulor.de) y se conserva por compatibilidad. Para la plataforma actual, usa la referencia de la API de Famulor 2.0.Cuerpo de la solicitud
string
requerido
El tipo de troncal SIP:
extension para una extensión SIP, o number para un número de teléfono (DID). Esto determina el formato esperado del campo phone_number.string
requerido
La extensión SIP (1-15 caracteres, p. ej.,
1000) cuando sip_trunk_type es extension, o un número de teléfono en formato E.164 (p. ej., +14155551234) cuando sip_trunk_type es number.string
Una etiqueta corta y descriptiva para la troncal (p. ej., «Proveedor X — Principal»). Máximo 50 caracteres.
string
requerido
Nombre de usuario para la autenticación SIP (3-128 caracteres)
string
requerido
Contraseña para la autenticación SIP (mínimo 3 caracteres)
string
requerido
La dirección del servidor SIP sin puerto (p. ej.,
sip.provider.com)string
requerido
El formato del número de llamada saliente:
+e164- Internacional con prefijo+(p. ej.,+12025550123)e164- Internacional sin prefijo+(p. ej.,12025550123)national- Formato nacional sin código de país (p. ej.,0741926265)
string
requerido
Cómo se autentican las llamadas entrantes:
auth- Usa el mismo nombre de usuario y contraseña SIP configurados para el tráfico salienteip- Incluye en la lista blanca direcciones IP específicas (requiereallowed_inbound_ips)
array
Array de direcciones IP autorizadas a enviar llamadas entrantes. Obligatorio cuando
inbound_authorization_type es ip. Debe contener al menos una dirección IP válida.string
requerido
Código de país ISO 3166-2 donde se encuentra la troncal SIP (p. ej.,
US, GB, DE). Cuando sip_trunk_type es number, el país se detecta automáticamente a partir del número de teléfono si es posible.boolean
Enruta las llamadas salientes a través de una dirección IP fija. Predeterminado:
false. Actívalo solo si tu proveedor SIP requiere autenticación basada en IP para el tráfico saliente.Respuesta
string
Mensaje de éxito
object
El objeto de troncal SIP creado (los mismos campos que Obtener troncal SIP)
{
"message": "SIP trunk created successfully.",
"data": {
"id": 42,
"phone_number": "1000",
"nickname": "Provider X — Main",
"sip_username": "myuser",
"sip_address": "sip.provider.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"message": "SIP trunk created successfully.",
"data": {
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "trunk_user",
"sip_address": "sip.provider.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"error": "A SIP trunk with the same phone number, username, and address already exists."
}
{
"message": "The given data was invalid.",
"errors": {
"sip_address": ["SIP server address is required."],
"sip_calling_format": ["SIP calling format must be one of: +e164, e164, national."]
}
}
{
"error": "Failed to create SIP trunk. Please try again or contact support."
}
Qué ocurre después de la creación
Al crear una troncal SIP, la plataforma automáticamente:- Aprovisiona una troncal entrante en la infraestructura de voz, usando autenticación por nombre de usuario/contraseña o basada en IP según tu configuración de
inbound_authorization_type - Aprovisiona una troncal saliente, usando la dirección SIP y las credenciales que proporcionaste, opcionalmente a través del proxy saliente
500.
Próximos pasos
Después de crear una troncal SIP, asígnala a un asistente de IA:- Crear asistente - Usa el parámetro
phone_number_id - Actualizar asistente - Cambia el número de teléfono en un asistente existente