Reuse H Extension?

Home » Asterisk Users » Reuse H Extension?
Asterisk Users 9 Comments

I have 2 contexts, however both have the same h extension. Currently I am doing copy&paste for the h extension – is there a better way?
Can I somehow reference a h extension, so I have to create/modify it only once?

Thanks for any hint!

9 thoughts on - Reuse H Extension?

  • I do. I call the Hangup application in priority 1 so I can send calls there without needing to call it. Then the h extension goes to status,hangup,2.

    – Logan

  • 2012-09-29 11:32, Stefan at WPF skrev:

    Have you tried goto? I have some extensions that are related and I use goto to the main context from the others.


  • I don’t have it readily available, but it would be something like this

    exten => hangup,1,Hangup same => 2,NoOp(Hangup)
    ; do further processing here

    exten => 1234,1,Answer
    ; other priorities same => Goto(status,hangup,1) ; < - actually hangs up the channel exten => h,1,Goto(status,hangup,2) ; <- processes a channel not hung up by the dialplan

  • ; templates
    exten = h,1, verbose(1,[${EXTEN}@${CONTEXT}])
    exten = h,n, goto(settle-card,s,1)

    exten = i,1, verbose(1,[${EXTEN}@${CONTEXT}])
    exten = i,n, goto(${CONTEXT},s,1)

    exten = s,1, verbose(1,[${EXTEN}@${CONTEXT}])

    ; example1
    exten = s,2, blah-blah-blah()
    exten = s,n, hangup()

    ; example2
    exten = s,2, blah-blah-blah()
    exten = s,n, hangup()