If you’re a frequent visitor to this blog, you had most probably already learned that over the past 5 years, my main Open Source passion is a project called Asterisk – The Open Source PBX. This section in the blog is dedicated to my thoughts about Asterisk, its current status, where is was, where it is and where it going to.
My aim is to share my thoughts, rants and desires about Asterisk, and especially, where I would like to see it going in the next 12, 18 and 24 months period of time.
Follow the links on the right for more information.
You must be logged in to post a comment.
Hello Sir,
I have a problem with the following code (took from your book). It
doesnot make a beep sound and takes ainput. I am using Zoiper soft
phone to test it with an IAX2 account.
$result = agi->get_data(“beep”, 3000, 20);
say_digits() also not working.
My code looks like…
1. #!/usr/bin/php -q
2. answer();
10.
11. $agi->stream_file(“demo-congrats”,”#”);
12. do
13. {
14. $agi->stream_file(“enter-some-digits”,”#”);
15. $result = $agi->get_data(‘beep’, 3000, 20);
$keys = $result['result'];
16.
17. $agi->stream_file(“you-entered”,”#”);
18. $agi->say_digits($keys);
19. } while($keys != ‘111′);
20. $agi->hangup();
21. ?>
asterisk out put….
— Accepting AUTHENTICATED call from 127.0.0.1:
> requested format = gsm,
> requested prefs = (),
> actual format = gsm,
> host prefs = (),
> priority = mine
— Executing [999@agitest:1] AGI(“IAX2/rajib-14434″, “hello.php”) in
new stack
— Launched AGI Script /var/lib/asterisk/agi-bin/hello.php
AGI Tx >> agi_request: hello.php
AGI Tx >> agi_channel: IAX2/rajib-14434
AGI Tx >> agi_language: en
AGI Tx >> agi_type: IAX2
AGI Tx >> agi_uniqueid: 1234947670.52
AGI Tx >> agi_version: 1.6.0.5
AGI Tx >> agi_callerid: unknown
AGI Tx >> agi_calleridname: rajib
AGI Tx >> agi_callingpres: 1
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 16
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 999
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: agitest
AGI Tx >> agi_extension: 999
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >> agi_threadid: -1217868912
AGI Tx >>
— AGI Script hello.php completed, returning 0
— Executing [999@agitest:2] Hangup(“IAX2/rajib-14434″, “”) in new stack
== Spawn extension (agitest, 999, 2) exited non-zero on ‘IAX2/rajib-14434′
— Hungup ‘IAX2/rajib-14434′
server configuration…..
Fedora core 8
asterisk server 1.6.0.5
phpagi-2.14
No other hardware is attached for PSTN line. I have tested the examples
with Zoiper.
Please help me out.
Thanks and Regards
Rajib Deka
rajib@excoflare.com
Hi Rajib,
Well, if you copy pasted your AGI script as is, you have a small mistake with your ANSWER directive.
1. #!/usr/bin/php -q
2. answer();
10.
11. $agi->stream_file(”demo-congrats”,”#”);
12. do
13. {
14. $agi->stream_file(”enter-some-digits”,”#”);
15. $result = $agi->get_data(’beep’, 3000, 20);
$keys = $result['result'];
16.
17. $agi->stream_file(”you-entered”,”#”);
18. $agi->say_digits($keys);
19. } while($keys != ‘111′);
20. $agi->hangup();
21. ?>
In addition, it would appear that you didn’t even construct the AGI object correctly. If you refer to page 105 of my book, you would notice that lines 3 through 7 are missing from your script.
Try also to increase your console debug level via the /etc/asterisk/logger.conf file, that may shed some more information in regards to what breaks your script.
Cheers,
Nir
Hi Sir,
thanks for your promptly response. I am a newbie to asterisk. I have a intel dual core pc with 1 GB ram. I have installed Asterisk 1.6.0.5 and configured with Zoiper Soft phone. I want to connect my PSTN line to it and some other phones to the extensions so, what hardware I need to attach PSTN line to my asterisk server. Please let me know.
Thanks and Regards
Rajib Deka