CN109495633A - A method of fxs phone is controlled by single-chip microcontroller and realizes automatic dial service - Google Patents
A method of fxs phone is controlled by single-chip microcontroller and realizes automatic dial service Download PDFInfo
- Publication number
- CN109495633A CN109495633A CN201811310328.8A CN201811310328A CN109495633A CN 109495633 A CN109495633 A CN 109495633A CN 201811310328 A CN201811310328 A CN 201811310328A CN 109495633 A CN109495633 A CN 109495633A
- Authority
- CN
- China
- Prior art keywords
- phone
- hook
- chip microcontroller
- chip
- api
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/24—Arrangements for testing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/26—Devices for calling a subscriber
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
Abstract
The present invention provides a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller, including step S1, the addition phone dial business process in host computer, and the api in phone dial business process is packaged into corresponding keyword;Step S2, automatic test script calls corresponding api to send corresponding command word toward serial ports when executing phone dial business process using keyword;Step S3, single-chip microcontroller receives the command word that serial ports transmits, and command word control phone analog chip executes corresponding dial business operation based on the received.The invention has the advantages that not only can greatly improve testing efficiency, but also test quality can be improved, and reduce testing cost.
Description
Technical field
It is the present invention relates to fxs phone testing field, in particular to a kind of that fxs phone realization automatic poking is controlled by single-chip microcontroller
The method of number business.
Background technique
Currently, being all to realize test using three-party library pjsip in automatic test phone use-case.But due to
Three-party library pjsip can not provide related service to fxs phone and support, therefore, when being related to the test to fxs phone,
It requires to go to test manually by staff.And it manually tests with low efficiency, fault rate height, need to expend greatly
The defects of human resources of amount, therefore, urgent need, seek a kind of at low cost, high-efficient, quality and guaranteed testing scheme.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of by single-chip microcontroller control fxs phone realization auto dialing
The testing efficiency and test quality to fxs phone can be improved by this method in the method for business.
The present invention is implemented as follows: a kind of control the method that fxs phone realizes automatic dial service, institute by single-chip microcontroller
The method of stating need to provide a host computer, a test fixture and a gateway to be measured, the host computer and the test fixture communication link
It connects, the gateway to be measured is communicated to connect with the host computer and test fixture respectively;The test fixture include single-chip microcontroller and
Phone analog chip;
Described method includes following steps:
Step S1, phone dial business process is added in host computer, and the api in phone dial business process is encapsulated
At corresponding keyword;
Step S2, automatic test script calls corresponding api using keyword when executing phone dial business process
Corresponding command word is sent toward serial ports;
Step S3, single-chip microcontroller receives the command word that serial ports transmits, and command word controls phone analog chip based on the received
Execute corresponding dial business operation.
Further, the step S1 specifically:
In host computer add phone dial business process, and by phone dial business process serial communication api, pluck
Machine sends corresponding instruction api, on-hook sends corresponding instruction api, ring detection api and dialing api are packaged into corresponding pass
Key word;The phone dial business process includes off-hook operation, dial-up operation, ring detection operation and on-hook operation.
Further, the step S2 specifically:
Off-hook operation is first carried out when executing phone dial business process in automatic test script, and using off-hook, institute is right
The keyword answered calls off-hook to send corresponding instruction api and sends command word corresponding to off-hook toward serial ports;Then dialing behaviour is executed
Make, calls dialing api toward audio file corresponding to serial ports Sending dialled number using the corresponding keyword of dialing;Then vibration is executed
Bell detection operates, and detects corresponding keyword using ring and ring is called to detect api toward corresponding to serial ports transmission ring detection
Command word;On-hook operation is finally executed, calls on-hook to send corresponding instruction api toward serial ports using keyword corresponding to on-hook
Send command word corresponding to on-hook.
Further, the step S3 specifically:
When single-chip microcontroller receive be command word corresponding to off-hook when, then command word corresponding to off-hook is converted into plucking
Machine sends phone analog chip to induction signal, and after off-hook converts induction signal by DAC;The broadcasting of phone analog chip is plucked
Machine corresponding states sound, and off hook signal is sent to gateway to be measured;
When single-chip microcontroller receive be dialing corresponding audio file when, then the corresponding audio file of dialing is done
DAC is decoded and is sent phone analog chip to;Phone analog chip carries out playback according to number of the dialing sequence to calling,
Gateway to be measured obtains the number of calling from phone analog chip;
When single-chip microcontroller receive be ring detection corresponding command word when, then the command word that ring detection is corresponding
Ring detection is converted into induction signal, and whether detection gateway to be measured sends bell signal in the preset time and give phone analog core
Piece, if it is, bell signal is sent to single-chip microcontroller by phone analog chip, and returns to preset numerical value to upper by single-chip microcontroller
Position machine;If it is not, then returning to preset failure numerical value to host computer by single-chip microcontroller;
When single-chip microcontroller receive be command word corresponding to on-hook when, then command word corresponding to on-hook is converted into hanging
Machine controls phone analog chip and carries out on-hook to induction signal, meanwhile, on-hook is returned to host computer by single-chip microcontroller and is successfully disappeared
Breath.
Further, the preset time is 60 seconds.
Further, the gateway to be measured is PBX server.
Further, the single-chip microcontroller is STM32F407VET6 single-chip microcontroller.
Further, the phone analog chip is CPC5622 chip.
The present invention has the advantage that can realize that the dislodging machine to fxs phone, detection ring and dialing automate
Test, without going to test manually by staff, therefore, not only can greatly improve testing efficiency, Er Qieke
Quality is tested to improve, and reduces testing cost.
Detailed description of the invention
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 need to provide hard for a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller of the present invention
Part functional block diagram.
Fig. 2, which is that the present invention is a kind of, controls the execution process that fxs phone realizes the method for automatic dial service by single-chip microcontroller
Figure.
Specific embodiment
It please refers to shown in Fig. 1 to Fig. 2, the present invention is a kind of to control fxs phone realization automatic dial service by single-chip microcontroller
The preferred embodiment of method, the method need to provide a host computer (i.e. PC machine), a test fixture and a gateway to be measured, described
Host computer and the test fixture communicate to connect, and the gateway to be measured is communicated to connect with the host computer and test fixture respectively;
The test fixture includes single-chip microcontroller and phone analog chip;
Wherein, the gateway to be measured is PBX server.The single-chip microcontroller is STM32F407VET6 single-chip microcontroller.The phone
Analog chip is CPC5622 chip (i.e. fxs phone).Host computer can be treated as automatic test script performing environment is provided
Survey grid pass initiates or receives a call, dials, dislodging machine is requested, and is handed down to single-chip microcontroller by serial ports (USART).
Described method includes following steps:
Step S1, phone dial business process is added in host computer, and the api in phone dial business process is encapsulated
At corresponding keyword;
Step S2, automatic test script calls corresponding api using keyword when executing phone dial business process
Corresponding command word is sent toward serial ports;
Step S3, single-chip microcontroller receives the command word that serial ports transmits, and command word controls phone analog chip based on the received
Execute corresponding dial business operation.
The step S1 specifically:
In host computer add phone dial business process, and by phone dial business process serial communication api, pluck
Machine sends corresponding instruction api, on-hook sends corresponding instruction api, ring detection api and dialing api are packaged into corresponding pass
Key word, for example, the keyword that off-hook sends corresponding instruction api can be packaged into " picking up phone $ { corresponding extension set } ", to realize
Api corresponding to off-hook is called by keyword;The phone dial business process includes off-hook operation, dial-up operation, ring
Detection operation and on-hook operation.In the specific implementation, keyword involved in automatic test script generally includes: picking up words
Machine (corresponding " off-hook sends corresponding instruction api "), waits phone ring (corresponding " ring detection at calling (corresponding " dialing api ")
Ap "), hang call drop machine (corresponding " on-hook sends corresponding instruction api "), it is, of course, also possible to which other keywords are set as needed.
The step S2 specifically:
Off-hook operation is first carried out when executing phone dial business process in automatic test script, and using off-hook, institute is right
The keyword answered calls off-hook to send corresponding instruction api and sends command word corresponding to off-hook toward serial ports;Then dialing behaviour is executed
Make, calls dialing api toward audio file corresponding to serial ports Sending dialled number, the audio file using the corresponding keyword of dialing
Include the binary audios packet such as number sound (i.e. 1,2,3,4,5,6,7,8,9,0) and " # " number, " * " number;Then vibration is executed
Bell detection operates, and detects corresponding keyword using ring and ring is called to detect api toward corresponding to serial ports transmission ring detection
Command word;On-hook operation is finally executed, calls on-hook to send corresponding instruction api toward serial ports using keyword corresponding to on-hook
Send command word corresponding to on-hook.
The step S3 specifically:
When single-chip microcontroller receive be command word corresponding to off-hook when, then command word corresponding to off-hook is converted into plucking
Machine sends phone analog chip, in the specific implementation, monolithic to induction signal, and after off-hook converts induction signal by DAC
Chance drags down the level of off-hook relevant pins in phone analog chip, this way it is possible to realize off-hook transmits induction signal
Give phone analog chip;Phone analog chip plays off-hook corresponding states sound, and off hook signal is sent to gateway to be measured, i.e.,
Off hook signal is informed to gateway to be measured;
When single-chip microcontroller receive be dialing corresponding audio file when, then the corresponding audio file of dialing is done
DAC is decoded and is sent phone analog chip to, and in the specific implementation, single-chip microcontroller can be by relevant tube defined in phone analog chip
The level of foot drags down, to realize that automatic imitation dials, for example, the number of calling is: 123467, then, single-chip microcontroller will
The level of corresponding 1,2,3,4,6,7 pin defined in phone analog chip is dragged down;Phone analog chip is suitable according to dialling
The number of ordered pair calling carries out playback (the broadcasting number sound i.e. according to the sequence of dialing one by one), and gateway to be measured is from electricity
Talk about the number that analog chip obtains calling;
When single-chip microcontroller receive be ring detection corresponding command word when, then the command word that ring detection is corresponding
Be converted into ring detection to induction signal, and detect gateway to be measured whether the preset time send bell signal give phone analog core
Piece, if it is, bell signal is sent to single-chip microcontroller by phone analog chip, and returns to preset numerical value to upper by single-chip microcontroller
Position machine, in the specific implementation, single-chip microcontroller can return to hexadecimal values that one presets to host computer, and host computer is receiving
After the hexadecimal values preset, so that it may judge that phone analog chip is just in ring corresponding to single-chip microcontroller;If
It is no, then preset failure numerical value is returned to host computer by single-chip microcontroller, in the specific implementation, single-chip microcontroller can also return to one and preset
For good hexadecimal values to host computer, host computer is after receiving the hexadecimal values preset, so that it may judge
Phone analog chip corresponding to single-chip microcontroller does not have ring (i.e. ringing test failure);
When single-chip microcontroller receive be command word corresponding to on-hook when, then command word corresponding to on-hook is converted into hanging
Machine controls phone analog chip and carries out on-hook to induction signal, meanwhile, on-hook is returned to host computer by single-chip microcontroller and is successfully disappeared
Breath.
The preset time is 60 seconds, i.e., in the specific implementation, detects whether that the operation longest of ring can continue 60
Second, if all not detecting ring in 60 seconds, illustrate that ringing test fails.
In conclusion the invention has the advantages that: the dislodging machine to fxs phone, detection ring and dialing can be achieved and carry out
Therefore automatic test, not only can greatly improve testing efficiency without going to test manually by staff,
And test quality can be improved, and reduce testing cost.
Although specific embodiments of the present invention have been described above, those familiar with the art should be managed
Solution, we are merely exemplary described specific embodiment, rather than for the restriction to the scope of the present invention, it is familiar with this
The technical staff in field should be covered of the invention according to modification and variation equivalent made by spirit of the invention
In scope of the claimed protection.
Claims (8)
1. a kind of control the method that fxs phone realizes automatic dial service by single-chip microcontroller, it is characterised in that: the method need to mention
For a host computer, a test fixture and a gateway to be measured, the host computer and the test fixture are communicated to connect, described to be measured
Gateway is communicated to connect with the host computer and test fixture respectively;The test fixture includes single-chip microcontroller and phone analog core
Piece;
Described method includes following steps:
Step S1, phone dial business process is added in host computer, and the api in phone dial business process is packaged into pair
The keyword answered;
Step S2, automatic test script calls corresponding api toward string when executing phone dial business process using keyword
Mouth sends corresponding command word;
Step S3, single-chip microcontroller receives the command word that serial ports transmits, and command word control phone analog chip executes based on the received
Corresponding dial business operation.
2. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 1, special
Sign is: the step S1 specifically:
Phone dial business process is added in host computer, and serial communication api, the off-hook in phone dial business process are sent out
It send corresponding instruction api, on-hook to send corresponding instruction api, ring detection api and dialing api and is packaged into corresponding keyword;
The phone dial business process includes off-hook operation, dial-up operation, ring detection operation and on-hook operation.
3. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 2, special
Sign is: the step S2 specifically:
When executing phone dial business process off-hook operation is first carried out, using corresponding to off-hook in automatic test script
Keyword calls off-hook to send corresponding instruction api and sends command word corresponding to off-hook toward serial ports;Then dial-up operation is executed, benefit
Call dialing api toward audio file corresponding to serial ports Sending dialled number with the corresponding keyword of dialing;Then ring inspection is executed
Operation is surveyed, calls ring to detect api using the corresponding keyword of ring detection and sends the corresponding life of ring detection toward serial ports
Enable word;On-hook operation is finally executed, calls on-hook to send corresponding instruction api using keyword corresponding to on-hook and is sent toward serial ports
Command word corresponding to on-hook.
4. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 3, special
Sign is: the step S3 specifically:
When single-chip microcontroller receive be command word corresponding to off-hook when, then command word corresponding to off-hook is converted into off-hook pair
Induction signal, and phone analog chip is sent to after off-hook converts induction signal by DAC;Phone analog chip plays off-hook pair
State sound is answered, and off hook signal is sent to gateway to be measured;
When single-chip microcontroller receive be dialing corresponding audio file when, then the corresponding audio file of dialing is done into DAC solution
Code simultaneously sends phone analog chip to;Phone analog chip carries out playback according to number of the dialing sequence to calling, to be measured
Gateway obtains the number of calling from phone analog chip;
When single-chip microcontroller receive be ring detection corresponding command word when, then the corresponding command word of ring detection is converted
At ring detection to induction signal, and whether detection gateway to be measured sends bell signal in the preset time and gives phone analog chip,
If it is, bell signal is sent to single-chip microcontroller by phone analog chip, and returns to preset numerical value to upper by single-chip microcontroller
Machine;If it is not, then returning to preset failure numerical value to host computer by single-chip microcontroller;
When single-chip microcontroller receive be command word corresponding to on-hook when, then command word corresponding to on-hook is converted into on-hook pair
Induction signal, and control phone analog chip and carry out on-hook, meanwhile, on-hook success message is returned to host computer by single-chip microcontroller.
5. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 4, special
Sign is: the preset time is 60 seconds.
6. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 1, special
Sign is: the gateway to be measured is PBX server.
7. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 1, special
Sign is: the single-chip microcontroller is STM32F407VET6 single-chip microcontroller.
8. a kind of method for controlling fxs phone realization automatic dial service by single-chip microcontroller according to claim 1, special
Sign is: the phone analog chip is CPC5622 chip.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811310328.8A CN109495633A (en) | 2018-11-06 | 2018-11-06 | A method of fxs phone is controlled by single-chip microcontroller and realizes automatic dial service |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811310328.8A CN109495633A (en) | 2018-11-06 | 2018-11-06 | A method of fxs phone is controlled by single-chip microcontroller and realizes automatic dial service |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109495633A true CN109495633A (en) | 2019-03-19 |
Family
ID=65693906
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811310328.8A Pending CN109495633A (en) | 2018-11-06 | 2018-11-06 | A method of fxs phone is controlled by single-chip microcontroller and realizes automatic dial service |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109495633A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111245685A (en) * | 2020-02-27 | 2020-06-05 | 青岛海信电子设备股份有限公司 | VOIP test system and method for gateway equipment and abnormal positioning method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118517A (en) * | 2009-12-31 | 2011-07-06 | 北京大唐高鸿数据网络技术有限公司 | Method for automatically testing integrated access devices of VoIP |
CN102333163A (en) * | 2011-06-01 | 2012-01-25 | 迈普通信技术股份有限公司 | External auxiliary testing apparatus, and testing system thereof and method thereof |
CN103401768A (en) * | 2013-07-19 | 2013-11-20 | 福建星网锐捷通讯股份有限公司 | Quick detection method for home gateway equipment interface |
CN105282348A (en) * | 2015-11-17 | 2016-01-27 | 上海斐讯数据通信技术有限公司 | Integration testing method and system for VOIP |
CN106383784A (en) * | 2016-09-20 | 2017-02-08 | 上海爱数信息技术股份有限公司 | Software automated test method and system |
US20170089981A1 (en) * | 2015-09-25 | 2017-03-30 | Contec, Llc | Core Testing Machine |
-
2018
- 2018-11-06 CN CN201811310328.8A patent/CN109495633A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118517A (en) * | 2009-12-31 | 2011-07-06 | 北京大唐高鸿数据网络技术有限公司 | Method for automatically testing integrated access devices of VoIP |
CN102333163A (en) * | 2011-06-01 | 2012-01-25 | 迈普通信技术股份有限公司 | External auxiliary testing apparatus, and testing system thereof and method thereof |
CN103401768A (en) * | 2013-07-19 | 2013-11-20 | 福建星网锐捷通讯股份有限公司 | Quick detection method for home gateway equipment interface |
US20170089981A1 (en) * | 2015-09-25 | 2017-03-30 | Contec, Llc | Core Testing Machine |
CN105282348A (en) * | 2015-11-17 | 2016-01-27 | 上海斐讯数据通信技术有限公司 | Integration testing method and system for VOIP |
CN106383784A (en) * | 2016-09-20 | 2017-02-08 | 上海爱数信息技术股份有限公司 | Software automated test method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111245685A (en) * | 2020-02-27 | 2020-06-05 | 青岛海信电子设备股份有限公司 | VOIP test system and method for gateway equipment and abnormal positioning method |
CN111245685B (en) * | 2020-02-27 | 2023-04-18 | 青岛海信电子设备股份有限公司 | VOIP test system and method for gateway equipment and abnormal positioning method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA1258548A (en) | System and method for defining and providing telephone network services | |
CN105119877B (en) | Speech verification method, apparatus and system | |
CN102333163B (en) | External auxiliary testing apparatus, and testing system thereof and method thereof | |
CN101489004B (en) | Remote diagnosis method and system for VoIP terminal | |
CN101990040A (en) | System and method for testing voice over internet protocol (VOIP) device | |
CN101437086B (en) | System and method for implementing voice test | |
WO2013000334A1 (en) | Method and device for testing voice media gateway | |
CN109495633A (en) | A method of fxs phone is controlled by single-chip microcontroller and realizes automatic dial service | |
CN104954533B (en) | Junk phone interception method, apparatus based on intelligent communications terminal and system | |
CN105871617B (en) | A kind of implementation method of home gateway H.248 protocol voice fault self-diagnosis | |
CN1984171A (en) | System and method for realizing speech apparatus function test | |
EP2442584B1 (en) | METHOD AND APPARATUS FOR SUPPORTING CALL CONTROL OF CIRCUIT DOMAIN TELEPHONE AND VoIP | |
CN1860775A (en) | Subscriber's side powered telephony system | |
CN103401768A (en) | Quick detection method for home gateway equipment interface | |
CN101287263A (en) | Test method, system and server for relay link in exchange network | |
CN105721727A (en) | Call forwarding method and apparatus | |
CN115580681A (en) | Method for testing hardware function of analog port | |
CN105812589B (en) | Home gateway voice hardware diagnostic system and method | |
CN102118517B (en) | Method for automatically testing integrated access devices of VoIP | |
US20100118863A1 (en) | Method for Realizing a Re-Answer Call | |
CN113595826A (en) | Method for single-voice-port PON gateway equipment to carry out single-equipment voice production test | |
CN105101127A (en) | Abnormal call warning method and device | |
CN111182163B (en) | Automatic call test method and device, computer equipment and medium | |
CN102299813B (en) | Broadband network terminal and method for dynamically adjusting network speed thereof | |
CN105516518A (en) | Network voice testing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190319 |