-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyVoIP fails to register to Asterisk #263
Comments
now I tried with myIP='192.168.1.73' according to: $ ip a so this is sip dialog I got from sngrep 5 times: REGISTER sip:67.220.85.61 SIP/2.0 SIP/2.0 401 Unauthorized now I tried to register using Zoiper from same computer same network and got: 2024/06/14 08:34:49.344642 87.116.135.135:12870 -> 67.220.85.61:5060 2024/06/14 08:34:49.344928 67.220.85.61:5060 -> 87.116.135.135:12870 2024/06/14 08:34:49.576569 87.116.135.135:12870 -> 67.220.85.61:5060 |
Anybody? |
Hi, I am using this package in combination with PJSIP in Asterisk. I configured the endpoint with the same authentication and endpoint name, as differing values appeared to cause authentication failures. I also applied this patch in order to get Asterisk's polling to work when "qualify" is enabled. You could also look at the fork made by the author of the patch. |
Actually I'm using Vicibox11 with chan_sip, is that what makes issue? |
Do you have any issues when using Zoiper with the phone 2005@..., user 2005 and password ***?
|
I tried PyVoIP basic example:
from pyVoIP.VoIP import VoIPPhone, InvalidStateError
def answer(call):
try:
call.answer()
call.hangup()
except InvalidStateError:
pass
if name == "main":
phone = VoIPPhone('******', '5060', '2005', '', myIP='127.0.0.1', callCallback=answer)
phone.start()
input('Press enter to disable the phone')
phone.stop()
[root@vujisic pyvoip]# python3.6 -V
Python 3.6.6
[root@vujisic pyvoip]# pip3.6 -V
pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
[root@vujisic pyvoip]# python3.6 phone-auto-answer-hangup.py
SIPClient.gen_tag called from SIPClient.init start NSD False
SIPClient.gen_urn_uuid called from SIPClient.init start
VoIPPhone.start called from start
SIPClient.start called from VoIPPhone.start start IP 127.0.0.1 Port 5060
SIPClient.register called from SIPClient.start start
SIPClient.gen_first_response called from SIPClient.register start
SIPClient.gen_branch called from SIPClient.gen_first_response start
SIPClient.gen_call_id called from SIPClient.gen_first_response start
SIPClient.send_message called from SIPClient.register --> message sever 67.220.85.61 port 5060
REGISTER sip:67.220.85.61 SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK9340ee15d0974bf2bee08fb90;rport
From: "2005" sip:[email protected];tag=9dbfdbf6
To: "2005" sip:[email protected]
Call-ID: [email protected]:5060
CSeq: 1 REGISTER
Contact: sip:127.0.0.1:5060;transport=UDP;+sip.instance="urn:uuid:571D34F4-B3BB-45C7-9199-C1BF5F3D2B7D"
Allow: INVITE, ACK, BYE, CANCEL, NOTIFY
Max-Forwards: 70
Allow-Events: org.3gpp.nwinitdereg
User-Agent: pyVoIP 1.6.1
Expires: 120
Content-Length: 0
SIPClient.stop called from VoIPPhone.start start
SIPClient._close_sockets called from SIPClient.stop start
Traceback (most recent call last):
File "phone-auto-answer-hangup.py", line 13, in
phone.start()
File "/usr/local/lib/python3.6/site-packages/pyVoIP/VoIP.py", line 519, in start
self.sip.start()
File "/usr/local/lib/python3.6/site-packages/pyVoIP/SIP.py", line 924, in start
self.register()
File "/usr/local/lib/python3.6/site-packages/pyVoIP/SIP.py", line 1484, in register
self.send_message(firstRequest)
File "/usr/local/lib/python3.6/site-packages/pyVoIP/SIP.py", line 810, in send_message
self.out.sendto(message.encode('utf8'), ((self.proxy if self.proxy else self.server), self.port))
TypeError: an integer is required (got type str)
This line: Via: SIP/2.0/UDP 127.0.0.1:5060 i.e. 127.0.0.1 doesn't matter since I tried 0.0.0.0, {server public ip address}
The text was updated successfully, but these errors were encountered: