chan_ooh323.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (C) 2004-2005 by Objective Systems, Inc.
  3. *
  4. * This software is furnished under an open source license and may be
  5. * used and copied only in accordance with the terms of this license.
  6. * The text of the license may generally be found in the root
  7. * directory of this installation in the COPYING file. It
  8. * can also be viewed online at the following URL:
  9. *
  10. * http://www.obj-sys.com/open/license.html
  11. *
  12. * Any redistributions of this file including modified versions must
  13. * maintain this copyright notice.
  14. *
  15. *****************************************************************************/
  16. #ifndef _OO_CHAN_H323_H_
  17. #define _OO_CHAN_H323_H_
  18. #include "asterisk.h"
  19. #undef PACKAGE_NAME
  20. #undef PACKAGE_TARNAME
  21. #undef PACKAGE_VERSION
  22. #undef PACKAGE_STRING
  23. #undef PACKAGE_BUGREPORT
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <string.h>
  27. #include <sys/socket.h>
  28. #include <sys/param.h>
  29. #include <arpa/inet.h>
  30. #include <net/if.h>
  31. #include <netinet/in.h>
  32. #include <netinet/in_systm.h>
  33. #include <netinet/ip.h>
  34. #include <unistd.h>
  35. #include <netdb.h>
  36. #include <errno.h>
  37. #include <fcntl.h>
  38. #include <signal.h>
  39. #include <sys/signal.h>
  40. #include "asterisk/lock.h"
  41. #include "asterisk/channel.h"
  42. #include "asterisk/config.h"
  43. #include "asterisk/logger.h"
  44. #include "asterisk/module.h"
  45. #include "asterisk/pbx.h"
  46. #include "asterisk/utils.h"
  47. #include "asterisk/options.h"
  48. #include "asterisk/sched.h"
  49. #include "asterisk/io.h"
  50. #include "asterisk/causes.h"
  51. #include "asterisk/rtp_engine.h"
  52. #include "asterisk/acl.h"
  53. #include "asterisk/callerid.h"
  54. #include "asterisk/file.h"
  55. #include "asterisk/cli.h"
  56. #include "asterisk/app.h"
  57. #include "asterisk/musiconhold.h"
  58. #include "asterisk/manager.h"
  59. #include "asterisk/dsp.h"
  60. #include "asterisk/stringfields.h"
  61. #include "asterisk/format.h"
  62. #include "asterisk/format_cap.h"
  63. #include "asterisk/udptl.h"
  64. #include "asterisk/stasis_channels.h"
  65. #include "asterisk/format_cache.h"
  66. #include "ootypes.h"
  67. #include "ooUtils.h"
  68. #include "ooCapability.h"
  69. #include "oochannels.h"
  70. #include "ooh323ep.h"
  71. #include "ooh323cDriver.h"
  72. #include "ooCalls.h"
  73. #include "ooq931.h"
  74. #include "ooStackCmds.h"
  75. #include "ooCapability.h"
  76. #include "ooGkClient.h"
  77. struct ooh323_pvt;
  78. struct ooh323_user;
  79. struct ooh323_peer;
  80. /* Helper functions */
  81. struct ooh323_user *find_user(const char * name, const char *ip);
  82. struct ooh323_peer *find_peer(const char * name, int port);
  83. void ooh323_delete_peer(struct ooh323_peer *peer);
  84. int delete_users(void);
  85. int delete_peers(void);
  86. int ooh323_destroy(struct ooh323_pvt *p);
  87. int reload_config(int reload);
  88. int restart_monitor(void);
  89. int configure_local_rtp(struct ooh323_pvt *p, ooCallData* call);
  90. void setup_rtp_connection(ooCallData *call, const char *remoteIp,
  91. int remotePort);
  92. void close_rtp_connection(ooCallData *call);
  93. struct ast_frame *ooh323_rtp_read
  94. (struct ast_channel *ast, struct ooh323_pvt *p);
  95. void ooh323_set_write_format(ooCallData *call, struct ast_format *fmt, int txframes);
  96. void ooh323_set_read_format(ooCallData *call, struct ast_format *fmt);
  97. int ooh323_convertAsteriskCapToH323Cap(struct ast_format *format);
  98. int ooh323_convert_hangupcause_asteriskToH323(int cause);
  99. int ooh323_convert_hangupcause_h323ToAsterisk(int cause);
  100. int update_our_aliases(ooCallData *call, struct ooh323_pvt *p);
  101. /* h323 msg callbacks */
  102. int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg);
  103. int ooh323_onReceivedDigit(OOH323CallData *call, const char* digit);
  104. void setup_udptl_connection(ooCallData *call, const char *remoteIp, int remotePort);
  105. void close_udptl_connection(ooCallData *call);
  106. EXTERN char *handle_cli_ooh323_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
  107. #endif