/protocols/ss7/map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Server.java

http://mobicents.googlecode.com/ · Java · 515 lines · 242 code · 62 blank · 211 comment · 8 complexity · b8a9bb578c8958d6fb1f86b34fd11758 MD5 · raw file

  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual
  4. * contributors as indicated by the @authors tag. All rights reserved.
  5. * See the copyright.txt in the distribution for a full listing
  6. * of individual contributors.
  7. *
  8. * This copyrighted material is made available to anyone wishing to use,
  9. * modify, copy, or redistribute it subject to the terms and conditions
  10. * of the GNU General Public License, v. 2.0.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License,
  18. * v. 2.0 along with this distribution; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  20. * MA 02110-1301, USA.
  21. */
  22. package org.mobicents.protocols.ss7.map.load;
  23. import org.apache.log4j.Logger;
  24. import org.mobicents.protocols.sctp.ManagementImpl;
  25. import org.mobicents.protocols.ss7.m3ua.ExchangeType;
  26. import org.mobicents.protocols.ss7.m3ua.Functionality;
  27. import org.mobicents.protocols.ss7.m3ua.IPSPType;
  28. import org.mobicents.protocols.ss7.m3ua.impl.As;
  29. import org.mobicents.protocols.ss7.m3ua.impl.Asp;
  30. import org.mobicents.protocols.ss7.m3ua.impl.AspFactory;
  31. import org.mobicents.protocols.ss7.m3ua.impl.M3UAManagement;
  32. import org.mobicents.protocols.ss7.m3ua.parameter.RoutingContext;
  33. import org.mobicents.protocols.ss7.m3ua.parameter.TrafficModeType;
  34. import org.mobicents.protocols.ss7.map.MAPStackImpl;
  35. import org.mobicents.protocols.ss7.map.api.MAPDialog;
  36. import org.mobicents.protocols.ss7.map.api.MAPException;
  37. import org.mobicents.protocols.ss7.map.api.MAPProvider;
  38. import org.mobicents.protocols.ss7.map.api.dialog.MAPAbortProviderReason;
  39. import org.mobicents.protocols.ss7.map.api.dialog.MAPAbortSource;
  40. import org.mobicents.protocols.ss7.map.api.dialog.MAPNoticeProblemDiagnostic;
  41. import org.mobicents.protocols.ss7.map.api.dialog.MAPProviderError;
  42. import org.mobicents.protocols.ss7.map.api.dialog.MAPRefuseReason;
  43. import org.mobicents.protocols.ss7.map.api.dialog.MAPUserAbortChoice;
  44. import org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage;
  45. import org.mobicents.protocols.ss7.map.api.primitives.AddressNature;
  46. import org.mobicents.protocols.ss7.map.api.primitives.AddressString;
  47. import org.mobicents.protocols.ss7.map.api.primitives.IMSI;
  48. import org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString;
  49. import org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer;
  50. import org.mobicents.protocols.ss7.map.api.primitives.NumberingPlan;
  51. import org.mobicents.protocols.ss7.map.api.primitives.USSDString;
  52. import org.mobicents.protocols.ss7.map.api.service.supplementary.MAPDialogSupplementary;
  53. import org.mobicents.protocols.ss7.map.api.service.supplementary.ProcessUnstructuredSSRequestIndication;
  54. import org.mobicents.protocols.ss7.map.api.service.supplementary.ProcessUnstructuredSSResponseIndication;
  55. import org.mobicents.protocols.ss7.map.api.service.supplementary.UnstructuredSSNotifyRequestIndication;
  56. import org.mobicents.protocols.ss7.map.api.service.supplementary.UnstructuredSSNotifyResponseIndication;
  57. import org.mobicents.protocols.ss7.map.api.service.supplementary.UnstructuredSSRequestIndication;
  58. import org.mobicents.protocols.ss7.map.api.service.supplementary.UnstructuredSSResponseIndication;
  59. import org.mobicents.protocols.ss7.sccp.impl.RemoteSignalingPointCode;
  60. import org.mobicents.protocols.ss7.sccp.impl.RemoteSubSystem;
  61. import org.mobicents.protocols.ss7.sccp.impl.SccpResource;
  62. import org.mobicents.protocols.ss7.sccp.impl.SccpStackImpl;
  63. import org.mobicents.protocols.ss7.tcap.asn.ApplicationContextName;
  64. import org.mobicents.protocols.ss7.tcap.asn.comp.Problem;
  65. /**
  66. * @author amit bhayani
  67. *
  68. */
  69. public class Server extends TestHarness {
  70. private static Logger logger = Logger.getLogger(Server.class);
  71. // MAP
  72. private MAPStackImpl mapStack;
  73. private MAPProvider mapProvider;
  74. // SCCP
  75. private SccpStackImpl sccpStack;
  76. private SccpResource sccpResource;
  77. // M3UA
  78. private M3UAManagement serverM3UAMgmt;
  79. // SCTP
  80. private ManagementImpl sctpManagement;
  81. protected void initializeStack() throws Exception {
  82. this.initSCTP();
  83. // Initialize M3UA first
  84. this.initM3UA();
  85. // Initialize SCCP
  86. this.initSCCP();
  87. // Initialize MAP
  88. this.initMAP();
  89. // 7. Start ASP
  90. serverM3UAMgmt.startAsp("RASP1");
  91. }
  92. private void initSCTP() throws Exception {
  93. this.sctpManagement = new ManagementImpl("Server");
  94. this.sctpManagement.setSingleThread(true);
  95. this.sctpManagement.setConnectDelay(10000);
  96. this.sctpManagement.start();
  97. // 1. Create SCTP Server
  98. sctpManagement.addServer(SERVER_NAME, SERVER_IP, SERVER_PORT);
  99. // 2. Create SCTP Server Association
  100. sctpManagement.addServerAssociation(CLIENT_IP, CLIENT_PORT, SERVER_NAME, SERVER_ASSOCIATION_NAME);
  101. // 3. Start Server
  102. sctpManagement.startServer(SERVER_NAME);
  103. }
  104. private void initM3UA() throws Exception {
  105. this.serverM3UAMgmt = new M3UAManagement("Server");
  106. this.serverM3UAMgmt.setTransportManagement(this.sctpManagement);
  107. this.serverM3UAMgmt.start();
  108. // Step 1 : Create App Server
  109. RoutingContext rc = factory.createRoutingContext(new long[] { 100l });
  110. TrafficModeType trafficModeType = factory.createTrafficModeType(TrafficModeType.Loadshare);
  111. As as = this.serverM3UAMgmt.createAs("RAS1", Functionality.SGW, ExchangeType.SE, IPSPType.CLIENT, rc, trafficModeType, null);
  112. // Step 2 : Create ASP
  113. AspFactory aspFactor = this.serverM3UAMgmt.createAspFactory("RASP1", SERVER_ASSOCIATION_NAME);
  114. // Step3 : Assign ASP to AS
  115. Asp asp = this.serverM3UAMgmt.assignAspToAs("RAS1", "RASP1");
  116. // Step 4: Add Route. Remote point code is 2
  117. this.serverM3UAMgmt.addRoute(CLIENT_SPC, -1, -1, "RAS1");
  118. }
  119. private void initSCCP() {
  120. this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
  121. this.sccpStack.setLocalSpc(SERVET_SPC);
  122. this.sccpStack.setNi(NETWORK_INDICATOR);
  123. this.sccpStack.setMtp3UserPart(this.serverM3UAMgmt);
  124. this.sccpStack.start();
  125. // Clean orevious resources if present
  126. // this.sccpResource = new SccpResource();
  127. // this.sccpResource.start();
  128. //
  129. // this.sccpStack.setSccpResource(this.sccpResource);
  130. RemoteSignalingPointCode rspc = new RemoteSignalingPointCode(CLIENT_SPC, 0, 0);
  131. RemoteSubSystem rss = new RemoteSubSystem(CLIENT_SPC, SSN, 0);
  132. this.sccpStack.getSccpResource().addRemoteSpc(0, rspc);
  133. this.sccpStack.getSccpResource().addRemoteSsn(0, rss);
  134. }
  135. private void initMAP() {
  136. this.mapStack = new MAPStackImpl(this.sccpStack.getSccpProvider(), SSN);
  137. this.mapProvider = this.mapStack.getMAPProvider();
  138. this.mapProvider.addMAPDialogListener(this);
  139. this.mapProvider.getMAPServiceSupplementary().addMAPServiceListener(this);
  140. this.mapProvider.getMAPServiceSupplementary().acivate();
  141. this.mapStack.start();
  142. }
  143. /*
  144. * (non-Javadoc)
  145. *
  146. * @see
  147. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogDelimiter
  148. * (org.mobicents.protocols.ss7.map.api.MAPDialog)
  149. */
  150. @Override
  151. public void onDialogDelimiter(MAPDialog mapDialog) {
  152. if (logger.isDebugEnabled()) {
  153. logger.debug(String.format("onDialogDelimiter for DialogId=%d", mapDialog.getDialogId()));
  154. }
  155. }
  156. /*
  157. * (non-Javadoc)
  158. *
  159. * @see
  160. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogRequest
  161. * (org.mobicents.protocols.ss7.map.api.MAPDialog,
  162. * org.mobicents.protocols.ss7.map.api.primitives.AddressString,
  163. * org.mobicents.protocols.ss7.map.api.primitives.AddressString,
  164. * org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer)
  165. */
  166. @Override
  167. public void onDialogRequest(MAPDialog mapDialog, AddressString destReference, AddressString origReference, MAPExtensionContainer extensionContainer) {
  168. if (logger.isDebugEnabled()) {
  169. logger.debug(String.format("onDialogRequest for DialogId=%d DestinationReference=%s OriginReference=%s MAPExtensionContainer=%s",
  170. mapDialog.getDialogId(), destReference, origReference, extensionContainer));
  171. }
  172. }
  173. @Override
  174. public void onDialogRequestEricsson(MAPDialog mapDialog, AddressString destReference, AddressString origReference, IMSI imsi, AddressString vlr) {
  175. if (logger.isDebugEnabled()) {
  176. logger.debug(String.format("onDialogRequest for DialogId=%d DestinationReference=%s OriginReference=%s ", mapDialog.getDialogId(), destReference,
  177. origReference));
  178. }
  179. }
  180. /*
  181. * (non-Javadoc)
  182. *
  183. * @see
  184. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogAccept(
  185. * org.mobicents.protocols.ss7.map.api.MAPDialog,
  186. * org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer)
  187. */
  188. @Override
  189. public void onDialogAccept(MAPDialog mapDialog, MAPExtensionContainer extensionContainer) {
  190. if (logger.isDebugEnabled()) {
  191. logger.debug(String.format("onDialogAccept for DialogId=%d MAPExtensionContainer=%s", mapDialog.getDialogId(), extensionContainer));
  192. }
  193. }
  194. /*
  195. * (non-Javadoc)
  196. *
  197. * @see
  198. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogReject(
  199. * org.mobicents.protocols.ss7.map.api.MAPDialog,
  200. * org.mobicents.protocols.ss7.map.api.dialog.MAPRefuseReason,
  201. * org.mobicents.protocols.ss7.map.api.dialog.MAPProviderError,
  202. * org.mobicents.protocols.ss7.tcap.asn.ApplicationContextName,
  203. * org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer)
  204. */
  205. @Override
  206. public void onDialogReject(MAPDialog mapDialog, MAPRefuseReason refuseReason, MAPProviderError providerError,
  207. ApplicationContextName alternativeApplicationContext, MAPExtensionContainer extensionContainer) {
  208. logger.error(String.format("onDialogReject for DialogId=%d MAPRefuseReason=%s MAPProviderError=%s ApplicationContextName=%s MAPExtensionContainer=%s",
  209. mapDialog.getDialogId(), refuseReason, providerError, alternativeApplicationContext, extensionContainer));
  210. }
  211. /*
  212. * (non-Javadoc)
  213. *
  214. * @see
  215. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogUserAbort
  216. * (org.mobicents.protocols.ss7.map.api.MAPDialog,
  217. * org.mobicents.protocols.ss7.map.api.dialog.MAPUserAbortChoice,
  218. * org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer)
  219. */
  220. @Override
  221. public void onDialogUserAbort(MAPDialog mapDialog, MAPUserAbortChoice userReason, MAPExtensionContainer extensionContainer) {
  222. logger.error(String.format("onDialogUserAbort for DialogId=%d MAPUserAbortChoice=%s MAPExtensionContainer=%s", mapDialog.getDialogId(), userReason,
  223. extensionContainer));
  224. }
  225. /*
  226. * (non-Javadoc)
  227. *
  228. * @see
  229. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogProviderAbort
  230. * (org.mobicents.protocols.ss7.map.api.MAPDialog,
  231. * org.mobicents.protocols.ss7.map.api.dialog.MAPAbortProviderReason,
  232. * org.mobicents.protocols.ss7.map.api.dialog.MAPAbortSource,
  233. * org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer)
  234. */
  235. @Override
  236. public void onDialogProviderAbort(MAPDialog mapDialog, MAPAbortProviderReason abortProviderReason, MAPAbortSource abortSource,
  237. MAPExtensionContainer extensionContainer) {
  238. logger.error(String.format("onDialogProviderAbort for DialogId=%d MAPAbortProviderReason=%s MAPAbortSource=%s MAPExtensionContainer=%s",
  239. mapDialog.getDialogId(), abortProviderReason, abortSource, extensionContainer));
  240. }
  241. /*
  242. * (non-Javadoc)
  243. *
  244. * @see
  245. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogClose(org
  246. * .mobicents.protocols.ss7.map.api.MAPDialog)
  247. */
  248. @Override
  249. public void onDialogClose(MAPDialog mapDialog) {
  250. if (logger.isDebugEnabled()) {
  251. logger.debug(String.format("DialogClose for Dialog=%d", mapDialog.getDialogId()));
  252. }
  253. }
  254. /*
  255. * (non-Javadoc)
  256. *
  257. * @see
  258. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogNotice(
  259. * org.mobicents.protocols.ss7.map.api.MAPDialog,
  260. * org.mobicents.protocols.ss7.map.api.dialog.MAPNoticeProblemDiagnostic)
  261. */
  262. @Override
  263. public void onDialogNotice(MAPDialog mapDialog, MAPNoticeProblemDiagnostic noticeProblemDiagnostic) {
  264. logger.error(String.format("onDialogNotice for DialogId=%d MAPNoticeProblemDiagnostic=%s ", mapDialog.getDialogId(), noticeProblemDiagnostic));
  265. }
  266. /*
  267. * (non-Javadoc)
  268. *
  269. * @see
  270. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogResease
  271. * (org.mobicents.protocols.ss7.map.api.MAPDialog)
  272. */
  273. @Override
  274. public void onDialogResease(MAPDialog mapDialog) {
  275. if (logger.isDebugEnabled()) {
  276. logger.debug(String.format("onDialogResease for DialogId=%d", mapDialog.getDialogId()));
  277. }
  278. }
  279. /*
  280. * (non-Javadoc)
  281. *
  282. * @see
  283. * org.mobicents.protocols.ss7.map.api.MAPDialogListener#onDialogTimeout
  284. * (org.mobicents.protocols.ss7.map.api.MAPDialog)
  285. */
  286. @Override
  287. public void onDialogTimeout(MAPDialog mapDialog) {
  288. logger.error(String.format("onDialogTimeout for DialogId=%d", mapDialog.getDialogId()));
  289. }
  290. /*
  291. * (non-Javadoc)
  292. *
  293. * @see org.mobicents.protocols.ss7.map.api.service.supplementary.
  294. * MAPServiceSupplementaryListener
  295. * #onProcessUnstructuredSSRequestIndication(org
  296. * .mobicents.protocols.ss7.map.
  297. * api.service.supplementary.ProcessUnstructuredSSRequestIndication)
  298. */
  299. @Override
  300. public void onProcessUnstructuredSSRequestIndication(ProcessUnstructuredSSRequestIndication procUnstrReqInd) {
  301. if (logger.isDebugEnabled()) {
  302. logger.debug(String.format("onProcessUnstructuredSSRequestIndication for DialogId=%d", procUnstrReqInd.getMAPDialog().getDialogId()));
  303. }
  304. try {
  305. long invokeId = procUnstrReqInd.getInvokeId();
  306. USSDString ussdStrObj = this.mapProvider.getMAPParameterFactory().createUSSDString(
  307. "USSD String : Hello World <CR> 1. Balance <CR> 2. Texts Remaining");
  308. byte ussdDataCodingScheme = (byte) 0x0F;
  309. MAPDialogSupplementary dialog = procUnstrReqInd.getMAPDialog();
  310. dialog.setUserObject(invokeId);
  311. ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number,
  312. NumberingPlan.ISDN, "31628838002");
  313. dialog.addUnstructuredSSRequest(ussdDataCodingScheme, ussdStrObj, null, msisdn);
  314. dialog.send();
  315. } catch (MAPException e) {
  316. logger.error("Error while sending UnstructuredSSRequest ", e);
  317. }
  318. }
  319. /*
  320. * (non-Javadoc)
  321. *
  322. * @see org.mobicents.protocols.ss7.map.api.service.supplementary.
  323. * MAPServiceSupplementaryListener
  324. * #onProcessUnstructuredSSResponseIndication(
  325. * org.mobicents.protocols.ss7.map
  326. * .api.service.supplementary.ProcessUnstructuredSSResponseIndication)
  327. */
  328. @Override
  329. public void onProcessUnstructuredSSResponseIndication(ProcessUnstructuredSSResponseIndication procUnstrResInd) {
  330. // Server shouldn't be getting ProcessUnstructuredSSResponseIndication
  331. logger.error(String.format("onProcessUnstructuredSSResponseIndication for Dialog=%d and invokeId=%d", procUnstrResInd.getMAPDialog().getDialogId(),
  332. procUnstrResInd.getInvokeId()));
  333. }
  334. /*
  335. * (non-Javadoc)
  336. *
  337. * @see org.mobicents.protocols.ss7.map.api.service.supplementary.
  338. * MAPServiceSupplementaryListener
  339. * #onUnstructuredSSRequestIndication(org.mobicents
  340. * .protocols.ss7.map.api.service
  341. * .supplementary.UnstructuredSSRequestIndication)
  342. */
  343. @Override
  344. public void onUnstructuredSSRequestIndication(UnstructuredSSRequestIndication unstrReqInd) {
  345. // Server shouldn't be getting UnstructuredSSRequestIndication
  346. logger.error(String.format("onUnstructuredSSRequestIndication for Dialog=%d and invokeId=%d", unstrReqInd.getMAPDialog().getDialogId(),
  347. unstrReqInd.getInvokeId()));
  348. }
  349. /*
  350. * (non-Javadoc)
  351. *
  352. * @see org.mobicents.protocols.ss7.map.api.service.supplementary.
  353. * MAPServiceSupplementaryListener
  354. * #onUnstructuredSSResponseIndication(org.mobicents
  355. * .protocols.ss7.map.api.service
  356. * .supplementary.UnstructuredSSResponseIndication)
  357. */
  358. @Override
  359. public void onUnstructuredSSResponseIndication(UnstructuredSSResponseIndication unstrResInd) {
  360. if (logger.isDebugEnabled()) {
  361. logger.debug(String.format("onUnstructuredSSResponseIndication for DialogId=%d", unstrResInd.getMAPDialog().getDialogId()));
  362. }
  363. try {
  364. USSDString ussdStrObj = this.mapProvider.getMAPParameterFactory().createUSSDString("Your balance is 500");
  365. byte ussdDataCodingScheme = (byte) 0x0F;
  366. MAPDialogSupplementary dialog = unstrResInd.getMAPDialog();
  367. AddressString msisdn = this.mapProvider.getMAPParameterFactory().createAddressString(AddressNature.international_number, NumberingPlan.ISDN,
  368. "31628838002");
  369. dialog.addProcessUnstructuredSSResponse(((Long) dialog.getUserObject()).longValue(), ussdDataCodingScheme, ussdStrObj);
  370. dialog.close(false);
  371. } catch (MAPException e) {
  372. logger.error("Error while sending UnstructuredSSRequest ", e);
  373. }
  374. }
  375. /*
  376. * (non-Javadoc)
  377. *
  378. * @see org.mobicents.protocols.ss7.map.api.service.supplementary.
  379. * MAPServiceSupplementaryListener
  380. * #onUnstructuredSSNotifyRequestIndication(org
  381. * .mobicents.protocols.ss7.map.api
  382. * .service.supplementary.UnstructuredSSNotifyRequestIndication)
  383. */
  384. @Override
  385. public void onUnstructuredSSNotifyRequestIndication(UnstructuredSSNotifyRequestIndication unstrNotifyInd) {
  386. // This error condition. Client should never receive the
  387. // UnstructuredSSNotifyRequestIndication
  388. logger.error(String.format("onUnstructuredSSNotifyRequestIndication for Dialog=%d and invokeId=%d", unstrNotifyInd.getMAPDialog().getDialogId(),
  389. unstrNotifyInd.getInvokeId()));
  390. }
  391. public void onUnstructuredSSNotifyResponseIndication(UnstructuredSSNotifyResponseIndication unstrNotifyInd) {
  392. // This error condition. Client should never receive the
  393. // UnstructuredSSNotifyRequestIndication
  394. logger.error(String.format("onUnstructuredSSNotifyResponseIndication for Dialog=%d and invokeId=%d", unstrNotifyInd.getMAPDialog().getDialogId(),
  395. unstrNotifyInd.getInvokeId()));
  396. }
  397. /*
  398. * (non-Javadoc)
  399. *
  400. * @see
  401. * org.mobicents.protocols.ss7.map.api.MAPServiceListener#onErrorComponent
  402. * (org.mobicents.protocols.ss7.map.api.MAPDialog, java.lang.Long,
  403. * org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage)
  404. */
  405. @Override
  406. public void onErrorComponent(MAPDialog mapDialog, Long invokeId, MAPErrorMessage mapErrorMessage) {
  407. logger.error(String.format("onErrorComponent for Dialog=%d and invokeId=%d MAPErrorMessage=%s", mapDialog.getDialogId(), invokeId, mapErrorMessage));
  408. }
  409. /*
  410. * (non-Javadoc)
  411. *
  412. * @see org.mobicents.protocols.ss7.map.api.MAPServiceListener#
  413. * onProviderErrorComponent(org.mobicents.protocols.ss7.map.api.MAPDialog,
  414. * java.lang.Long,
  415. * org.mobicents.protocols.ss7.map.api.dialog.MAPProviderError)
  416. */
  417. @Override
  418. public void onProviderErrorComponent(MAPDialog mapDialog, Long invokeId, MAPProviderError providerError) {
  419. logger.error(String.format("onProviderErrorComponent for Dialog=%d and invokeId=%d MAPProviderError=%s", mapDialog.getDialogId(), invokeId,
  420. providerError));
  421. }
  422. /*
  423. * (non-Javadoc)
  424. *
  425. * @see
  426. * org.mobicents.protocols.ss7.map.api.MAPServiceListener#onRejectComponent
  427. * (org.mobicents.protocols.ss7.map.api.MAPDialog, java.lang.Long,
  428. * org.mobicents.protocols.ss7.tcap.asn.comp.Problem)
  429. */
  430. @Override
  431. public void onRejectComponent(MAPDialog mapDialog, Long invokeId, Problem problem) {
  432. logger.error(String.format("onRejectComponent for Dialog=%d and invokeId=%d Problem=%s", mapDialog.getDialogId(), invokeId, problem));
  433. }
  434. /*
  435. * (non-Javadoc)
  436. *
  437. * @see
  438. * org.mobicents.protocols.ss7.map.api.MAPServiceListener#onInvokeTimeout
  439. * (org.mobicents.protocols.ss7.map.api.MAPDialog, java.lang.Long)
  440. */
  441. @Override
  442. public void onInvokeTimeout(MAPDialog mapDialog, Long invokeId) {
  443. logger.error(String.format("onInvokeTimeout for Dialog=%d and invokeId=%d", mapDialog.getDialogId(), invokeId));
  444. }
  445. public static void main(String args[]) {
  446. final Server server = new Server();
  447. try {
  448. server.initializeStack();
  449. } catch (Exception e) {
  450. e.printStackTrace();
  451. }
  452. }
  453. }