View Single Post
  #107 (permalink)  
Old 07-26-2009, 03:07 PM
chlauber chlauber is offline
Senior Member
 
Posts: 63
Default Matching Regexp

Quote:
Originally Posted by gracedman View Post
Thanks very much to the developers for this great zimlet. The addition of user configurable context was a life save for us.

We're having a bit of a problem in a USA based installation with number recognition. Zimbra recognizes phone numbers with dashes and parenthesis but this zimlet doesn't. It sees 1112223333 but not (111)2223333, (111) 222-3333 or 111-222-3333 and hence does not offer to dial on click. I noticed the regex parameter but that appears to be for cleaning input numbers and not for discerning numbers in the email and it does cull dashes and parenthesis. Is there any way to configure how the zimlet recognizes phone numbers?

Would it be possible to have it recognize email addresses as possible SIP adresses, e.g., sip:someuser@mycompany.com or just someuser@mycompany.com? Thanks - John
Hi gracedman

Sadly i didn't find yet a way to make a configure option to change the regexp that parses the phone numbers. But you can unpack the zipfile and change the matching regexp for phone numbers. Just change the following regexp in ch_bnc_asterisk.xml to your needs, repack as zip and install the zimlet.
Code:
<matchOn>
    <regex attrs="g">(\s|\t|^)\+?(\s?((\(\d{1,4}\))|(\d{1,4}))){6,10}(=?((\.|\,)?(\n|\r\n|\s|\t|$)))</regex>
</matchOn>
Reply With Quote