Dialplan-Action on Connection

Hello again,

I’m still working with Asterisk 1.4.42, but ran into a new problem. :neutral_face:

I want to activate an external device (via relay) for the duration a call / connection is active. So, someone is calling (ringing) nothing happens. The moment someone picks up the handset a connection is established (relay switches to on). For the duration the connection exists, the relay stays on. The moment the connections is destroyed the relay switches back to off.

Ringing --> nothing happens
handset off-hook --> relay on
during connection --> relay stays on
handset on-hook --> relay off

I tried to implement that with following dialplan:

exten => _X.,n(relay_connect), Verbose(Relay Connect Context)
exten => _X.,n,Dial(${PROTOCOL}/${EXTEN}@127.0.0.1:5062,${RINGTIME},kKtTG(relay_connect^s^1))

[relay_connect]
exten => s,1,Park()
exten => s,n,System(relay on)
exten => s,n,Wait(1)
exten => s,n,ParkedCall(701)

exten => h,1,System(relay off)

But that does not work. Any suggestions?

cheers’n’beers
Henning

That will stop when you park the call!

Don’t park the call!

hehe,

thanks david I solved that issue some time ago. :wink: