[asterisk-users] Priority based softhangup

Steve Edwards asterisk.org at sedwards.com
Tue Mar 30 16:16:27 CDT 2010


Un-top-posting...

> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of mir 
> shahnawaz
>
> Can you please give me idea about Softhang.agi

On Tue, 30 Mar 2010, Danny Nicholas wrote:

> Simple code
> In PERL -
> -- agi header stuff --
> My ($pri, $callno) = @ARGV;
> -- read database to get priority of lowest active call, return $lowpri,
> $lowid --
> if ($pri > $lowpri) {
>   print STDOUT "exec softhangup $lowid\n";
>   -- AMI dial $callno --
>   }
> Else {
>   Print STDOUT "exec BACKGROUND congested message\n";
>   }
>
> You can find real examples on voip-info.org.

mir, please keep in mind the above is meant to "give you an idea," not 
intended as literal code.

You will save yourself a lot of frustration if you use an existing AGI 
"library" for your chosen language*. While conceptually simple, nobody 
gets the AGI protocol right the first time.

*) I write most of my AGIs in C because it is the language I know best and 
you can execute hundreds of AGIs written in C in the time it takes to load 
the Perl or PHP interpreter and parse your script.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list