Skip to main content

PostgreSQL Contact Resolution

Connect a PostgreSQL database to display caller names on Cisco IP Phones in real-time. When customers call, Call Telemetry executes a SQL query to retrieve their name from your CRM, ERP, or custom database — replacing the raw phone number on the agent's phone display.

Watch the PostgreSQL CRM Integration Video Tutorial for a visual walkthrough.

Requirements​

Configuration Overview​

Setting up PostgreSQL caller ID takes about 10 minutes:

  1. Create a policy rule to intercept incoming calls
  2. Configure PostgreSQL connection and SQL query
  3. Map database results to caller ID display
  4. Test the call

Step 1: Create Call Policy and Rule​

First, set up a policy to intercept incoming calls for CRM lookup.

Quick Setup​

  • Navigate to Policies → Add Policy
  • Name it "CRM Lookup Policy"
  • Add a rule with trigger pattern .* to match all calls
  • Or use specific patterns like 408.* for area codes
Screenshot showing a rule trigger pattern

Verify Policy Is Active​

Your policy should show "Registered" status and accumulate hits as calls arrive. Check Call Policy History to confirm it's working.

New to policies? See Policy Configuration Guide and Rule Triggers Guide.

Step 2: Configure PostgreSQL Database Connection​

Create the PostgreSQL App​

  1. Go to Realtime Policies → Apps
  2. Click Add → Select PostgreSQL (under Realtime tab)
  3. Configure your database connection:

Connection String Format:

host=yourserver.com dbname=customerdb user=readonly password=secretpass

SQL Query Requirements:

  • Must return exactly one value (the name to display)
  • Use {event.calling_number} for the caller's phone number
  • Test your query directly in PostgreSQL first
PostgreSQL App configuration example

Step 3: Associate PostgreSQL App with Your Rule​

  1. Open your CRM Policy and select the rule
  2. Click the + button next to your PostgreSQL App
  3. The app now executes for every matching call
Adding PostgreSQL App to rule

Step 4: Test Database Query Results​

Use Call Tests to verify your PostgreSQL query returns the expected customer name:

  1. Navigate to Policies → Call Test
  2. Enter a test calling number that exists in your database
  3. Run the test and check app_data.lookup.data.results
Call Test showing PostgreSQL query results

You should see the customer name returned from your database.

Step 5: Display Customer Name on Phones​

Map the database result to the caller ID display:

  1. In your rule, find the Calling Party Name field
  2. Enter: {app_data.lookup.data.results}
  3. Save the rule

Now when customers call, their name from PostgreSQL replaces the phone number on agent displays.

Rule modifier configuration for caller name

Step 6: Verify Caller ID Display​

Confirm the integration works end-to-end:

  1. Run another call test with a known customer number
  2. Check the CURRI API response (right panel)
  3. Verify calling_name shows your database value
  4. Make a real test call to see the name on phones
CURRI response showing database name in caller ID

Troubleshooting​

No name displayed?

  • Verify phone number format matches database (with/without country code)
  • Check PostgreSQL user has SELECT permissions
  • Test query directly in psql or pgAdmin
  • Review Call Test results for error messages

Connection errors?

  • Verify network connectivity from Call Telemetry to PostgreSQL
  • Check firewall rules allow port 5432
  • Confirm connection string format is correct