Summary of the invention
The technical problem that the present invention mainly solves is to provide a kind of method and the mobile terminal device that automatically dial IP toll number, automatically can identify whether the telephone number that user dials is toll number, if toll number then adds pulling way IP number automatically, improve user experience.
Automatically dial a method for IP toll number, comprising:
Obtain number to be called;
Judge whether user is provided with automatically to add and pull out IP toll number function;
If user is provided with automatically to add pull out IP toll number function, then judge whether number to be called and loCal number are same ownership place;
If this number to be called and loCal number are not same ownership place, then obtain and be preset in local IP toll number;
Before number to be called, add IP toll number form new number to be called, and call out this new number to be called.
Further, judge user also comprises after whether being provided with the step automatically adding and pull out IP toll number function:
If user does not arrange automatically to add pull out IP toll number function, then directly call number to be called.
Further, judge user also comprises after whether being provided with the step automatically adding and pull out IP toll number function:
Judge that number to be called is phone number or base number;
If this number to be called is phone number, then judge that whether number to be called and loCal number be that the step of same ownership place is specially:
Judge whether this number to be called and loCal number are same ownership place according to the first seven of number to be called.
Further, judge that whether this number to be called and loCal number be that the step of same ownership place comprises according to the first seven of number to be called:
Obtain the front three data of this number to be called, and judge to be preset in local local number table whether there is the identical network segment position with these front three data, wherein, local number table comprises three network segment positions corresponding with the ownership place of loCal number and corresponding four serial numbers;
If there is not network segment position identical with these front three data in local number table, then this number to be called and loCal number are not same ownership place, perform the step obtaining and be preset in local IP toll number.
Further, judgement also comprises after being preset in local local number table and whether there is the step of the identical network segment position with these front three data:
If existed and the identical network segment position of front three data in local number table, then obtain the 4th of this number to be called to the 7th bit data, and judge whether to exist the 4th of number to be called with this in local number table to the identical serial number of the 7th bit data;
If do not existed in local number table with the 4th of number to be called the to the identical serial number of the 7th bit data, then this number to be called and loCal number are not same ownership place, perform the step obtaining and be preset in local IP toll number.
Further, also comprise after judging whether to exist in local number table the 4th of number to be called with this step to the identical serial number of the 7th bit data:
If exist in local number table with the 4th of number to be called to the identical serial number of the 7th bit data, then this number to be called and loCal number are same ownership place, directly call described number to be called.
Further, judgement also comprises before being preset in local local number table and whether there is the step of the identical network segment position with front three data:
From prefix table, retrieve the regional index corresponding to loCal number according to the first seven of loCal number, wherein, prefix table comprises four serial numbers of the regional index of different regions, three corresponding network segment positions and correspondence;
From prefix concordance list, three network segment positions corresponding with this area's index and corresponding four serial numbers are retrieved, to generate described local number table according to this area's index.
A kind of mobile terminal device, comprising:
First acquisition module, for obtaining number to be called;
First judge module, pulls out IP toll number function for judging whether user is provided with automatically to add;
Second judge module, for be provided with as user automatically add pull out IP toll number function time, then judge whether this number to be called and loCal number are same ownership place;
Second acquisition module, during for judging number to be called and loCal number when the second judge module not for same ownership place, obtaining and being preset in local IP toll number;
Calling module, forms new number to be called for adding described IP toll number before number to be called, and calls out this new number to be called, or directly call described number to be called.
Further, this mobile terminal device also comprises:
3rd judge module, for judging that the number to be called that the first acquisition module obtains is phone number or base number;
Described second judge module comprises:
First acquiring unit, for when the 3rd judge module judges that number to be called is phone number, obtains the front three data of this number to be called;
First judging unit, for judging the identical network segment position of front three data that whether there is the number to be called obtained with the first acquiring unit in local number table;
Second acquisition unit, during for judging to there is network segment position identical with the front three data of number to be called in local number table when the first judging unit, obtains the 4th of this number to be called to the 7th bit data;
Second judging unit, for judging whether to exist in local number table the 4th of the number to be called obtained with second acquisition unit to the identical serial number of the 7th bit data.
Further, this mobile terminal device also comprises:
Retrieval module, for retrieving the regional index corresponding to loCal number from prefix table according to the first seven of loCal number, wherein, prefix table comprises four serial numbers of the regional index of different regions, three corresponding network segment positions and correspondence;
Local number table generation module, three network segment positions corresponding with regional index and corresponding four serial numbers retrieved in the regional index for retrieving according to retrieval module from prefix concordance list, to generate described local number table.
The invention has the beneficial effects as follows: the situation being different from prior art, in the present invention, IP toll number function is pulled out when user to be provided with in mobile terminal inside automatically to add when dialing toll number, judge whether this number to be called and loCal number are same ownership place again, if not same ownership place, then be preset in local IP toll number form new number to be called by adding to pull out before this number to be called, then call out the number to be called that this is new; Method provided by the invention can identify whether the number that user dials is toll number automatically, if toll number then adds pulling way IP number automatically, all manually add IP toll number in rate that user can be enjoyed privileges when dialing toll number at every turn and noting be used in dial at every turn, improve user experience.
Embodiment
Consult Fig. 1, the first embodiment that the present invention dials the method for IP toll number automatically comprises:
101, number to be called is obtained;
Acquisition for mobile terminal number to be called, this number to be called can be user by the keyboard of mobile terminal or touch-screen input, or selects input from cell-phone telephone book, does not limit herein;
102, judge whether user is provided with automatically to add and pull out IP toll number;
After getting number to be called in a step 101, then judge whether user is provided with needs at this mobile terminal and automatically adds the setting option pulling out IP toll number function;
If 103 users are provided with automatically to add pull out IP toll number function, judge whether this number to be called and loCal number are same ownership place;
If judge that user is provided with the setting option automatically adding and pull out IP toll number function at this mobile terminal in a step 102, judge whether this number to be called and loCal number are same ownership place again, if be same ownership place, this number to be called is not toll number, does not need to add to pull out IP toll number; If not same ownership place then this number to be called be toll number, need to add and pull out IP toll number;
If 104 numbers to be called and loCal number are not same ownership place, then obtain and be preset in local IP toll number;
If judge that number to be called and loCal number are not same ownership place in step 103, then obtain the IP toll number being set in advance in mobile terminal this locality;
105, before number to be called, add described IP toll number and form new number to be called, and call out this new number to be called;
Obtain after being arranged on the IP toll number of mobile terminal this locality, this IP toll number is added on before number to be called, forms new number to be called, and call out this new number to be called;
In the present embodiment, IP toll number function is pulled out when user to be provided with in mobile terminal inside automatically to add when dialing toll number, judge whether this number to be called and loCal number are same ownership place again, if not same ownership place, then be preset in local IP toll number form new number to be called by adding to pull out before this number to be called, then call out the number to be called that this is new; Method provided by the invention can identify whether the number that user dials is toll number automatically, if toll number then adds pulling way IP number automatically, all manually add IP toll number in rate that user can be enjoyed privileges when dialing toll number at every turn and noting be used in dial at every turn, improve user experience.
Consult Fig. 2, the second embodiment that the present invention dials the method for IP toll number automatically comprises:
201, the number to be called of user's input is obtained;
User inputs number to be called, this number to be called of acquisition for mobile terminal by the keyboard of mobile terminal or touch-screen;
202, judge whether user is provided with automatically to add and pull out IP toll number function;
If judge that number to be called is phone number in step 202., then judge that whether user is provided with automatically to add in this locality again and pull out IP toll number function, concrete: whether mobile terminal is searched to arrange and automatically added the global variable pulling out IP toll number and be set to require automatically to add to pull out IP toll number in this locality is arranged, if this global variable is set to require automatically to add to pull out IP toll number, then illustrate that user is provided with in this locality automatically to add and pull out IP toll number function, perform step 203; If this global variable is not set to require automatically to add to pull out IP toll number, then illustrates that user is not provided with automatically to add in this locality and pull out IP toll number, perform step 213;
203, judge that number to be called is phone number or base number;
Judge that user is after this locality is provided with and automatically adds and pull out IP toll number function in step 202., judge that this number to be called is phone number or base number again, if judge that number to be called is phone number, judge whether this number to be called and loCal number are same ownership place according to the first seven of number to be called again, the description of concrete refer step 204 to step 207, if judge that number to be called is base number, then perform step 211; Or, if judge that number to be called is base number, this number to be called can also be directly called, namely perform step 213;
204, the front three data of number to be called are obtained;
If judge in step 203 that number to be called is phone number, then obtain the front three data of number to be called again;
205, judge in local number table, whether to there is network segment position identical with the front three data of number to be called;
After obtaining the front three data of number to be called in step 204, then judge in local number table, whether to there is network segment position identical with the front three data of number to be called, if existed, then perform step 206, if there is no, then perform step 208; Wherein, local number table comprises regional index, three network segment positions of correspondence and four serial numbers of correspondence; First mobile terminal retrieves the multipair regional index of answering of loCal number according to the first seven of loCal number from prefix table, three network segment positions and corresponding four serial numbers that retrieval is corresponding with regional index from prefix concordance list are obtained again according to this area's index, to generate described local number table, wherein, prefix table comprises four serial numbers of the regional index of different regions, three corresponding network segment positions and correspondence; Be described for prefix table 1 below:
Table 1
Area index |
Network segment position |
Serial number |
1 |
130 |
0020 |
1 |
130 |
0055 |
…… |
…… |
…… |
1 |
139 |
3562 |
2 |
135 |
0587 |
2 |
135 |
0588 |
…… |
…… |
…… |
2 |
136 |
5987 |
…… |
…… |
…… |
n |
130 |
8875 |
Save four serial numbers of the regional index of different regions, three corresponding network segment positions and correspondence in prefix table 1; Such as loCal number is 1350588, from table 1, retrieve regional index corresponding to loCal number is 2, then from table 1, retrieve according to this area's index 2 three network segment positions and four corresponding serial numbers that all regions index is the correspondence of 2, generate local number table 2;
Table 2
Area index |
Network segment position |
Serial number |
2 |
135 |
0587 |
2 |
135 |
0588 |
…… |
…… |
…… |
2 |
136 |
5987 |
In local number table 2, comprise regional index, three network segment positions and four serial numbers, three list items; Such as loCal number is the phone number in Shanghai City, if the regional index in Shanghai City is 2, the home zone of mobile phone number with user is listed in table 2, i.e. bathypelagic all number segments, as long as the phone number dialed belongs to the number segment listed in table 2, not not just toll number, otherwise be exactly toll number;
If the front three of number to be called is " 588 ", through inquiring about in network segment position in table 2, there is not the network segment of " 588 ", so judge that this number to be called does not belong to the ownership place of loCal number; If the front three of number to be called is " 134 ", through inquiring about in network segment position in table 2, there is the network segment of " 134 ", so judge that this number to be called belongs to the ownership place of loCal number;
206, the 4th of number to be called is obtained to the 7th bit data;
If judge in step 205 that the front three data of the number to be called obtained have identical with the data in network segment position, then obtain the 4th of number to be called again to the 7th bit data;
207, judge whether to exist in local number table with the 4th of number to be called the to the entirely identical serial number of the 7th bit data;
The 4th of number to be called is obtained to the 7th bit data in step 206, to judge whether to exist in local number table with the 4th of number to be called the to the entirely identical serial number of the 7th bit data again, if existed, then perform step 213, if there is no, then step 208 is performed; Concrete:
Local number table is as shown in table 2, if the 4th of number to be called the to the 7th is " 5234 ", through inquiring about in serial number in table 2, there is not the serial number of " 5234 ", so judge that this number to be called does not belong to the ownership place of loCal number; If the front three of number to be called is " 3566 ", through inquiring about in serial number in table 2, there is the serial number of " 3566 ", so judge that this number to be called belongs to the ownership place of loCal number;
208, the IP toll number being preset in this locality is obtained;
If judge that number to be called does not belong to the ownership place of loCal number, obtain and be preset in local IP toll number;
Specifically describe below and pre-set IP toll number how in the terminal:
In mobile terminal system setting option, be provided with " automatically adding IP long-distance " item, and in global variable, be provided with sub-option " startup " and " forbidding ", wherein 0 is forbidding, and 1 for starting; Global variable is defaulted as 0, is namely defaulted as disabled status; If user is when setting, select " enabling ", then according to client identification module card (SIM, Subscriber Identity Module) in international mobile subscriber identity (IMSI, International Mobile Subscriber Identification Number) judge which country which operator is this SIM card belong to, then the long-distance segment number of different IP is added according to different operators, and long-distance for this IP segment number is kept at this locality so that need to add pull out IP long-distance time add and pull out the long-distance segment number of this IP; As shown in Figure 3, concrete:
301, " enabling " option that user selects is received;
302, the IMSI number of reading SIM card, and obtain country's numbering and operator's code name;
After receiving " enabling " option of user's selection, the IMSI number of reading SIM card;
As shown in Figure 4, Fig. 4 is that IMSI forms schematic diagram, and IMSI forms by 15, and first 3 is country's numbering, and ensuing two or three is operator's code name, and the national coding of such as China Mobile is 460, and operator's code name is 01; The national coding of CHINAUNICOM is 460, and operator's code name is 02;
303, the country that judgement obtains numbers and operator's code name is numbered with the country being preset in this locality and whether operator's code name mates;
Country's numbering corresponding to loCal number and operator's code name is previously provided with in this locality, concrete, manually can arrange for user, also can obtain from server end, not limit herein;
Obtain country's numbering and operator's code name from SIM card after, country's numbering that judgement obtains and operator's code name are numbered with the country being preset in this locality and whether operator's code name mates; If the match is successful, then perform step 305, if mate unsuccessful, then perform step 304;
304, user manually arranges IP toll number;
If judge in step 303 that the country obtained numbers and operator's code name is numbered with the country being preset in this locality and operator's code name mates unsuccessful; Or judge in step 307 that the confirmation that user inputs is " cancellation ", then forward to and manually arrange the page, prompting user manually arranges IP toll number;
305, corresponding IP toll number is obtained according to country's numbering and operator's code name;
If the country's numbering judging in step 303 to obtain and operator's code name are numbered with the country being preset in this locality and operator's code name the match is successful, then obtain corresponding IP toll number according to country's numbering and operator's code name, concrete, acquisition can be searched from the file of the IP toll number of the preservation country numbering and operator's code name and correspondence that are set in advance in this locality, also can obtain from server end, not limit herein;
306, prompting frame is ejected, the IP toll number that prompting user finds;
After obtaining corresponding IP toll number according to country's numbering and operator's code name in step 305, eject prompting frame, the IP toll number that prompting user finds, select " determination " or " cancellation " for user;
307, receive the confirmation of user, and judge that this confirmation is " determination " or " cancellation ";
After user selects " determination " or " cancellation ", receive the confirmation of the selection of user, and judge that this confirmation is " determination " or " cancellation "; If " determination ", perform step 308, if " cancellation ", perform step 304;
308, arrange successfully, IP toll number is kept at this locality;
If user input confirmation be " determination ", then IP toll number is kept at this locality, arranges successfully, dial mobile phone long-distance time, will automatically add this IP toll number;
309, judge whether user is provided with IP toll number;
After user manually arranges IP toll number in execution step 304, judge whether user is provided with IP toll number, if user is provided with IP toll number, then perform step 308, if user does not arrange IP toll number, then perform step 310;
310, global variable is set to 0, when dialing phone, can not automatically add IP toll number;
User does not arrange IP toll number in manual setting procedure yet, so, global variable is set to 0, dial mobile phone long-distance time, can not automatically add IP toll number;
209, before number to be called, add IP toll number and form new number to be called;
Obtain in step 211 after being preset in local IP toll number, then before this IP toll number is added on number to be called, form new number to be called;
210, new number to be called is called out;
211, if base number, obtain the area code of this base number;
If judge in step 203 that number to be called is base number, then obtain the area code of this base number;
212, judge that whether this area is identical with the area code of loCal number ownership place;
After obtaining the area code for base number, judge that whether this area code is identical with the area code being preset in local loCal number ownership place; If identical, then perform step 213, if not identical, then perform step 208;
213, this number to be called is directly called;
If judge in step 202 that user does not arrange automatically to add in this locality to pull out IP toll number function, or judge that number to be called be loCal number is same ownership place, then directly call this number to be called;
Flow process is in the present embodiment a kind of implementing procedure for reaching beneficial effect, and the priority between step performs order and can adjust according to actual conditions, and in this present embodiment, the priority execution order of flow process can not as limitation of the present invention;
In the present embodiment, IP toll number is pulled out when user to be provided with in mobile terminal inside automatically to add when dialing toll number, judge whether this number to be called and loCal number are same ownership place according to the first seven of number to be called again, if not same ownership place, then be preset in local IP toll number form new number to be called by adding to pull out before this number to be called, then call out the number to be called that this is new; Method provided by the invention can identify whether the number that user dials is toll number automatically, if toll number then adds pulling way IP number automatically, all manually add IP toll number in rate that user can be enjoyed privileges when dialing toll number at every turn and noting be used in dial at every turn, improve user experience.
Refer to Fig. 5, the first embodiment of mobile terminal device of the present invention comprises:
Arrange module 501: for recording user configuration information, namely whether user requires automatically to add pulling way IP number; If user requires automatically to add No. IP, pulling way, the SIM card so used according to user judges it is which region of that operator, then arrange according to different operators and add long-distance No. IP that pulls out, 17951 are pulled out as China Mobile adds, China Telecom and CHINAUNICOM add pulls out 17909 etc., does not limit herein;
To make a phone call module 502: when making mobile phone, determine whether automatically adding pulling way IP number according to the setting arranging module 501; If user is set to require automatically to add to pull out, then calls and judge that ownership place module 503 is to judge that whether called number is for toll number, if toll number then automatically adds pulling way IP number before number to be called;
Judge ownership place module 503: judge whether loCal number and called number are same ownership place, if not same ownership place, then obtain the long-distance IP number of storage, and before number to be called, automatically add pulling way IP number call out;
In the present embodiment, IP toll number function is pulled out when user to be provided with in mobile terminal inside automatically to add when dialing toll number, judge whether this number to be called and loCal number are same ownership place again, if not same ownership place, then be preset in local IP toll number form new number to be called by adding to pull out before this number to be called, then call out the number to be called that this is new; Method provided by the invention can identify whether the number that user dials is toll number automatically, if toll number then adds pulling way IP number automatically, all manually add IP toll number in rate that user can be enjoyed privileges when dialing toll number at every turn and noting be used in dial at every turn, improve user experience.
Refer to Fig. 6, the second embodiment of mobile terminal device of the present invention comprises:
First acquisition module 601, for obtaining the number to be called of user's input, wherein, this number to be called can be user by the keyboard of mobile terminal or touch-screen input, or selects input from cell-phone telephone book, does not limit herein;
First judge module 602, pulls out IP toll number function for judging whether user is provided with automatically to add;
Second judge module 603, for be provided with as user automatically add pull out IP toll number function time, then judge whether this number to be called and loCal number are same ownership place;
Second acquisition module 604, during for judging number to be called and loCal number when the second judge module 603 not for same ownership place, obtaining and being preset in local IP toll number;
Calling module 605, the IP toll number obtained for adding the second acquisition module 604 before number to be called forms new number to be called, and calls out this new number to be called;
Further, calling module 605 is also for directly calling number to be called;
Further, the mobile terminal device in the present embodiment also comprises:
3rd judge module, for judging that the number to be called that the first acquisition module 601 obtains is phone number or base number;
Retrieval module, for retrieving the regional index corresponding to loCal number from prefix table according to the first seven of loCal number, wherein prefix table comprises four serial numbers of the regional index of different regions, three corresponding network segment positions and correspondence;
Local number table generation module, three network segment positions corresponding with regional index and corresponding four serial numbers retrieved in the regional index for retrieving according to retrieval module from prefix concordance list, to generate local number table;
Further, the second judge module 603 comprises:
First acquiring unit, for when the 3rd judge module judges that number to be called is phone number, obtains the front three data of this number to be called;
First judging unit, for judging the identical network segment position of front three data that whether there is the number to be called obtained with the first acquiring unit in local number table;
Second acquisition unit, during for judging to there is the identical network segment position with front three data in local number table when the first judging unit, obtains the 4th of number to be called to the 7th bit data;
Second judging unit, for judging whether to exist in local number table the 4th of the number to be called obtained with second acquisition unit to the identical serial number of the 7th bit data;
In the present embodiment, IP toll number function is pulled out when user to be provided with in mobile terminal inside automatically to add when dialing toll number, judge whether this number to be called and loCal number are same ownership place again, if not same ownership place, then be preset in local IP toll number form new number to be called by adding to pull out before this number to be called, then call out the number to be called that this is new; Method provided by the invention can identify whether the number that user dials is toll number automatically, if toll number then adds pulling way IP number automatically, all manually add IP toll number in rate that user can be enjoyed privileges when dialing toll number at every turn and noting be used in dial at every turn, improve user experience.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.