README 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. WARNING! This module is experimental and may crash SER or create
  2. unexpected results. You use the module at your own risk.
  3. Please submit bugs at http://bugs.sip-router.org/.
  4. =================
  5. Preliminary notes
  6. =================
  7. Copyright (C) 2005 RingCentral Inc.
  8. Dependencies
  9. ------------
  10. The following binaries were used during the development and testing:
  11. instantclient-basic-linux32-10.1.0.4-20050525.zip
  12. instantclient-sdk-linux32-10.1.0.4-20050525.zip
  13. WARNING! 10.2.0.1 version is unstable, and is not recommended for Debian Linux.
  14. (You do not need to install 'sdk' package if using binary SER distribution.)
  15. instantclient-sqlplus-linux32-10.1.0.4-20050525.zip
  16. might be required in future for automated creation of SER DB.
  17. The packages could be downloaded from "Downloads" section of www.oracle.com
  18. web site. (You'll be asked to register first.)
  19. Unzip the contents of the packages to /usr/local and make /usr/local/instantclient
  20. symbolic link to the created folder. Also make the following symlink:
  21. libclntsh.so -> libclntsh.so.10.1.
  22. Core sources patching
  23. ---------------------
  24. Recompile SER with the following macros added to the proper part of Makefile.defs
  25. below "#os specific stuff":
  26. DEFS += -DLINUX -D_GNU_SOURCE -D_REENTRANT
  27. LIBS += -lpthread
  28. I took them from Makefile example of the instantclient SDK.
  29. (Probably, -DLINUX could be omitted.)
  30. There were some warnings about redefinition of _XOPEN_SOURCE,
  31. _XOPEN_SOURCE_EXTENDED, and __USE_XOPEN_EXTENDED macros inside
  32. daemonize.c. So, I protected them with '#ifndef _XOPEN_SOURCE'
  33. condition.
  34. Getting started from command line
  35. ---------------------------------
  36. export CVSROOT=:pserver:[email protected]:/cvsroot/ser
  37. cvs -z4 co -r rel_0_9_0 experimental/oracle
  38. cvs -z4 co -r rel_0_9_0 sip_router
  39. cp -a experimental/oracle sip_router/modules/
  40. # download instantclient archives to $HOME as described above, then:
  41. sudo unzip $HOME/instantclient-sdk-linux32-10.1.0.5-20060511.zip -d /usr/local
  42. sudo unzip $HOME/instantclient-basic-linux32-10.1.0.5-20060511.zip -d /usr/local
  43. sudo ln -s libclntsh.so.10.1 /usr/local/instantclient10_1/libclntsh.so
  44. sudo ln -s instantclient10_1 /usr/local/instantclient
  45. cd sip_router
  46. # patch Makefile.defs and daemonize.c as described above, then:
  47. make modules=modules/oracle modules
  48. Usage
  49. -----
  50. For basic SER set up add/change the following lines to your ser.cfg:
  51. fifo_db_url="oracle://username:passwd@/ser"
  52. loadmodule "/path/to/ser/lib/ser/modules/oracle.so"
  53. modparam("usrloc", "db_url", "oracle://username:passwd@/ser")
  54. modparam("auth_db", "db_url", "oracle://username:passwd@/ser")
  55. Additional SER modules may require similar changes to ser.cfg.
  56. See documentation for corresponding modules.
  57. db_url format: "oracle://username:password@/dbname"
  58. Additional parameters are taken from tnsnames.ora file which must be located
  59. inside $TNS_ADMIN folder.
  60. Example contents of tnsnames.ora:
  61. -- begin --
  62. SER =
  63. (DESCRIPTION =
  64. (ADDRESS_LIST =
  65. (ADDRESS = (PROTOCOL = TCP)(HOST = <your.db.host.com>)(PORT = <port>))
  66. )
  67. (CONNECT_DATA =
  68. (SERVICE_NAME = <sevice.name.com>)
  69. )
  70. )
  71. -- end --
  72. Example 'version' table schema (NUMBER precision is important!):
  73. -- begin --
  74. Name Null? Type
  75. ----------------------------------------- -------- ----------------------------
  76. TABLE_NAME NOT NULL VARCHAR2(64)
  77. TABLE_VERSION NOT NULL NUMBER(5)
  78. -- end --
  79. Implementation
  80. --------------
  81. OCI API is utilized. It is recommended to use Oracle Instant Client package.
  82. db_raw_query() is not implemented.
  83. TODO
  84. ----
  85. - commit patch for core sources
  86. - poorly tested with respect to call stress-load.
  87. - insert will fail if more than single date is inserted.
  88. - BLOBs are limited to 4000 bytes, and untested.
  89. - returned column names are not filled with proper data.
  90. - timezone related stuff should be reviewed
  91. - Review why checks for NULL argument to pkg_free() are required?
  92. - remove const prefix from db_val_t:val.string_val
  93. - yet not robust against hackish parameters.
  94. - use pool of connections, (like in mysql?)
  95. - additional TODOs are marked with XXX throughout the code.
  96. Contacts
  97. --------
  98. Dmitry Semyonov <[email protected]> (primary),
  99. <[email protected]> (secondary).