Christian B
2006-Mar-10  09:29 UTC
[Asterisk-Users] Action after _caller_ has hungup(cmd Dial 'g'-option)
Hello! There's the "g"-option for the Dial-cmd that allows to execute the next extensions in the current context when the callee hangs up. I would need the same for a call where the caller hangs up, concretely i have to inform a agi-application of the end of a call. Does someone know a way to do this from the dialplan? thanks Christian
Benchev
2006-Mar-11  02:34 UTC
[Asterisk-Users] Action after _caller_ has hungup(cmd Dial 'g'-option)
> There's the "g"-option for the Dial-cmd that allows to execute the next > extensions in the current context when the callee hangs up. > > I would need the same for a call where the caller hangs up, concretely > i have to inform a agi-application of the end of a call. Does someone > know a way to do this from the dialplan?You could add after your agi-application a hangup section starting with "h": exten => _X.,n,AGI,agi-application.agi exten => h,1,Set(result=${DIALSTATUS}) exten => h,2,GotoIf($["${RESULT}" = "CANCEL" | "${RESULT}" = "NOANSWER" | "${RESULT}" = "BUSY" | "${RESULT}" = "CHANUNAVAIL" | "${RESULT}" = "CONGESTION" | "${RESULT}" = ""]?500:3) exten => h,3,Do_things exten => h,500,Congestion benchev
Julian J. M.
2006-Mar-11  02:54 UTC
[Asterisk-Users] Action after _caller_ has hungup(cmd Dial 'g'-option)
You can use DeadAGI.
exten => _X.,1,DeadAGI(agicall.agi,${EXTEN})
now in that AGI (pseudocode)
$exten=Get parameter 1
$dialstring="SIP/mytrunk/".$exten;
$res=$agi->dial($dialstring),
//If we used deadagi, if the _caller_ hangs up, the agi keep runing here
 $chres = $agi->channel_status();
$status=$chres['data'];
Here's a list of possible return values. If $status==6, then the
_callee_ hung up.
CLI> show agi channel status
 Usage: CHANNEL STATUS [<channelname>]
        Returns the status of the specified channel.
 If no channel name is given the returns the status of the
 current channel.  Return values:
  0 Channel is down and available
  1 Channel is down, but reserved
  2 Channel is off hook
  3 Digits (or equivalent) have been dialed
  4 Line is ringing
  5 Remote end is ringing
  6 Line is up
  7 Line is busy
---
Julian J. M.
On 3/10/06, Christian B <bencokakao@gmail.com>
wrote:> Hello!
>
> There's the "g"-option for the Dial-cmd that allows to
execute the next
> extensions in the current context when the callee hangs up.
>
> I would need the same for a call where the caller hangs up, concretely
> i have to inform a agi-application of the end of a call. Does someone
> know a way to do this from the dialplan?
>
> thanks
> Christian
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>