MySQL CallerID Lookup

I currently have a MySQL database populated with company cell phone numbers. I was hoping that the callerID information would be overwritten by what is in the database - but that does not appear to be the case.

Any recommendations?

Here is an example incoming call:

    -- Executing [1235555740@from-trunk-sip-McLeodUSA:1] Set("SIP/McLeodUSA-000032b8", "GROUP()=OUT_2") in new stack
    -- Executing [1235555740@from-trunk-sip-McLeodUSA:2] Goto("SIP/McLeodUSA-000032b8", "from-trunk|1235555740|1") in new stack
    -- Goto (from-trunk,1235555740,1)
    -- Executing [1235555740@from-trunk:1] Set("SIP/McLeodUSA-000032b8", "__FROM_DID=1235555740") in new stack
    -- Executing [1235555740@from-trunk:2] ExecIf("SIP/McLeodUSA-000032b8", "0 |Set|CALLERID(name)=1235553882") in new stack
    -- Executing [1235555740@from-trunk:3] Set("SIP/McLeodUSA-000032b8", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [1235555740@from-trunk:4] SetCallerPres("SIP/McLeodUSA-000032b8", "allowed_not_screened") in new stack
    -- Executing [1235555740@from-trunk:5] Goto("SIP/McLeodUSA-000032b8", "from-did-direct|322|1") in new stack
    -- Goto (from-did-direct,322,1)
    -- Executing [322@from-did-direct:1] GotoIf("SIP/McLeodUSA-000032b8", "1?ext-local|322|1") in new stack
    -- Goto (ext-local,322,1)
    -- Executing [322@ext-local:1] Macro("SIP/McLeodUSA-000032b8", "exten-vm|322|322") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/McLeodUSA-000032b8", "user-callerid|") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/McLeodUSA-000032b8", "AMPUSER=1235553882") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/McLeodUSA-000032b8", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/McLeodUSA-000032b8", "1|Set|REALCALLERIDNUM=1235553882") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/McLeodUSA-000032b8", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/McLeodUSA-000032b8", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/McLeodUSA-000032b8", "1?report") in new stack
    -- Goto (macro-user-callerid,s,9)
    -- Executing [s@macro-user-callerid:9] GotoIf("SIP/McLeodUSA-000032b8", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/McLeodUSA-000032b8", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/McLeodUSA-000032b8", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,18)
    -- Executing [s@macro-user-callerid:18] NoOp("SIP/McLeodUSA-000032b8", "Using CallerID "Unavailable" <1235553882>") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/McLeodUSA-000032b8", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/McLeodUSA-000032b8", "VMBOX=322") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/McLeodUSA-000032b8", "__EXTTOCALL=322") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/McLeodUSA-000032b8", "CFUEXT=") in new stack
    -- Executing [s@macro-exten-vm:6] Set("SIP/McLeodUSA-000032b8", "CFBEXT=") in new stack
    -- Executing [s@macro-exten-vm:7] Set("SIP/McLeodUSA-000032b8", "RT=25") in new stack
    -- Executing [s@macro-exten-vm:8] Macro("SIP/McLeodUSA-000032b8", "record-enable|322|IN") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/McLeodUSA-000032b8", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] ExecIf("SIP/McLeodUSA-000032b8", "0|MacroExit|") in new stack
    -- Executing [s@macro-record-enable:5] GotoIf("SIP/McLeodUSA-000032b8", "0?Group:OUT") in new stack
    -- Goto (macro-record-enable,s,15)
    -- Executing [s@macro-record-enable:15] GotoIf("SIP/McLeodUSA-000032b8", "1?IN") in new stack
    -- Goto (macro-record-enable,s,20)
    -- Executing [s@macro-record-enable:20] ExecIf("SIP/McLeodUSA-000032b8", "1|MacroExit|") in new stack
    -- Executing [s@macro-exten-vm:9] Macro("SIP/McLeodUSA-000032b8", "dial|25|trWw|322") in new stack
    -- Executing [s@macro-dial:1] GotoIf("SIP/McLeodUSA-000032b8", "1?dial") in new stack
    -- Goto (macro-dial,s,3)
    -- Executing [s@macro-dial:3] AGI("SIP/McLeodUSA-000032b8", "dialparties.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
  dialparties.agi: Starting New Dialparties.agi
  == Parsing '/etc/asterisk/manager.conf': Found
  == Parsing '/etc/asterisk/manager_additional.conf': Found
  == Parsing '/etc/asterisk/manager_custom.conf': Found
  dialparties.agi: Caller ID name is 'Unavailable' number is '1235553882'
  dialparties.agi: USE_CONFIRMATION:  'FALSE'
  dialparties.agi: RINGGROUP_INDEX:   ''
  dialparties.agi: Methodology of ring is  'none'
    --  dialparties.agi: Added extension 322 to extension map
       >  dialparties.agi: Extension 322 has call screening off
    --  dialparties.agi: Extension 322 cf is disabled
    --  dialparties.agi: Extension 322 do not disturb is disabled
       >  dialparties.agi: extnum 322 has:  cw: 1; hascfb: 0 [] hascfu: 0 []
  dialparties.agi: ExtensionState: 0
    --  dialparties.agi: dbset CALLTRACE/322 to 1235553882
    --  dialparties.agi: Filtered ARG3: 322
    -- AGI Script dialparties.agi completed, returning 0
    -- Executing [s@macro-dial:7] Dial("SIP/McLeodUSA-000032b8", "SIP/322|25|trWw") in new stack
    -- Called 322
    -- SIP/322-000032b9 is ringing
  == Spawn extension (macro-dial, s, 7) exited non-zero on 'SIP/McLeodUSA-000032b8' in macro 'dial'
  == Spawn extension (macro-exten-vm, s, 9) exited non-zero on 'SIP/McLeodUSA-000032b8' in macro 'exten-vm'
  == Spawn extension (ext-local, 322, 1) exited non-zero on 'SIP/McLeodUSA-000032b8'
    -- Executing [h@macro-dial:1] Macro("SIP/McLeodUSA-000032b8", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/McLeodUSA-000032b8", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,4)
    -- Executing [s@macro-hangupcall:4] GotoIf("SIP/McLeodUSA-000032b8", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] GotoIf("SIP/McLeodUSA-000032b8", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] Hangup("SIP/McLeodUSA-000032b8", "") in new stack
  == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/McLeodUSA-000032b8' in macro 'hangupcall'
  == Spawn extension (macro-dial, h, 1) exited non-zero on 'SIP/McLeodUSA-000032b8'

You need to define your database in CallerID Lookup Sources, then add that source in your Inbound Routes.

I had forgotten to define the lookup source on the inbound route - however, after I did this it still did not effect what was being displayed.

Check the log again if you have a result from the MySQL query.