how can i call a number with out
hello i use the. example code to connect with the sip
from pyVoIP.VoIP import VoIPPhone, InvalidStateError
def answer(call): # This will be your callback function for when you receive a phone call.
try:
call.answer()
call.hangup()
except InvalidStateError:
pass
domain = 'sip.com'
user_name = 'myuser'
Password = 'mupass'
Port = 5090
if __name__ == "__main__":
phone=VoIPPhone(domain,Port, user_name,Password, callCallback=answer, myIP='192.168.43.82')
phone.start()
input('Press enter to disable the phone')
phone.stop()
it's work and registed
the question how can i make a call with out a voice just call number and get ringing in the other side the one who i'm calling him
If you're trying to make a call, simply do phone.call(number) after phone.start()
it dosen't work
Are you getting a traceback? If so, can you post it here?
Invited
import time
import wave
from pyVoIP.VoIP import VoIPPhone, InvalidStateError,CallState
def answer(call): # This will be your callback function for when you receive a phone call.
try:
call.answer()
call.hangup()
except InvalidStateError:
pass
domain = 'prod.tncp.textnow.com'
user_name = '13043620939_nQmBqJVCWgX3IozpPnIeddbgNlfOBkCXX4O6lbxOB98t'
Password = '98e2c39a48e72f2d3f54eef0a791e8ec'
Port = 5090
if __name__ == "__main__":
try:
phone=VoIPPhone(domain,Port, user_name,Password, callCallback=answer)
phone.start()
phone.call('+19704321329')
input('Press enter to disable the phone')
phone.stop()
except Exception as e:
print(e)
Well, I don't know about TextNow, but for Flowroute you're not supposed to put the plus, so that could be your issue.
Try the following:
import time
import wave
from pyVoIP.VoIP import VoIPPhone, InvalidStateError,CallState
# For extra debug remove the following quotes around this code.
"""
import pyVoIP
pyVoIP.DEBUG = True
"""
def answer(call): # This will be your callback function for when you receive a phone call.
try:
call.answer()
call.hangup()
except InvalidStateError:
pass
domain = 'prod.tncp.textnow.com'
user_name = '13043620939_nQmBqJVCWgX3IozpPnIeddbgNlfOBkCXX4O6lbxOB98t'
Password = '98e2c39a48e72f2d3f54eef0a791e8ec'
Port = 5090
if __name__ == "__main__":
try:
phone=VoIPPhone(domain,Port, user_name,Password, callCallback=answer)
phone.start()
call = phone.call('19704321329')
print("Dailing...", end="")
while call.state == CallState.DIALING:
print(".", end="")
print()
if call.state == CallState.ANSWERED:
# Do things
call.hangup()
input('Press enter to disable the phone')
phone.stop()
except Exception as e:
print(e)
Did this work for you @devlop7 ?
it doesn't work even when i put this data in voip app or software it regist and i can make a call from it so i don't know exactly when it doesn't work and other things the TCP protocol is not there in the lib some sip line use it so u should add it if u figer out a way to make it ringing call tell me domain = 'prod.tncp.textnow.com' user_name = '13043620939_nQmBqJVCWgX3IozpPnIeddbgNlfOBkCXX4O6lbxOB98t' Password = '98e2c39a48e72f2d3f54eef0a791e8ec'
I've ran the code as well and got the same result as you, I can't seem to find any documentation for textnow's VoIP server, I do see that they use a proxy server to receive calls which pyVoIP does not support, however, I don't seem to be getting that error. I'm wondering if it's tied to #76 as I'm not actually receiving a response to the INVITE according to Wireshark, but I am receiving a response to register requests so I'm unsure.
i can recive the call normally when i call the sip to your lib
but i can not make a call .........
i can recive a call normal it's work but to make a call it dosen't
Can you give me the VoIP documentation for text now?
it dosen't has one i use wireshare to get data
If you're trying to make a call, simply do phone.call(number) after phone.start()
Worked great in my case to make calls, but I was having random issues when connecting to Grandstream UCM6202V1.5A 1.0.20.38
Then I noticed the Grandstream was returning code 491 (Request Pending) and this was incorrectly raising InvalidAccountInfoError.
As a workaround I changed the line 1769 of SIP.py to
if response.status == SIPStatus.OK or response.status == SIPStatus.REQUEST_PENDING:
@guijusto it dosen’t works