[Home]

Summary:ASTERISK-14582: [patch] [branch] Implement standard XMPP Jingle in Asterisk
Reporter:sles (sles)Labels:
Date Opened:2009-08-03 00:59:54Date Closed:2012-09-06 08:13:34
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_jingle
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) patch-jingle_speex-1.diff
( 1) pidgin_calling_asterisk.txt
Description:Hello!

psi 0.13 is just released, with jingle support.
it is not gtalk compatible, but, according to developers , it is jingle specification compatible
http://forum.psi-im.org/thread/5335
it will be good if psi will work with asterisk...


****** ADDITIONAL INFORMATION ******

Branch:  http://svn.digium.com/svn/asterisk/team/phsultan/jingle-support
Comments:By: snuffy (snuffy) 2009-08-03 08:02:06

Hello, you are aware that there is a chan_jingle.
See the jingle.conf for an example.

By: phsultan (phsultan) 2009-08-03 11:34:11

Yep, chan_jingle is more appropriate to test with. However, the latest Jingle specs have not been implemented in this channel driver.

Maybe you can provide us with a console debug output so we can see what actually goes wrong.

By: sles (sles) 2009-08-04 03:03:47

Hello!
Thank you!
I tested chan_jingle, unfortunatly result is the same as with chan_gtalk- just nothing is happening ( at least I see nothing in asterisk -r -cvvvvv), looks like psi and chan_jingle have completely different signalling...

By: Leif Madsen (lmadsen) 2009-09-22 08:15:58

This appears to be a feature request, or at least a major request for driver change without a patch, thus this issue is now closed for the time being.

By: phsultan (phsultan) 2009-10-04 10:50:03

I'm working on this. Now that the Jingle specs are (almost) standardized, we can make chan_jingle live.

I'll publish a patch or branch by the end of the week.

By: phsultan (phsultan) 2009-10-09 05:19:56

sles, I created a branch to handle Jingle calls from Psi using chan_jingle :

http://svn.digium.com/svn/asterisk/team/phsultan/jingle-support/

What it does :
- accepts voice calls from Psi over Jingle ;
- negociates the transport information over ICE.

What's missing :
- place outgoing calls to Psi over Jingle ;
- send proper speex stream to Psi (show up on the console and the sound quality is bad from Asterisk to Psi).

You need to compile Asterisk with speex support, because Psi only knows that codec.

Thank you for your feedback!

By: sles (sles) 2009-10-19 03:57:09

thank you!

if sound quality is bad, is it time to do tests or I have to wait? I'd like to use jingle for meetme conference...

By: phsultan (phsultan) 2009-10-22 08:06:27

sles: testing is needed to confirm that calls can be established in different environments. In particular, it would be interesting to test the calls when Asterisk and Psi are separated by a NAT box.

All my testings have been made with Psi and Asterisk staying in the same LAN.

Thanks!

By: sles (sles) 2009-10-27 02:09:34

Hello!

I have following problem with call from psi-0.13- no sound.
Here is what I see on console:

*CLI> module  load chan_jingle
*CLI>   == Parsing '/etc/asterisk/jingle.conf':   == Found
 == Registered RTP glue 'Jingle'
 == Registered channel type 'Jingle' (Jingle Channel Driver)
Loaded chan_jingle.so => (Jingle Channel Driver)
*CLI>
*CLI>
*CLI> [Oct 27 11:02:58] NOTICE[653]: chan_jingle.c:811 jingle_new: Codec initialized to : SpeeX
   -- Executing [s@jabber-in:1] NoOp("Jingle/jnk-e2ed", " Call from Gtalk ") in new stack
   -- Executing [s@jabber-in:2] Set("Jingle/jnk-e2ed", "CALLERID(name)=”From Google Talk”") in new stack
   -- Executing [s@jabber-in:3] MeetMe("Jingle/jnk-e2ed", "6000") in new stack
[Oct 27 11:02:58] NOTICE[676]: chan_jingle.c:1349 jingle_indicate: Don't know how to indicate condition '-1'
[Oct 27 11:02:58] NOTICE[653]: chan_jingle.c:1174 jingle_add_candidate: Processing candidate
[Oct 27 11:02:58] NOTICE[653]: chan_jingle.c:1174 jingle_add_candidate: Processing candidate
[Oct 27 11:02:58] NOTICE[653]: chan_jingle.c:1206 jingle_add_candidate: Candidates parsed
 == Parsing '/etc/asterisk/meetme.conf':   == Found
[Oct 27 11:02:59] WARNING[676]: channel.c:4535 ast_request: No channel type registered for 'DAHDI'
   -- Created MeetMe conference 1023 for conference '6000'
   -- <Jingle/jnk-e2ed> Playing 'conf-onlyperson.gsm' (language 'en')
[Oct 27 11:03:02] NOTICE[676]: chan_jingle.c:1349 jingle_indicate: Don't know how to indicate condition '-1'
[Oct 27 11:03:06] WARNING[676]: frame.c:1385 speex_samples: Not enough bits remaining after wide band for speex samples.
[Oct 27 11:03:06] WARNING[676]: frame.c:1385 speex_samples: Not enough bits remaining after wide band for speex samples.
[Oct 27 11:03:06] WARNING[676]: frame.c:1385 speex_samples: Not enough bits remaining after wide band for speex samples.
[Oct 27 11:03:06] WARNING[676]: frame.c:1385 speex_samples: Not enough bits remaining after wide band for speex samples.

By: sles (sles) 2009-10-27 02:15:02

btw, I forget to mention- I compiled asterisk on ubuntu 9.04 amd64.
Thank you!

By: phsultan (phsultan) 2009-10-28 08:37:59

sles, thanks a lot. Can you test the Echo application instead of Meetme so that we make sure the call establishes?

By: sles (sles) 2009-10-29 00:10:44

Hello!

Unfortunately if I use Echo in extensions call is not established.
Psi is forever in Calling state.
Here is asterisk output:
*CLI> [Oct 29 09:01:42] NOTICE[22336]: chan_jingle.c:811 jingle_new: Codec initialized to : SpeeX
   -- Executing [s@jabber-in:1] NoOp("Jingle/dm-fbdd", " Call from Gtalk ") in new stack
   -- Executing [s@jabber-in:2] Set("Jingle/dm-fbdd", "CALLERID(name)=”From Google Talk”") in new stack
   -- Executing [s@jabber-in:3] Echo("Jingle/dm-fbdd", "") in new stack
[Oct 29 09:01:42] NOTICE[22336]: chan_jingle.c:1174 jingle_add_candidate: Processing candidate
[Oct 29 09:01:42] NOTICE[22336]: chan_jingle.c:1174 jingle_add_candidate: Processing candidate
[Oct 29 09:01:42] NOTICE[22336]: chan_jingle.c:1206 jingle_add_candidate: Candidates parsed


Thank you!



By: sles (sles) 2009-11-10 23:18:55.000-0600

btw, just tried to make call with empathy (ubuntu 9.10), no call, nothing on console...

By: phsultan (phsultan) 2009-11-17 15:30:38.000-0600

sles, I just updated the branch, can you please test the new code along with Empathy (version 2.28.1 or higher), or Pidgin (version 2.6.2 or higher)?

Both these clients support the G.711 codecs, so we might get more chances to have them work with Asterisk than with Psi, that only supports speex.

Also, please call the Answer application first if you test the Echo application in your dialplan.

Thanks a lot for your testing!

By: sles (sles) 2009-11-17 23:35:35.000-0600

Hello!

Thank you!

With empathy, as I see, speex is used anyway, but this is only what I see:


*CLI>
*CLI> [Nov 18 09:23:20] NOTICE[9186]: chan_jingle.c:811 jingle_new: Codec initialized to : SpeeX


Looks like echo doesn't work, but I don't shure- may be I have problems with microphone in empathy, but empathy status is somethnig like not connected.

Psi creates different output:

 == Starting Jingle/dm-e381 at jabber-in,s,1 still failed so falling back to context 'default'
[Nov 18 09:26:07] WARNING[9340]: pbx.c:4710 __ast_pbx_run: Channel 'Jingle/dm-e381' sent into invalid extension 's' in context 'default', but no invalid handler

Certanly call is failed.
Here is my context:

[jabber-in]
;exten => s,1,NoOp( Call from Gtalk )
;exten => s,n,Set(CALLERID(name)=”From Google Talk”)
exten => s,1,Answer()
;exten => s,n,Dial(SIP/6052)
;exten => s,n,Meetme(6000)
exten => s,n,Echo()

Thank you!

By: phsultan (phsultan) 2009-11-18 03:21:53.000-0600

Here is what I have in my jingle.conf :
[general]
context=default
allowguest=yes
debug=yes
bindaddr=X.X.X.X
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=speex

[guest]
disallow=all
allow=ulaw
allow=alaw
allow=speex
context=jingle-in


extensions.conf :
[jingle-in]
exten => s,1,NoOp(In jingle context);
exten => s,n,Dial(SIP/1234)
;exten => s,1,Answer
;exten => s,n,Playback(beep)
;exten => s,n,Echo
exten => s,n,Hangup


I can call my SIP phone from Empathy, works with Pidgin as well.

By: sles (sles) 2009-11-18 23:00:00.000-0600

Hello!

I almost copied your config:

[general]
context=default
allowguest=yes
debug=yes
bindaddr=192.168.22.229
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=speex

[guest]
disallow=all
allow=ulaw
allow=alaw
allow=speex
context=jingle-in

(btw, only speex was used before just because I allowed only speex).

and extensions.conf :

[jingle-in]
exten => s,1,NoOp(In jingle context);
exten => s,n,Dial(SIP/6052)
;exten => s,1,Answer
;exten => s,n,Playback(beep)
;exten => s,n,Echo
exten => s,n,Hangup


Result is the same:

Call from windows psi 0.14pre1:

*CLI> [Nov 19 08:48:05] NOTICE[22047]: chan_jingle.c:811 jingle_new: Codec initialized to : G.711 u-law
 == Starting Jingle/kasimov-3882 at jingle-in,s,1 failed so falling back to exten 's'
 == Starting Jingle/kasimov-3882 at jingle-in,s,1 still failed so falling back to context 'default'
[Nov 19 08:48:05] WARNING[22223]: pbx.c:4710 __ast_pbx_run: Channel 'Jingle/kasimov-3882' sent into invalid extension 's' in context 'default', but no invalid handler


Call from Empathy:

*CLI> [Nov 19 08:41:39] NOTICE[22047]: chan_jingle.c:811 jingle_new: Codec initialized to : G.711 u-law
 == Starting Jingle/dm-eb6b at jingle-in,s,1 failed so falling back to exten 's'
 == Starting Jingle/dm-eb6b at jingle-in,s,1 still failed so falling back to context 'default'
[Nov 19 08:41:39] WARNING[22129]: pbx.c:4710 __ast_pbx_run: Channel 'Jingle/dm-eb6b' sent into invalid extension 's' in context 'default', but no invalid handler

May be this is because I compiled asterisk on 64-bit host ?- my desktop, ubuntu 9.10, amd64....

By: phsultan (phsultan) 2009-11-19 05:38:15.000-0600

No, I believe it's just because I messed with the code that loads the Asterisk modules, sorry. Can you download a fresh copy of the branch and try again?

By: sles (sles) 2009-11-19 06:23:39.000-0600

Thank you!

It works with empathy and g711 (at least when I call sip phone).
Unfortunately, call with psi fails:

CLI> [Nov 19 16:15:46] NOTICE[28395]: chan_jingle.c:811 jingle_new: Codec initialized to : SpeeX
   -- Executing [s@jingle-in:1] NoOp("Jingle/dm-78cf", "In jingle context") in new stack
   -- Executing [s@jingle-in:2] Dial("Jingle/dm-78cf", "SIP/6052") in new stack
 == Using UDPTL CoS mark 5
   -- Called 6052
[Nov 19 16:15:46] NOTICE[28395]: chan_jingle.c:1174 jingle_add_candidate: Processing candidate
[Nov 19 16:15:46] NOTICE[28395]: chan_jingle.c:1174 jingle_add_candidate: Processing candidate
[Nov 19 16:15:46] NOTICE[28395]: chan_jingle.c:1206 jingle_add_candidate: Candidates parsed
   -- SIP/6052-00000002 is ringing
[Nov 19 16:15:46] NOTICE[28513]: chan_jingle.c:1352 jingle_indicate: Don't know how to indicate condition '3'
[Nov 19 16:15:50] NOTICE[28513]: chan_jingle.c:1352 jingle_indicate: Don't know how to indicate condition '22'
   -- SIP/6052-00000002 answered Jingle/dm-78cf
[Nov 19 16:15:50] NOTICE[28513]: chan_jingle.c:1352 jingle_indicate: Don't know how to indicate condition '-1'
[Nov 19 16:15:50] NOTICE[28513]: chan_jingle.c:1352 jingle_indicate: Don't know how to indicate condition '20'


Is it possible to fix this?

Thank you very much!

By: ph (ph) 2009-12-10 02:34:48.000-0600

Tested with Empathy 2.28.1 !
Empathy can call asterisk (ulaw).
JabberSend works nice.
JABBER_RECEIVE works nice too.
Just one trouble when calling from asterisk to empathy : jingle capacities from empathy not detected.

By: Leif Madsen (lmadsen) 2010-01-07 11:15:34.000-0600

What is the next step on this issue? Is there a patch or a branch that I should reference here?

By: phsultan (phsultan) 2010-01-11 10:24:17.000-0600

Hi Leif,

I created a branch here : http://svn.digium.com/svn/asterisk/team/phsultan/jingle-support

I asked the community for help in testing it, without much feedback though : http://lists.digium.com/pipermail/asterisk-users/2009-November/241498.html

By: Leif Madsen (lmadsen) 2010-01-11 14:21:38.000-0600

Great thanks for the feedback! Any chance you could maybe ask again and see if we can get anyone to test? I'm marking this as Ready for Testing. You may also want to get this on reviewboard if you haven't already. Thanks!

By: sles (sles) 2010-01-19 01:05:14.000-0600

Hello! I can do more testings, but only if psi with it's speex will be supported- our users uses mainly psi/win32...

By: John Todd (jtodd) 2010-01-29 16:38:37.000-0600

Is this ready to go into TRUNK?  Looks interesting, but.... enough testing done yet?

By: phsultan (phsultan) 2010-02-04 09:05:08.000-0600

The following Jingle clients have been reported to work :
- Empathy 2.28.1
- Pidgin 2.6.2

Those clients run on Linux only if one wants to use their Jingle capabilities.

Psi 0.13 remains problematic. The Jingle sessions are properly established, but no sound available, most probably due to the way Asterisk and Psi handle SPEEX together.

I also asked for a code review here : https://reviewboard.asterisk.org/r/401/

I need to update the code according to Vadim's remarks who kindly reviewed the code. But last time I tried to, the reviewboard wouldn't accept my new diffs for some reason.

An interesting part of the code is that it implement RFC 5389 (new STUN), and gives an basic API to any RTP channels that would need to implement ICE, just like Jingle.

By: phsultan (phsultan) 2010-04-30 08:25:46

I just added the ability to place Jingle calls to the code branch. Tested with Pidgin.

By: phsultan (phsultan) 2010-04-30 08:55:39

I added a patch that applies to the jingle-support branch that solves the SPEEX compatibility issue between PSI and Asterisk.

The main problem is that PSI comes with 16 kHz SPEEX, whereas Asterisk handles 8 kHz. Now, from Asterisk, incoming 16 kHz SPEEX packets can be treated as 8 kHz, as SPEEX packets are properly separated in lower and higher bandwidths. This means that we don't need to modify anything in Asterisk SPEEX code to handle 16 kHz SPEEX packets.

The thing is that we still need to send 16 kHz SPEEX packets to PSI, and this is the purpose of this patch. Basically, we just need to set the SPEEX encoder to wideband mode, take 16 kHz samples and explicitly set the internal SPEEX sample rate to 16000.

This is just a hack. We need either a proper wideband SPEEX implementation or wait for PSI to come up with compatible codecs.

Tested with PSI 0.14 on a MAC OS 10.4 platform.

By: Leif Madsen (lmadsen) 2010-04-30 13:58:11

NICE! Good work here! How close are we to getting this ready for review? If you think you're done, please post to reviewboard and post the reviewboard link here.

By: yokonunz (yokonunz) 2010-05-02 06:11:29

i got a segfault using chan jingle:

May  2 13:06:08 server kernel: [8881959.390861] asterisk[24084]: segfault at b700e1d0 ip b700e1d0 sp b722ed4c error 4 in pbx_loopback.so[b7013000+2000]


May  1 15:51:06 server kernel: [8805457.693987] asterisk[24677]: segfault at 1340 ip b78781f0 sp b72efc50 error 4 in res_jabber.so[b7874000+f000]


thanks all

By: Leif Madsen (lmadsen) 2010-05-04 15:55:44

@yokonunz: if you're getting a segfault, please upload a backtrace per the instructions here: http://svn.asterisk.org/svn/asterisk/trunk/doc/backtrace.txt

By: yokonunz (yokonunz) 2010-05-08 02:34:51

@lmadsen i'll do this. thanks

By: Arie Skliarouk (skliarie) 2010-06-28 08:02:36

I compiled and installed the http://svn.digium.com/svn/asterisk/team/phsultan/jingle-support and still can not make pidgin 2.6.6 to establish voice connection to it. When I call the asterisk, pidgin shows "Calling..." and nothing happens.

Empathy version 2.30.1.1-0ubuntu1 (as packaged on ubuntu 10.04) can't even do Audio call as it is greyed out.

Find attached logs seen on asterisk when call arrives from pidgin client.

By: phsultan (phsultan) 2010-06-28 09:06:02

skliarie: Google's XMPP network does not let XMPP Jingle packets pass through. Please make your tests using your own XMPP server or another public XMPP network like jabber.org for example.

Thanks!

By: Arie Skliarouk (skliarie) 2010-06-29 07:35:11

Using asterisk 1:1.6.2.7-1 (as packaged in debian unstable) I was able to establish voice call using GTalk client and successfully talk. Note, that this did not work when I tried the "jingle-support" branch of the asterisk (GTalk established the call but nothing was heard).

Pidgin also works better with the stock asterisk as it establishes the call and prints "Call in progress.". No audio is heard though.

By: Arie Skliarouk (skliarie) 2010-08-18 10:49:52

The bug is in empathy as VoIP from GTalk windows client works properly with asterisk:
https://bugs.freedesktop.org/show_bug.cgi?id=29649

By: Leif Madsen (lmadsen) 2010-08-31 14:58:49

Should this issue be closed?

By: Danny Messano (drmessano) 2010-09-29 11:52:13

Any chance this will be reviewed soon?

By: Leif Madsen (lmadsen) 2010-10-04 12:33:38

This issue is now assigned to 1.8.0 and will be reviewed by someone at Digium over the coming couple of weeks.

By: Julius Schwartzenberg (z_god) 2010-10-17 12:20:13

The merge with 1.8 broke everything as far as I saw.

By: Dmitry Melekhov (slesru) 2011-06-16 00:33:46.269-0500

Hello!

Could you tell me current jingle status? As I see 1.8 is still not compatible with psimedia.
Are there any plans to implement this for 1.8?

Thank you!


By: Dmitry Melekhov (slesru) 2011-06-16 23:03:44.535-0500

btw, as I see here there even patches for this jingle branch which makes it really suitable for jingle here
http://psi-plus.com/wiki/doku.php/en:jingle_bots?s[]=asterisk

By: phsultan (phsultan) 2011-06-23 06:23:24.624-0500

Well, the Jingle branch has not been merged in 1.8, so it's still on its own and accessible there :
http://svn.digium.com/svn/asterisk/team/phsultan/jingle-support

I guess there are quite a few modifications in this branch that make it difficult to merge with the trunk, mostly the developements made on the STUN stack to update it to the current standard (RFC 5389).

I'd like to point out that Google made an annoucement saying they now support the Jingle standard, and will keep their version (GoogleTalk) for backward compatibility :
http://mail.jabber.org/pipermail/jingle/2011-June/001640.html

That means that both chan_gtalk and chan_jingle (well, the one from the developement branch) can be used to communicate with Google now.

By: Dmitry Melekhov (slesru) 2011-06-26 04:23:44.365-0500

Hello!

Yes, I know about google announcement, it means that jingle support now should get more priority :-)

Thank you!


By: Matt Jordan (mjordan) 2012-09-06 08:13:24.712-0500

Asterisk 10 now includes full wide band audio support.  This includes support for SPEEX.

Asterisk 11 introduced a new revamped channel driver for Jingle/Google Talk, chan_motif.

At this time, I do not feel that we will patch or otherwise change chan_gtalk or chan_jingle in earlier versions of Asterisk, nor will we add limited support for SPEEX in versions of Asterisk prior to 10.

If you have any problems with these features in the respective versions of Asterisk, please open a bug report against the specific feature in that version of Asterisk where the support was added.