Tuesday, December 15, 2015

Retrieve Records based on a Completed Period of Time (eg. Every 15 Minutes)

When you need to run a batch of transaction in a controlled manner and know when they are processed, this approach may be helpful.  The idea is to retrieve all the records that fall under a complete period of time, for example, if we select a period of 5 minutes, the query should retrieve records created within a full 5 minutes period such as: from 10:00:00-10:04:59, from 10:05:00-10:09:59 and so on… no matter at what time we execute the retrieval process.

So if you need to run a process every 15 time to check for transactions, the query should retrieve transactions done, no matter the hour, every completed block of 15 minutes such as 

                                  xx:00:00 till xx:14:59
                                  xx:15:00 till xx:29:59
                                  xx:30:00 till xx:44:59 
                                  xx:45:00 till xx:59:59. 

where xx is any hour.

No matter at what time the process is executed, the query will retrieve the previously completed period for example, if the current time is 13:42:15 the query will retrieve all the transactions from 13:15:00 till 13:29:59 since it is the previous 15 minute period that was completed.

Note that the maximum waiting time will be the period duration (in the previous example 15 minutes) but your process does not need to run every minute or so and does not need to be pulling.

For example, the following is the query format:

 select *  
 from <tables>  
 where <time stamp> between (SYSDATE-15/1440)-((TO_CHAR(((SYSDATE-15/1440)),'MI')*60 + TO_CHAR(((SYSDATE -15/1440)),'SS'))/86400) + (15*(CASE WHEN (TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')-1)<=0 THEN 3 ELSE TO_NUMBER((TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')-1)) END))/1440   
 AND ((SYSDATE)-((TO_CHAR(((SYSDATE)),'MI')*60 + TO_CHAR(((SYSDATE)),'SS'))/86400) + (15*(TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')))/1440)-1/86400   

where <tables> are your tables and the <time_stamp> is the record time that is going to be compared to.

If we execute the query against the current time we have:


 select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') current_time,  
 to_char((SYSDATE-15/1440)-((TO_CHAR(((SYSDATE-15/1440)),'MI')*60 + TO_CHAR(((SYSDATE -15/1440)),'SS'))/86400) + (15*(CASE WHEN (TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')-1)<=0 THEN 3 ELSE TO_NUMBER((TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')-1)) END))/1440,'yyyy-mm-dd hh24:mi:ss') period_start,  
 to_char(((SYSDATE)-((TO_CHAR(((SYSDATE)),'MI')*60 + TO_CHAR(((SYSDATE)),'SS'))/86400) + (15*(TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')))/1440)-1/86400,'yyyy-mm-dd hh24:mi:ss') period_end  
 from dual  

and the output is:




as you can see, even though the current time is 11:02:31, the period start is the start of the last completed 15 minute period, 10:45:00 and the period end is the end time of the last completed period, 10:59:59.


Lets analyze the first part of the query which obtains the start time of the period:



1:  (SYSDATE-15/1440)  
2:    -   
3:  ((TO_CHAR(((SYSDATE-15/1440)),'MI')*60 + TO_CHAR(((SYSDATE -15/1440)),'SS'))/86400)   
4:    +   
5:  (15* (   
6:      CASE WHEN (  
7:                           TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')-1)<=0 THEN 3   
8:                 ELSE      TO_NUMBER((TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')-1))   
9:            END  
10:       )  
11:  )/1440  

Line 1: The current time minus 15 minutes. As you know, when you rest units to sysdate it will deduct days, so what we need to deduct is a fraction of a day, for example, for one second is 1/86400 where 86400 is the number of seconds in a day so to deduct 15 minutes we can do 15*60 / (1440 * 60) where 1440 is the number of minutes in an hour. We can eliminate the 60 seconds and the final number is 15/1440.
Line 3: We obtains the total number of seconds within the current hour. For example, if the time was 13:32:12, we obtain the 32 minutes and the 12 seconds so we can deduct them from the time obtained in line 1
Lines 3-11: We obtains the period number, being 0 the first quarter, 1 the second, 2 the third and 3 the fourth
Line 7 and 8: Obtain the number of period in the current minute. If the division by 15 results in 2 it means we are in the second period, etc..
Lines 6-9: The case verifies that we don't fall between hours, so in case we are in the first minutes of the hour we will use the last quarter from the previous hour.
Lines 1-11: Obtain the start of the period.


The second part, the end period is:


1:  (     (SYSDATE)  
2:            -  
3:       ((TO_CHAR(((SYSDATE)),'MI')*60 + TO_CHAR(((SYSDATE)),'SS'))/86400)   
4:            +   
5:       (15*(TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'MI'))/15,'0')))/1440  
6:  )-1/86400   

Line 1: The current time minus 15 minutes. As you know, when you rest units to sysdate it will deduct days, so what we need to deduct is a fraction of a day, for example, for one second is 1/86400 where 86400 is the number of seconds in a day so to deduct 15 minutes we can do 15*60 / (1440 * 60) where 1440 is the number of minutes in an hour. We can eliminate the 60 seconds and the final number is 15/1440.
Lines 1-6: Computes the end time of the period
Line 3: Obtains the total number of seconds within the current hour so if the time is 10:42:15 it will obtain the number of seconds that 42:15 represent
Line 5: Obtains the number of seconds based on the period number. If the division by 15 results in 2 it means we are in the second period and the total number of minutes is 30
Lines 1-6: We deduct one second so that the end period will be the minute and 59 seconds.



Friday, December 11, 2015

Step by Step Access Your Facebook Page Information and Statistics

Although Facebook publishes information on how to use their API, there are not enough examples and the information on how to set up everything is not very clear. I have found many questions/answers in different web sites asking on how to do this and how to do that.

It is highly recommended that you read Facebook's Graph API.


The intention of this post is to help you get started and the first thing to do is to have a Facebook page. Once you have your page and some likes on it follow the next steps:


  1. Go to https://developers.facebook.com/ and login
  2. Register as a Developer




  3. Once you are registered you will be able to add apps to Facebook, this is needed in order to extract information.
  4. Click on "Add a New App" if is not open, otherwise just choose "WWW" Website.



  5. Click on "Skip and Create App ID"



  6. On the next screen, select an App name, in the category select Application for Pages and then click on Create Application Identifier.



  7. You application Dashboard will appear, from there you can get your application ID as well as your Application Secret ID.



  8. Now you have your application ID that you can use to login to Facebook.


The Graph API is a low level HTTP based API that allows you to query data, post new stories, upload photos and other tasks. The API will work on any programming language or tool that supports HTTP such as cURL and urllib. In our examples, we are not going to use any specific tool but row HTTP and since the interface uses SSL we are going to use  openssl in order to open a raw socket.

Every element in Facebook is called a Node and each node has an ID, you need those IDs in order to extract information from the. Please refer to the Graph API for more details on this.

You can get your node id by looking at the address bar or when you put your mouse over an object in the status bar.




For using openssl I am using a Cygwin terminal. 

The first thing we need to do is to get the access key, that key will allow us to use the rest of the APIs.

For getting the access key I will send the following command:

GET /oauth/access_token?client_id=<app id>&client_secret=<app secret>&grant_type=client_credentials HTTP/1.1
Host: graph.facebook.com

Where the <app id> and the <app secret> were taken from the Application Dashboard. 

Note that you need to press Enter twice after you enter the last line:

GET /oauth/access_token?client_id=<app id>&client_secret=<app secret>&grant_type=client_credentials HTTP/1.1
Host: graph.facebook.com
<crlf><crlf>

Lets do an example on how to obtain the access_token:

  1. Connect to Facebook API:  openssl s_client -connect graph.facebook.com:443
    After issuing this command, many printouts  appear in the screen
  2. Then we type or better just copy an paste the following, remember to update your application id and secret id, the onces below are fake (press Enter twice):
    GET /oauth/access_token?client_id=5153436434343&client_secret=43434h4347851fb&grant_type=client_credentials HTTP/1.1
    Host: graph.facebook.com



Once you are connected you can use the API in the same manner, lets do another example but now lets retrieve the page information. 

Please follow the next steps:


  1. Connect to Facebook's API (following the previous steps), if you are already connected, just copy the obtained access_token .
  2. Update the following request with the obtained access token and with your node (page) id:

    GET /v2.5/170838892958036?access_token=515365081974110|5gM5WkAfUZLUm7f2n8t0_icPqb0 HTTP/1.1
    Host: graph.facebook.com
  3. Copy and paste it to the terminal, remember to put two Enters at the end.



    When you paste the request it will be next to the access_token, see the underlined text, do not worry, a space or an enter is not necessary because the previous HTTP response includes a specific number of chars, so you can paste the request there. The text with the green line to the left is the HTTP response headers and the text with the blue line is the API response.

    {"name":"Visita Mexico","id":"170838892958036"}

You will have access to public available information and this is because of the permissions you have. If you try to request information for a metric or parameter that your do not have permissions you may get empty data, for example, if we want to retrieve the total number of people who have liked the page we need to use the following request:

GET /v2.5/170838892958036/insights/page_fans?access_token=fUZLUm7f2n8t0_icPqb0 HTTP/1.1
Host: graph.facebook.com 

Where the number 170838892958036 is the node(page) id and the access_token is the one previously obtained, since I do not have permissions I will get the following:


{"data":[],
"paging":
{"previous":"https:\/\/graph.facebook.com\/v2.5\/170838892958036\/insights\/page_fans?access_token=515365081974110\u00257C5gM5WkAfUZLUm7f2n8t0_icPqb0&since=1449087470&until=1449346670",
"next":"https:\/\/graph.facebook.com\/v2.5\/170838892958036\/insights\/page_fans?access_token=515365081974110\u00257C5gM5WkAfUZLUm7f2n8t0_icPqb0&since=1449605870&until=1449865070"
}
}

Please ignore the access_token since it is not the real one but note that the response contains "data": []  which is empty, the expected one should look like:


{
  "data": [
    {
      "name": "page_fans",
      "period": "lifetime",
      "values": [
        {
          "value": 50,
          "end_time": "2015-12-05T08:00:00+0000"
        },
        {
          "value": 50,
          "end_time": "2015-12-06T08:00:00+0000"
        },
        {
          "value": 50,
          "end_time": "2015-12-07T08:00:00+0000"
        }
      ],
      "title": "Lifetime Total Likes",
      "description": "Lifetime: The total number of people who have liked your Page. (Unique Users)",
      "id": "170838892958036/insights/page_fans/lifetime"
    }
  ],
  "paging": {
    "previous": "https://graph.facebook.com/v2.5/170838892958036/insights/page_fans?access_token=CAACEdEose0cBADYixYmUPSmjTZBAjNTDyZCBm5omZAQV6KFwEZBWBM6XUVSr7p3ClYiFHcaocjs3d323nAExn2Sn3pOPKudsZC43wRFYOVON5VitrPUEvHbKIFofb3o1TAJteaCqSxZCo9Pf0Fda6VGqizeKE00ZAJ2P8swfhyS9FKbGBvRZBXqpZAYezP2ZALal8DQ4Uz95iITI9d2OWzbJzs&debug=all&format=json&method=get&pretty=0&suppress_http_code=1&since=1448913822&until=1449173022",
    "next": "https://graph.facebook.com/v2.5/170838892958036/insights/page_fans?access_token=CAACEdEose0cBADYixYmUPSmjTZBAjNTDyZCBm5omZAQV6KFwEZBWBM6XUVSr7p3ClYiFHcaocjs3d323nAExn2Sn3pOPKudsZC43wRFYOVON5VitrPUEvHbKIFofb3o1TAJteaCqSxZCo9Pf0Fda6VGqizeKE00ZAJ2P8swfhyS9FKbGBvRZBXqpZAYezP2ZALal8DQ4Uz95iITI9d2OWzbJzs&debug=all&format=json&method=get&pretty=0&suppress_http_code=1&since=1449432222&until=1449691422"
  }

}

In the above response you can see that the page has 50 likes. 

There are many statistics and information that you can retrieve from Facebook, check all API options. If you are interested in metrics about your Facebook Page such as the number of stories generated about your Page, the total number of people who liked your Page, etc. look at Facebook's Insights Metrics (more info in Insights Metric). 
  

In order to get the extended permissions you have to first submit your app for review, in general the steps:


  1. Go to your application dashboard.
  2. Click on "Status & Review"
  3. Click on "Start a Submission"




  4. You will have to fill the form and follow all the steps. The approval process takes around 7 business days.



Wednesday, December 2, 2015

PHP Restrict Objects Access based on Security Profiles

When you are building a web application or a web site and you want to restrict access to pages, links, buttons, etc. you can take many approaches, one approach may be to hide the objects you do not want the user to have access to, another approach is to gray/disable objects that are restricted. Both approaches have their advantages and disadvantages. I know customers that do not like things to disappear, they like more a homogeneous interface and some other customers do not like to see options that are not available. So which approach is the best, it depends on your customer and on your application design.

No matter what approach you use, you need to be able to uniquely identify such objects, that way you may create different profiles with different accesses to different elements or objects, but what happens if you have hundreds or thousands objects that you want to control its access.

You can give an ID to each object and when a user logs in, it will load all the allowed IDs into a memory array and you will have to query that array for every restricted object. That may be a lot of memory. Another approach is to query the database for each of the restricted objects, but again you may need to query the database several times on each page or create an array at the beginning and query it for each object.

The approach I like is to uniquely identify each restricted object using a bit, this means that for each byte I can store 8 different objects, so to uniquely identify 80 objects I only need 10 bytes, for 500 objects I need 63 bytes (500 objects/8 bits in a byte) and for 1000 I need 125 bytes.

The object IDs will be defined using a number that is divided in two parts, the first one will identify the byte position within a string and the second one will identify the bit position within that byte. The first one can be any number from 0 till whatever, depending on the number of objects we have and the second one will go from 1 till 8, the number of bits in a byte. The below code defines 3 objects, the first byte (0) defines the position in the security string and the second byte(1,2,3) defines the bit position within that byte.


 const MAIN_PAGE = "01"; // bits: 00000001 
 const MENU_ENTRY_DETAILS = "02";  // bits: 00000010 
 const MENU_ENTRY_UPDATE = "03";  // bits: 00000100

Each user will have a string that will represent its access, that string will contain all the bits that represent all the objects the user has access to. This string is usually build based on the security profile the user has in the database. 

If the user only has access to the first two elements, its security string will be defined as:

 $security = 0b00000011;   

if we want the user to have access to the second and third the security string will be defined as:


 $security = 0b00000110;   

and full access will be:


 $security = 0b00000111;   


Let's do an example to depict this approach, we will set it to hold a maximum of 80 objects (10 bytes). The below code define the restricted objects:


 const MAIN_PAGE = "01";  
 const MENU_ENTRY_DETAILS = "02";  
 const MENU_ENTRY_UPDATE = "03";  
 const MENU_ENTRY_ADD = "04";  
 const PAGE_ORDER_DETAILS = "05";  
 const PAGE_ORDER_DETAILS_EDIT = "06";  
 const PAGE_ORDER_DETAILS_ADD  = "07";  
 const MAIN_PAGE_CHANGE_PASSWORD = "08";  
 const PAGE_USERS_VIEW = "11";  
 const PAGE_USERS_ADD = "12";  
 const PAGE_USERS_EDIT = "13";  
 const PAGE_USER_DELETE = "14";  
 const EXTERNAL_LINKS = "15";  
 const MAIN_PAGE_END_SESSION = "16";  
 const MAIN_PAGE_NEW_SESSION = "17";  


As you can see each one has two digits (in this example), the first digit represents its position within the security string and the second one represents the bit position within a byte, that way the last digits goes from 1 till 8.

When the user logs in, we need to call a function that returns its security string based on its security profile, the next function will do the job for our example:


1:       public static function getSecurityString() {  
2:            $security="";  
3:            $permissions = array_fill(0,self::M_SECURITY_STRING_LEN,0);  
4:            /* begin: this should be ontained from a DB or other source*/  
5:            $objects = array();  
6:            $objects[0] = "01"; //main page  
7:            $objects[1] = "02"; //menu entry details  
8:            $objects[2] = "05"; //page order details  
9:            $objects[3] = "06"; //page order details edit   
10:           $objects[4] = "07"; //page order details add   
11:           $objects[5] = "08"; //main page change password  
12:           $objects[6] = "11"; //page users view  
13:            /* end: this should be ontained from a DB */  
14:            for ($count=0;$count<count($objects);$count++) {  
15:                 $pos = substr($objects[$count],0,strlen($objects[$count])-1);  
16:                 $value = substr($objects[$count],strlen($objects[$count])-1) - 1;  
17:                 if ($pos < self::M_SECURITY_STRING_LEN) {  
18:                      $permissions[$pos] = $permissions[$pos] | (1 << $value);   
19:                 } else {  
20:                      //this should not happen, raise an error  
21:                 }  
22:            }  
23:            for ($count=0; $count < self::M_SECURITY_STRING_LEN; $count++) {  
24:                 $security = $security . pack("C1",$permissions[$count]);  
25:            }  
26:            return $security;  
27:       }  

Lets talk about the above code:

Line 3: initialized the security string with zeros. (no access)
Lines 4-13: Define the objects the user has access to, this will usually come from an external source such as a database. It is hard coded here for simplicity.
Line 14: Executes for every object
Line 15: Extracts the byte position from the security string
Line 16: Extracts the bit position within the byte.
Line 18: Sets the bit from the right byte of the security string
Line 23: Executes for every byte of the security string
Line 24: Builds the security string attaching all the bytes.

Once we have the security string, we can store it on a variable or session variable.


 $secStr = Security::getSecurityString();  

Now for each restricted object you will have code similar to the below one:


1:  if (Security::isAllowed($secStr,Security::PAGE_USER_DELETE)) {  
2:       echo "access is granted";  
3:       //execute you restricted code  
4:  } else {  
5:       echo "access is denied";  
6:       //execute the code when access is denied or hide/gray the elements  
7:  }  

The function isAllowed is defined as follows:


1:  public static function isAllowed($_security, $_ID) {  
2:            $pos=0;  
3:            $value=0;  
4:            $secValue=0;  
5:            $secString=0;  
6:            $pos = substr($_ID,0,strlen($_ID)-1);  
7:            $value = substr($_ID,strlen($_ID)-1) - 1;  
8:            $secArray = unpack('C1', $_security{$pos});  
9:            $secString = $secArray[1];  
10:            $secValue = (1 << $value);  
11:            if ( ($secString & $secValue) != 0) {  
12:                 return true;  
13:            } else {  
14:                 echo "Access Denied to object: " . $_ID;  
15:            }  
16:            return false;  
17:       }  

Line 6: Retrieves, from the element ID, the byte position within the security string.
Line 7: Retrieves, from the element ID,  the bit position within the byte.
Line 8-9: From the security string, retrieves the byte based on the previously obtained position. 
Line 10: Based on the bit position obtained in line 7, we create a byte with that bit set.
Line 11: Compares the bit set in the security string with the one of the element ID.
Line 12: If the value is not zero is allowed.

You need to add some validations in these functions that were omitted for simplicity, for example, in the isAllowed function, you need to make sure that the position is not bigger than the length of the security string.

The definition of the Security class is as follows:


1:  class Security {  
2:       private $m_security="";  
3:       const M_SECURITY_STRING_LEN = 10;  
4:       const TOTAL_OBJECTS = 15;  
5:       const MAIN_PAGE = "01";  
6:       const MENU_ENTRY_DETAILS = "02";  
7:       const MENU_ENTRY_UPDATE = "03";  
8:       const MENU_ENTRY_ADD = "04";  
9:       const PAGE_ORDER_DETAILS = "05";  
10:       const PAGE_ORDER_DETAILS_EDIT = "06";  
11:       const PAGE_ORDER_DETAILS_ADD  = "07";  
12:       const MAIN_PAGE_CHANGE_PASSWORD = "08";  
13:       const PAGE_USERS_VIEW = "11";  
14:       const PAGE_USERS_ADD = "12";  
15:       const PAGE_USERS_EDIT = "13";  
16:       const PAGE_USER_DELETE = "14";  
17:       const EXTERNAL_LINKS = "15";  
18:       const MAIN_PAGE_END_SESSION = "16";  
19:       const MAIN_PAGE_NEW_SESSION = "17";  
20:       public static function getSecurityString() {  
21:            $security="";  
22:            $permissions = array_fill(0,self::M_SECURITY_STRING_LEN,0);  
23:            /* begin: this should be ontained from a DB or other source*/  
24:            $objects = array();  
25:            $objects[0] = "01"; //main page  
26:            $objects[1] = "02"; //menu entry details  
27:            $objects[2] = "05"; //page order details  
28:            $objects[3] = "06"; //page order details edit   
29:            $objects[4] = "07"; //page order details add   
30:            $objects[5] = "08"; //main page change password  
31:            $objects[6] = "11"; //page users view  
32:            /* end: this should be ontained from a DB */  
33:            for ($count=0;$count<count($objects);$count++) {  
34:                 $pos = substr($objects[$count],0,strlen($objects[$count])-1);  
35:                 $value = substr($objects[$count],strlen($objects[$count])-1) - 1;  
36:                 if ($pos < self::M_SECURITY_STRING_LEN) {  
37:                      $permissions[$pos] = $permissions[$pos] | (1 << $value);   
38:                 } else {  
39:                      //this should not happen, raise an error  
40:                 }  
41:            }  
42:            for ($count=0; $count < self::M_SECURITY_STRING_LEN; $count++) {  
43:                 $security = $security . pack("C1",$permissions[$count]);  
44:            }  
45:            return $security;  
46:       }  
47:       public static function isAllowed($_security, $_ID) {  
48:            $pos=0;  
49:            $value=0;  
50:            $secValue=0;  
51:            $secString=0;  
52:            $pos = substr($_ID,0,strlen($_ID)-1);  
53:            $value = substr($_ID,strlen($_ID)-1) - 1;  
54:            $secArray = unpack('C1', $_security{$pos});  
55:            $secString = $secArray[1];  
56:            $secValue = (1 << $value);  
57:            if ( ($secString & $secValue) != 0) {  
58:                 return true;  
59:            } else {  
60:                 echo "Access Denied to object: " . $_ID;  
61:            }  
62:            return false;  
63:       }  
64:  }  

With this approach, you can restrict access to many objects using little memory and I/O. I have use it in a Java environment and it works very good. This PHP version has not been tested, so please let me know if you find issues or improvements.


Monday, November 23, 2015

Obtain Diameter Average Response Time with Wireshark

Obtain Diameter Average Response Time with Wireshark


To get the average response time of diameter credit control requests using wireshark do the following:


1. Open a capture file in wireshark







2. From the "Statistics" menu select "I/O Graph". If wireshark starts to parse the content you may cancel it.

3. On the "I/O Graph" window, under the "Y axis" section,  set for the Unit field the value "Advance"



4. On the "Graphs" Section we need to fill the fields as follows:
  • Filter: (diameter.flags.request == 0 && diameter.cmd.code == 272)
  • Calc select: AVG(*) type: diameter.resp_time


What we are doing here is that we are filtering all the requests and getting only the responses (diameter.flags.request==0) and making sure that the requests are credit control requests (diameter.cmd.code==272). 

5. Click on "Graph 1"



That's it. 



Friday, November 20, 2015

SS7 translation into SIP did not trigger more services

Some years ago there were some limitation is the MSCs that did not allow Telco providers to offer more services; then new solutions arrived to the market such as service/mediation controllers and many of those limitations were removed, one of such limitations was that the MSC was only able to connect to one service control point (SCP).

The service controller came to solve that limitation, together with series of additional options that opened the doors for Telco operators to offer additional services (VAS). Now operators may orchestrate calls, sending the same call setup to multiple services allowing for differentiate charging, VPN services, location services, the use of application servers, etc…

But there is one particular service that I think operators did not took advantage of, and it was the possibility to translate SS7 signaling into SIP signaling. This translation allows operators to use an application server to develop any service they want using almost any programming language and opened the possibility of using “common” programmers for manipulating SS7, that some years ago was very difficult and not many people had the knowledge.

With the possibility of manipulating any call using SIP and any programming language such as Java, I would expect Telco operators to start offering many more services, something I am not sure that happened; at least it did not happen with some of the operators I know.  I would expect that subscribers will have a self service access to services such as black/white lists, multi-ring, call diversion, access to their call history anytime, restrict call hours, etc.; in some aspects I would like to see my phone service to beehive as my email box, when I receive a call from an unknown or undesirable source (spam) I will like to block it in addition to the possibility to create rules and actions for certain phone numbers.

However, opening the SS7 network to Java programmers did not trigger an explosion of services, few were developed but most of them were still been acquire such as number portability solutions. So it seems to me that Telco operators are still comfortable with the buy-in approach more that in-house development of network services, pretty much as they were 20 years ago.


Thursday, November 19, 2015

Ética en las TICs (Tecnología, Información y Comunicación)

En este post hablaremos sobre la ética en el uso de la tecnología, particularmente enfocado a escuelas.

Existen diversas definiciones de que es la ética, para nuestros efectos vamos a utilizar la siguiente definición:


  • Principios de conducta que gobiernan a un individuo o grupo
  • Decisiones éticas involucran un juicio de valores (bueno, malo, correcto, incorrecto, mejor, peor)
  • Involucra moralidad
  • La ley por si sola no es una guía para decidir si algo es ético o no.


Algunas veces, la gente que es percibida como muy ética actúa de manera poco ética, pero, qué es lo que hace que la gente haga cosas malas? Una explicación nos la da la teoría de neutralización que en general dice:

  • Aprendemos comportamiento convencional así como uno desviado de lo normal
  • Aprendemos técnicas para neutralizar valores positivos
  • Nos desviamos de nuestros valores normativos adoptando temporalmente actitudes de neutralización que anestesian nuestro sistema de valores.
Por ejemplo:
  • Negación de Responsabilidad. El infractor justifica sus actos debido a una fuerza fuera de su control.
  • Nadie será Afectado. El infractor decide que nadie va a ser afectado.
  • No Hay victimas. El infractor decide que aunque alguien puede salir afectado, se lo merece.
  • Condena de los que Condenan. Los infractores deciden que los que los critican son hipócritas.
  • Apelar a Lealtades mas Altas. Las exigencias de algún grupo cercano tienen prioridad sobre las necesidades de cualquier persona que pueda ser afectada por las acciones del ofensor.
  • En Defensa del Necesitado. Los infractores deciden que sus acciones son para un fin en particular, por lo que no se sienten culpables.
  • Metáfora de Ledger. Los infractores deciden que han hecho muchas cosas buenas por lo que pueden hacer unas malas.

La relación que tiene la ética y la tecnología esta en que la ética tecnológica es un conjunto de principios morales que regulan su uso, incluyendo el uso que hacemos de los derechos de autor, de la privacidad y de los efectos que esto tiene en nuestra sociedad. Con respecto a esto, la pregunta no es si podemos hacer algo, si no mas bien si debemos hacerlo.


Reputación


Hoy en día tenemos por lo menos dos reputaciones que mantener, una digital y una real. Ambas deben de ser mantenidas correctamente y sus alcancen y gestión son distintas. Nuestra reputación digital tiene las siguientes características:

  • Bueno es muy positiva
  • Mala es desastrosa
  • No hay un botón de borrar
  • Es persistente
  • Visible a nivel global
  • Replicable
  • Se puede buscar
Debido a esto, es muy importante hacer el mejor uso de nuestro criterio cada vez que deseamos hacer una publicación. Debemos de pensarlo por lo menos 2 veces antes de publicar algo. Por ejemplo, si en nuestra cuenta de Facebook algunos de nuestros amigos también son nuestros clientes, nuestras publicaciones aunque sean puntos de vista personal también afectan nuestra imagen comercial. Al final del día somos la misma persona y aunque publicamos en nuestra cuenta personal y lo compartimos con nuestros amigos también estamos mostrando cual es nuestra postura, valores, políticas, etc a nuestros clientes que quizá no los comportan o estén limitados a realizar transacciones con personas con ese perfil.

Seguridad en Internet

Reglas de Oro


  1. Mantén tu privacidad. Lo que la gente sabe de ti depende de ti.
  2. Protege tu reputación. Reflexión antes de revelación. Lo que es gracioso hoy te podría costar mañana.
  3. Nada es privado en línea. Todo lo que digas o hagas puede ser copiado, pegado y mandado a millones de personas sin tu permiso.
  4. Asume que todos te están mirando. Hay una gran audiencia en Internet. Si alguien es amigo de tu amigo puede ver todo.
  5. Aplica la regla de oro. Si no quieres que te lo hagan a ti no lo hagas a otros.
  6. Balancea tu tiempo. Un abrazo virtual no es lo mismo que uno real. Mantén un balance en tu vida.
  7. Selecciona Inteligentemente. No todo el contenido es apropiado. Sabes a lo que nos referimos.
  8. No te escondas. Utilizar el anonimato para ocultar tus acciones no te convierte en una persona responsable y confiable.
  9. Piensa en lo que ves. Solo porque esta en línea no quiere decir que es verdad.
  10. Se inteligente y mantente seguro. No todos son lo que dicen ser.

El Comportamiento y la Tecnología


Como hemos mencionado hay personas buenas que por alguna razón hacen cosas malas, pero también hay personas que hacen cosas malas sin pensar en las consecuencias. Cada vez hay más países legislan en contra del ciber bullying. 


Los 5 crímenes mas populares son:

  • Fraudes reembolso de impuestos
  • Robo de cuentas
  • Robo de Identidad
  • Robo de información sensitiva.
  • Robo de Propiedad Intelectual




El problema más popular no es hacking or cracking sino:
  • Descarga de software y juegos de manera no autorizada
  • Mal uso de la propiedad intelectual y derechos de autor.

También es importante notar el alcance, con la tecnología nuestro alcance es mucho mayor y esta controlado muchas veces por terceros.

  • Trabajo local efecto global
  • Efecto Durable
  • No se puede borrar




Estudio de RIT

Estudiantes de Secundaria y Preparatoria


  • 21% admiten haber utilizado un dispositivo electrónico para hacer trampa en la escuela.
  • 12% admiten haber copiado un trabajo del Internet
  • 65% han bajado música de manera ilegal; 
  • 34% han bajado películas de manera ilegal.
fuente: http://scholarworks.rit.edu/cgi/viewcontent.cgi?article=2426&context=article

Lo que no Debemos hacer


  • Debería de compartir una foto de mi amig@ o novi@ en facebook?
  • Esta bien bajar una canción de la cual no tengo derechos?
  • Piratería
  • Plagio
  • Hacking
  • Bullying
  • Etc…


Material Obsceno


El material obsceno se refiere a material que ofende la moral y la normativa sexual, ya sea expresado de manera verbal, escrita, con imágenes, acciones etc... y si mandar fotos tuyas o de tus amigos en ropa interior o desnudos se puede considerar material obsceno.



Es importante tener conciencia de las consecuencias de tomar, mandar o ver material obsceno. Cabe mencionar que según un estudio, en EU 39% de los adolescentes han mandado o subido un email o texto con material sexualmente sugestivo. Esto se llama Sexting y es ilegal, se considera como un crimen y es tratado como tal. 

Mandar uno foto de un amig@ desnudo o en ropa interior, se considera como pornografía infantil y es un delito que se persigue de oficio, en este caso, tus padres no podrán protegerte y te tendrás que enfrentar a las leyes.



Que Hacer?

Bueno pues muy sencillo:

  • No mandar fotos desnudoso en ropa interior
  • No tomar fotos de amig@s desnudos en ropa interior
  • Aunque sean novios no tomarse fotos desnudos
  • En general, no hacer algo que en público no harías. Cuando mandas por Internet es considerado como público.


Tener Cuidado

                 No tomarse fotos desnudos
  • Photo Stream
    • Las fotos se distribuyen automáticamente.
  • Social Media
    • No se pueden borrar una vez publicadas. Si ya se, si las puedes borrar de tu cuenta, pero quien te garantiza que alguien no la haya copiado o reenviado para ese entonces?
  • Amigos de mis amigos




Derechos de Autor

  • Sino dice lo contrario, se asume que tiene todo el material en Internet tiene derechos de autor y no lo puedes copiar o tomar sin permiso
  • Da crédito al propietario o a la fuente

Hacking

  • Un Computer Hacker es un experto en computadoras.
    • No debes de forzar un acceso a una computadora
    • No debes sobrepasar la seguridad de una computadora
    • No debes de obtener información privada de otros
    • No debes de dañar equipos ajenos

CyberBulling


El cyberbulling es lo mismo que bullying, el hecho que no estés enfrente de una persona no quiere decir que sea anónimo o que te puedas ocultar. Los gobiernos cada vez crean leyes mas duras para enfrentar esto y muchas veces los jovenes, menores de edad, son enjuiciados como adultos. México tiene la ley para la promoción de la convivencia libre de violencia en el entorno escolar.







Uso en la Escuela

La tecnología ya esta presente en todos nuestros aspectos de la vida cotidiana por lo que es natural que también este presente en las escuelas. Esto no quiere decir que los alumnos deban de utilizar dispositivos tecnológicos siempre, más bien, deberán aprender a utilizarlos cuando sea apropiado y de la manera apropiada, como una herramienta mas de trabajo, investigación y aprendizaje. Dependiendo de la edad, se debe de regular y se deberá contar con clases o instrucción sobre ciudadanía digital.




BuenoMalo
Tomar notasTomar fotos que no son solicitadas
Investigación de un asunto relacionado con la lecturaBrincarse los procedimientos del colegio
Colaboración de un asunto relacionado con la lecturaMolestar o hacer bullying
Grabar una clase
Actividades ilegales o criminales
No limitado a bajar música, peliculas, etc sin permiso
Copiar sin citar o sin permiso
Comunicarse con otros cuando no es el momento apropiado.

Recuerden

Un Crimen es un Crimen!!!

                     Tomarse fotos desnud@s y compartirlas es Sexting, 
                                                                       y es un delito


Los Mandamientos


  1. No usar la computadora para dañar a otros
  2. No interferir con el trabajo de otros
  3. No husmear en los archivos de otros
  4. No debes de utilizar la computadora para robar
  5. No debes de utilizar la computadora para dar testimonios falsos.
  6. No debes copiar o utilizar software del que no hayas pagado.
  7. No debes de utilizar los recursos de otras computadoras sin autorizacion o compensación
  8. No te debes de apropiar de la propiedad intelectual de otras personas
  9. Piensa en las consecuencias sociales de los programas que escribes o diseñes.
  10. Utiliza la computadora de una manera que muestre respeto y consideración de otras personas.

Fuentes y Referencias


  • http://www.techterms.com/definition/computerethics
  • Dessler, 1998
  • Gresham Sykes and David Matza (1957) and extended by Carl Klockars (1974) and William Minor (1981)
  • http://www.ikeepsafe.org/be-a-pro/reputation/
  • http://www.drhowie.com/
  • http://www.ikeepsafe.org/be-a-pro/ethics/
  • http://www.fbi.gov/stats-services/publications/law-enforcement-bulletin/july-2010/sexting
  • http://www.macobserver.com/tmo/article/how-to-understand-and-work-with-your-icloud-photo-stream
  • http://www.pitt.edu/~skvarka/education/copyright/
  • http://www.library.dmu.ac.uk/Support/Copyright/index.php?page=425
  • http://e-quipped.com.au/2011/12/03/the-ten-commandments-of-computer-ethics/
  • http://scholarworks.rit.edu/cgi/viewcontent.cgi?article=2426&context=article