Asterisk 11 And DAHDI/i4

Home » Asterisk Users » Asterisk 11 And DAHDI/i4
Asterisk Users 16 Comments

In 1.4.43 I would see things from “core show channels” like DAHDI/18/xxxxx for line 18

in Asterisk 11 its DAHDI/i4/xxxx

How do I get the line number back?

Jerry

16 thoughts on - Asterisk 11 And DAHDI/i4

  • This was a change in v1.8 and is documented in the v1.8 UPGRADE.txt file:

    * The PRI channels in chan_dahdi can no longer change the channel name if a
    different B channel is selected during call negotiation. To prevent using
    the channel name to infer what B channel a call is using and to avoid name
    collisions, the channel name format is changed.
    The new channel naming for PRI channels is:
    DAHDI/i/[:]-

    * Added CHANNEL(dahdi_span), CHANNEL(dahdi_channel), and CHANNEL(dahdi_type)
    so the dialplan can determine the B channel currently in use by the channel.
    Use CHANNEL(no_media_path) to determine if the channel even has a B channel.

    * Added AMI event DAHDIChannel to associate a DAHDI channel with an Asterisk
    channel so AMI applications can passively determine the B channel currently
    in use. Calls with “no-media” as the DAHDIChannel do not have an associated
    B channel. No-media calls are either on hold or call-waiting.

    Richard

  • ok – can I use a different method of doing my check to see if a line is available by using the AMI call ExtensionState or ChanIsAvail?

    Doing Action: ExtensionState Parameters: DAHDI/1

    says Error Message: Extension not specified

    and Action: Command Command: ChanIsAvail Parameters: DAHDI/1

    says Error No such command “ChanIsAvail”

    I’m clearly missing something?

    Jerry

  • It is Action: ExtensionState Exten: 5551212
    Context: fubar

    This will return the status of the dialplan exten hint.

    ChanIsAvail is a dialplan application not a CLI command. It also will not work for what you want in this case.

    Quite possibly. 🙂

    Richard

  • OK – so what I am trying to do is through the AMI interface ask if channel DAHDI/1 is busy, on hook or available.

    How do I tell that….

    In the past I simply did a “core show channels” and see if DAHDI/1 was present. It it was I new it was in use…

    How do check now in asterisk 11 if the channels are reported as DAHDI/i4
    etc…

    Thanks,

    Jerry

  • The “Asterisk 11” part is irrelevant. You need to use an AGI or “local call” to use the ChanIsAvail function.

    From: asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Jerry Geis Sent: Thursday, December 20, 2012 11:03 AM
    To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: Re: [asterisk-users] asterisk 11 and DAHDI/i4

    It is Action: ExtensionState Exten: 5551212
    Context: fubar

    This will return the status of the dialplan exten hint.

    ChanIsAvail is a dialplan application not a CLI command. It also will not work for what you want in this case.

    Quite possibly. 🙂

    Richard

    OK – so what I am trying to do is through the AMI interface ask if channel DAHDI/1 is busy, on hook or available.

    How do I tell that….

    In the past I simply did a “core show channels” and see if DAHDI/1 was present. It it was I new it was in use…

    How do check now in asterisk 11 if the channels are reported as DAHDI/i4
    etc…

    Thanks,

    Jerry

  • You should just cache the AMI DAHDIChannel event information in your program.

    If you really must you could use the CLI command “pri show channels”. However, it is not intended to be repeatedly run for performance reasons. It blocks processing of ISDN messages while it is running.

    Richard

  • I am not continually logged in to the AMI to catch those events…

    Can I make a call to a local channel, run some context+ extension, there call ChanIsAvail for the channel I am interested in –
    but they how do I get that info back to my C program?

    Also is that a big overhead?

    jerry

  • IMO the local channel call should be the lowest overhead option available.

    From: asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Jerry Geis Sent: Thursday, December 20, 2012 11:42 AM
    To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: Re: [asterisk-users] asterisk 11 and DAHDI/i4

    You should just cache the AMI DAHDIChannel event information in your program.

    If you really must you could use the CLI command “pri show channels”. However, it is not intended to be repeatedly run for performance reasons. It blocks processing of ISDN messages while it is running.

    I am not continually logged in to the AMI to catch those events…

    Can I make a call to a local channel, run some context+ extension, there call ChanIsAvail for the channel I am interested in –
    but they how do I get that info back to my C program?

    Also is that a big overhead?

    jerry

  • Whether the overhead is going to affect performance to be a problem depends on how often you execute the command.

    You can also use the AMI DAHDIShowChannels action. If the channel has a B channel it will be listed with which B channel it currently is attached.

    Richard

  • What about:

    Action: Command Command: dahdi show channels

    I can just look to see if “Extension” has anything for the Chan I am interested in?

    is that a big overhead and block anything?

    Jerry

  • Looks like the “dahdi show channels” does not work for me because if I
    make a call originating from a polycom phone going out a line (DAHDI/1) it is not reflected there. So I cannot tell the line is in use.

    It only shows a call as active if its an incoming call.

    Jerry

  • I have a little dialplan context now…

    [check-chanisavail]
    exten => s,1,ChanIsAvail(${agi_channel})
    exten => s,n,System(/bin/echo ${AVAILCHAN} > /tmp/${agi_file})
    exten => s,n,Hangup()

    and a call file:

    Channel: Local/s@check-chanisavail/n Context: check-chanisavail Extension: s Priority: 1
    SetVar: agi_file=jerry SetVar: agi_channel

  • Just for grins, do you have a softphone like xlite that you can try the outgoing call on? I think it’s an outgoing issue, not a polycom one.

    —–Original Message—

  • Ok so I was not able to get the actual line in use from “core show channels” anymore. So I thought I would bit the bullet and just monitor events since that seemed like the thing to do. After doing that I mad a call.

    Event: Newchannel Privilege: call,all Channel: DAHDI/i4/317XXXXXXX
    ChannelState: 1
    ChannelStateDesc: Rsrvd CallerIDNum:
    CallerIDName:
    AccountCode:
    Exten:
    Context: smvoice-incoming Uniqueid: 1356099673.5

    As you can see I still have the DAHDI/i4. How do I determine over AMI what the “actual” line in use is?

    I’m stuck.

    Jerry

  • As stated earlier, the event you are looking for to associate a DAHDI channel is:
    Event: DAHDIChannel Privilege: call,all Channel: DAHDI/i4/317XXXXXXX
    Uniqueid: 1356099673.5
    DAHDISpan: 4
    DAHDIChannel: 3

    Richard