juniorlm87 / sipml5

Automatically exported from code.google.com/p/sipml5
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Unable to register to FreeSwitch server & unable to call SIP client (XLite) respectively using SIPml5 client #142

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am unable to register to FreeSwitch server & unable to call to SIP client 
(XLite) by using **SIPml5** SIP client.

Following is my HTML5 code:

    <!DOCTYPE html>
    <html>

    <head>

    <meta content="charset=utf-8"/>
    <script type="text/javascript" src="SIPml-api.js"></script>
    <title>SIP Client 1</title>

    <script type="text/javascript">
    window.onload = function()
    {
    var readyCallback = function(e){
        createSipStack(); // see next section
    };
        var errorCallback = function(e){
        console.error('Failed to initialize the engine: ' + e.message);
    }
    SIPml.init(readyCallback, errorCallback);

    console.info("WINDOW ONLOAD");
    }
           var sipStack;
            function createSipStack()
            {
                var eventsListener = function(e)
                {
                    if(e.type == 'started')
                    {
                        login();
                    }
                    else if(e.type == 'i_new_message')
                    {
                        acceptMessage(e);
                    }
                    else if(e.type == 'i_new_call')
                    {
                        acceptCall(e);
                    }
                }
                sipStack = new SIPml.Stack(
                {
                    realm: '192.168.1.33', // mandatory: domain name
                    impi: '1001', // mandatory: authorization name (IMS Private Identity)
                    impu: 'sip:1001@192.168.1.33', // mandatory: valid SIP Uri (IMS Public Identity)
                    password: '1234',
                    display_name: 'Osama', // optional
                    enable_rtcweb_breaker: true,
                    events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events
                });
                sipStack.start();
                console.info("CREATE SIP STACK");

            }

            var registerSession;
            var eventsListener = function(e){
                console.info('session event = ' + e.type);
                if(e.type == 'connected' && e.session == registerSession){
                    makeCall();
                }
            }
            function login(){
                registerSession = sipStack.newSession('register', {
                    events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events
                });
                registerSession.register();
                console.info("LOGIN");
            }

            var callSession;
            function makeCall()
            {
                var eventsListener = function(e)
                {
                    console.info('session event = ' + e.type);
                }
                callSession = sipStack.newSession('call-audiovideo', {
                    video_local: document.getElementById('video_local'),
                    video_remote: document.getElementById('video_remote'),
                    audio_remote: document.getElementById('audio_remote'),
                    events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events
                });
                callSession.call('1002');
                console.info("MAKE CALL");
            }

            function acceptCall(e){
                e.newSession.accept(); // e.newSession.reject() to reject the call
            }

    </script>
    </head>
    <body>

    <form method="post" style="height: 197px">
    <input name="Button1" type="button" value="Call" onclick="makeCall()">&nbsp;
    <input name="Button2" type="button" value="Accept" onclick="acceptCall"><video class="video" id="video_remote" autoplay="autoplay" style="width: 184px; height: 188px"></video>&nbsp;
    <audio id="audio_remote" autoplay="autoplay" />
    </audio><video class="video" width="88px" height="72px" id="video_local" autoplay="autoplay"></video><span></span></form>

    </body>

    </html>

Following is my Chrome console output:

    SIPML5 API version = 1.3.203 SIPml-api.js:1
    User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 SIPml-api.js:1
    WebSocket supported = yes SIPml-api.js:1
    Navigator friendly name = chrome SIPml-api.js:1
    OS friendly name = windows SIPml-api.js:1
    Have WebRTC = yes SIPml-api.js:1
    Have GUM = yes SIPml-api.js:1
    Engine initialized SIPml-api.js:1
    s_websocket_server_url=(null) SIPml-api.js:1
    s_sip_outboundproxy_url=(null) SIPml-api.js:1
    b_rtcweb_breaker_enabled=yes SIPml-api.js:1
    b_click2call_enabled=no SIPml-api.js:1
    b_early_ims=yes SIPml-api.js:1
    b_enable_media_stream_cache=no SIPml-api.js:1
    o_bandwidth={} SIPml-api.js:1
    o_video_size={} SIPml-api.js:1
    SIP stack start: proxy='ns313841.ovh.net:10062', realm='<sip:192.168.1.33>', impi='1001', impu='"Osama"<sip:1001@192.168.1.33>' SIPml-api.js:1
    Connecting to 'wss://ns313841.ovh.net:10062' SIPml-api.js:1
    CREATE SIP STACK default.html:52
    WINDOW ONLOAD default.html:21
    __tsip_transport_ws_onopen SIPml-api.js:1
    State machine: tsip_dialog_register_Started_2_InProgress_X_oRegister SIPml-api.js:1
    SEND: REGISTER sip:192.168.1.33 SIP/2.0
    Via: SIP/2.0/WSS df7jal23ls0d.invalid;branch=z9hG4bKpMrcuIswwvJBNixNUiHLuVPJA7tXxnrN;rport
    From: "Osama"<sip:1001@192.168.1.33>;tag=UAy54NJ9TiBQ4J8hWEn8
    To: "Osama"<sip:1001@192.168.1.33>
    Contact: "Osama"<sips:1001@df7jal23ls0d.invalid;rtcweb-breaker=yes;transport=wss>;expires=1800;click2call=no
    Call-ID: 690d263e-325b-1fc8-5bf7-bc5a545940f1
    CSeq: 2210 REGISTER
    Content-Length: 0
    Max-Forwards: 70
    Supported: path

    SIPml-api.js:1
    LOGIN default.html:68
    session event = connecting default.html:58
    session event = sent_request default.html:58
    State machine: tsip_dialog_register_Any_2_Terminated_X_transportError SIPml-api.js:1
    === REGISTER Dialog terminated === SIPml-api.js:1
    session event = transport_error default.html:58
    session event = terminated default.html:58
    The FSM is in the final state

I followed this [developer guide][1].
I don't know where am going wrong. I even enabled RTCWEB breaker as mentioned 
[here][2].
Please help me in registering to FreeSwitch server & calling to SIP client 
using SIPml5 client. The XLite is registered to FreeSwitch & is in ready state.

  [1]: http://sipml5.org/docgen/index.html?svn=200
  [2]: http://code.google.com/p/sipml5/wiki/FAQ#Is_it_possible_to_use_FreeSWITCH_to_make/receive_calls?

Original issue reported on code.google.com by osam...@omarax.com on 11 Dec 2013 at 11:25

GoogleCodeExporter commented 9 years ago
Hi
I also have similar issue,when i make a call  to xlite i see 180,then 200(OK) 
but after this there is silence. I have enabled RTCWebbreaker and value seems 
to be input properly but still no luck.
Second scenario: When i get a call from xlite i see"media stream dissconnected" 
for a while and call drops.Please guide.

Here is my Log:
s_websocket_server_url=(null) 
s_sip_outboundproxy_url=(null) 
b_rtcweb_breaker_enabled=yes 
b_click2call_enabled=no 
b_early_ims=yes 
b_enable_media_stream_cache=no 
o_bandwidth={} 
o_video_size={} 
SIP stack start: proxy='ns313841.ovh.net:13062', realm='<sip:83.98.187.237>', 
impi='test2', impu='"yusuf"<sip:test2@83.98.187.237>' 
Connecting to 'wss://ns313841.ovh.net:13062' 
==stack event = starting 
__tsip_transport_ws_onopen S
==stack event = started 
State machine: tsip_dialog_register_Started_2_InProgress_X_oRegister S
SEND: REGISTER sip:83.98.187.237 SIP/2.0
Via: SIP/2.0/WSS 
df7jal23ls0d.invalid;branch=z9hG4bKFntrc4Na0TifLRSGuhV8t9Kg1sdxhVuA;rport
From: "yusuf"<sip:test2@83.98.187.237>;tag=dtqf1NNTCftv6bW4Blr3
To: "yusuf"<sip:test2@83.98.187.237>
Contact: 
"yusuf"<sips:test2@df7jal23ls0d.invalid;rtcweb-breaker=yes;transport=wss>;expire
s=200;click2call=no;+g.oma.sip-im;+audio;language="en,fr"
Call-ID: 76cacac3-1e93-da5a-6c32-92d5ccebcd62
CSeq: 4735 REGISTER
Content-Length: 0
Max-Forwards: 70
User-Agent: IM-client/OMA1.0 sipML5-v1.2014.04.18
Organization: Doubango Telecom
Supported: path

==session event = connecting SIPml-api.js?svn=224:1
==session event = sent_request SIPml-api.js?svn=224:1
__tsip_transport_ws_onmessage SIPml-api.js?svn=224:1
recv=SIP/2.0 423 Interval too brief
Via: SIP/2.0/UDP 
188.165.231.30:13060;rport=13060;received=188.165.231.30;branch=z9hG4bKFntrc4Na0
TifLRSGuhV8t9Kg1sdxhVuA
From: "yusuf"<sip:test2@83.98.187.237>;tag=dtqf1NNTCftv6bW4Blr3
To: "yusuf"<sip:test2@83.98.187.237>
Call-ID: 76cacac3-1e93-da5a-6c32-92d5ccebcd62
CSeq: 4735 REGISTER
Content-Length: 0
Via: SIP/2.0/TCP 
122.177.178.149:16437;rport;branch=z9hG4bKFntrc4Na0TifLRSGuhV8t9Kg1sdxhVuA;ws-ha
cked=WSS
Min-Expires: 300

 State machine: tsip_dialog_register_InProgress_2_InProgress_X_423 
SEND: REGISTER sip:83.98.187.237 SIP/2.0
Via: SIP/2.0/WSS 
df7jal23ls0d.invalid;branch=z9hG4bK4LTrVf7yLvevQRE0EWrbZt07ylleUTGM;rport
From: "yusuf"<sip:test2@83.98.187.237>;tag=dtqf1NNTCftv6bW4Blr3
To: "yusuf"<sip:test2@83.98.187.237>
Contact: 
"yusuf"<sips:test2@df7jal23ls0d.invalid;rtcweb-breaker=yes;transport=wss>;expire
s=300;click2call=no;+g.oma.sip-im;+audio;language="en,fr"
Call-ID: 76cacac3-1e93-da5a-6c32-92d5ccebcd62
CSeq: 4736 REGISTER
Content-Length: 0
Max-Forwards: 70
User-Agent: IM-client/OMA1.0 sipML5-v1.2014.04.18
Organization: Doubango Telecom
Supported: path

==session event = sent_request 
__tsip_transport_ws_onmessage 
recv=SIP/2.0 200 OK
Via: SIP/2.0/UDP 
188.165.231.30:13060;rport=13060;received=188.165.231.30;branch=z9hG4bK4LTrVf7yL
vevQRE0EWrbZt07ylleUTGM
From: "yusuf"<sip:test2@83.98.187.237>;tag=dtqf1NNTCftv6bW4Blr3
To: "yusuf"<sip:test2@83.98.187.237>;tag=a9b
Contact: 
<sip:test2@188.165.231.30:13060;rtcweb-breaker=yes;transport=udp;ws-src-ip=122.1
77.178.149;ws-src-port=16437;ws-src-proto=wss>;expires=300
Call-ID: 76cacac3-1e93-da5a-6c32-92d5ccebcd62
CSeq: 4736 REGISTER
Content-Length: 0
Via: SIP/2.0/TCP 
122.177.178.149:16437;rport;branch=z9hG4bK4LTrVf7yLvevQRE0EWrbZt07ylleUTGM;ws-ha
cked=WSS
Date: 16 May 2014 13:59:26 GMT;16

State machine: tsip_dialog_register_InProgress_2_Connected_X_2xx 
==session event = connected 
State machine: c0000_Started_2_Outgoing_X_oINVITE 
ICE servers:[{"url":"stun:stun.l.google.com:19302"}] 
onGetUserMediaError 
NavigatorUserMediaError {constraintName: "", message: "", name: 
"PermissionDeniedError"} 
State machine: c0000_Outgoing_2_Cancelling_X_oCANCEL 
PeerConnection::stop()
There is no INVITE request to cancel 
==stack event = m_permission_requested 
==session event = connecting 
This/PeerConnection is null: unexpected 
==stack event = m_permission_refused 
==session event = terminating 

I wish that helps to figure out,to me it looks like some codecs issue. you help 
would be appreciated.appreciated. Thanks in advance.

Original comment by joseph...@gmail.com on 16 May 2014 at 2:28