[asterisk-users] retry loop in ansible ?

Axel Rau Axel.Rau at Chaos1.DE
Mon Jan 8 12:43:30 CST 2024


Hi,

> Am 08.01.2024 um 18:16 schrieb C. Maj <chris at PenguinPBX.com>:
> 
> On 12/6/23 02:08, Axel Rau wrote:
>> I have a simple config with some phones ringing simultaneously.
>> Some of them are softphones (zoiper apps on iPhone w/o push notification).
>> If such an app did bot register in time, it has no chance to pick up the call.
>> If I could configure a retry loop checking for registered candidates,
>> say once a second until one phone takes the call, this would allow me
>> to pick up the call with zoiper app registered late.
>> How could this be done in ansible?
> 
> Did you mean asterisk ?
Yes. 
> 
> If so, then you might look into the While()/EndWhile() applications, combined with timeouts to Dial() application, starting with something very basic such as the following:
> 
> same = n,Set(tries=0)
> same = n,While($[${INC(tries)}<99])
> same = n,Set(PUSH(team,&)=${PJSIP_DIAL_CONTACTS(1234)})
> same = n,Set(PUSH(team,&)=${PJSIP_DIAL_CONTACTS(5678)})
> same = n,Dial(${team},10)
> same = n,Wait(1)
> same = n,EndWhile()
> 
> ...at most that would be 11 seconds in between registration of x5678 and the next time it gets called when x1234 is not answering.
Thanks a lot for this example.

> 
> Other approaches might involve Queue()'s with some ChannelRedirect()'s or even Bridge()'s, maybe AGI/ARI, etc.
> 
> BTW the Asterisk Forums are a great place to post these kinds of questions in the future: https://community.asterisk.org

I will try this in the future,

Regards, Axel
—
PGP-Key: CDE74120  ☀ mobile: +49 160 7568212
computing @ chaos claudius

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20240108/707beda3/attachment.html>


More information about the asterisk-users mailing list