Hi all
Just one thing that have helped me to get media stream properly set up
between to instances of sipml5 on the same LAN whom the asterisk
server belongs to.
The problem: both sipml5 instance did not receive the audio stream,
because the clients use as stun server stun.l.google.com:19302 (hard coded
value), that is outside of your LAN and that's why the audio stream did not
"flow" properly between the callee and caller.
To solve it this what I've done.
Firstly you need to install stun server inside your LAN, I did install
it on the same machine where asterisk is installed.
If you're using deb based system try "sudo apt-get install stun" to install it,
then edit /etc/default/stun. Uncomment START_DAEMON=true, then set
PRIMARY_IP and SECONDARY_IP properly (use your server private IP
for the former and localhost for the latter)
Then start the stun server: sudo service stun start.
Then you have to edit sipml5 js code. I'm assuming you're
using a fresh checkout of sipml5 code
(see https://code.google.com/p/sipml5/source/checkout).
The files you've to edit are:
src/tinyMEDIA/src/tmedia_session_roap.js
src/tinyMEDIA/src/tmedia_session_jsep.js
This is the diff, just rember to use the IP address
of your stun server instead of 192.168.0.2:
Index: src/tinyMEDIA/src/tmedia_session_roap.js
===================================================================
--- src/tinyMEDIA/src/tmedia_session_roap.js (revision 168)
+++ src/tinyMEDIA/src/tmedia_session_roap.js (working copy)
@@ -80,7 +80,7 @@
this.o_mgr.set_stream_local(__o_roap_stream);
__o_session_roap.o_local_stream = __o_roap_stream;
- __o_session_roap.o_pc = new __o_peerconnection_class("STUN stun.l.google.com:19302", __o_session_roap.__on_signaling_message);
+ __o_session_roap.o_pc = new __o_peerconnection_class("STUN 192.168.0.2:3478", __o_session_roap.__on_signaling_message);
//__o_session_roap.o_pc = new webkitDeprecatedPeerConnection("NONE", __o_session_roap.__on_signaling_message);
__o_session_roap.o_pc.o_session = __o_session_roap;
__o_session_roap.o_pc.onstatechange = tmedia_session_roap.prototype.__on_state_change;
@@ -336,4 +336,4 @@
__o_session_roap.o_mgr.set_stream_remote(null);
}
}
-}
\ No newline at end of file
+}
Index: src/tinyMEDIA/src/tmedia_session_jsep.js
===================================================================
--- src/tinyMEDIA/src/tmedia_session_jsep.js (revision 168)
+++ src/tinyMEDIA/src/tmedia_session_jsep.js (working copy)
@@ -315,7 +315,7 @@
var This = this;
// "__o_peerconnection_class" is equal to "webkitPeerConnection00 || webkitPeerConnection" on chrome and "w4aPeerConnection" on IE
- this.o_pc = new __o_peerconnection_class("STUN stun.l.google.com:19302",
+ this.o_pc = new __o_peerconnection_class("STUN 192.168.0.2:3478",
function (o_candidate, b_moreToFollow) {
// tsk_utils_log_info("__on_ice_candidate: " + (o_candidate ? o_candidate.toSdp() : "null"));
if (o_candidate) {
@@ -617,7 +617,7 @@
var This = this;
if (!this.o_pc && !this.b_lo_held) {
this.o_pc = new __o_peerconnection_class(
- { iceServers: [{ url: 'stun:stun.l.google.com:19302'}] },
+ { iceServers: [{ url: 'stun:192.168.0.2:3478'}] },
this.o_media_constraints
);
this.o_pc.onicecandidate = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onIceCandidate : function(o_event){ tmedia_session_jsep01.onIceCandidate(o_event, This) };
Once you did those changes you should be able to place
a call between two sipml5 clients without any audio problems.
Other things that could help you:
* I'm using asterisk 11.2.0 (released yesterday) built from
source patched with:
https://code.google.com/p/sipml5/source/browse/trunk/asterisk/asterisk_376131.patch
* both sipml5 client run inside google chorme version 25.0.1364.29 dev
Andrea
On Sunday, December 16, 2012 10:53:09 PM UTC+1, Matthew Smith wrote:I have followed the 'recipe' at https://code.google.com/p/sipml5/wiki/Asterisk pretty well to the letter, with the exception that, since I don't have a Windows machine with audio (only a VM, no sound,) I tested with an Android SIP client (CSipSimple) instead of Xlite.--
Asterisk is running on a virtual machine on my LAN - no firewalls involved.
I have established a connection to Asterisk from http://sipml5.org/asterisk/call.htm and - when calling an unconnected number, got voicemail. So OK there.
However, when I try to make a call to the connection through Chrome/SIPML5 - either from the Android SIP client or from another machine running Chrome/SIPML5 - I get a long string of errors, then Asterisk terminates.
Here is a sample of what I see from the Asterisk CLI:
Connected to Asterisk SVN-trunk-r376131M currently running on asterisk2 (pid = 1743)== WebSocket connection from '10.10.10.16:45086' for protocol 'sip' accepted using version '13'== WebSocket connection from '10.10.10.209:37712' for protocol 'sip' accepted using version '13'== Using SIP RTP CoS mark 5== Using SIP RTP CoS mark 5[Dec 17 08:03:38] WARNING[1889][C-00000000]: res_rtp_asterisk.c:1451 __rtp_recvfrom: PJ ICE Rx error status code: 370401 'Unauthorized'.[Dec 17 08:03:38] WARNING[1889][C-00000000]: res_rtp_asterisk.c:1451 __rtp_recvfrom: PJ ICE Rx error status code: 370401 'Unauthorized'.[Dec 17 08:03:38] WARNING[1889][C-00000000]: res_rtp_asterisk.c:1451 __rtp_recvfrom: PJ ICE Rx error status code: 370401 'Unauthorized'.
[Dec 17 08:03:38] WARNING[1889][C-00000000]: res_rtp_asterisk.c:1451 __rtp_recvfrom: PJ ICE Rx error status code: 370401 'Unauthorized'....lots more of the above...[Dec 17 08:03:38] WARNING[1889][C-00000000]: res_rtp_asterisk.c:1451 __rtp_recvfrom: PJ ICE Rx error status code: 370401 'Unauthorized'.[Dec 17 08:03:41] ERROR[1888][C-00000000]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo("df7jal23ls0d.invalid", "(null)", ...): Name or service not known
[Dec 17 08:03:41] WARNING[1888][C-00000000]: chan_sip.c:15777 __set_address_from_contact: Invalid host name in Contact: (can't resolve in DNS) : 'df7jal23ls0d.invalid'asterisk2*CLI>Disconnected from Asterisk serverExecuting last minute cleanupsAsterisk cleanly ending (0).
Can anyone throw any light on why this is happening and what I can try to remedy it?
Cheers
M
Many thanks for the detailed explanation! I'm commuting home now, tomorrow (CET) i will try to capture the network traffic involved and I'll open a ticket with the full dump attached.
Do you have any "ready-to-use" tcpdump filter to get all the needed packets?
Andrea
I'm using google chrome ver 25.0.1364.29 dev (os ubuntu 12.04 64bit)
On Jan 15, 2013 6:47 PM, "Mamadou" <diopm...@doubango.org> wrote:
>
> Please note that current chrome stable (24) contain a bug on ICE side as I explained at https://groups.google.com/group/doubango/browse_thread/thread/3eec5fec71dda522#.
> Using local STUN server is like disabling Public IP gathering and this could explain why it works. Instead of using a local STUN server with slow down the connection process, just disable it.
> If you're not an expert we recommend using webrtc2sip.
>
We definitely want to try the full stack (webrtc2sip, media coder etc)
but let's say that we're aiming to becoming experts since we want to deploy this new webrtc based tech as substitute of legacy app in our facilty
we're using asterisk 11.2.0 properly patched