<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="urn:jboss:bean-deployer:2.0">


	<bean name="SCTPManagement" class="org.mobicents.protocols.sctp.ManagementImpl">
		<constructor>
			<parameter>SCTPManagement</parameter>
		</constructor>
		<property name="persistDir">${jboss.server.data.dir}</property>
		<property name="singleThread">true</property>
		<property name="connectDelay">30000</property>
	</bean>

	<bean name="SCTPShellExecutor"
		class="org.mobicents.protocols.ss7.m3ua.impl.oam.SCTPShellExecutor">
		<property name="sctpManagement">
			<inject bean="SCTPManagement" />
		</property>
	</bean>	
	<!-- ==================================================================== -->
	<!-- M3UA -->
	<!-- M3UAManagement is managing the m3ua side commands -->
	<!-- ==================================================================== -->
	<!-- -->
	<bean name="Mtp3UserPart" class="org.mobicents.protocols.ss7.m3ua.impl.M3UAManagementImpl">
		<constructor>
			<parameter>Mtp3UserPart</parameter>
		</constructor>
		<property name="maxSequenceNumber">256</property>
		<property name="persistDir">${jboss.server.data.dir}</property>
		<property name="transportManagement">
			<inject bean="SCTPManagement" />
		</property>
	</bean>

	<bean name="M3UAShellExecutor"
		class="org.mobicents.protocols.ss7.m3ua.impl.oam.M3UAShellExecutor">
		<property name="m3uaManagement">
			<inject bean="Mtp3UserPart" />
		</property>
	</bean>
	
	<!-- ==================================================================== -->
	<!-- Scheduler -->
	<!-- Scheduler for ss7 stack -->
	<!-- ==================================================================== -->
	<!-- -->
	<bean name="SS7Clock" class="org.mobicents.protocols.ss7.scheduler.DefaultClock">
	</bean>

	<bean name="SS7Scheduler" class="org.mobicents.protocols.ss7.scheduler.Scheduler">
		<property name="clock">
			<inject bean="SS7Clock" />
		</property>
	</bean>	
	
	<!-- ==================================================================== -->
	<!-- Dialogic Mtp3UserPart -->
	<!-- ==================================================================== -->
	<!-- <bean name="Mtp3UserPart" class="org.mobicents.ss7.hardware.dialogic.DialogicMtp3UserPart"> 
		<property name="sourceModuleId">61</property> <property name="destinationModuleId">34</property> 
		</bean> -->

	<!-- ==================================================================== -->
	<!-- SCCP Service -->
	<!-- ==================================================================== -->
	<bean name="SccpStack" class="org.mobicents.protocols.ss7.sccp.impl.SccpStackImpl">
		<constructor>
			<parameter>SccpStack</parameter>
		</constructor>
		<property name="persistDir">${jboss.server.data.dir}</property>
		<property name="removeSpc">true</property>
		<property name="mtp3UserParts">
			<map keyClass="java.lang.Integer" valueClass="org.mobicents.protocols.ss7.mtp.Mtp3UserPart">
				<entry>
					<key>1</key>
					<value>
						<inject bean="Mtp3UserPart" />
					</value>
				</entry>
			</map>
		</property>
	</bean>

	<bean name="SccpExecutor"
		class="org.mobicents.protocols.ss7.sccp.impl.oam.SccpExecutor">
		<property name="sccpStack">
			<inject bean="SccpStack" />
		</property>
	</bean>

	<!-- ==================================================================== -->
	<!-- TCAP Service -->
	<!-- ==================================================================== -->
	<bean name="TcapStack" class="org.mobicents.protocols.ss7.tcap.TCAPStackImpl">
		<constructor>
                        <parameter>"TcapStack"</parameter>
			<parameter>
				<inject bean="SccpStack" property="sccpProvider" />
			</parameter>
			<parameter>8</parameter>
		</constructor>
		<property name="dialogIdleTimeout">60000</property>
		<property name="invokeTimeout">30000</property>
		<property name="maxDialogs">25000</property>
	</bean>

	<!-- ==================================================================== -->
	<!-- MAP Service -->
	<!-- ==================================================================== -->
	<bean name="MapStack" class="org.mobicents.protocols.ss7.map.MAPStackImpl">
		<constructor>
                        <parameter>"MAPStack"</parameter>
			<parameter>
				<inject bean="TcapStack" property="provider" />
			</parameter>
		</constructor>
	</bean>

	<!-- ==================================================================== -->
	<!-- Shell Service -->
	<!-- ==================================================================== -->
	<!-- Define Shell Executor -->
	<bean name="ShellExecutor" class="org.mobicents.ss7.management.console.ShellServer">
		<constructor>
			<parameter>
				<inject bean="SS7Scheduler" />
			</parameter>
			<parameter>
				<list class="javolution.util.FastList" elementClass="org.mobicents.ss7.management.console.ShellExecutor">
					<inject bean="SccpExecutor" />
					<inject bean="M3UAShellExecutor" />
					<inject bean="SCTPShellExecutor" />
					<inject bean="UssdShellExecutor" />
				</list>
			</parameter>
		</constructor>

		<property name="address">${jboss.bind.address}</property>
		<property name="port">3435</property>
	</bean>

	<!-- ==================================================================== -->
	<!-- Mobicents SS7 Service -->
	<!-- ==================================================================== -->
	<bean name="MAPSS7Service" class="org.mobicents.applications.ussd.bootstrap.SS7Service">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.ss7:service=SS7Service",exposedInterface=org.mobicents.applications.ussd.bootstrap.SS7ServiceMBean.class,registerDirectly=true)
		</annotation>
		<property name="jndiName">java:/mobicents/ss7/map</property>
		<property name="stack">
			<inject bean="MapStack" property="MAPProvider" />
		</property>
	</bean>
	
	<!-- ==================================================================== -->
	<!-- USSD -->
	<!-- UssdManagement is managing the all ussd server commands -->
	<!-- ==================================================================== -->
	<bean name="UssdManagement" class="org.mobicents.ussdgateway.UssdManagement">
		<constructor>
			<parameter>UssdManagement</parameter>
		</constructor>
		<property name="persistDir">${jboss.server.data.dir}</property>
	</bean>

	<bean name="UssdShellExecutor" class="org.mobicents.ussdgateway.UssdShellExecutor">
		<property name="ussdManagement">
			<inject bean="UssdManagement" />
		</property>
	</bean>	
</deployment>
