Asterisk 18.14.0 Vs 18.18.0 And Chan_console/chan_alsa

Home » Asterisk Users » Asterisk 18.14.0 Vs 18.18.0 And Chan_console/chan_alsa
Asterisk Users 23 Comments

Joshua

Asterisk 18.14.0 with chan_alsa and Console/dsp works. This does not work in 18.18.0 with chan_console enabled. I am on Ubuntu 20.04 LTS.

Is there a howto for the new chan_console ?
how can I get this working again ?
I am trying to just play audio on pulse audio.

Thanks,

Jerry

23 thoughts on - Asterisk 18.14.0 Vs 18.18.0 And Chan_console/chan_alsa

  • I’m not aware of one. The module itself has existed since at least Asterisk
    1.8

    I don’t have anything additional to add beyond what I’ve said and the config file I’ve provided.

  • I can say that with the default configuration file it would be Console/default though, and would use the system default input and output devices according to PortAudio.

  • Yes, because that lists the available devices. You have to configure it in console.conf in order to be able to dial it. If you haven’t configured a thing named “dmix” in console.conf, then it’s not going to work.

    “console list available” show available devices that you can use in the configuration
    “console list devices” show what is actually configured

  • ok switching to “Console/default” does show the text
    — <("<) --- Call to device 'default' on console from 'default' <2564286000> — (>”)> –

  • In the old days when I was using console/dsp, I would have to use alsamix from the console to verify that the output wasn’t muted.  Maybe it’s still the same.

    Doug

  • Some progress to report:

    I had to run asterisk as the user logged in – actually not even that. I
    could not “su user -c ” to that user – I had to run it as that user. Then I did a test and got audio! Great… But when I do a second test. Asterisk HANGS on ChanIsAvail()

    Then I thought lets SKIP that – and just let it do the Dial() – I stopped everything – got it running again. – and then the Dial() hangs on the second call.

    So both ChanIsAvail() or Dial() both hang on the second call in.

    So only 1 call in will work. Below is the CLI report of the call that works.

    This is my context
    [smvoice-mediacontroller-public-address]
    exten => s,1,ChanIsAvail(Console/default)
    exten => s,n,GotoIf($[“${AVAILCHAN}” = “”]?smvoice-busy,s,1)
    exten => s,n,Playback(beep)
    exten => s,n,Dial(Console/default)
    exten => s,n,Hangup

    Now what ???

    Jerry

    onnected to Asterisk 18.18.0 currently running on nuc11cdev2 (pid = 282195)
    == Using SIP RTP CoS mark 5
    > 0x7feeec0086b0 — Strict RTP learning after remote address set to:
    192.168.1.8:17526
    — Executing [public_address@smvoice-mediacontroller:1]
    SoftHangup(“SIP/devgeis_to_nuc11cdev2-00000000”, “ALSA/dummy”) in new stack
    — Executing [public_address@smvoice-mediacontroller:2]
    Goto(“SIP/devgeis_to_nuc11cdev2-00000000”,
    “smvoice-mediacontroller-public-address,s,1”) in new stack
    — Goto (smvoice-mediacontroller-public-address,s,1)
    — Executing [s@smvoice-mediacontroller-public-address:1]
    NoOp(“SIP/devgeis_to_nuc11cdev2-00000000”, “JERRY”) in new stack
    — Executing [s@smvoice-mediacontroller-public-address:2]
    Playback(“SIP/devgeis_to_nuc11cdev2-00000000”, “beep”) in new stack
    > 0x7feeec0086b0 — Strict RTP switching to RTP target address
    192.168.1.8:17526 as source
    Playing ‘beep.gsm’ (language
    ‘en’)
    — Executing [s@smvoice-mediacontroller-public-address:3]
    Dial(“SIP/devgeis_to_nuc11cdev2-00000000”, “Console/default”) in new stack
    — <("<) --- Call to device 'default' on console from 'MyName Here' <2564286000> — (>”)> –

  • Well this is a bummer….

    [Sep 8 08:45:28] WARNING[313684][C-00000001]: chan_console.c:651
    console_indicate: Don’t know how to display condition 26 on Console/default
    — <("<) --- Hangup on Console --- (>“)> –

  • So I have done through chan_console.c and searched for console_pct_lock() –
    every one – has a matching console_pvt_unlock()

    How is the deadlock occurring ?

    jerry

  • I don’t know if this will help you, but looking back through an old config I have for an older version of Asterisk, I had used chan_console with the old and now defunct app_rpt app to listen to audio on various nodes via the console for testing.

    Here is what I did:

    In console.conf, I defined this:
    [default]
    input_device = default output_device = default autoanswer = no context = extension =
    callerid =
    language = en overridecontext = no mohintrepret = default active = yes

    In modules.conf I loaded the audio module (in this case it was chan_alsa.so, but I also could use chan_oss.so). I made sure noload was commented out for chan_alsa.so

    In alsa.conf, I defined some of the same things as in console.conf:
    [general]
    autoanswer=no context=
    extension=

    inputdevice=plughw:0,1
    otuputdevice=plughw:0,0
    mute=true

    You’ll need to check your ALSA device to see what the input and output devices are.

    That last line is important, since on the console you may not have a mic that works to talk, you just want to listen,

    In extensions.conf, I defined a dialplan that instead of trying to dial out, it just answered the call and then threw me into the app.

    Then to dial from the console, I woudl use:
    console dial

    And it woudl use the context I defined and launch the Rpt app.

    What you could do is define somehting like this ,but have the extension use DISA so that you can then get dumped into your normal dialplan logic where you could use “console dial xxx”.

    No guarantees that this will work with a newer version of Asterisk, but this did work with a 1.8 setup I used to have (that I have the configs saved for).

    -Stacy

  • Is there a dial plan call that can “exit asterisk” or completely reload everything – killall active calls and start over ?

    seems the console/dummy (chan_console) is holding some resource. How do I
    just “exit” and start over after call came in ?

    Thanks

    Jerry

  • I have noticed that once my message speaks – the server thinks its done and HUNGUP, the endpoint STILL thinks the channel is active – the last message says
    “Rx: BYE” on sip show channels I tried ADDING to Dial() ,20,g and then had a Hangup after teh dial. Its NOT getting there to hangup.

    Jerry

  • So I tried this

    exten => s,1,Playback(beep)
    exten => s,n,Dial(Console/default,20,g)
    exten => s,n,Hangup exten => s,n,System(asterisk -rx ‘core restart now’)

    But it does not continue. Last thing I see is “Exited non zero”
    so its not doing the hangup or the system.

    jerry

  • It worked with my test. I’m on Asterisk 18.19.0

    — Executing [517xxxxxxx@voipms:4] System(“IAX2/voipms-15815”, “asterisk -rx ‘core restart now'”) in new stack
    — Remote UNIX connection Asterisk uncleanly ending (0). Executing last minute cleanups
    == Destroying musiconhold processes
    == Manager unregistered action DBGet
    == Manager unregistered action DBGetTree
    == Manager unregistered action DBPut
    == Manager unregistered action DBDel
    == Manager unregistered action DBDelTree Preparing for Asterisk restart… Asterisk is now restarting… asterisk*CLI>
    Disconnected from Asterisk server Asterisk cleanly ending (0). Executing last minute cleanups

    After a hung call, can you run core restart now from the asterisk console?

    Doug

  • Doing a “killall -9 asterisk” is the only thing that works I tried killall asterisk – does not free up the channel the asterisk “core restart now” takes like a good 20 seconds to return but does work.

    The issue is I cannot run it after teh Dial() as the Dial(Console/default,20,g) never returns to the dial plan.

    jerry

  • I have found that I can add the restart of asterisk (killall -9 asterisk)
    to the h extension- BOY is that UGLY.

    chan_console is not a testing device – how can we get this nasty bug fixed ?

    Jerry

  • Yes – this fix is working for me.

    Only issue I have now is, I used to run asterisk like this:
    su silentm -c “/usr/sbin/asterisk -fn”
    I also tried su silentm -l -c “/usr/sbin/asterisk -fn”

    these do not work for the chan_console. I have to actually login as silentm and then run asterisks – to HEAR the audio. doing su above I do not hear the audio – but the CLI looks the same – no errors.

    Thoughts?

    Jerry

  • SGVsbG8gSmVycnksCgp3aGVuIHlvdSBydW4gYXN0ZXJpc2sgdXNpbmcgc3UsIG93bmVyc2hpcCBv ZiBhdWRpbyBkZXZpY2UgZmlsZXMgZG9lcyBub3QgZ2V0IHVwZGF0ZWQuIFdoZW4geW91IGxvZ2lu LCB5b3UgZ2V0IHRoZSBwZXJtaXNzaW9ucy4gWW91IGNhbiB2ZXJpZnkgYnkgbHMgLWwgYW5kIGdl dGZhY2wgb24gdGhlIGRldmljZSBmaWxlLgoKTWFyZWsKCi0tLS0tLS0gT3JpZ2luYWwgTWVzc2Fn ZSAtLS0tLS0tCk9uIFRodXJzZGF5LCBTZXB0ZW1iZXIgMTR0aCwgMjAyMyBhdCAxNDozMywgSmVy cnkgR2VpcyA8amVycnkuZ2Vpc0BnbWFpbC5jb20+IHdyb3RlOgoKPiBPbiBXZWQsIFNlcCAxMywg MjAyMyBhdCA1OjIw4oCvUE0gSmVycnkgR2VpcyA8amVycnkuZ2Vpc0BnbWFpbC5jb20+IHdyb3Rl Ogo+Cj4+PkFuIGlzc3VlWzFdIHdhcyBhbHJlYWR5IGNyZWF0ZWQgYnkgYXN0ZXJpc2sgYXQgcGhy ZWFrbmV0Lm9yZyBhbmQgdGhleSBhbHNvIHB1dAo+Pj5hIGZpeCB1cCBmb3IgcmV2aWV3IGFuZCBp bmNsdXNpb25bMl0uCj4+Cj4+PlsxXSBodHRwczovL2dpdGh1Yi5jb20vYXN0ZXJpc2svYXN0ZXJp c2svaXNzdWVzLzMwOAo+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