#!/bin/bash context="from-internal" exten=6001 num=6002 bridge=$(asterisk -rx 'core show channels concise' | grep PJSIP/$exten | cut -d '!' -f13 ) channel=$(asterisk -rx 'core show channels concise' | grep $bridge | grep -v PJSIP/$exten- | cut -d '!' -f1) result=$(asterisk -rx "channel redirect $channel $context,$num,1") echo $result exit 0
nicely transfers a connected call to a given extension. I was wondering if it’s possible to modify this script so it will work for calls which are ringing and not yet connected? Thanks!!