2
0

lcr.conf.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <configuration name="lcr.conf" description="LCR Configuration">
  2. <settings>
  3. <param name="odbc-dsn" value="freeswitch-mysql:freeswitch:Fr33Sw1tch"/>
  4. <!-- <param name="odbc-dsn" value="freeswitch-pgsql:freeswitch:Fr33Sw1tch"/> -->
  5. </settings>
  6. <profiles>
  7. <profile name="default">
  8. <param name="id" value="0"/>
  9. <param name="order_by" value="rate,quality,reliability"/>
  10. </profile>
  11. <profile name="qual_rel">
  12. <param name="id" value="1"/>
  13. <param name="order_by" value="quality,reliability"/>
  14. </profile>
  15. <profile name="rel_qual">
  16. <param name="id" value="2"/>
  17. <param name="order_by" value="reliability,quality"/>
  18. </profile>
  19. <!--
  20. Some samples of how to do custom SQL:
  21. =============================================================
  22. PostgreSQL with contrib prefix module which supports fast
  23. prefix queries. Ideal option.
  24. =============================================================
  25. <profile name="pg_prefix">
  26. <param name="custom_sql" value="
  27. SELECT l.digits AS lcr_digits,
  28. c.carrier_name AS lcr_carrier_name,
  29. l.${lcr_rate_field} as lcr_rate_field,
  30. cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix,
  31. l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip,
  32. l.prefix AS lcr_prefix, l.suffix AS lcr_suffix
  33. FROM lcr l
  34. JOIN carriers c ON l.carrier_id=c.id
  35. JOIN carrier_gateway cg ON c.id=cg.carrier_id
  36. WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
  37. AND digits_prefix @> %q
  38. AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
  39. ORDER BY digits DESC, ${lcr_rate_field}, random();
  40. "/>
  41. </profile>
  42. =============================================================
  43. PostgreSQL with contrib prefix module which supports fast
  44. prefix queries. Ideal option. Alternate syntax which requies
  45. a session but allows variable substitution.
  46. =============================================================
  47. <profile name="pg_prefix2">
  48. <param name="custom_sql" value="
  49. SELECT l.digits AS lcr_digits,
  50. c.carrier_name AS lcr_carrier_name,
  51. l.${lcr_rate_field} as lcr_rate_field,
  52. cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix,
  53. l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip,
  54. l.prefix AS lcr_prefix, l.suffix AS lcr_suffix
  55. FROM lcr l
  56. JOIN carriers c ON l.carrier_id=c.id
  57. JOIN carrier_gateway cg ON c.id=cg.carrier_id
  58. WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
  59. AND digits_prefix @> '${lcr_query_digits}'
  60. AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
  61. ORDER BY digits DESC, ${lcr_rate_field}, random();
  62. "/>
  63. </profile>
  64. =============================================================
  65. Demonstrates use of computed inlist.
  66. =============================================================
  67. <profile name="inlist">
  68. <param name="custom_sql" value="
  69. SELECT l.digits AS lcr_digits,
  70. c.carrier_name AS lcr_carrier_name,
  71. l.${lcr_rate_field} as lcr_rate_field,
  72. cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix,
  73. l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip,
  74. l.prefix AS lcr_prefix, l.suffix AS lcr_suffix
  75. FROM lcr l
  76. JOIN carriers c ON l.carrier_id=c.id
  77. JOIN carrier_gateway cg ON c.id=cg.carrier_id
  78. WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
  79. AND digits IN (${lcr_query_expanded_digits})
  80. AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
  81. ORDER BY digits DESC, ${lcr_rate_field}, random();
  82. "/>
  83. </profile>
  84. -->
  85. </profiles>
  86. </configuration>