Yate Community Forum
General Category => Yate users hangout place => Topic started by: bigpaulie 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.
-
Hi,
You can use the register module
http://docs.yate.ro/wiki/Register
-
Multumesc Monica ,
[call.preroute]
query=SELECT contact_name FROM contacts WHERE contact_phone_number = ${caller}
result=contact_name
callername=${contact_name}
?
-
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