running a script on an inbound call

Status
Not open for further replies.

calin

Member
Jul 29, 2022
41
0
6
54
hi, i need to integrate a crm with fusion pbx and i need, based on caller id from an inbound call, to get some results from the crm. how can i do this?

thanks
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
You can call another process such as a script form the dialplan.
Have a look at /usr/share/freeswitch/script/cidlookup.lua
This is an .lua script that can be called on an inbound route to lookup a callers name from the contacts table. I sure this could be adapted to interface with CRM.
Screenshot from 2022-08-29 20-41-53.png
 

calin

Member
Jul 29, 2022
41
0
6
54
hi all and a happy 2023!

i need your help, as i need to integrate fusion with an existing crm, as i already told you. so, based on caller id in an incoming call, i must to run a script and search in crm's database data about the caller and return in crm web a popup with info. the developers from crm told me that i need to use soap services and they provide me a simple example with a php script that will access the crm. right now i don't know how to run php scripts from fusion....
 

calin

Member
Jul 29, 2022
41
0
6
54
well, succeed to install esl php. now i need to see how to insert caller id number in my script....
 

calin

Member
Jul 29, 2022
41
0
6
54
well, tried to use a php script in dialplan for inbound call, but no luck. i don't know if it is inserted the caller number in my script. can anyone from you to help me, pls?
 

calin

Member
Jul 29, 2022
41
0
6
54
hi again. can someone explain me how can i load caller_id_number in a php variable, pls? tried some scripts, but no luck.... thanks
 

avnho

New Member
Sep 20, 2022
1
0
1
41
You can easily achieve this via the freeswitch's API on port 8021.

I've done it before and listen to the following events to trigger actions.
  1. "member-queue-start"
  2. "member-queue-end"
  3. "bridge-agent-start"
Just use some free-switch listener and listen for these events. it should work.
 
Status
Not open for further replies.