Please try this <div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">xten => s,2,ExecIf( 0EXISTS(${ARG3})=1 & 0${ARG3}=1|</span><br><br><div class="gmail_quote">On Fri, Oct 16, 2009 at 3:45 PM, Ishfaq Malik <span dir="ltr"><<a href="mailto:ish@pack-net.co.uk">ish@pack-net.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'm basically trying to make an argument optional in a macro, I'm<br>
starting to think it's not possible<br>
<br>
If I do this in my macro<br>
exten => s,2,ExecIf(EXISTS(${ARG3})=1 & ${ARG3}=1|<whatever I want to do><br>
<br>
I see this in the console<br>
Executing [s@macro-extcall:2] ExecIf("SIP/PACK501-08222428", "EXISTS()=1<br>
& =1|<whatever I want to do><br>
<br>
As I didn't pass a third argument.<br>
<br>
Essentially, what I'm trying to do in php terms would be this<br>
if(isset($var) && $var==1)<br>
<br>
Ish<br>
<div class="im"><br>
ABBAS SHAKEEL wrote:<br>
> Sorry its macro I called it a function.<br>
><br>
> This link will be helpful to you<br>
> <a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+variables" target="_blank">http://www.voip-info.org/wiki/index.php?page=Asterisk+variables</a><br>
><br>
><br>
> On Fri, Oct 16, 2009 at 3:13 PM, ABBAS SHAKEEL<br>
</div><div class="im">> <<a href="mailto:shakeel.abbas.qau@gmail.com">shakeel.abbas.qau@gmail.com</a> <mailto:<a href="mailto:shakeel.abbas.qau@gmail.com">shakeel.abbas.qau@gmail.com</a>>> wrote:<br>
><br>
> If you want to check in Console then NOOP can be used .<br>
> if in case of function call you can check its length if there<br>
> exists some thing<br>
><br>
><br>
> On Fri, Oct 16, 2009 at 3:04 PM, Ishfaq Malik <<a href="mailto:ish@pack-net.co.uk">ish@pack-net.co.uk</a><br>
</div><div><div></div><div class="h5">> <mailto:<a href="mailto:ish@pack-net.co.uk">ish@pack-net.co.uk</a>>> wrote:<br>
><br>
> Hi<br>
><br>
> Is there any way to check if a variable is set in asterisk?<br>
> I've had a<br>
> look around and can't find a purpose built function for it.<br>
><br>
> I'm going to be using it to see if an argument has been passed<br>
> with a<br>
> macro or not (e.g. see if ${ARG3} is set or not)<br>
><br>
> Thanks in advance<br>
><br>
> Ish<br>
> --<br>
> Ishfaq Malik<br>
> Software Developer<br>
> PackNet Ltd<br>
><br>
> Office: 0161 660 3062<br>
><br>
> _______________________________________________<br>
> -- Bandwidth and Colocation Provided by<br>
> <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona<br>
> Register Now: <a href="http://www.astricon.net" target="_blank">http://www.astricon.net</a><br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Best Regards<br>
> Shakeel Abbas<br>
><br>
><br>
><br>
><br>
> --<br>
> Best Regards<br>
> Shakeel Abbas<br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">><br>
> _______________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona<br>
> Register Now: <a href="http://www.astricon.net" target="_blank">http://www.astricon.net</a><br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
<br>
--<br>
Ishfaq Malik<br>
Software Developer<br>
PackNet Ltd<br>
<br>
Office: 0161 660 3062<br>
<br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
AstriCon 2009 - October 13 - 15 Phoenix, Arizona<br>
Register Now: <a href="http://www.astricon.net" target="_blank">http://www.astricon.net</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>Shakeel Abbas<br><br>
</div>