1

We are using FreePBX as a server for VoIP, and looking for a way to implement APNS voip push notifications. FreePBX allows loading of PHP modules in the following format: https://wiki.freepbx.org/display/FOP/FreePBX+Development

I have found some PHP sample code for APNS push notifications (including some on SO at http://stackoverflow.com/questions/14563097/sending-multiple-iphone-push-notifications-apns-php-tutorial), but no already completed modules for FreePBX (free or at a cost).

It appears that a StackOverflow user maybe created such a module here: Asterisk / FreePBX - Perform action when receiving a call but I don't have any way to ask for details since I am a new user here.

Not being a PHP developer or a FreePBX configuration expert, I was just wondering if anybody done such a module before, or knew where to find one?

alf
  • 31
  • 2

1 Answers1

1

I am not sure, but yes something is help full for you.

  • You should not use APNS
  • You must use Push kit silent notification
  • Using Pushkit payload you can schedule local notification and achieve your task
  • Some PHP code and creating certificate process is as below.

$ openssl x509 -in aps_development.cer -inform der -out PushCert.pem

// Convert .p12 to .pem. Enter your pass pharse which is the same pwd that you have given while creating the .p12 certificate. PEM pass phrase also same as .p12 cert.  
$ openssl pkcs12 -nocerts -out PushKey1.pem -in pushkey.p12

Enter Import Password:

MAC verified OK

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

// To remove passpharse for the key to access globally. This only solved my stream_socket_client() & certificate capath warnings.
$ openssl rsa -in PushKey1.pem -out PushKey1_Rmv.pem

Enter pass phrase for PushChatKey1.pem:

writing RSA key

// To join the two .pem file into one file:
$ cat PushCert.pem PushKey1_Rmv.pem > ApnsDev.pem

Refer

Hasya
  • 9,792
  • 4
  • 31
  • 46
  • I have asterisk server running and if i want to send silent push notification to my ios (pjsip client) to notify about the incoming call what should be the approach. Is the sending push notification code will be seperate like on php file? – Paresh. P Jul 11 '19 at 06:00