Feature #245
User requests data source for Serbia, Montenegro and Kosovo
| Status: | Closed | Start: | 12/18/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | 12/20/2010 | |
| Assigned to: | tshif | % Done: | 100% |
|
| Category: | - | |||
| Target version: | Caller ID Superfecta Source Files |
Description
Added by lukicweb
http://www.belestrane.988info.rs/site/ lookup source for white pages
http://www.988info.rs/site/ look up source for yellow pageshe
It would be great if you can make php script for Serbia, I know that lot of people would be using this. I will be the first one
I am using Caller ID Superfecta for my trixbox for calls from US and this is must have feature ..
Thank you in advance...
Related issues
| follows Caller ID Superfecta - Feature #384: Moved functions from source-Telekom_rs_SR.php to callerid.php | Closed | 12/10/2010 | 12/17/2010 |
History
Updated by tshif about 2 years ago
- Subject changed from User requests data source for Serbia to User requests data source for Serbia, Montenegro and Kosovo
Updated by lgaetz over 1 year ago
Began some preliminary work for this. I have been in email communication with lukicweb for some help in translating some of the page output and for help with number format etc. I have started out using http://www.belestrane.988info.rs/site/ (white pages listings) but could not get anything to work using MS internet explorer. Switching to firefox got expected behavior. Here is a summary of our email communication:
Translations:
"Mrezna grupa" this is like area code
phone format is like 011 xxx-xxxx
Second field is city but that can stay as "Sva mesta" which means all places
'Telefon" phone number name
Ime
"Prezime" last name
"Ulica" -street
"broj" -number
two butns "Trazi" is search and "Ponisti" is cancel
"Za zadati kriterijum nisu prona?eni podaci!" - For requested criteria there is no data
The page that does the actual work is this URL http://www.telekom.rs/WhitePages/SearchPage.asp?Mg=019, this example passes area code 019 but I havn't figured out yet how to pass the phone number. I may need some help with this one.
Updated by lgaetz about 1 year ago
- File functions-TelekomRs_White_Pages.php added
- File source-TelekomRs_White_Pages.php added
user jkiel from PIAF forums created the two files attached which is the lions share of the work done. Left outstanding at this point is number format checking.
Updated by lgaetz about 1 year ago
- Combined functions into the souce code php file in order to facilitate future updates to the source and to bring it in line with formats of other sources
- renamed variables as appropriate. Note to jkiel you can't alter the value of $thenumber, if the lookup fails, it will cascade to the next lookup source with the value altered.
- Removed most of the number checking because it was blocking some acceptable numbers. If lukicweb will help with all the possibilities, more sophisticated number format checking can be added.
- renamed source file to bring it in line with others
This source is ready for testing
Updated by lgaetz about 1 year ago
After having written #2 in the post immediately above, I have gone back and looked thru several sources and am wondering now if that is correct. Please someone confirm.
Updated by jkiel about 1 year ago
lgaetz wrote:
- Combined functions into the souce code php file in order to facilitate future updates to the source and to bring it in line with formats of other sources
It would be best if these functions could be made globally available to other sources. They are not unique to Serbian numbers.
I see one thing to change, and is left from when I was debugging the code. Line 157 should probably change from:
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
to:
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
As it is, an error will be raised if the page fails to load properly.
- renamed variables as appropriate. Note to jkiel you can't alter the value of $thenumber, if the lookup fails, it will cascade to the next lookup source with the value altered.
I wondered about this. The White Pages source that I used as a template did modify $thenumber -- though as you point out it probably isn't a wise move.
Updated by lgaetz about 1 year ago
jkiel wrote:
I see one thing to change, and is left from when I was debugging the code. Line 157 should probably change
Change committed to repository see r276
jkiel wrote:
The White Pages source that I used as a template did modify $thenumber -- though as you point out it probably isn't a wise move.
I didn't think that altering $thenumber was permitted, but I see many of the lookup sources do. Can someone confirm one way or the other please. In this document http://projects.colsolgrp.net/documents/8 it states:
Be careful not to modify a variables already used by bin/callerid.php as their value need to be used by other sources
Updated by jkiel about 1 year ago
lgaetz wrote:
I didn't think that altering $thenumber was permitted, but I see many of the lookup sources do. Can someone confirm one way or the other please. In this document http://projects.colsolgrp.net/documents/8 it states:
Be careful not to modify a variables already used by bin/callerid.php as their value need to be used by other sources
Looking at callerid.php, in the foreach source loop, line 233 has "$thenumber = $theoriginalnumber;" before the eval that includes the source. So in this case, it appears $thenumber is reset for each source.
The problem is that each source will still share variables. source-White_Pages.php, for example, uses $error_number as a flag to skip processing if the $thenumber does not appear to fit the requirements of the source. Since I used source-White_Pages.php as a template, source-Telekom_rs_SR.php uses $error_number as well. Unfortunately, source-White_Pages.php does not reset $error_number to a default of false (source-Telekom_rs_SR.php does) so if source-Telekom_rs_SR.php sets $error_number = true before source-White_Pages.php runs, source-White_Pages.php will not perform a lookup, even if it should.
source-Telekom_rs_SR.php could be modified to set $error_number = false; before it exits, but the better solution is to fix source-White_Pages.php, and any other script that makes assumptions on the state of a variable on script entry. In short, I propose that each source should assign a default value to variables it will use.
Updated by jkiel about 1 year ago
jkiel wrote:
In short, I propose that each source should assign a default value to variables it will use.
Thinking this through further -- perhaps each source should be wrapped in its own class or function. This would certainly take some time to implement, and could/would break existing sources -- but would keep them more isolated from each other, limiting the problems a buggy source could cause.
Updated by tshif about 1 year ago
- Status changed from Reviewed to Feedback
If I understand this correctly, you are suggesting that this data source be composed of two separate file. If so - that will break The Live Update function. Please assess this - we wont release any data source that wont work with live update.
Updated by jkiel about 1 year ago
When I first submitted the code to lgaetz, before I had access here, I was unsure where to put functions (only to later discover that there is no "neat" place to submit new functions). lgaetz combined them into one source file, source-Telekom_rs_SR.ph, which unfortunately doesn't work. See r287 for my resolution to the issue.
Updated by tshif about 1 year ago
- Status changed from Feedback to Assigned
It sounds as if this case is a dunsel, and should be closed. Yes?
Updated by tshif about 1 year ago
- Due date changed from 12/11/2010 to 12/13/2010
- Assigned to set to tshif
Ticket can be QS and closed once related #384 has passed QS and is closed..
Updated by tshif about 1 year ago
- Status changed from Assigned to QA Testing
Updated by tshif about 1 year ago
- Status changed from QA Testing to Closed
- % Done changed from 0 to 100
QS: Pass. Connected issue #384 has already been closed.
The required architectural changes have been made to support this data source.
These changes have been accepted into build for 2.2.4
This data source should not be added to live update untill the module v 2.2.4 is released - since it is dependant upon changes in #384.