CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Click 2 Call -> linking phone numbers
Pages: [1]

Author Topic: Click 2 Call -> linking phone numbers  (Read 677 times)

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Click 2 Call -> linking phone numbers
November 11, 2012, 06:53:52 pm
I'm working on click to call functionality within CiviCRM and Twilio. User can login, authorize CiviCRM to use their personal / constituency Twilio account (through Twilio Connect), and set a callback number for the duration of the logged in session.

Users can then click on any phone number, and will be presented with a small pop-up window. They can select to dial directly from the browser using Twilio Client, or they can have the phone next to them ring, and be connected to the contact after pressing 1 to confirm the connection (just in case they entered the wrong callback number).

Right now, I am achieving this by editing the phone number field to change from (555) 555-1212 to

Code: [Select]
<a href="https://www.example.com/twilio/click2call/click2call.php?to=5555551212&cid=1" onclick="window.open (this.href, 'child', 'height=400,width=300'); return false">(555) 555-1212</a>.

This is easy enough to achieve programmatically through pre- and post- hooks formatting the phone (as is done already to achieve the brackets and hyphen); however, it looks a little messy when someone goes to edit a contact, and could get messy for my planned future CiviPhone (clone of CiviSMS and CiviMail).

Any thoughts about how this could be done cleaner? It would be nice to have a standard way to 'format' phone numbers, as we do with addresses (CRM_Utils_Address).

Just wanted to get other peoples thoughts about what they think would be the best way to accomplish this. Obviously storing html and javascript inside the phone field in mysql is not the most elegant way to achieve the solution.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Click 2 Call -> linking phone numbers
November 11, 2012, 11:22:38 pm
I think having the phone set up as an option on the localization set up (like the address) is a good idea.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Click 2 Call -> linking phone numbers

This forum was archived on 2017-11-26.