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 [[email protected]:1] Set("SIP/McLeodUSA-000032b8", "GROUP()=OUT_2") in new stack
    -- Executing [[email protected]:2] Goto("SIP/McLeodUSA-000032b8", "from-trunk|1235555740|1") in new stack
    -- Goto (from-trunk,1235555740,1)
    -- Executing [[email protected]:1] Set("SIP/McLeodUSA-000032b8", "__FROM_DID=1235555740") in new stack
    -- Executing [[email protected]:2] ExecIf("SIP/McLeodUSA-000032b8", "0 |Set|CALLERID(name)=1235553882") in new stack
    -- Executing [[email protected]:3] Set("SIP/McLeodUSA-000032b8", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [[email protected]:4] SetCallerPres("SIP/McLeodUSA-000032b8", "allowed_not_screened") in new stack
    -- Executing [[email protected]:5] Goto("SIP/McLeodUSA-000032b8", "from-did-direct|322|1") in new stack
    -- Goto (from-did-direct,322,1)
    -- Executing [[email protected]:1] GotoIf("SIP/McLeodUSA-000032b8", "1?ext-local|322|1") in new stack
    -- Goto (ext-local,322,1)
    -- Executing [[email protected]:1] Macro("SIP/McLeodUSA-000032b8", "exten-vm|322|322") in new stack
    -- Executing [[email protected]:1] Macro("SIP/McLeodUSA-000032b8", "user-callerid|") in new stack
    -- Executing [[email protected]:1] Set("SIP/McLeodUSA-000032b8", "AMPUSER=1235553882") in new stack
    -- Executing [[email protected]:2] GotoIf("SIP/McLeodUSA-000032b8", "0?report") in new stack
    -- Executing [[email protected]:3] ExecIf("SIP/McLeodUSA-000032b8", "1|Set|REALCALLERIDNUM=1235553882") in new stack
    -- Executing [[email protected]:4] Set("SIP/McLeodUSA-000032b8", "AMPUSER=") in new stack
    -- Executing [[email protected]:5] Set("SIP/McLeodUSA-000032b8", "AMPUSERCIDNAME=") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/McLeodUSA-000032b8", "1?report") in new stack
    -- Goto (macro-user-callerid,s,9)
    -- Executing [[email protected]:9] GotoIf("SIP/McLeodUSA-000032b8", "0?continue") in new stack
    -- Executing [[email protected]:10] Set("SIP/McLeodUSA-000032b8", "__TTL=64") in new stack
    -- Executing [[email protected]:11] GotoIf("SIP/McLeodUSA-000032b8", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,18)
    -- Executing [[email protected]:18] NoOp("SIP/McLeodUSA-000032b8", "Using CallerID "Unavailable" <1235553882>") in new stack
    -- Executing [[email protected]:2] Set("SIP/McLeodUSA-000032b8", "RingGroupMethod=none") in new stack
    -- Executing [[email protected]:3] Set("SIP/McLeodUSA-000032b8", "VMBOX=322") in new stack
    -- Executing [[email protected]:4] Set("SIP/McLeodUSA-000032b8", "__EXTTOCALL=322") in new stack
    -- Executing [[email protected]:5] Set("SIP/McLeodUSA-000032b8", "CFUEXT=") in new stack
    -- Executing [[email protected]:6] Set("SIP/McLeodUSA-000032b8", "CFBEXT=") in new stack
    -- Executing [[email protected]:7] Set("SIP/McLeodUSA-000032b8", "RT=25") in new stack
    -- Executing [[email protected]:8] Macro("SIP/McLeodUSA-000032b8", "record-enable|322|IN") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/McLeodUSA-000032b8", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [[email protected]:4] ExecIf("SIP/McLeodUSA-000032b8", "0|MacroExit|") in new stack
    -- Executing [[email protected]:5] GotoIf("SIP/McLeodUSA-000032b8", "0?Group:OUT") in new stack
    -- Goto (macro-record-enable,s,15)
    -- Executing [[email protected]:15] GotoIf("SIP/McLeodUSA-000032b8", "1?IN") in new stack
    -- Goto (macro-record-enable,s,20)
    -- Executing [[email protected]:20] ExecIf("SIP/McLeodUSA-000032b8", "1|MacroExit|") in new stack
    -- Executing [[email protected]:9] Macro("SIP/McLeodUSA-000032b8", "dial|25|trWw|322") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/McLeodUSA-000032b8", "1?dial") in new stack
    -- Goto (macro-dial,s,3)
    -- Executing [[email protected]: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 [[email protected]: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 [[email protected]:1] Macro("SIP/McLeodUSA-000032b8", "hangupcall") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/McLeodUSA-000032b8", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,4)
    -- Executing [[email protected]:4] GotoIf("SIP/McLeodUSA-000032b8", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [[email protected]:7] GotoIf("SIP/McLeodUSA-000032b8", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [[email protected]: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.