SOLVED Push Notification.

Status
Not open for further replies.

Amit Iyer

Member
Feb 6, 2018
60
11
8
29
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
Sep 29, 2016
3,070
577
113
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
 

Amit Iyer

Member
Feb 6, 2018
60
11
8
29
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.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
You should not edit the xml files directly, make your changes in dialplan manager.
 

Amit Iyer

Member
Feb 6, 2018
60
11
8
29
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 ?
 

goose2600

Member
Dec 18, 2018
51
1
8
@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:

Amit Iyer

Member
Feb 6, 2018
60
11
8
29
Thank you Goose and Daz, i was able to achieve push notification on linphone through the dialplan settings.
Please close this thread.
 

goose2600

Member
Dec 18, 2018
51
1
8
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.
 

Attachments

  • 1.jpg
    1.jpg
    35.8 KB · Views: 130
  • 2.jpg
    2.jpg
    47.1 KB · Views: 118
  • 3.jpg
    3.jpg
    46.3 KB · Views: 139
  • wakeUpDevice.tsk.zip
    536 bytes · Views: 43
  • 4.jpg
    4.jpg
    114.1 KB · Views: 150
Last edited:

Dee

Member
Jun 7, 2019
50
3
8
35
Hello, I tried to follow this but in my fusionpbx version there is no option for 'system in the dialplan. Am I missing something?
 

Dee

Member
Jun 7, 2019
50
3
8
35
Thanks,for some reason it is not in my pbx. Is there a way to get this dialplan application?
 

Attachments

  • Screenshot 2020-02-04 at 21.33.40.png
    Screenshot 2020-02-04 at 21.33.40.png
    433 KB · Views: 134

ad5ou

Active Member
Jun 12, 2018
892
204
43
Select a random action, then clear out the field and type what you want.
1580852832547.png
1580852901979.png
1580852864532.png
 
Status
Not open for further replies.