How to use Zoiper or pyVoip to connect extension user

allenshi

Trial User
Joined
Sep 7, 2024
Messages
2
Reaction score
0
Hi all,

I build up 3cx on cloud, and setting extension 1003 username and password. but I can't login my extension by SIP.

```
Raw:
b'SIP/2.0 403 Invalid credentials\r\nVia: SIP/2.0/UDP 10.0.0.5:5060;branch=z9hG4bKdfbeb6c54bbd477b81da1c5c4;rport=5060;received=x.x.x.x\r\nTo: "1003"<sip:[email protected]>;tag=f8aef86a\r\nFrom: "1003" <sip:[email protected]>;tag=94f95b5b\r\nCall-ID: [email protected]:5060\r\nCSeq: 6 REGISTER\r\nContent-Length: 0\r\n\r\n'
Status: 403 Forbidden

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('10.0.0.5', '5060'), 'branch': 'z9hG4bKdfbeb6c54bbd477b81da1c5c4', 'rport': '5060', 'received': 'x,x,x,x'}]
To: {'raw': '"1003"<sip:[email protected]>', 'tag': 'f8aef86a', 'address': '[email protected]', 'number': '1003', 'caller': '1003', 'host': 'xxx.3cx.com.tw'}
From: {'raw': '"1003" <sip:[email protected]>', 'tag': '94f95b5b', 'address': '[email protected]', 'number': '1003', 'caller': '1003" ', 'host': 'xxx.3cx.com.tw'}
Call-ID: [email protected]:5060
CSeq: {'check': '6', 'method': 'REGISTER'}
Content-Length: 0

Body:

Raw:
b'SIP/2.0 403 Invalid credentials\r\nVia: SIP/2.0/UDP 10.0.0.5:5060;branch=z9hG4bKdfbeb6c54bbd477b81da1c5c4;rport=5060;received=x.x.x.x\r\nTo: "1003"<sip:[email protected]>;tag=f8aef86a\r\nFrom: "1003" <sip:[email protected]>;tag=94f95b5b\r\nCall-ID: [email protected]:5060\r\nCSeq: 6 REGISTER\r\nContent-Length: 0\r\n\r\n'

```

pyVoip

serverIP = "xxxx.3cx.com.tw"
serverPort = 5060
username = "1003"
password = "xxxxx"
hostIP="10.0.0.5"
auth_username = "1003"
vp = VoIPPhone(serverIP, serverPort, username, password,callCallback=answer,auth_username=auth_username,myIP=hostIP)
vp.start()
print(vp._status)
input("Press any key to exist")
vp.stop()
```

I use proxy authentication version on below

https://github.com/tayler6000/pyVoIP/pull/216
 

Attachments

  • SCR-20240911-ltn.png
    SCR-20240911-ltn.png
    101.6 KB · Views: 16
  • SCR-20240911-ltv.png
    SCR-20240911-ltv.png
    80.5 KB · Views: 16
Whats wrong with the 3CX app?

Anyway..

Go to IP Phone and select "I will configure the phone myself" > Local LAN/VPN > Add Phone

Account Name: xxxxx
Domain: FQDN
Username: Ext#
Password: Generated from previous step
Caller ID: ext#
Auth Username: generated from previous step (AuthID)
Outbound proxy: enable
outbound proxy: FQDN
 
  • Like
Reactions: Evolute IT
Many thanks for your help

I am newbie in PBX / SIP, I want to use python to answer our customer.
 

Members Online Now

No members online now.

Forum statistics

Threads
111,832
Messages
589,286
Members
164,662
Latest member
DejanMDS