In the exemplary embodiment, the phone service device or the VoIP device 200 may be a VoIP gateway, an asymmetric digital subscriber line (ADSL) modem, or a wireless access point. The telephone 100 can route a phone number to the PSTN 300 or the VoIP network 400 via the VoIP device 200.
In the exemplary embodiment, the VoIP device 200 initially receives a dialed digit from the telephone 100, collects the dialed digit in a dial string, and then determines whether a PSTN redial has started. If the PSTN redial has not started, the VoIP device 200 further determines whether a prefix matching the dial string is found in a PSTN redial table. If a prefix matching the dial string is found in the PSTN redial table, the VoIP device 200 redials the dial string to the PSTN 300. Therefore, time for PSTN redialing is effectively reduced, and accordingly time for users to wait is reduced.
The storage module 240 includes a PSTN redial table 241 and a VoIP digit map 242. In the exemplary embodiment, the PSTN redial table 241 can be configured manually, and stored in the storage module 240. The VoIP digit map 242 is configured by the call agent 410, and stored in the storage module 240.
The PSTN redial table 241 includes a plurality of PSTN dial entries. Each PSTN dial entry includes a prefix and a length, for defining a plurality of PSTN phone numbers. The prefix of the PSTN dial entry indicates a prefix of the defined PSTN phone numbers, and the length of the PSTN dial entry indicates a length of the defined PSTN phone numbers. In the exemplary embodiment, the length of the PSTN dial entry may be a non-zero digit, indicating a length of the defined PSTN phone numbers is equal to the non-zero digit. The length of the PSTN dial entry may be a zero digit, indicating a length of the defined PSTN phone numbers is indefinite.
The VoIP digit map 242 includes a plurality of VoIP dial entries. Each VoIP dial entry includes a prefix and a length, for defining a plurality of VoIP phone numbers. The prefix of the VoIP dial entry indicates a prefix of the defined VoIP phone numbers, and the length of the VoIP dial entry indicates a length of the defined VoIP phone numbers. In the exemplary embodiment, the length of the VoIP dial entry may be a non-zero digit, indicating a length of the defined VoIP phone numbers is equal to the non-zero digit. The length of the VoIP dial entry may be a zero digit, indicating a length of the defined VoIP phone numbers is indefinite.
The receiving module 210 receives a dialed digit, and collects the dialed digit in a dial string. The PSTN processing module 220, for processing the dial string, includes a PSTN redial determination sub-module 221, a PSTN prefix determination sub-module 222, a PSTN redial sub-module 223, and a PSTN completion determination sub-module 224.
The PSTN redial determination sub-module 221 determines whether a PSTN redial has started. In the exemplary embodiment, the PSTN processing module 220 sets a PSTN flag to represent whether the PSTN redial has started. The PSTN redial determination sub-module 221 determines whether the PSTN redial has started according to how the PSTN flag is set. For example, if the PSTN flag is set to 1, the PSTN redial has started. If the PSTN flag is set to 0, the PSTN redial has not started.
The PSTN prefix determination sub-module 222 determines whether a prefix matching the dial string is found in the PSTN redial table 241 when the PSTN redial has not started. In the exemplary embodiment, the PSTN prefix determination sub-module 222 compares the dial string with a prefix of each dial entry in the PSTN redial table 241 to determine whether a prefix matching the dial string is found in the PSTN redial table 241.
The PSTN redial sub-module 223 redials the dial string to the PSTN 300 when a prefix matching the dial string is found in the PSTN redial table 241. In the exemplary embodiment, when redialing the dial string to the PSTN 300, the PSTN redial sub-module 223 further sets the PSTN flag to 1.
When the PSTN redial has started, the PSTN redial sub-module 223 further redials the dialed digit to the PSTN 300.
The PSNT completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number. In the exemplary embodiment, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number according to a length of the dial string or according to whether a dial time has elapsed. In this embodiment, if a length of a PSTN dial entry matching the dial string in the PSTN redial table 241 is a non-zero digit, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number according to the length of the dial string. If the length of the dial string is equal to the non-zero digit, the dial string is a complete PSTN phone number. If the length of the dial string is not equal to the non-zero digit, the dial string is not a complete PSTN phone number.
If the length of a PSTN dial entry matching the dial string in the PSTN redial table 241 is a zero digit, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number according to whether the dial time has elapsed. If the dial time has elapsed, the dial string is a complete PSTN phone number. If the dial time has not elapsed, the dial string is not a complete PSTN phone number. For example, if a next dialed digit is not received within a certain period of time such as 3 seconds after the VoIP device 200 receives one dialed digit, the PSTN completion determination sub-module 224 determines that the dial time has elapsed, thereby determining that the dial string is a complete PSTN phone number. If a next dialed digit is received within 3 seconds after the VoIP device 200 receives one dialed digit, the PSTN completion determination sub-module 224 determines that the dial time has not elapsed, thereby determining that the dial string is not a complete PSTN phone number.
In the exemplary embodiment, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number after the PSTN redial sub-module 223 redials the dialed digit or the dial string to the PSTN 300. If the dial string is a complete PSTN phone number, the PSTN redial is ended. If the dial string is not a complete PSTN phone number, the receiving module 210 goes on receiving another dialed digit and collecting the dialed digit in the dial string.
The VoIP processing module 230, for processing the dial string, includes a VoIP prefix determination sub-module 231, a VoIP completion determination sub-module 232, and a VoIP transmitting sub-module 233.
The VoIP prefix determination sub-module 231 determines whether a prefix matching the dial string is found in the VoIP digit map 242 when no prefix matching the dial string is found in the PSTN redial table 241. In the exemplary embodiment, the VoIP prefix determination sub-module 231 compares the dial string with a prefix of each dial entry in the VoIP digit map 242 to determine whether a prefix matching the dial string is found in the VoIP digit map 242.
When no prefix matching the dial string is found in the VoIP digit map 242, the receiving module 210 goes on receiving another dialed digit and collecting the dialed digit in the dial string.
The VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number when a prefix matching the dial string is found in the VoIP digit map 242. In the exemplary embodiment, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number according to a length of the dial string or according to whether the dial time has elapsed. In this embodiment, if a length of a VoIP dial entry matching the dial string in the VoIP digit map 242 is a non-zero digit, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number according to the length of the dial string. If the length of the dial string is equal to the non-zero digit, the dial string is a complete VoIP phone number. If the length of the dial string is not equal to the non-zero digit, the dial string is not a complete VoIP phone number.
If the length of a VoIP dial entry matching the dial string in the VoIP digit map 242 is a zero digit, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number according to whether the dial time has elapsed. If the dial time has elapsed, the dial string is a complete VoIP phone number. If the dial time has not elapsed, the dial string is not a complete VoIP phone number.
When the dial string is not a complete VoIP phone number, the receiving module 210 goes on receiving another dialed digit and collecting the dialed digit in the dial string.
The VoIP transmitting sub-module 233 transmits the dial string to the VoIP network 400 when the dial string is a complete VoIP dial phone number.
In detail, in step S300, the receiving module 210 of the VoIP device 200 receives a dialed digit, and collects the dialed digit in a dial string.
In step S302, the PSTN redial determination sub-module 221 determines whether a PSTN redial has started. In the exemplary embodiment, the PSTN processing module 220 sets a PSTN flag to represent whether the PSTN redial has started. The PSTN redial determination sub-module 221 determines whether the PSTN redial has started according to how the PSTN flag is set. For example, if the PSTN flag is set to 1, the PSTN redial has started. If the PSTN flag is set to 0, the PSTN redial has not started.
If the PSTN redial has started, in step S310, the PSTN redial sub-module 223 redials the dialed digit to the PSTN 300.
If the PSTN redial has not started, in step S304, the PSTN prefix determination sub-module 222 determines whether a prefix matching the dial string is found in the PSTN redial table 241. In the exemplary embodiment, the PSTN prefix determination sub-module 222 compares the dial string with the prefix of each dial entry in the PSTN redial table 241 to determine whether a prefix matching the dial string is found in the PSTN redial table 241.
If no prefix matching the dial string is found in the PSTN redial table 241, in step S312, the VoIP prefix determination sub-module 231 determines whether a prefix matching the dial string is found in the VoIP digit map 242.
If a prefix matching the dial string is found in the PSTN redial table 241, in step S306, the PSTN redial sub-module 223 redials the dial string to the PSTN 300. In the exemplary embodiment, when redialing the dial string to the PSTN 300, the PSTN redial sub-module 223 further sets the PSTN flag to 1.
In step S308, the PSNT completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number. In the exemplary embodiment, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number according to a length of the dial string or according to whether a dial time has elapsed. In this embodiment, if a length of a PSTN dial entry matching the dial string in the PSTN redial table 241 is a non-zero digit, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number according to the length of the dial string. If the length of the dial string is equal to the non-zero digit, the dial string is a complete PSTN phone number. If the length of the dial string is not equal to the non-zero digit, the dial string is not a complete PSTN phone number.
If the length of a PSTN dial entry matching the dial string in the PSTN redial table 241 is a zero digit, the PSTN completion determination sub-module 224 determines whether the dial string is a complete PSTN phone number according to whether the dial time has elapsed. If the dial time has elapsed, the dial string is a complete PSTN phone number. If the dial time has not elapsed, the dial string is not a complete PSTN phone number.
If the dial string is a complete PSTN phone number, the PSTN redial is ended.
If the dial string is not a complete PSTN phone number, going back to step S300, the receiving module 210 goes on receiving another dialed digit and collecting the dialed digit in the dial string.
In step S312, when no prefix matching the dial string is found in the PSTN redial table 241, the VoIP prefix determination sub-module 231 compares the dial string with a prefix of each dial entry in the VoIP digit map 242 to determine whether a prefix matching the dial string is found in the VoIP digit map 242.
If no prefix matching the dial string is found in the VoIP digit map 242, returning to step S300, the receiving module 210 goes on receiving another dialed digit and collecting the dialed digit in the dial string.
If a prefix matching the dial string is found in the VoIP digit map 242, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number. In the exemplary embodiment, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number according to a length of the dial string or according to whether the dial time has elapsed. In this embodiment, if a length of a PSTN dial entry matching the dial string in the VoIP digit map 242 is a non-zero digit, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number according to the length of the dial string. If the length of the dial string is equal to the non-zero digit, the dial string is a complete VoIP phone number. If the length of the dial string is not equal to the non-zero digit, the dial string is not a complete VoIP phone number.
If the length of a VoIP dial entry matching the dial string in the VoIP digit map 242 is a zero digit, the VoIP completion determination sub-module 232 determines whether the dial string is a complete VoIP phone number according to whether the dial time has elapsed. If the dial time has elapsed, the dial string is a complete VoIP phone number. If the dial time has not elapsed, the dial string is not a complete VoIP phone number.
If the dial string is a complete VoIP phone number, in step S316, the VoIP transmitting sub-module 233 transmits the dial string to the VoIP network 400.
If the dial string is not a complete VoIP phone number, going back to step S300, the receiving module 210 goes on receiving another dialed digit and collecting the dialed digit in the dial string.
In the exemplary embodiment of the present invention, the VoIP device 200 redials a dial string to the PSTN 300 when a prefix matching the dial string is found in the PSTN redial table 241 without comparing the length of the dial string. Thus, time for PSTN redialing is reduced, and accordingly time for uses to wait is reduced.
While various embodiments and methods of the present invention have been described above, it should be understood that they have been presented by way of example only and not by way of limitation. Thus the breadth and scope of the present invention should not be limited by the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
200610062243.3 | Aug 2006 | CN | national |