Uploaded image for project: 'ASTPP Community'
  1. ASTPP Community
  2. ASTPPCOM-1409

Anonymous calls to calling card access number drop and result in SQL query error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Reproducibility:
      always
    • Category:
      Performance
    • Edition:
      Community

      Description

      Anonymous calls to calling card access numbers 16045554444 and 14162225523 get dropped due to SQL lookup error for a field 'anonymous'.
      https://pastebin.com/AhBfyB1b

      I fixed it by skipping the sql query if ani_number is 'anonymous' or 'private'
      in '/opt/ASTPP/freeswitch/scripts/astpp/lib/calingcard.functions.lua'

      --[[ Check DID info. Original code changed to DCI code below
      function get_ani(ani_number)
      local query = "SELECT * FROM ani_map WHERE number = ".. ani_number
      Logger.debug("[CHECK_DID] Query :" .. query)
      assert (dbh:query(query, function(u)
      ani = u;
      end))
      return ani;
      end ]]

      – DCI change. Check DID info. Skip sql query if ani_number is anonymous
      function get_ani(ani_number)
      local ani = nil – Initialize ani variable to nil
      – Check if ani_number contains alphanumeric characters to avoid SQL query execution
      if ani_number == "anonymous" or ani_number == "private" or ani_number == "Unavailable" then
      Logger.debug("[CHECK_DID] Skipping SQL query for ani_number: " .. ani_number)
      else
      local query = "SELECT * FROM ani_map WHERE number = ".. ani_number
      Logger.debug("[CHECK_DID] Query :" .. query)
      – Execute the SQL query only if ani_number doesn't contain special values
      assert(dbh:query(query, function(u)
      ani = u;
      end))
      end
      return ani;
      end – DCI end ]]

        Attachments

          Activity

            People

            Assignee:
            samir.doshi Samir Doshi
            Reporter:
            dcitelecom Jack Birnbaum
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: