System() call

I wrote a simple dialplan context as shown below. It uses the System() call with wget and sed to fetch/process a small HTML page and to extract a phone number on the page. I manually executed the wget and sed on a console shell and it produced a clean phone number as expected. However, when I put them in a dialplan context, all I get is the status of the System() call and not the phone number. Can anyone please help?

I found the solution to this since my post above. I use SHELL() instead of System() as shown below.

Hi Maz why dont you use curl its native in the dialplan and a lot less load


Hi Ian, I can do that too. BTW, I thought curl is an external program that needs be installed first.

You do need curl installed, but should be leaner than a system call doing a wget and parsing the result


IC your point there. At the moment, I will just leave it as is since both the wget and sed on my Asterisk PBX system are already part of busybox.