Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-06 Thread Eric Wieling
Keep it as simple as you can. ​[test] exten => 12345678900,1,Noop( Set callER hangup handler CHANNEL(name)='${CHANNEL(name)}' SIPCALLID='${SIPCALLID}') same => n,Set(CHANNEL(hangup_handler_push)=test_caller_hangup,${EXTEN},1) same =>

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-06 Thread David P
FYI, we found that our peers don't hangup properly. But we would still like to know how to get the peer's hangup handler to fire upon peer hangup, because right now it corrupts our globals by firing after the caller's hangup handler. On Tue, Jun 5, 2018 at 5:40 PM, David P wrote: > FWIW, I

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
FWIW, I added the following after the Dial, and it doesn't appear in cli after peer hangup: same => n,NoOp(After Dial ${AddressToReachPeer}) I also tried putting 'g' before the 'b'. I also tried removing the context headers of the hangup handlers and predial handler, and just referring to those

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
This has been super-helpful, Eric. However, the handleHangupByPeer priorities below are still not run when the peer hangs-up. The last line in the cli when the peer hangs-up is still: Strict RTP learning complete - Locking on source address (Although sometimes there is also: Retransmission timeout

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread Eric Wieling
Don't use the _. pattern. Ever. The call has two channels so it needs two hangup handlers, something like this, though I've not tested it. [some_context] exten => _X.,1,Noop same => n,Set(CHANNEL(hangup_handler_push)=my_caller_hangup_handler) same => n,Dial(SIP/number@peer,b(pre_dial^s^1))

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
Thanks, Eric. I just tried a hangup handler, but it's showing a similar problem: When the peer hangs-up, the hangup handler is not invoked and the caller channel remains open. same => n(callPeer),Set(GLOBAL(Peer${IndexIntoPeers}CurrentCallsCount)=$[${PeerCurrentCallsCount} + 1]) same =>

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread Eric Wieling
Use hangup handlers, they work around the issues with the 'h' extension. On 06/05/2018 05:33 AM, David P wrote: Thanks, Anthony. I added both 'g' and 'F' options. Now, when the caller hangs-up, my cleanup code is run by both the caller channel and the peer channel, but I only want the caller

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
Thanks, Anthony. I added both 'g' and 'F' options. Now, when the caller hangs-up, my cleanup code is run by both the caller channel and the peer channel, but I only want the caller channel to do that. Also, when the peer hangs-up, there is no execution of the priorities following the Dial.

Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread Antony Stone
On Tuesday 05 June 2018 at 08:33:26, David P wrote: > We're using Asterisk 14.7.6 and I have a dialplan that ends like this: > > same => n,Dial(SIP/${EXTEN:0:4}@peer1) > same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH}) > same => n,Hangup() > > When peer1 hangsup, the priorities after the Dial

[asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
We're using Asterisk 14.7.6 and I have a dialplan that ends like this: same => n,Dial(SIP/${EXTEN:0:4}@peer1) same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH}) same => n,Hangup() When peer1 hangsup, the priorities after the Dial are executed fine. But when the caller hangsup during the Dial, the