Externalize your AGI Configuration
Using Spring Framework for AGI Mapping and Configuration
Using a dependency injection framework like the Spring Framework to exernalize your configuration is often a great enhancement for maintainance and deployment of your application.
If you are building an AGI application using Asterisk-Java the following code snippets will show you how do it.
<beans xmlns="..."> <bean id="agiServer" class="org.asteriskjava.fastagi.DefaultAgiServer" init-method="startup" destroy-method="shutdown"> <property name="mappingStrategy" ref="mappingStrategy" /> </bean> <bean id="mappingStrategy" class="org.asteriskjava.fastagi.SimpleMappingStrategy"> <property name="mappings"> <map> <entry key="hello.agi" value-ref="helloAgi" /> </map> </property> </bean> <bean id="helloAgi" class="HelloAgi"> <property name="voicePrompt" value="tt-monkeys" /> </bean> </beans>
Asterisk-Java 0.3 Milestone 2
Asterisk-Java 0.3 Milestone 2 has been released and is available from http://asterisk-java.org/download/0.3-m2.
Here is the Changelog:
Bug
- [AJ-47] - AGI does not support multi line data
- [AJ-48] - UserEvent does not work with Asterisk 1.4
- [AJ-51] - Problems with non-english locales
- [AJ-52] - Fix shutdown when using the live api
Improvement
- [AJ-41] - Add ability to get ManagerConnection from AsteriskServer
- [AJ-49] - Support socket read timeout
New Feature
- [AJ-35] - Support timestamp property on manager events
- [AJ-42] - Add support QueueSummary action to Queue manager interface
- [AJ-44] - Support PauseMonitor and UnpauseMonitor actions
- [AJ-45] - Support ZapRestart action
Task
- [AJ-53] - Refactor BaseAgiScript to extend AgiOperations and implement AgiScript so users can extend AgiOperation to provide their own add-on features
Documentation for 0.3-m2 is available at http://asterisk-java.org/0.3-m2/.
Asterisk-Java 0.3 Milestone 1
Asterisk-Java 0.3 Milestone 1 has been released and is available from http://asterisk-java.org/download/0.3-m1. The package name has been changed from net.sf.asterisk to org.asteriskjava and it makes use of Java 5 features so you need at least a JDK 1.5.
A whole bunch of new features has been added including support for SSL secured connections to the Manager API and the new org.asteriskjava.live package that handles call tracking and allows you to build applications like click2call very easily and without all the hassles involved in directly using the Manager API.
Here is the Changelog:
Bug
- [AJ-17] - call.getChannel() is null when using AsteriskManager.originateCall()
- [AJ-25] - Timing issue with ResourceBundleMappingStrategy
- [AJ-27] - ManagerReader Interrupt
- [AJ-31] - getParameter() Bug
- [AJ-32] - Incorrect usage of ConnectEvent
- [AJ-33] - no setter for the dnd field
- [AJ-34] - redirect action for 2 channels not works
- [AJ-36] - Bug with CommandAction: result is overwritten each time
- [AJ-37] - Default CompositeMappingStrategy doesn't honor fastagi-mapping.properties
- [AJ-39] - Missing property "callerId" on ExtensionStatusEvent
New Feature
- [AJ-28] - Add support for login with eventMask
- [AJ-29] - Add support for non-shared instances to ResourceBundleMappingStrategy and ClassNameMappingStrategy
Task
- [AJ-18] - Change to maven2
- [AJ-19] - Change package name to org.asteriskjava
- [AJ-26] - Fix @version javadoc tags which are broken since moving to svn
Documentation for 0.3-m1 is available at http://asterisk-java.org/0.3-m1/.
Asterisk-Java 0.3 will be released with the release of Asterisk 1.4.
Asterisk 1.4 beta released
Digium has released a first beta of Asterisk 1.4 which is scheduled for October.
It is available from http://www.asterisk.org.
Now its time to review the changes and see what finally made it into the new stable branch of Asterisk and adjust Asterisk-Java accordingly. I hope there won't be too much to add to Asterisk-Java as we already closely followed the development of Asterisk. If all goes well Asterisk-Java 0.3 should be available with full Asterisk 1.4 support short time after the final Asterisk 1.4 release.
Debugging Manager API
Start ngrep either on the Asterisk server or on the client:
ngrep -s 1500 port 5038 -T
A successful login results in output like this:
interface: eth1 (10.13.0.0/255.255.255.0) filter: (ip or ip6) and ( port 5038 ) #### T +7.653003 10.13.0.102:5038 -> 10.13.0.55:46779 [AP] Asterisk Call Manager/1.2.. ## T +0.113468 10.13.0.55:46779 -> 10.13.0.102:5038 [AP] action: Challenge..actionid: 29181730_0#..authtype: MD5.... ## T +0.000391 10.13.0.102:5038 -> 10.13.0.55:46779 [AP] Response: Success..ActionID: 29181730_0#..Challenge: 171465739.... ## T +0.036776 10.13.0.55:46779 -> 10.13.0.102:5038 [AP] action: Login..actionid: 29181730_1#..key: fdc46063e81c6c5ab84188698e0cb55b..authtype: MD5..username: manager.... # T +0.001271 10.13.0.102:5038 -> 10.13.0.55:46779 [AP] Response: Success.. #