Author Topic: Callerid from database  (Read 11566 times)

bigpaulie

  • Newbie
  • *
  • Posts: 3
    • View Profile
Callerid from database
« on: February 12, 2015, 03:51:41 AM »
Hello guys ,

I have a database of phone numbers and each time someone calls I want to query the database and get the name of the person and send it as caller id to my extension .
Is it possible , if so how can I do it . Can somebody help me ?

Best Regards,
Paul.

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Callerid from database
« Reply #1 on: February 12, 2015, 05:01:10 AM »
Hi,

You can use the register module

http://docs.yate.ro/wiki/Register

bigpaulie

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Callerid from database
« Reply #2 on: February 12, 2015, 05:21:35 AM »
Multumesc Monica ,

[call.preroute]
query=SELECT contact_name FROM contacts WHERE contact_phone_number = ${caller}
result=contact_name

callername=${contact_name}

?

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Callerid from database
« Reply #3 on: February 12, 2015, 06:01:37 AM »
Hi,

If you only want to change the callername parameter then you have to added in the query. If you don't route from the database it would be something like this:

[call.preroute]
query=SELECT contact_name as callername, null as location FROM contacts WHERE contact_phone_number = ${caller}
result=location

or

[call.route]
query=SELECT contact_name as callername, location FROM contacts WHERE contact_phone_number = ${caller}
result=location

id you also have the location in the database

This depends on how the routing is done and if you want to do it here or from another module/script