Summary of the invention
For the defects of prior art, the present invention can't directly directly be dialed the technical problem of extension set by page text in order to solve prior art, a kind of method and device of automatically dialing extension telephone in the page is provided.
For achieving the above object, the present invention adopts following technical scheme:
On the one hand, the invention provides a kind of method of automatically dialing extension telephone in the page, described method comprises:
When there is the telephone number that can dial in the browser of portable terminal in the page, obtain the operation that the user clicks described telephone number;
Extract the telephone number of described click and identify, behind the extension number in identifying described telephone number, delay is dialed symbol before described extension number, will contain described time-delay and dial the telephone number of symbol and import dialing interface into;
In dialing interface, dial first the main frame number before symbol is dialed in described time-delay, dial symbol according to described time-delay again and automatically dial extension number after symbol is dialed in described time-delay.
Preferably, after delay is dialed symbol before described extension number and before importing dialing interface into, also comprise, filter the irrelevant symbol of dialing outer symbol in the described telephone number except described time-delay.
Preferably, the telephone number that extracts described click is identified and is comprised:
When in judging described telephone number, containing separator, determine that described telephone number contains extension number, and determine that the number behind the described separator is extension number.
Preferably, the number behind described definite described separator is that extension number comprises:
When containing a separator, and the numeric string before the described separator is that the N position is above, the numeric string behind the described separator is that the N-1 position is when following, then determine behind this separator to be extension number, and this separator is replaced with described time-delay dial symbol, be inserted in before the described extension number;
Wherein, described N is the landline telephone figure place in city under the described telephone number.
Preferably, the number behind described definite described separator is that extension number comprises:
When containing one more than the separator, and the numeric string behind the last separator is that the numeric string before following, the last separator in N-1 position is that the N position is when above, then determine behind this last separator to be extension number, and will this last separator replace with described time-delay and dial symbol, be inserted in before the extension number;
Wherein, described N is the landline telephone figure place in city under the described telephone number.
Preferably, the telephone number that extracts described click is identified and is comprised:
When in judging described telephone number, not containing separator, if right parenthesis is contained at described telephone number end, and last to the numeric string in the bracket be below the N-1 position, last numeric string before to the left bracket of bracket is more than the N position, then determine this last to being extension number in the bracket, and with this last left bracket of bracket is replaced with described time-delay and dial symbol, be inserted in before the extension number;
Wherein, described N is the landline telephone figure place in city under the described telephone number.
Preferably, it is the half-angle comma that symbol is dialed in described time-delay, ".
On the other hand, the present invention also provides a kind of device of automatically dialing extension telephone in the page simultaneously, and described device comprises:
Click acquisition module, be used for obtaining the operation that the user clicks described telephone number when the browser of portable terminal during at the telephone number that page existence can be dialed;
Identification module, the telephone number that is used for extracting described click is identified, and behind the extension number in identifying described telephone number, delay is dialed symbol before described extension number, will contain described time-delay and dial the telephone number of symbol and import dialing interface into;
Automatic poking molding piece is used for dialing first main frame number before symbol is dialed in described time-delay at dialing interface, dials symbol according to described time-delay again and automatically dials extension number after symbol is dialed in described time-delay.
Preferably, described device also comprises:
Filtering module, when institute's identification module after delay is dialed symbol before described extension number and before importing dialing interface into, described filtering module is used for filtering described telephone number is dialed outer symbol except described time-delay irrelevant symbol.
Preferably, described device also comprises:
The separator processing module, when the telephone number that extracts described click at described identification module is identified, described separator processing module is used for when judging described telephone number and contain separator, determine that described telephone number contains extension number, and determine that the number behind the described separator is extension number.
In the solution of the present invention, browser automatically identify in the page phone with extension number, dial symbol by delay before described extension number, so that dial in the time-delay of carrying out automatically after called host, to carry out when phone is dialed extension number, need not the user and too much intervene, can realize that a key automatic poking beats extension telephone.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is a part of embodiment of the present invention, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills obtain under the prerequisite of not making creative work belongs to the scope of protection of the invention.
Consider the special circumstances that extension is dialed, technical scheme of the present invention is at first identified the numeric string in the page, behind the extension number that in identifying numeric string, contains, delay is dialed symbol before described extension number, so subsequently carry out phone when dialing automatically after called host, dial symbol according to time-delay, dial the extension number after symbol is dialed in this time-delay, like this, need not the user and too much intervene, can realize that a key automatic poking beats extension telephone.
In an embodiment of the present invention, for clicking the phone that changes the handset dialing interface in the webpage, by the judgement to the extension number rules for writing, identify in the phone with extension number; When user's click is dialed, delay is dialed symbol and is filtered other symbol in the middle of host phone and extension number, thereby the extension number that generates the mobile phone support is dialed form and is inserted dialing interface, realizes allowing the user by clicking the extension number of directly dialing in the web telephone.
As shown in Figure 1, the inventive method comprises step:
When there are the telephone number that can dial in S1, the browser of portable terminal in the page, obtain the operation that the user clicks described telephone number;
S2 extracts the telephone number of described click and identifies, and behind the extension number in identifying described telephone number, delay is dialed symbol before described extension number, will contain described time-delay and dial the telephone number of symbol and import dialing interface into;
S3 dials first the main frame number before symbol is dialed in described time-delay in dialing interface, dial symbol according to described time-delay again and automatically dial extension number after symbol is dialed in described time-delay.
In an embodiment of the present invention, browser determines whether there is the telephone number that can dial in the page, enters dialing interface in response to user's click.In a preferred embodiment, determine telephone number in the page in the page, to be shown as the link that to click according to the label in the page source code, subsequently in response to user's click, call the dialing interface that relevant function starts mobile phone.Generally, mobile phone is used in the source code of the page that shows in (such as browser application etc.) can do special processing to telephone number, such as before telephone number, adopting " wtai: //wp/mc " label to identify, wtai(Wireless Telephony Applications Interface wherein, the wireless telephony application interface) being is at WML(Wireless Markup Language specially, WAP Markup Language) set up the function of call in, a typical example of the source code after telephone number is processed is such as:<ahref=" wtai: //wp/mc:13800138000 "〉13800138000</a 〉.
In preferred embodiment of the present invention, after the user clicks, directly the telephone number in the webpage is not inserted the dialing interface of mobile phone, but first whether the telephone number in the webpage is judged with extension number, if extension number is arranged, then delay is dialed symbol between host number and extension number, and filters out other irrelevant symbol, inserts dialing interface again and dials; If there is not extension number, then only filter out other irrelevant symbol, telephone number is inserted dialing interface dial.In preferred embodiment, utilize existing operation system of smart phone (such as Android, IOS, Windows Phone etc.) to the support of dialing, it is the half-angle comma that symbol is dialed in the time-delay of inserting between host number and extension number; " mobile phone can be treated to delay operation with this symbol when dialing like this, pause a period of time continues to dial extension afterwards again behind the main frame number before dialing this symbol, thereby realizes automatic poking marking plane No..
Corresponding with method of the present invention, the present invention also comprises a kind of device of automatically dialing extension telephone in the page simultaneously, and as shown in Figure 2, described device comprises:
Click acquisition module 201, be used for obtaining the operation that the user clicks described telephone number when the browser of portable terminal during at the telephone number that page existence can be dialed;
Identification module 202, the telephone number that is used for extracting described click is identified, and behind the extension number in identifying described telephone number, delay is dialed symbol before described extension number, will contain described time-delay and dial the telephone number of symbol and import dialing interface into;
Automatic poking molding piece 203 is used for dialing first main frame number before symbol is dialed in described time-delay at dialing interface, dials symbol according to described time-delay again and automatically dials extension number after symbol is dialed in described time-delay.
Further, described device also comprises: filtering module, when institute's identification module after delay is dialed symbol before described extension number and before importing dialing interface into, described filtering module is used for filtering described telephone number is dialed outer symbol except described time-delay irrelevant symbol.
In addition, described device also can comprise: the separator processing module, when the telephone number that extracts described click at described identification module is identified, described separator processing module is used for when judging described telephone number and contain separator, determine that described telephone number contains extension number, and determine that the number behind the described separator is extension number.
The detailed process of judgement and the processing of extension number more specifically, is described by Fig. 3 and corresponding several examples.In the method for the present invention, when detecting the user and click the phone dial the string representation that contains numeral in the page, need to judge first whether comprise separation mark between the alphabet string; Because the mark that current expression phone is separated is generally separator "-" or bracket, thereby in the embodiments of figure 3 to judge that this two classes separation mark is introduced as example but is not limited to this.The relevant technical staff in the field will be understood that the separation mark that forms for other symbols, adopts method of the present invention obviously can process equally, and this two classes separation mark only is a kind of preferred implementation of the present invention, should not be construed as limitation of the invention.
Particularly, referring to Fig. 3, step S301 at first judges whether comprise separator "-" in the character string, if any then carrying out step S302, otherwise carries out step S305;
S302 further judges whether only comprise a separator in the character string, then carries out in this way step S303, otherwise carries out step S308;
S303, whether the length of judging the Connected digits before the separator more than N position (such as 7), is then carried out in this way step S304, otherwise is carried out step S310; Because at present the each department telephone number is all more than 7, this step is used for judging the numeral effective main frame number whether before the separator; It should be noted that, the phone in some cities may be more than 8, so the present invention sets natural number N according to the fixed telephone number figure place in city, according to the actual conditions value, be 7 then N=7 such as A city fixed telephone number figure place, B city fixed telephone number figure place is 8 then N=8.
S304, whether the length of judging the Connected digits behind the separator behind the separator is extension number then in this way below N-1 position (such as 6), with separator replace with time-delay dial symbol (being the half-angle comma; ") carry out again step S310, otherwise directly carry out step S310; Whether this step be used for judges behind the separator extension, and extension mostly is 3 or 4 bit digital generally speaking, for forming difference and comprise as far as possible special extension with the main frame number, here with the N-1 figure place as criterion;
S305, if step S301 does not find separator, then might be all with bracket as separation mark, further judge whether right parenthesis ") of character string end this moment ", if then carry out step S306, otherwise carry out step S310;
S306, judge last to the length of the Connected digits in the bracket whether below 6, then carry out in this way step S307, otherwise carry out step S310;
S307, " whether the length of the Connected digits that (" is front is more than N position (such as 7) to judge last left bracket to bracket, in this way then this last to being extension number in the bracket, then this left bracket is replaced with the time-delay dial symbol (being the half-angle comma; ") carry out again step S310, otherwise directly carry out step S310;
S308, in the character string a plurality of separators are arranged if find among the step S302, then might character string all with separator as separation mark, judge that continuous number string length behind last separator is whether below the N-1 position (such as 6) this moment, then carry out in this way step S309, otherwise carry out step S310;
S309, further judge that the front continuous number string length of last separator is whether more than N position (such as 7), behind this last separator be extension number then in this way, with last separator replace with the time-delay dial symbol (being the half-angle comma; ") carry out again step S310, otherwise directly carry out step S310;
S310 filters out the irrelevant symbol in the character string, the character string after processing is returned inserted dialing interface and dial, and dialing first time-delay and dialing main frame number before the symbol, then automatically dialing time-delay and dialing extension after the symbol.
Here irrelevant symbol mainly refers to space character, left and right sides bracket and separator etc., filters namely directly with these irrelevant Punctures.
Corresponding with said method, in the device of automatically dialing extension telephone in the page of the present invention, the separator processing module can further comprise:
Single separator processing module, be used for when containing a separator, and the numeric string before the described separator is that the N position is above, the numeric string behind the described separator is that the N-1 position is when following, determine the extension number that is behind this separator, and this separator is replaced with described time-delay dial symbol, be inserted in before the described extension number.
And, many separators processing module, be used for when containing one more than the separator, and the numeric string behind the last separator is that the numeric string before following, the last separator in N-1 position is that the N position is when above, determine the extension number that is behind this last separator, and will this last separator replace with described time-delay and dial symbol, be inserted in before the extension number.
Described device also can comprise: the bracket processing module, be used for when judging described telephone number and do not contain separator, if right parenthesis is contained at described telephone number end, and last to the numeric string in the bracket be below the N-1 position, last numeric string before to the left bracket of bracket is more than the N position, determine this last in the bracket for extension number, and with this last left bracket of bracket is replaced with described time-delay and dial symbol, be inserted in before the extension number.
Wherein, the N in the above-mentioned module is the landline telephone figure place in city under the described telephone number.
The below illustrates above-mentioned deterministic process with several concrete phone number examples.
At first be the situation with extension number:
Example one, (020) 66824888-8456
Browser detects the user and clicks when dialing this phone, judges whether to comprise separator "-";
Separator is arranged, further judge whether only to comprise a separator;
Separator only, whether 7 (N=7 is example) is above (if behind the separator be extension number to judge the front continuous number string length of separator, must be the main frame number so before the separator, otherwise can determine directly that behind the separator be not extension number, need not follow-up judgement can dial.Because the phone figure place of each department is 7 at least, judge therefore whether the Connected digits before the separator gets final product more than or equal to 7);
Be the main frame number before the separator, judge continuous number string length behind the separator whether below 6, whether namely judge behind the separator extension;
Be extension, then separator replaced with the half-angle comma, "; Subsequent filtration left and right sides bracket " (" and ") ", with 02066824888,8456 pass to system's dialing interface, can pass come " 02066824888,8456 " with browser and be shown in the handset dialing interface user's click to dial key this moment, can dial first main frame number 02066824888 so, then dial the half-angle comma, " afterwards extension 8456, can directly dial.
Example two ,+86-020-66824888-8456
Judge whether to comprise separator "-";
Comprise, judge whether only to comprise a separator;
A more than separator, judge continuous number string length (because extension number last at phone normally whether below 6 behind last separator, therefore this step determines whether this phone contains extension number, then need not follow-up judgement and can dial as not containing);
Be extension number, judge whether the number of characters before last separator determines more than or equal to 7(whether the numeric string before last separator is the main frame number);
Be host number, last separator replaced with the half-angle comma, ", filter "-", incite somebody to action+8602066824888,8456 and pass to system's dialing interface, can directly dial.
Example three: (020) 66824888(8456)
Judge whether to comprise separator "-";
Do not contain separator, judge whether the end of phone comprises right parenthesis ") ";
Contain right parenthesis, judge whether last is less than or equal to 6(to the number of characters in the bracket and determines extension number);
Extension number, judge last left bracket to bracket " whether the length of the Connected digits that (" is front determines host number more than or equal to 7();
Be host number, with last left bracket " (" replaces with the half-angle comma, ", filter all the other left and right sides brackets " (" and ") ", pass to system's dialing interface with 02066824888,8456 and can directly dial.
For not with the situation of extension number:
Example four: (020) 66824888
Detect the user and click when dialing this phone, judge whether to comprise separator "-";
Do not contain separator, judge whether the end of phone comprises right parenthesis ") ";
The end does not contain ") ", determine that then phone is not with extension number, with the irrelevant symbol in the character string " (" and ") " filtration, pass to the handset dialing interface with 02066824888, can directly dial.
Example five: 020-66824888
Can judge at first whether this phone comprises separator "-";
Contain separator, judge whether only comprise a separator in this character string;
Only a separator judges that whether the front numeric string length of separator is more than or equal to 7;
Less than 7, then definite phone is not with extension number, and the irrelevant symbol "-" in the character string is filtered, and then passes to the handset dialing interface with 02066824888, can directly dial.
Example six :+86-020-66824888
Can judge at first whether this phone comprises separator "-";
Contain separator, judge whether only comprise a separator in this character string;
A more than separator judges whether the numeric string length behind last separator is less than or equal to 6;
More than 6, then definite phone is not with extension number, and the irrelevant symbol "-" in the character string is filtered, and then passes to the handset dialing interface with+8602066824888, can directly dial.
Example seven: 135-803-50593
Can judge at first whether this phone comprises separator "-";
Contain separator, judge whether only comprise a separator in this character string.
A more than separator judges whether the numeric string length behind last separator is less than or equal to 6;
Less than 6, judge whether the number of characters before last separator determines more than or equal to 7(whether the numeric string before last separator is the main frame number);
Not host number, determine that then phone is not the phone with extension number, the irrelevant symbol "-" in the character string is filtered, pass to the handset dialing interface with 13580350593, can directly dial.
In the solution of the present invention, by judgement and the processing to dial number, can automatically identify the page show in the phone with extension number, and delay is dialed symbol before described extension number, so subsequently carry out phone when dialing automatically after called host time-delay dial extension number, need not the user and too much intervene, can realize that a key dials the extension telephone in the page automatically.The present invention has significantly improved the efficient of directly utilizing content of pages in portable terminal, has simplified user's operation, has strengthened user's experience.
One of ordinary skill in the art will appreciate that, realize that all or part of step in above-described embodiment method is to come the relevant hardware of instruction to finish by program, described program can be stored in the computer read/write memory medium, this program is when carrying out, each step that comprises above-described embodiment method, and described storage medium can be: ROM/RAM, magnetic disc, CD, storage card etc.
Above execution mode only is used for explanation the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; in the situation that do not break away from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.