Summary of the invention
For the above-mentioned defect of prior art, the present invention directly directly cannot be dialed the technical problem of extension set by page text in order to solve prior art, provide a kind of method and the device of automatically dialing extension telephone in the page.
For achieving the above object, the present invention adopts following technical scheme:
On the one hand, the invention provides a kind of method automatically dialing extension telephone in the page, described method comprises:
When the browser of mobile terminal exists the telephone number that can dial in the page, obtain the operation that user clicks described telephone number;
The telephone number extracting described click identifies, after identifying the extension number in described telephone number, before described extension number, delay dials symbol, imports the telephone number dialing symbol containing described time delay into dialing interface;
First dial in dialing interface described time delay dial symbol before main frame number, then dial symbol according to described time delay and automatically dial described time delay and dial the extension number after symbol.
Preferably, after delay dials symbol before described extension number and before importing dialing interface into, also comprise, filter in described telephone number except the irrelevant symbol of outer symbol is dialed in described time delay.
Preferably, the telephone number extracting described click carries out identification and comprises:
When judging to contain separator in described telephone number, determining that described telephone number contains extension number, and determining that the number after described separator is extension number.
Preferably, described determine described separator after number be that extension number comprises:
When containing a separator, and the numeric string before described separator be more than N position, numeric string after described separator is when being below N-1 position, then determine after this separator for extension number, and this separator is replaced with described time delay and dials symbol, before being inserted in described extension number;
Wherein, the landline telephone figure place in described N city belonging to described telephone number.
Preferably, described determine described separator after number be that extension number comprises:
When containing a more than separator, and the numeric string after last separator be below N-1 position, numeric string before last separator is when being more than N position, then determine after this last separator for extension number, and this last separator is replaced with described time delay and dials symbol, before being inserted in extension number;
Wherein, the landline telephone figure place in described N city belonging to described telephone number.
Preferably, the telephone number extracting described click carries out identification and comprises:
When judging not contain separator in described telephone number, if right parenthesis is contained at described telephone number end, and last to the numeric string in bracket be below N-1 position, last is more than N position to the numeric string before the left bracket of bracket, then determine this last in bracket for extension number, and by this last, described time delay is replaced with to the left bracket of bracket and dial symbol, before being inserted in extension number;
Wherein, the landline telephone figure place in described N city belonging to described telephone number.
Preferably, it is half-angle comma that symbol is dialed in described time delay, ".
On the other hand, the present invention also provides a kind of device automatically dialing extension telephone in the page simultaneously, and described device comprises:
Clicking acquisition module, for when there is when the browser of mobile terminal the telephone number that can dial in the page, obtaining the operation that user clicks described telephone number;
Identification module, identifies for the telephone number extracting described click, and after identifying the extension number in described telephone number, before described extension number, delay dials symbol, imports the telephone number dialing symbol containing described time delay into dialing interface;
Automatic poking molding block, dials the main frame number before symbol for first dialing described time delay in dialing interface, then dials symbol according to described time delay and automatically dial described time delay and dial the extension number after symbol.
Preferably, described device also comprises:
Filtering module, after before described extension number, delay dials symbol to institute's identification module and before importing dialing interface into, described filtering module is for filtering in described telephone number except the irrelevant symbol of outer symbol is dialed in described time delay.
Preferably, described device also comprises:
Separator processing module, when the telephone number that described identification module extracts described click identifies, described separator processing module is used for when judging to contain separator in described telephone number, determine that described telephone number contains extension number, and determine that the number after described separator is extension number.
In the solution of the present invention, browser automatically identify in page phone with extension number, symbol is dialed by delay before described extension number, automatically the time delay can carrying out extension number when carrying out telephone call after called host is dialed, too much intervene without the need to user, a key automatic poking can be realized and beat extension telephone.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not making creative work, all belongs to the scope of protection of the invention.
Consider the special circumstances that extension is dialed, first technical scheme of the present invention identifies the numeric string in the page, after identifying the extension number contained in numeric string, before described extension number, delay dials symbol, so subsequently when carrying out telephone call automatically after called host, dial symbol according to time delay, dial this time delay dial symbol after extension number, like this, too much intervene without the need to user, a key automatic poking can be realized and beat extension telephone.
In an embodiment of the present invention, for the phone proceeding to handset dialing interface can be clicked in webpage, by the judgement to extension number rules for writing, identify in phone with extension number; When user's click is dialed, in the middle of host phone and extension number, delay is dialed symbol and filters other symbol, thus the extension number generating mobile phone support is dialed form and is inserted dialing interface, realizes allowing user pass through to click the extension number directly dialed in web telephone.
As shown in Figure 1, the inventive method comprises step:
S1, when the browser of mobile terminal exists the telephone number that can dial in the page, obtains the operation that user clicks described telephone number;
S2, the telephone number extracting described click identifies, after identifying the extension number in described telephone number, before described extension number, delay dials symbol, imports the telephone number dialing symbol containing described time delay into dialing interface;
S3, first dial in dialing interface described time delay dial symbol before main frame number, then dial symbol according to described time delay and automatically dial described time delay and dial the extension number after symbol.
In an embodiment of the present invention, whether there is the telephone number that can dial in the browser determination page, the click in response to user enters dialing interface.In a preferred embodiment, according to the telephone number in the label determination page in page source code, in the page, be shown as a link that can click, subsequently in response to the click of user, call the dialing interface that relevant function starts mobile phone.Under normal circumstances, special processing can be done to telephone number in the source code of the page shown in mobile phone application (as browser application etc.), before telephone number, such as adopt " wtai: //wp/mc " label to identify, wherein wtai(Wireless TelephonyApplications Interface, wireless telephony application interface) be at WML(Wireless Markup Language specially, WAP Markup Language) in set up the function of call, a typical example of the source code after processing telephone number is as <ahref=" wtai: //wp/mc:13800138000 " >13800138000</aGreatT.GreaT.G T.
In the present invention's preferred embodiment, after user clicks, directly the telephone number in webpage is not inserted the dialing interface of mobile phone, but first whether the telephone number in webpage is judged with extension number, if there is extension number, then between host number and extension number, delay dials symbol, and filters out other irrelevant symbol, then inserts dialing interface and dial; If there is no extension number, then only filter out other irrelevant symbol, telephone number is inserted dialing interface and dials.In a more preferred embodiment, utilize existing operation system of smart phone (as Android, IOS, Windows Phone etc.) support to dialing, it is half-angle comma that symbol is dialed in the time delay of inserting between host number and extension number; " this Symbol processing can be delay operation when dialling by such mobile phone, pause after main frame number before dialing this symbol a period of time continue again to dial after extension, thus realize automatic poking marking plane No..
Corresponding with method of the present invention, the present invention also comprises a kind of device automatically dialing extension telephone in the page simultaneously, and as shown in Figure 2, described device comprises:
Clicking acquisition module 201, for when there is when the browser of mobile terminal the telephone number that can dial in the page, obtaining the operation that user clicks described telephone number;
Identification module 202, identifies for the telephone number extracting described click, and after identifying the extension number in described telephone number, before described extension number, delay dials symbol, imports the telephone number dialing symbol containing described time delay into dialing interface;
Automatic poking molding block 203, dials the main frame number before symbol for first dialing described time delay in dialing interface, then dials symbol according to described time delay and automatically dial described time delay and dial the extension number after symbol.
Further, described device also comprises: filtering module, after before described extension number, delay dials symbol to institute's identification module and before importing dialing interface into, described filtering module is for filtering in described telephone number except the irrelevant symbol of outer symbol is dialed in described time delay.
In addition, described device also can comprise: separator processing module, when the telephone number that described identification module extracts described click identifies, described separator processing module is used for when judging to contain separator in described telephone number, determine that described telephone number contains extension number, and determine that the number after described separator is extension number.
More specifically, by Fig. 3 and corresponding several examples, the judgement of extension number and the detailed process of process are described.In method of the present invention, when detecting that user clicks the phone of the string representation of dialing containing numeral in the page, need first to judge whether comprise separation mark between alphabet string; The mark separated due to current expression phone is generally separator "-" or bracket, thus in the embodiments of figure 3 to judge that this two classes separation mark is introduced but is not limited to this.Relevant technical staff in the field will be understood that the separation mark formed for other symbols, adopts method of the present invention obviously can process equally, and this two classes separation mark is only a kind of preferred implementation of the present invention, should not be construed as limitation of the invention.
Particularly, see Fig. 3, first step S301 judges whether comprise separator "-" in character string, if any then carrying out step S302, otherwise carries out step S305;
S302, judges whether only comprise a separator in character string further, then carries out step S303 in this way, otherwise carry out step S308;
S303, judges that the length of the Connected digits before separator is whether more than N position (such as 7), then carries out step S304 in this way, otherwise carries out step S310; Because current each department telephone number is all more than 7, this step is for judging whether the numeral before separator is an effective main frame number; It should be noted that, the phone in some cities may be more than 8, and therefore the present invention sets natural number N, according to actual conditions value according to the fixed telephone number figure place in city, as A city fixed telephone number figure place be 7 then N=7, B city fixed telephone number figure place be 8 then N=8.
S304, whether N-1 position (such as 6) below judge the length of the Connected digits after separator, in this way then after separator is extension number, separator is replaced with time delay dial symbol (i.e. half-angle comma; ") carry out step S310 again, otherwise directly carry out step S310; Whether this step is extension after judging separator, and generally extension mostly is 3 or 4 bit digital, for not also comprising special extension as far as possible, here using N-1 figure place as criterion with main frame number forming region;
S305, if step S301 does not find separator, then likely all using bracket as separation mark, now judges whether character string end is right parenthesis ") further ", if then carry out step S306, otherwise carry out step S310;
S306, judges last to the length of the Connected digits in bracket whether below 6, then carries out step S307 in this way, 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 bracket, then this left bracket is replaced with time delay dial symbol (i.e. half-angle comma; ") carry out step S310 again, otherwise directly carry out step S310;
S308, if find there is multiple separator in character string in step S302, then likely character string all using separator as separation mark, now judge the continuous number string length after last separator be whether N-1 position (such as 6) below, then carry out step S309 in this way, otherwise carry out step S310;
S309, judge the continuous number string length before last separator whether more than N position (such as 7) further, in this way then after this last separator is extension number, last separator is replaced with time delay dial symbol (i.e. half-angle comma; ") carry out step S310 again, otherwise directly carry out step S310;
S310, filters out the irrelevant symbol in character string, the character string after process is returned and inserts dialing interface and dial, first dial the main frame number before symbol is dialed in time delay, then automatically dial the extension after symbol is dialed in time delay.
Here irrelevant symbol mainly refers to space character, left and right bracket and separator etc., filtration and direct by these irrelevant Punctures.
Corresponding with said method, of the present inventionly automatically dial in the device of extension telephone in the page, separator processing module can comprise further:
Single separator processing module, for working as containing a separator, and the numeric string before described separator be more than N position, numeric string after described separator is when being below N-1 position, determine after this separator for extension number, and this separator is replaced with described time delay and dials symbol, before being inserted in described extension number.
And, many separators processing module, for working as containing more than a separator, and the numeric string after last separator be below N-1 position, numeric string before last separator is when being more than N position, determine after this last separator for extension number, and this last separator is replaced with described time delay and dials symbol, before being inserted in extension number.
Described device also can comprise: bracket processing module, for when judging not contain separator in described telephone number, if right parenthesis is contained at described telephone number end, and last to the numeric string in bracket be below N-1 position, last is more than N position to the numeric string before the left bracket of bracket, determine this last in bracket for extension number, and by this last, described time delay is replaced with to the left bracket of bracket and dial symbol, before being inserted in extension number.
Wherein, the landline telephone figure place in the city belonging to described telephone number of the N in above-mentioned module.
With several concrete phone number example, above-mentioned deterministic process is described below.
First be the situation with extension number:
Example one, (020) 66824888-8456
Browser detects that user clicks when dialing this phone, judges whether to comprise separator "-";
There is separator, judge whether further only to comprise a separator;
An only separator, judge whether the continuous number string length before separator is that more than 7 (N=7 is example) are (if be extension number after separator, must be so main frame number before separator, otherwise not be extension number after can directly determining separator, can dial without the need to follow-up judgement.Phone figure place due to each department is at least 7, therefore judges whether the Connected digits before separator is more than or equal to 7);
Be main frame number before separator, judge whether the continuous number string length after separator is less than 6, whether is extension after namely judging separator;
Be extension, then separator replaced with half-angle comma, "; Filter left and right bracket " (" and ") " subsequently, by 02066824888,8456 pass to system dialing interface, now browser can be passed come " 02066824888,8456 " is shown in handset dialing interface, user's click to dial key, so can first dial main frame number 02066824888, then dial half-angle comma, " after 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 that whether the continuous number string length after last separator is less than 6 (because last normally at phone of extension number, therefore this step determines that whether this phone is containing extension number, then can dial without the need to follow-up judgement if do not contained);
Extension number, judge the number of characters before last separator whether be more than or equal to 7(determine last separator before numeric string whether be main frame number);
Be host number, last separator replaced with half-angle comma, ", filter "-", pass to system dialing interface by+8602066824888,8456, can directly dial.
Example three: (020) 66824888(8456)
Judge whether to comprise separator "-";
Not containing separator, judge whether the end of phone comprises right parenthesis ") ";
Containing right parenthesis, judge whether last is less than or equal to 6(to the number of characters in bracket and determines extension number);
Extension number, judge last left bracket to bracket " whether the length of the Connected digits that (" is front is more than or equal to 7(is determined host number);
Be host number, by last left bracket " (" replaces with half-angle comma, ", filter all the other left and right brackets " (" and ") ", by 02066824888,8456 pass to system dialing interface can directly dial.
Situation for not with extension number:
Example four: (020) 66824888
Detect that user clicks when dialing this phone, judge whether to comprise separator "-";
Not containing separator, judge whether the end of phone comprises right parenthesis ") ";
End is not containing ") ", then determine that phone is not with extension number, the irrelevant symbol " (" and ") " in character string is filtered, passes to handset dialing interface by 02066824888, can directly dial.
Example five: 020-66824888
First can judge whether this phone comprises separator "-";
Containing separator, judge whether only comprise a separator in this character string;
An only separator, judges whether the numeric string length before separator is more than or equal to 7;
Be less than 7, then determine that phone is not with extension number, the irrelevant symbol "-" in character string is filtered, then passes to handset dialing interface by 02066824888, can directly dial.
Example six :+86-020-66824888
First can judge whether this phone comprises separator "-";
Containing separator, judge whether only comprise a separator in this character string;
A more than separator, judges whether the numeric string length after last separator is less than or equal to 6;
More than 6, then determine that phone is not with extension number, the irrelevant symbol "-" in character string is filtered, then passes to handset dialing interface by+8602066824888, can directly dial.
Example seven: 135-803-50593
First can judge whether this phone comprises separator "-";
Containing separator, judge whether only comprise a separator in this character string.
A more than separator, judges whether the numeric string length after last separator is less than or equal to 6;
Be less than 6, judge the number of characters before last separator whether be more than or equal to 7(determine last separator before numeric string whether be main frame number);
Not host number, then determine that phone is not the phone of band extension number, the irrelevant symbol "-" in character string is filtered, passes to handset dialing interface by 13580350593, can directly dial.
In the solution of the present invention, by to the judgement of dial number and process, can automatically identify the page display phone in extension number, and delay dials symbol before described extension number, so subsequently when carrying out telephone call automatically after called host time delay dial extension number, too much intervene without the need to user, a key can be realized and automatically dial extension telephone in the page.Invention significantly improves the efficiency directly utilizing content of pages in the terminal, simplify the operation of user, enhance Consumer's Experience.
One of ordinary skill in the art will appreciate that, the all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program has come, described program can be stored in a computer read/write memory medium, this program is when performing, comprise each step of above-described embodiment method, and described storage medium can be: ROM/RAM, magnetic disc, CD, storage card etc.
Above execution mode is only for illustration of the present invention; and be not limitation of the present invention; the those of ordinary skill of relevant technical field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all equivalent technical schemes also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.