[asterisk-dev] h extension not considered within a macro for Asterisk 1.6.0.6 and later

asterisk at ntplx.net asterisk at ntplx.net
Tue Apr 7 21:00:59 CDT 2009


I agree, it would be nice to have it consistant.
This was filed as a bug for 1.4 a few months ago.

http://bugs.digium.com/view.php?id=14122

-- 

Andrew Lindh



Quoting Alec Davis <sivad.a at paradise.net.nz>:

> Now that the documentation has changed for app_macro, removing the reference
> to the 'h' extension.
>
> app_macro will execute the 'h' extension from within the macro context if
> the call was answered.
> It doesn't execute the 'h' extension if the caller hungup before the call
> was answered, which is where our problems started.
>
> Agreed, switching to GOSUB fixes this. But shouldn't MACRO be consistant,
> either never or always, but not sometimes, execute the 'h' extension?
>
> FYI:
> The offending MACRO 'application' was using a MYSQL stored Proc, with a
> MYSQL Fetch within a While loop, which didn't close MYSQL connections if the
> caller hungup before the call was answered.
>
> ...
> exten => s,n,MYSQL(Connect connid localhost pbxtable pbxuser pbxpassword)
> exten => s,n,MYSQL(Query resultid ${connid} call
> pbx_dial('${CALLERID(num)}','${dialing}'))
> exten => s,n,MYSQL(Fetch fetchid ${resultid} type devices busy timeout)
>
> exten => s,n,While($[${fetchid}==1])
> exten => s,n,NoOp(type=${type} devices=${devices} busy=${busy}
> timeout=${timeout})
> exten => s,n,Dial(${devices},${timeout},r)
> exten => s,n,GotoIf($["${DIALSTATUS}"!="BUSY"]?fetchnext)
> exten => s,n,ExitWhile()
> exten => s,n(fetchnext),MYSQL(Fetch fetchid ${resultid} type devices busy
> timeout)
> exten => s,n,EndWhile()
> ...
>
> exten => h,1,NoOp(== hangup dialstatus=${DIALSTATUS} ==)
> exten => h,n,MYSQL(Clear ${resultid})
> exten => h,n,MYSQL(Disconnect ${connid})
>
>
> Alec
>
>
> -----Original Message-----
> From: asterisk-dev-bounces at lists.digium.com
> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Tilghman Lesher
> Sent: Wednesday, 8 April 2009 10:12 a.m.
> To: Asterisk Developers Mailing List
> Subject: Re:
> [asterisk-dev]=?ansi_x3.4-1968?q?h_extension_not_considered_with?==?ansi_x3.
> 4-1968?q?in_a_macro=09for_Asterisk_1=2E6=2E0=2E6_and_lat?==?ansi_x3.4-1968?q
> ?er?=
>
> On Tuesday 07 April 2009 14:35:25 Alec Davis wrote:
>> But is GOSUB going to stay that way? Or is it also considered a BUG
>> that works, and has yet to be fixed.
>
> No, that's the intended behavior of Gosub.  It should not change.
>
>> Please read carefully the output from 'core show application macro',
>> if the help is wrong, please correct it.
>
> Someone changed the documentation to match the buggy behavior:
> http://bugs.digium.com/view.php?id=9337
>
> I'll change it back now.
>
> --
> Tilghman
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>






More information about the asterisk-dev mailing list