When I log into FreePBX UCP, using my extension number (1111), I noticed that Asterisk sees me as logged in as my WebRTC number (991111).
I know I’m logged in as my WebRTC number by going to the Asterisk Rest Interface (ARI) endpoint /ari/endpoints
.
Does FreePBX UCP use a different login mechanism to the standard SIP connection authentication?
If so, am I able to use this mechanism as well in my javascript or is it only accessible to FreePBX Modules?
// Sample Js Code I use to log in:
var socket = new JsSIP.WebSocketInterface('wss://myfreepbx.local:8089/ws')
var configuration = {
sockets : [ socket ],
uri : 'sip:[email protected]',
password : 'notmyrealpassword',
authorization_user: 1111,
register: true,
register_server: `sip:myfreepbx.local`,
session_timer: true
}
var ua = new JsSIP.UA(configuration)
try {
ua.on('connected', (e) => {console.log('connected...')})
ua.on('disconnected', (e) => {console.log('disconnected...')})
ua.on('registered', (e) => {console.log('registered...')})
ua.on('unregistered', (e) => {console.log('unregistered...')})
ua.on('registrationFailed', (e) => {console.log('registrationFailed...')})
ua.start()
} catch (error) {
console.log(error)
}
My Config Details:
- FreePBX: v16.0.33
- Asterisk: v18.16.0
- JsSIP: v3.10.0
; FILE: pjsip.endpoint.conf
[1111]
type=endpoint
aors=1111
auth=1111-auth
webrtc=yes
callerid=UserA <1111>
...
[991111]
type=endpoint
aors=991111
auth=991111-auth
webrtc=yes
callerid=UserA <991111>
...
; FILE: pjsip.auth.conf
[1111-auth]
type=auth
auth_type=userpass
password=notmyrealpassword
username=1111
[991111-auth]
type=auth
auth_type=userpass
password=someautogeneratedpassword
username=991111
; FILE: pjsip.aor.conf
[1111]
type=aor
max_contacts=1
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60
[991111]
type=aor
mailboxes=991111@device
max_contacts=1
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60