[asterisk-users] Using SetVar with System() is it possible?

bruce bruce bruceb444 at gmail.com
Sat Jun 19 23:24:17 CDT 2010


I am using Asterisk v1.4.x

I have got php along with phpagi to report back using a system call within
php to asterisk -rx but it's buggy. For one thing php is hanging sometimes
and not returning anything.

Wondering if I can run search to see if a g.729 channel is up or not using
only the dial-plan. I want to get a TRUE or FALSE in a var for it.

I was pointed to GROUP_COUNT but that doesn't cut it for me in this case.

There is gotta be some simple dial-plan to find out if a trunk is being used
or if a g.729 call is going through or if a specific destination is being
dialed with first three digits being 789 (for example) as all of those
variables can help me move to next step which is to decide to place a second
call through the same trunk or not.

Any inputs?

Thanks a lot



On Sat, Jun 19, 2010 at 1:56 PM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>wrote:

> On Sat, Jun 19, 2010 at 10:58:17AM -0400, bruce bruce wrote:
> > Hi Guys,
> >
> > Is it possible to harvest the output of system into a SetVar(variable)?
> >
> > exten => s,n,SetVar(var=system(*asterisk -rx "sip show channels" | grep
> -c
> > "(ulaw)")*
>
> There's the function SHELL. Though I suspect you use 1.2 and I'm not
> sure if it was there already.
>
> Anyway, I'm the output of that command is so simple to parse.
>
> --
>               Tzafrir Cohen
> icq#16849755              jabber:tzafrir.cohen at xorcom.com<jabber%3Atzafrir.cohen at xorcom.com>
> +972-50-7952406           mailto:tzafrir.cohen at xorcom.com
> http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100620/7f74a8ce/attachment.htm 


More information about the asterisk-users mailing list