jehowe
Guru
- Joined
- Nov 14, 2007
- Messages
- 288
- Reaction score
- 4
Update: Success! See my post further down......
Specifically using an agi script file to craft push notifications to android phones when a call arrives. This is for a mobile project that is using Asterisk to process inbound calls. The dialplan currently uses an agi script which plucks callerid data and sends it to an external DB. I'd like to add the capability of sending push notifications from within the asterisk environment.
Call comes in->agi script inserts the callerid data to a remote DB and kicks off a push notification to android devices. At least that's what I hope can be done, it's that simple.
I have two boxes to use for testing, one running PIAF Green (asterisk 11), and a vanilla asterisk 11 (ubuntu) install. I have cURL installed on the ubuntu machine currently. I can import the variables I need from the dialplan into the script, and also have working php code to handle the push notification piece. The questions I do have surround:
1) two include files handling android push (php)- how do I include them properly within an agi script. where do I put the include files? if they remain in the ../asterisk/agi-bin folder, do I need to rename them as .agi files? Or do I need to incorporate the includes into the agi script.
2) any potential issues using cURL in an asterisk environment? cURL would be used to format and send variables using POST to an external url (https://android.googleapis.com/gcm/send in this case).
Thank you for any tips or advice, I'm not entirely sure how to proceed without filling in some gaps I have from the questions above. cURL is installed on the vanilla ubuntu asterisk machine, and again, I also have a PIAF Green to test with as well. I'd also be happy to post any code if it will help anyone understand exactly what I'm trying to do.
Specifically using an agi script file to craft push notifications to android phones when a call arrives. This is for a mobile project that is using Asterisk to process inbound calls. The dialplan currently uses an agi script which plucks callerid data and sends it to an external DB. I'd like to add the capability of sending push notifications from within the asterisk environment.
Call comes in->agi script inserts the callerid data to a remote DB and kicks off a push notification to android devices. At least that's what I hope can be done, it's that simple.
I have two boxes to use for testing, one running PIAF Green (asterisk 11), and a vanilla asterisk 11 (ubuntu) install. I have cURL installed on the ubuntu machine currently. I can import the variables I need from the dialplan into the script, and also have working php code to handle the push notification piece. The questions I do have surround:
1) two include files handling android push (php)- how do I include them properly within an agi script. where do I put the include files? if they remain in the ../asterisk/agi-bin folder, do I need to rename them as .agi files? Or do I need to incorporate the includes into the agi script.
2) any potential issues using cURL in an asterisk environment? cURL would be used to format and send variables using POST to an external url (https://android.googleapis.com/gcm/send in this case).
Thank you for any tips or advice, I'm not entirely sure how to proceed without filling in some gaps I have from the questions above. cURL is installed on the vanilla ubuntu asterisk machine, and again, I also have a PIAF Green to test with as well. I'd also be happy to post any code if it will help anyone understand exactly what I'm trying to do.