Answer the question
In order to leave comments, you need to log in
How to call via python using goip gateway?
There is a goip4 gateway, there is a need to call through it through python, you don’t need to talk or receive calls, you just need to make a call to a given number. How can this be implemented?
Answer the question
In order to leave comments, you need to log in
import requests
import re
url = 'http://login:[email protected]_IP_address/default/en_US/tools.html?type=dial'
responce = requests.get(url)
# Находим dialkey
dialkey = re.search('name=\"dialkey\" value=\"(.*?)\">', responce.text).group(1)
# Задаем параметры звонка
# Скакой линии звонить
line = 1
# Номер телефона
phone = "номер_телефона"
# Продолжительность звонка, сек
seconds = 5
params = {'line': line,
'dialkey': dialkey,
'action': 'dial',
'telnum': phone,
'duration': seconds,
'dial': 'Dial',
}
# Звоним
requests.post(url, data=params)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question