[Gambas-user] Gambas AMI For PBX Asterisk

T Lee Davidson t.lee.davidson at gmail.com
Fri Apr 28 01:25:36 CEST 2023

On 4/26/23 16:19, Mayost Sharon wrote:
> Hello
> I tried to build a class for an ASTERISK AMI
> https://wiki.asterisk.org/wiki/display/AST/The+Asterisk+Manager+TCP+IP+API
> It works very well
> I tried it on my switchboard and it does the job well
> The class can be used freely by anyone who needs it
>    I will gladly accept comments on the code
> Thank you very much everyone

I don't know anything about ASTERISK AMI, so I cannot comment much on your code.

However, there a couple things I will mention.

When you are sending or receiving from an external source, you might want to use TRY so you can recover from any network errors. 
Line 95 in gbAmi.class is one example.

Also, in the Add method of _Action_Keys.class, you are relying on a valid gbAmi instance. You may wish to check if that 
reference is null before you use it.


More information about the User mailing list