3CX integrated with database

Status
Not open for further replies.

Alex.Hu

Free User
Joined
Sep 2, 2021
Messages
8
Reaction score
0
Hello everyone

1. I see 3CX can be integrated with PostgreSQL database,
But I would like to ask how to add contactid when Contact Creation

In the article, I only saw this paragraph of SQL Statement, but did not see how to add contactid

"INSERT INTO contacts (first_name, last_name, phone) VALUES ('New', '3CX Contact','[Number]');SELECT id as contactid, first_name as firstname, last_name as lastname, phone as phonebusiness FROM contacts WHERE phone = '[Number]' "


2. To be honest, I don't know why I need to insert it in the query first. Does it have any meaning?
 
Hello everyone

1. I see 3CX can be integrated with PostgreSQL database,
But I would like to ask how to add contactid when Contact Creation

In the article, I only saw this paragraph of SQL Statement, but did not see how to add contactid

"INSERT INTO contacts (first_name, last_name, phone) VALUES ('New', '3CX Contact','[Number]');SELECT id as contactid, first_name as firstname, last_name as lastname, phone as phonebusiness FROM contacts WHERE phone = '[Number]' "


2. To be honest, I don't know why I need to insert it in the query first. Does it have any meaning?
The ID would nornally be generated automatically by the auto increment of the database or a custom function. That example only provides references as to how to use the statement (create the contact then return it for data, which SQL means INSERT then SELECT.)
 
  • Like
Reactions: edossantos
2. To be honest, I don't know why I need to insert it in the query first. Does it have any meaning?
Creating a contact in the database is an optional feature that you can turn on or off. If you leave it disabled, 3CX will not create contacts in your database when the caller's number can't be matched to an existing contact. This is up to you.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei