Issues with Local Channel

Home » Asterisk Users » Issues with Local Channel
Asterisk Users 3 Comments


I don’t really understand how channel Local works. I need that asterisk initiate a call and get some data (DTMF).

So to do that I’ve created this dialplan :

; extensions.conf – the Asterisk dial plan

exten => 1,1,Verbose(Get User ID)
exten => 1,n,Dial(dahdi/1/99999999,120,G(read^1^1))
exten => 1,n,Hangup()

exten => 1,1,Hangup()
exten => 1,n,Read(data,play-msg,4,,2,15)
exten => 1,n,Verbose(“${data}”)
exten => 1,n,AGI(,${data})
exten => 1,n,Hangup()


Channel: Local/1@dtmf
Application: NoOp

I’ve create a file name and then move the call file to the dir /var/spool/asterisk/outgoing/. Some issues I’ve had, the option G, in the Dial function don’t wait the user answer the call to follow the dialplan. Is this rigth? Is this because I have used a Local Channel?
Are better way to do that?


S idarta Oliveira

3 thoughts on - Issues with Local Channel

  • Local channels behave like an endpoint. So instead of a sip phone
    picking up the call, asterisk is picking up the call.

    Instead of someone speaking into a sip phone, asterisk can play tracks,
    or record digits, etc.

    You need to make sure that the call does not end before you’re done with
    your local channel. Your current use is incorrect and your call is
    going to hang up before it does much of anything.

    Channel: Local/1@dtmf
    Application: NoOp

    This is guaranteed to not work… asterisk will spawn the local channel
    one one leg, lets call it the source leg, and it will run the
    application NoOp on the destination leg. The NoOp will run, there is
    then no more dialplan to run, so the call will be hung up.

    Also… using the G option to dial, is probably not what you want. You
    must think of a local channel as an end point.

    I’m not sure if this will get you exactly what you want, but it should
    get you further along the path.

    # destination dialplan
    exten => 1,1,Answer()
    exten => 1,n,Read(data,play-msg,4,,2,15)
    exten => 1,n,Verbose(“${data}”)
    exten => 1,n,AGI(,${data})
    exten => 1,n,Hangup()

  • Thanks Mark for your reply.

    I understand all you explained and I agree . All I want to do is abstract for my app how handle channels (DAHDI or SIP). That’s is the main reason, I try to use Local Channels and NoOp Application so the dial plan should do all the heavy work (channels avaliable).
    My app , in the first idea, will create the same call file.
    There is a better way to treat this issue?

    Until now, we use asterisk for routes call in our office. Now we are thinking in integrate asterisk with our app.

    Thanks once again!


    S idarta Oliveira

  • You can definitely use the local channel and dialplan combination to put
    all the work inside dialplan. See my second example on using a local
    channel on one side, and dialplan on the other.

    In your source leg (dialout) you can write up any logic for handling the
    call, you can dial out dahdi, or sip, or iax, or anything else. You can
    do db lookups or dialplan logic, or anything else that dialplan allows.