3

I am working with Asterisk 12 and sip.js . I am trying to call chrome browser from zoiper (android phone )

my pears are

[6004]
context=default
secret=6004
type=friend
host=dynamic


[1060] ; This will be WebRTC client
type=friend
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=1060 ; The SIP Password for SIP.js
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
videosupport=no
nat=force_rport,comedia

and My JS code is

   var session;
    var mediaStream;
    var audio = new Audio('ring.mp3');
    var config = {
        // Replace this IP address with your Asterisk IP address
        uri: 'sip:1060@XXX:9091',
        // Replace this IP address with your Asterisk IP address,
        // and replace the port with your Asterisk port from the http.conf file
        ws_servers: 'ws://XXX:9092/ws',
        // Replace this with the username from your sip.conf file
        authorizationUser: '1060',
        // Replace this with the password from your sip.conf file
        password: '1060',
        // HackIpInContact for Asterisk
        hackIpInContact: true
    };

    var ua = new SIP.UA(config);

    ua.on('invite', function(incomingSession) {
        session = incomingSession;
        audio.play();
        prepareToanswer();
    });

I can get invite but when I accept it , i can not get audio stream. Can anybody help me?

1
  • and what about the other browsers?
    – AlexGreg
    Commented Aug 6, 2014 at 8:25

1 Answer 1

3

It sounds like your DTLS certificates might not be setup correctly.

    mkdir /etc/asterisk/keys
    cd /usr/local/src/asterisk*/contrib/scripts.
   ./ast_tls_cert -C pbx.mycompany.com -O "My Super Company" -d /etc/asterisk/keys.

Replace pbx.mycompany.com with your ip address of the Asterisk box.

Source: http://sipjs.com/guides/server-configuration/asterisk/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.