Python / RestAPI/ARI channel/bridge internal SIP / external SIP and custom trunk

Hi,
I have a problem and don’t know how to work around it.
When I had 1 outgoing trunk, it worked, but now I have 3 phone lines and the problem. And necessarily I need to use a particular external number/specific trunk

I want to have a CALL button on the web site, and I want the support - helpdesk, to be able to click on that button and have the support number connect to my cell number.

With the current setting, after firing the script, the phone rings in the internal phone and that’s it, the call to the external phone does not go out. After answering the phone in the internal phone (SIP/100), the call is disconnected.

If I change only endpoint to:
SIP/100@outTrunk1
the extension does not ring (SIP/100)

if I change only context to:
'context: ‘from-trunk-sip-outTrunk1’,
then on the SIP/100 phone I can answer, I hear - invalid number and the voiceover reads the number to me digit by digit and hangs up

settings:

outgoing trunk - outTrunk1
my cell phone number - +123456789
service number - variable but one of the SIP extensions, i.e. SIP/100…999

and now I have a script in python:

import requests
url_ = “https://192.168.1.1:8089/ari/channels
data1 = {
‘api_key’: ‘user:password’,
‘endpoint’: ‘SIP/100’,
‘extension’: ‘+123456789’,
‘context’: ‘from-internal’,
‘priority’: ‘1’,
‘callerId’: ‘+123456789’,
}
data2 = {“variables”: {‘CALLERID(num)’: ‘+123456789’}}
headers = {
‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/json’
}
answer = requests.post(url=url_, params=data1, json=data2, headers=headers, allow_redirects=True, verify=False, timeout=10000)
txt = answer.content.decode(‘UTF-8’)

Provide an example of the failed call.
Providing Great Debug - Support Services - Documentation (freepbx.org)

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.