Results 1 to 3 of 3

Thread: An easy Clic to call

  1. #1
    Join Date
    Jan 2009
    Location
    Paris
    Posts
    4
    Rep Power
    6

    Default An easy Clic to call

    Hi,

    After migrating from Outlook to Zimbra NE I was missing my daily 'clic to call' partner that save me some times during work.
    I had a look at the phone zimlet but
    1- I did not wanted to use skype neither a sisco phone, I use Eyebeam from Counterpath (v.1.5)
    2 -The french phone numbers where not properly recocgnised.
    3- I wanted to keep things simple.
    So I did some work on that phone zimlet in order to be able to do an easy 'Clic to call'.

    It is quite simple : the zimlet use the Url Handler feature (it can be setup for various softphones, sip or iax like idefisk).

    On windows environment (for other platform see firefox url handler addon):
    1-Create a sip.reg with the following lines :

    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\sip]
    "EditFlags"=hex:02,00,00,00
    @="URL:Sip Protocol"
    "URL Protocol"=""
    [HKEY_CLASSES_ROOT\sip\shell]
    [HKEY_CLASSES_ROOT\sip\shell\open]
    [HKEY_CLASSES_ROOT\sip\shell\open\command]
    @="\"C:\\Program Files\\CounterPath\\eyeBeam 1.5\\eyeBeam.exe\" -dial=\"%1\""

    2- Double-clic on it to import in registry.
    3- Deploy the new version of the zimlet : com_zimbra_phone.zip

    On this uk version, I left the original zimlet regexp, but for France I had to change the regexp in order to pattern the french dial plan (it is not perfect, but it works).
    If you need to improve the dial plan to match your country dial plan, you can go to Regular Expression Library, there are nice samples.
    The change of the regexp must be done in com_zimbra_phone.xml.
    Becarefull with cache.

    For me it was a quick and easy setup and it works fine.

    if any questions...
    Last edited by pberger; 07-23-2009 at 09:22 AM.

  2. #2
    Join Date
    May 2006
    Location
    England.
    Posts
    927
    Rep Power
    10

    Default

    That looks like a useful function, thanks.

    It seems that you've modified the original zimlet to make this work, which is fine of couse, but could you detail the actual changes made? Some people may prefer to make the edit's themselves.

  3. #3
    Join Date
    Jan 2009
    Location
    Paris
    Posts
    4
    Rep Power
    6

    Default

    ok,

    1-Unzip the com_zimbra_phone.zip
    the additional code is in blue color and italic

    2-In the com_zimbra_phone.xml
    For the regexp english people do not have to change anythings others have to change the dial plan regexp pattern (refer to my post) and put their own.
    Code:
    <!-- french pattern <regex attrs="g">((\+)?(([\(0-9\)\.\- ]){4}([0-9\-\. ]){5,17}))</regex>-->
    <regex attrs="g">(((\+\d{2}[-\. ]\d{5}[-\. ]?\d{5})|(\b(\d{1}[-. ])?(\(?\d{3}\)?[-. ])?\d{3}[-.]\d{4}\b)|(\(\d{3}\)[-\. ]?\d{7}))(( x| ext)[-#: ]?\d{1,5}){0,1})</regex>
    Code:
       <menuItem label="${msg.skypeCall}" icon="Telephone" id="CALL"/>
       <menuItem label="${msg.clicCall}" icon="Telephone" id="CLICCALL"/>
    </contextMenu>
    3-In each property file com_zimbra_phone_xx_XX.properties
    of course the value must be change in your own language
    Code:
      search = Search
      addToContacts = Add To Contacts
      skypeCall = Skype Call
      clicCall = Call with my SoftPhone
    4-Modify phone.js
    Code:
    function(itemId) {
    	switch (itemId) {
    		case "SEARCH":		this._searchListener(); break;
    		case "ADDCONTACT":	this._contactListener(); break;
    		case "CALL":		this._callListener(); break;
    		case "CLICCALL":	this._clicCall(); break;
    	}
    };
    The last two updates could be optimized of course by a simple function. I strip unwanted characters from the string for my softphone to be happy.
    Code:
    Com_Zimbra_Phone.getClicCallToLink =
    function(phoneIn) {
    	if (!phoneIn) { return ""; }
    	var phone = AjxStringUtil.trim(phoneIn, true);
    	var reg01 = new RegExp("[\+]","g");
    	var reg02 = new RegExp("[-\(\)_\.\s]","g");
    	phone = phone.replace(reg01, '00');
    	phone = phone.replace(reg02, '');
    	phone = phone.replace(/[\s]/g,"");
    	return "sip:" + phone;
    };
    
    
    Com_Zimbra_Phone.getCallToLink =
    function(phoneIn) {
    	if (!phoneIn) { return ""; }
    	var phone = AjxStringUtil.trim(phoneIn, true);
    	var reg01 = new RegExp("[\+]","g");
    	var reg02 = new RegExp("[-\(\)_\.\s]","g");
    	phone = phone.replace(reg01, '00');
    	phone = phone.replace(reg02, '');
    	phone = phone.replace(/[\s]/g,"");
    	return "callto:" + phone;
    };
    5- Re-zip
    6- Deploy

    7- Try it !
    Pascal Berger
    OS integration
    DS Digital Systems
    ZCS 6.01 on Ubuntu 8.04-LTS server_64
    http://www.digsys.fr

Similar Threads

  1. Replies: 0
    Last Post: 12-08-2008, 06:23 AM
  2. zmclamdctl is not running after upgrade
    By Darren in forum Installation
    Replies: 24
    Last Post: 10-10-2008, 10:10 AM
  3. Replies: 13
    Last Post: 10-31-2005, 04:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •