janus and asterisk 13 integration

1,667 views
Skip to first unread message

Javier Riveros

unread,
Jan 3, 2015, 5:57:52 PM1/3/15
to meetech...@googlegroups.com
Hi guys , i have already tested janus and works great , at this moment i have a janus server and have asterisk 13.1, i'm using sip gateway siptest.html example i want to test video with this accounts. at this moment audio works great.

I have client A register with sip gateway and client B with register with sipgateway to ,When siptest.js send a call to asterisk the invite is send with no Video offer.

v=0
o=sipcli-Session 1412386420 499860722 IN IP4 195.154.168.206
s=sipcli
c=IN IP4 195.154.168.206
t=0 0
m=audio 5083 RTP/AVP 18 0 8 101
a=fmtp:101 0-15
a=rtpmap:18 G729/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv

when asterisk make an invite to other endpoint Client B asterisk send invite with video offer so at this moment i have audio ok and one way video so the question is .

What i have to change in siptest.hmtl , siptest.js to make client A to send firts invite with video offer ?

Thank you so much for your effort i hope i could contribute with lots of test !

Regards

Lorenzo Miniero

unread,
Jan 4, 2015, 9:18:59 AM1/4/15
to meetech...@googlegroups.com
Change this line to force dovideo to be true:


There was a checkbox to allow you to choose whether to offer video as well, but we removed it. The reason for this is that via Asterisk video wasn't working very well, although this may have changed in the meanwhile. AFAIK Asterisk doesn't support REMB, and so the bandwidth used for video may increase up to 2mbit because there's no such feedback between peers. We're still thinking of some ways to cope with this in a proper and acceptable way. Let us know what your experience with this is.

L.

Lorenzo Miniero

unread,
Jan 4, 2015, 9:20:11 AM1/4/15
to meetech...@googlegroups.com
PS: of course you need an Asterisk that supports VP8 negotiation. Not sure if the current Asterisk version does (it should), otherwise one way to do so is using our opus-vp8 patch that you can find on github.

L.

Javier Riveros

unread,
Jan 4, 2015, 6:22:52 PM1/4/15
to meetech...@googlegroups.com

Hi Lorenzo thanks for your response.

Since im using asterisk 13 with PJSIP sip Stack    from your patch  Matt jordan and Josua colp write passthrough oficial support for VP8 and for Opus in Asterisk 12 and adapt this to PJSIP  sip Stack and chan_sip properly. 

Now  sip over websockets code is out of date to support all webrtc features and also asterisk reject all VP8 sdp offer dont pay attention to that offer ,audio work properly but video is another story.

So thats why i look for janus gateway since VP8 has better behavior over udp and PJSIP sip Stack in asterisk 13.

- coming back to my test on janus i change the line you tell me (thank you for  that ) and now siptest example is offering video but know client doesn't play audio an video :s. asterisk cli seems to process both media

## asterisk CLI ###

-- Added contact 'sip:gose...@192.168.88.18:40080;transport=udp' to AOR 'goseeped' with expiration of 3600 seconds
    -- Added contact 'sip:na...@192.168.88.18:44101;transport=udp' to AOR 'nathy' with expiration of 3600 seconds
    -- Executing [nathy@local:1] Dial("PJSIP/goseeped-00000000", "PJSIP/nathy") in new stack
    -- Called PJSIP/nathy
    -- PJSIP/nathy-00000001 is ringing
    -- PJSIP/nathy-00000001 answered PJSIP/goseeped-00000000
    -- Channel PJSIP/goseeped-00000000 joined 'simple_bridge' basic-bridge <58a716bc-6fea-43fc-9ce9-b93407b3815f>
    -- Channel PJSIP/nathy-00000001 joined 'simple_bridge' basic-bridge <58a716bc-6fea-43fc-9ce9-b93407b3815f>

       > 0x7f7b3400cde0 -- Probation passed - setting RTP source address to 192.168.88.18:53230
       > 0x7f7b3400f840 -- Probation passed - setting RTP source address to 192.168.88.18:30460
       > 0x7f7b38003660 -- Probation passed - setting RTP source address to 192.168.88.18:37472
       > 0x7f7b38007710 -- Probation passed - setting RTP source address to 192.168.88.18:18564

    -- Channel PJSIP/goseeped-00000000 left 'simple_bridge' basic-bridge <58a716bc-6fea-43fc-9ce9-b93407b3815f>
  == Spawn extension (local, nathy, 1) exited non-zero on 'PJSIP/goseeped-00000000'
    -- Channel PJSIP/nathy-00000001 left 'simple_bridge' basic-bridge <58a716bc-6fea-43fc-9ce9-b93407b3815f>


########## janus output  ########

janus show two WARINING when i made registration and show two ERROS on SDP offers. ,i left a blank line so you can see the error

Creating new session: 4216800089
Creating new handle in session 4216800089: 2908946926
[2908946926] There's a message for JANUS SIP plugin

outbound(0x7f541c002d40): FAILED to validate <sip:gose...@192.168.88.18:40080;transport=udp>
outbound(0x7f541c002d40): FAILED with 200 OK
Creating new session: 1246133390
Creating new handle in session 1246133390: 531105914
[531105914] There's a message for JANUS SIP plugin

outbound(0x7f541c0082d0): FAILED to validate <sip:na...@192.168.88.18:44101;transport=udp>
outbound(0x7f541c0082d0): FAILED with 200 OK

[2908946926] There's a message for JANUS SIP plugin
[2908946926] Creating ICE agent (controlled mode)
[2908946926] ICE send thread started...
candidate:2007661526 1 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
2007661526 1 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
[WARN] [2908946926]    Unsupported transport tcp!
candidate:2007661526 2 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
2007661526 2 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
candidate:2007661526 1 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
2007661526 1 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
[WARN] [2908946926]    Unsupported transport tcp!
candidate:959022886 1 udp 2122260223 192.168.88.190 52058 typ host generation 0
959022886 1 udp 2122260223 192.168.88.190 52058 typ host generation 0
[WARN] [2908946926] Queueing trickle candidate, status is not START yet
candidate:2007661526 2 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
2007661526 2 tcp 1518280447 192.168.88.190 0 typ host tcptype active generation 0
candidate:959022886 2 udp 2122260223 192.168.88.190 52058 typ host generation 0
959022886 2 udp 2122260223 192.168.88.190 52058 typ host generation 0
candidate:959022886 1 udp 2122260223 192.168.88.190 52058 typ host generation 0
959022886 1 udp 2122260223 192.168.88.190 52058 typ host generation 0
[WARN] [2908946926] Queueing trickle candidate, status is not START yet
candidate:959022886 2 udp 2122260223 192.168.88.190 52058 typ host generation 0
959022886 2 udp 2122260223 192.168.88.190 52058 typ host generation 0
candidate:4121213109 1 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
4121213109 1 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
[WARN] [2908946926] Queueing trickle candidate, status is not START yet
candidate:4121213109 2 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
4121213109 2 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
candidate:4121213109 1 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
4121213109 1 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
[WARN] [2908946926] Queueing trickle candidate, status is not START yet
candidate:4121213109 2 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
4121213109 2 udp 1686052607 190.207.75.74 52058 typ srflx raddr 192.168.88.190 rport 52058 generation 0
No more remote candidates for handle 2908946926!
[531105914] Creating ICE agent (controlling mode)
[531105914] ICE send thread started...
[531105914] There's a message for JANUS SIP plugin
[531105914]   -- ICE Trickling is supported by the browser, waiting for remote candidates...
candidate:2652000043 1 udp 2122260223 192.168.88.166 48258 typ host generation 0
2652000043 1 udp 2122260223 192.168.88.166 48258 typ host generation 0
candidate:2652000043 1 udp 2122260223 192.168.88.166 48258 typ host generation 0
2652000043 1 udp 2122260223 192.168.88.166 48258 typ host generation 0
[2908946926] Done! Ready to setup remote candidates and send connectivity checks...
No more remote candidates for handle 531105914!
[531105914] The DTLS handshake has been completed
WebRTC media is now available

[ERR] [ice.c:janus_ice_send_thread:1582:] [2908946926]     audio stream component has no valid SRTP session (yet?)

[2908946926] The DTLS handshake has been completed
WebRTC media is now available
No WebRTC media anymore
[WARN] Data available but Data Channels support disabled...
[2908946926] ICE send thread leaving...
[2908946926] WebRTC resources freed
No WebRTC media anymore
No WebRTC media anymore
[531105914] WebRTC resources freed
No WebRTC media anymore
[531105914] ICE send thread leaving...
[2908946926] There's a message for JANUS SIP plugin

[ERR] [plugins/janus_sip.c:janus_sip_handler:1287:] Wrong state (not in a call? state=2)

[2908946926] WebRTC resources freed
[531105914] WebRTC resources freed


If you need more info or debugs just let me know.

Thank you

Javier

Javier Riveros

unread,
Jan 4, 2015, 6:41:07 PM1/4/15
to meetech...@googlegroups.com
also i forget to say that 

asterisk 13 has ip : 192.168.88.17
janus has ip : 192.168.88.18

also i attached sip messages from asterisk,

thanks 

J.


El sábado, 3 de enero de 2015 18:27:52 UTC-4:30, Javier Riveros escribió:
sip_message_from_asterisk.txt

Lorenzo Miniero

unread,
Jan 5, 2015, 5:47:25 AM1/5/15
to meetech...@googlegroups.com
What are you using as a SIP client on the other side? It may simply be it doesn't handle VP8 the same way as browsers. AFAIK linphone, for instance, supports VP8 but is incompatible with Chrome and Firefox.

L.

Javier Riveros

unread,
Jan 5, 2015, 7:11:01 AM1/5/15
to meetech...@googlegroups.com
No in this case both clients are chrome,

Client A chromer  39 ->  janus WebRTC Gateway - >   asterisk UDP -> janus WebRTC Gateway - Client B chrome 39   

Im just using janus for WebRTC part and asterisk to handle media on UDP.


Both clients are logged on janus example , i have to say when i do this only with audio it just work.
asterisk is sending both media to client i check with wireshark on cient site ,but now client doesn't play anything no audio no video.


El sábado, 3 de enero de 2015 18:27:52 UTC-4:30, Javier Riveros escribió:

Lorenzo Miniero

unread,
Jan 5, 2015, 8:26:19 AM1/5/15
to meetech...@googlegroups.com
You should check with Wireshark if media is indeed flowing, and if the involved payload types are correct. Try also waiting a couple of minutes before hanging up, as it may simply be a case of missing key frame. 

L.

Javier Riveros

unread,
Jan 5, 2015, 10:23:14 AM1/5/15
to meetech...@googlegroups.com
I wait for couple of minutes after rtp flows in both clients only one RTP no both so i guess only audio also i increase the debug level on janus.

seems like janus doesn't understand what rtp stream asterisk is sending. 

ip : 192.168.88.190 client A
ip:  192.168.88.179 Client B

STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 1158 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 1158 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 1158 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 182 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 1158 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 1158 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa19c00c690 : s1:1: sending 1158 bytes to [192.168.88.190]:54276
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1158 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (182 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1158 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1159 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1158 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1159 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1158 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : s1:1: sending 182 bytes to [192.168.88.179]:52246
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1159 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1158 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1164 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1164 octets).
STUN error: RTP or other non-protocol packet!
(process:1319): libnice-DEBUG: Agent 0x7fa180005000 : Packet received on local socket 36 from [192.168.88.179]:52246 (1164 octets).
STUN error: RTP or other non-protocol packet!







El sábado, 3 de enero de 2015 18:27:52 UTC-4:30, Javier Riveros escribió:

Javier Riveros

unread,
Jan 5, 2015, 10:36:23 AM1/5/15
to meetech...@googlegroups.com
i just try the same escenario with firefox .

and audio flow but not video at all , it show the dtmf box on both client site no video box ,


:s



El sábado, 3 de enero de 2015 18:27:52 UTC-4:30, Javier Riveros escribió:

Lorenzo Miniero

unread,
Jan 5, 2015, 4:24:39 PM1/5/15
to meetech...@googlegroups.com
libnice is not involved between the SIP plugin and Asterisk. As I said, you should have a look with Wireshark to see what's flowing between browsers, Janus and Asterisk to see if video is indeed traveling on all media legs and how.

L.

Javier Riveros

unread,
Feb 23, 2015, 9:12:42 AM2/23/15
to meetech...@googlegroups.com
Hi Lorenzo ,

Sorry for my delayed response i know now what is doing asterisk wrong and why was processing media in a bad way. i have to patch asterisk 13 with a friend of mine  and now i could pass audio and video using janus with webrtc . :)

since we are not  experts in asterisk source code some other things stop working in asterisk like playback audio file before attempt a call and music on hold for example :( !

As for now we try to call directly (webrtc endpoints) on asterisk without janus and we have two way audio and one way video and after 3 min we have two way video , seems like key frame is coming ok so i dont know if the client jssip has a problem handling incoming calls at the moment we dont have the attention of asterisk community so we hope one day both things work properly ! 

As for now i want to thank you because you responses guide me to find a workaround , would be great that asterisk  13 has this capability like janus does.

thanks
Reply all
Reply to author
Forward
0 new messages