I think I can confidently say, after most of a day and reading the following....

https://stackoverflow.com/questions/66768885/why-doesnt-asterisk-17-catch-hangup-request-from-pjsip-client-solved
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+AGICommand_set+autohangup
https://community.freepbx.org/t/inbound-calls-dont-hang-up/53612
https://community.freepbx.org/t/pjsip-problem-channel-not-closing/65311/7
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_PJSIP_ENDPOINT
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Configuration_res_pjsip

... that Asterisk doesn't like mixing autoHangup with AGI, and there
appears to be no way of the ts-agi library I'm using knowing that it
has autoHungup, so it can't close the AGI connection which seems to
release Asterisk to hangup properly.

I had thought that the AGIEXITONHANGUP variable might help, but it
appears to do nothing, although I'm unsure if I'm setting it correctly
as:

Here it says the flag is "1"
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables

And here it says the flag is "yes"
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_AGI

That said, I wish I could use ARI not AGI but without the current
media offset available on ARI, I need AGI :)

So for now, the workaround is to forget about setting autohangup, and
just hangup the caller manually at the point they don't over-ride the
timeout.

Thanks!

On Wed, 26 May 2021 at 18:01, Joshua C. Colp <jc...@sangoma.com> wrote:
>
> On Wed, May 26, 2021 at 1:58 PM Jonathan H <lardconce...@gmail.com> wrote:
>>
>> I have also tried configuring pjsip wizard like this.
>>
>> endpoint/rtp_timeout=5
>>
>> And I see this shortly after the "hangup" command has been sent, so
>> that part is working:
>>
>> [May 26 17:36:37] NOTICE[1276]: res_pjsip_sdp_rtp.c:150
>> rtp_check_timeout: Disconnecting channel
>> 'PJSIP/fromvoipfone-206-0000000b' for lack of audio RTP activity in 5
>> seconds
>>
>> But, again, it doesn't disconnect. The line stays open. And yes, my
>> fallthrough after agi is
>>
>> same => n, Hangup()
>>
>> Also, apparently I now have a load of channels, which won't even hangup with
>>
>> channel request hangup all
>>
>> Requested Hangup on channel 'PJSIP/fromvoipfone-206-0000000b'
>> Requested Hangup on channel 'PJSIP/fromvoipfone-206-0000000a'
>> Requested Hangup on channel 'PJSIP/fromvoipfone-206-00000009'
>>
>> ...and wait.. and then...
>>
>> Channel              Location             State   Application(Data)
>> PJSIP/fromvoipfone-2 s@test:2             Up      AGI(agi://localhost:3456)
>> PJSIP/fromvoipfone-2 s@test:2             Up      AGI(agi://localhost:3456)
>> PJSIP/fromvoipfone-2 s@test:2             Up      AGI(agi://localhost:3456)
>> 3 active channels
>> 3 active calls
>>
>> So they just won't die.
>>
>> Asterisk 18.4.0 - worth filing a bug?
>
>
> Is your AGI closing the connection or are you expecting Asterisk to drop it? 
> (I'm not that familiar with FastAGI or AGI these days, just wondering what 
> happens if you drop the connection)
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to