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) »
  • Integration between asterisk and civicrm
Pages: [1]

Author Topic: Integration between asterisk and civicrm  (Read 2713 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Integration between asterisk and civicrm
February 20, 2009, 02:40:13 am
Hi,

I need to seek the name of a contact based on his phone number. I'm probably going to have to create a new api and query it from the rest interface.

On my db, the phone numbers are +44 20 39 48 39 3 (ie. with space), and the PBX is sending the phone number 0044203948393

What would you suggest to query it ?

My feeling is that it needs to be properly formatted in the db (without any space), so we can do a quick lookup, and add a layer of templating to format the phone numbers so it looks nice, and add validation/reformating as well on the data input side.

What do you think ? That's a side project, I'd rather avoid having to touch too much of Civi, the simpliest the best ;)

X+


-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Integration between asterisk and civicrm
February 20, 2009, 06:54:46 am

i think a better option might be to keep phone in DB the way the user has entered it, and then re-format it for Asterix via a filter (can be smarty plugin if we are doing templates)

the reformatting needs to be locale aware: since the below number when called from the US will be: 01144...

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Integration between asterisk and civicrm
February 20, 2009, 07:13:53 am
Hi,

The reformating can't be via template, wasn't clear about how I need to use it.

Someone calls you, instead of displaying 0114412345678 on your phone as the caller id, asterisk does a lookup on civicrm (via the rest interface),  eg rest.php?q=contact/byphone?phone=+0114412345678 that returns a
<contacts>
  <contact>
    <sort_name>Von Dach, gunter</sort_name>
    ...


asterisk then uses the sort_name as the caller id and displays it on your phone.

I could reformat the phone number to transform it to 011 44 12 34 56 78 before doing the query, but it would assume that the users are really strict on the formatting of the phone numbers...

If we don't enforce a formatting in the dataentry/import of these phone numbers, I somehow doubt it will work very very well.

Any idea ?
X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Integration between asterisk and civicrm
February 23, 2009, 05:42:47 pm
I'm completely with Xavier on this. I think phone numbers should be treated as data not text. (Although given I'm a Telco Engineer I would say that)

But nice clean data opens up so many more technical options (such as VOIP integration)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Integration between asterisk and civicrm

This forum was archived on 2017-11-26.