SOLVED Push Notification.

Hello,

I am trying to implement Push Notification from Fusionpbx to Linphone application, Can any one tell me the best way to implement this and how do it do it ? Also how do i alter the default dialplan in fusionpbx to run a PHP script before the call is ringing on the extension.
 

DigitalDaz

Administrator
Staff member
php will probably work but if you know php you should be able to pick it up quite easily and it is already used widely in fusionpbx.

Just look in /usr/share/freeswitch/scripts
 
Yes, I know how to make it work in PHP, but the challenge is how do i alter the Default Dialplan, Do i have to change it from the Dialplan (local_extension) from the WebUI ? or i should directly change it in the xml file ? If i have to change it in the xml file, can you point me the directory ?
Thank you.
 
Hi,

I have made a PHP file and when i run that manually i can receive push, now i need to add it in the dialplan for local extensions, Can you please let me know where should i change and what command should i set there ?
 
@Amit Iyer
In order to get incoming calls notifications via pushover (or via whatever you want), I set up a "system" action in the dialplan for the inbound route (order 100), which call a bash script, located in the folder /usr/share/freeswitch/scripts/

I put this in the dialplan, just before the transfer action (which is the last dialplan instsruction):
Action : System : /usr/share/freeswitch/scripts/pushover.sh -m 'Inbound call from ${caller_id_number}'
 
Last edited:
Home-made push notifications service for Android

For the ones who can't build Linphone, this is how to build an "home-made" push notifications service, which launch an Android VoIP client, by pushing incoming calls notifications trough GCM.
NOTE: It requires two paid Android app: Pushover and Tasker.

Step 1: Create Pushover account and register application
Create a Pushover account (https://pushover.net/)
Register an application: https://pushover.net/api
Write the app token and the user key

Step 2: Setup bash shell script to send pushover notifications (credits to akusei https://github.com/akusei/pushover-bash)
Download the bash script: https://raw.githubusercontent.com/akusei/pushover-bash/master/pushover.sh
Put the script in "/usr/share/freeswitch/scripts/"
Be sure to make the file "pushover.sh" executable (chmod 755 pushover.sh)
Download the config file: https://raw.githubusercontent.com/akusei/pushover-bash/master/pushover-config
Put "pushover-config" in "/etc/pushover/" and fill it with your own Pushover api token and user key

Step 3: Install Pushover app (you can try the app before buying)
Install Pushover for Android on your device (https://play.google.com/store/apps/details?id=net.superblock.pushover) and insert username and password

Step 4: Test notifications
Run "pushover.sh" script in a bash shell: pushover.sh -m "TEST"

Step 4: Install Tasker app
Install Tasker on your device: https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm

Step 5: Create Tasker triggering profile (img 1)
Create a new Profile: Event: Pushover notification
Configure the triggering event: Message matches "Inbound call" (img 2)

Step 6: Create Tasker task
In order to launch an Android app while the device is locked, we can use a Java trick to wake up the device.
Import (or crete a new one task following the img 3) the attached "WakeUpDevice" task by long pressing on the "Tasks" tab (it is a zip file, because the forum does not allow to attach xml files, extract it before importing).
Edit the WakeUpDevice task and add an new action at the bottom of the task: Plus icon, App, Launc App and choose the VoIP client.
(A t this point, you can use AutoNotification cancel to auto dismiss the incoming call notification).
Set up a task to kill the VoIP client after a call is ended (in my case I set up Profile triggered by Sate: Display off, which run a task for killing the VoIP client)

Step 7: Configure Fusionpbx
Edit the Fusionpbx dialplan for the inbound route and insert the system action to send push notifications: /usr/share/freeswitch/scripts/pushover.sh -s none -m 'Inbound call from ${caller_id_number}'
Set the proper ringback option and sleep or call timeout (img 4 is an example of a dialplan based on the destination number which works for me).

Step 8: Final test
Test the system by runnig "pushover.sh" in a bash shell: pushover.sh -m "Inbound call from" or by calling your phone number.
If everything works, you should get a Pushover notifications on your phone and the VoIP client should start.

Of course, edit names and commands according to your needs.
 

Attached Files:

Last edited: