Hi,
I am still struggling, if someone has experience, please help. Thank you.
Below are my environment and configurations.
Asterisk(11.11.0) installed on CentOS 7 on 192.168.179.4
sip.conf
=======================================
[general]
transport=udp,ws
rtcachefriends=yes
allowguest=yes
limitonpeers=yes
callcounter=yes
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
udpbindaddr=192.168.179.4 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
;externhost=set_your_externhost_here
externrefresh=150
localnet=
192.168.179.4/255.255.255.0disallow=all
allow=gsm
allow=ulaw ; Allow codecs in order of preference
allow=alaw ; Allow codecs in order of preference
videosupport=yes
allow=speex
allow=vp8
textsupport=yes
language=en ; Default language setting for all users/peers
callcounter=yes
limitonpeers=yes
callevents=yes
realm=192.168.179.4
;nat=force_rport,comedia
;Instant message
accept_outofcall_message=yes
outofcall_message_context=message ;
auth_message_requests=no
[1060] ; alice
;there is another block of [1060] before [1061], similar to [1061] except the username only
;
[1061] ; bob
type=friend
username=1061 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=password ; The SIP Password for SIP.js
disallow=all
allow=ulaw
allow=alaw
dtmf=auto
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when
[1062]
type=friend
username=1062
host=dynamic
secret=password
context=default
qualify=no
canreinvite=yes
textsupport=yes
[1063]
type=friend
username=1063
host=dynamic
secret=password
context=default
qualify=no
canreinvite=yes
textsupport=yes
extensions.conf
=======================================
[default]
exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060
exten => 1060,n,Hangup()
exten => 1061,1,Dial(SIP/1061) ;
exten => 1061,n,Hangup()
exten => 1062,1,Dial(SIP/1062)
exten => 1062,n,Hangup()
exten => 1063,1,Dial(SIP/1063)
exten => 1063,n,Hangup()
[message]
exten => 1062,1,MessageSend(sip:${EXTEN},”${CALLERID(name)}”${MESSAGE(from)})
exten => 1063,1,MessageSend(sip:${EXTEN},”${CALLERID(name)}”${MESSAGE(from)})
=======================================
xlite and zoiper are installed on pc 192.168.179.3.
1062 is xlite, 1063 is zoiper. 1062 can voice call to 1063 and vice versa.
=======================================
At Apache on pc 192.168.179.3
I make use of the example on page <
http://sipjs.com/>. This example is really amazing.
In my own version of "sipjs_demo.js", below are the related part that I changed to suit my environment.
function createUA(callerURI, displayName) {
var configuration = {
traceSip: true,
uri: callerURI,
displayName: displayName,
username:displayName,
password: 'password'
};
var userAgent = new
SIP.UA(configuration);
return userAgent;
}
var domain = '192.168.179.4';
var aliceURI = '1060' + '@' + domain;
var aliceName = '1060';
var bobURI = '1061' + '@' + domain;
var bobName = '1061';
window.aliceUA = createUA(aliceURI, aliceName);
window.bobUA = createUA(bobURI, bobName);
aliceUA.on('registered', markAsRegistered);
aliceUA.on('registrationFailed', failRegistration);
The markAsRegistered and failRegistration are never being called.
Can anyone help? Thanks in advance.