A kind of Analog Trunk Interface control method
Technical field
The present invention relates to computer communication technology, particularly the ip voice treatment technology.
Background technology
In ip voice network (VOIP), voice gateways are by FXO (Foreign ExchangeOffice FXO, being called Analog Trunk Interface again) the speech interface drawn game links to each other with switch or commercial switch, thereby insert public switched telephone network (PSTN) PSTN, finish outside line incoming call and exhalation; Voice gateways connect subsets in the IP network by FXS (Foreign Exchange Station, FXS) speech interface, finish the incoming call and the exhalation of subscriber phone in the IP network, and network environment schematic diagram of the present invention as shown in Figure 1.Because the general uncomfortable two-stage dialing mode of telephone subscriber, in above applied environment, voice gateways realize direct-dial telephone by FXO interface and FXS interface are bound one by one, promptly as user on external switch during via the incoming call of FXO interface, can directly dial in the FXS user of correspondence, certain for its corresponding FXO interface when should FXS interface user breathing out switch.But there is a problem at present in above application technology, when being exactly the outside line user from the FXS interface user of its binding of FXO interface call of free time, the FXS user of this FXO interface correspondence busy (as being busy with netting interior conversation) on gateway, if the FXO interface does not know that its corresponding FXS user is busy, simultaneously in order not charge, before called off-hook, gateway can not taked any action, the calling subscriber hears it is ring-back tone always like this, thereby cause the calling subscriber owing to passive blindness wait callee's off-hook is lost time on the one hand, on the other hand the misunderstanding that may cause the callee deliberately not answer the call.
In the prior art, some gateway is in order to solve above called subscriber busy, is the problem of ring-back tone and the calling subscriber hears always, takes software control FXO interface elder generation off-hook, and then on-hook send the method for busy tone, and the problem that causes thus is exactly that office side can charge to the calling subscriber.
Summary of the invention
The present invention is directed to the shortcoming of prior art, a kind of Analog Trunk Interface FXO control method is proposed, as calling subscriber during from the incoming call of FXO interface, under the situation of called subscriber busy, the calling subscriber can hear busy tone at once, can not carry out billing operation to the calling subscriber simultaneously.
The technical solution used in the present invention is, proposes a kind of Analog Trunk Interface control method, is provided with in the voice gateways of binding relationship at FXO interface and FXS interface, comprises the steps:
A) FXS interface user off-hook;
B) gateway software is searched and the corresponding FXO interface of this FXS interface binding, judges whether this FXO Interface status is idle;
C) if the FXO interface free time, by this FXO interface off-hook of software control.
Further, the FXS interface off-hook described in the step a) does not take its corresponding FXO interface circuit.
Further, step b) and c) between comprise the steps gateway software judges whether the FXO interface is that other calling is shared, record FXO interface and FXS Interface status.
Further, when the above FXO interface that writes down takies call clearing, judge whether the FXS Interface status is idle.
Further, judge that more than the FXS interface is busy, by this FXO interface off-hook of software control.
Further, behind the control FXO interface off-hook, the corresponding sign of default indicates that this FXO interface is by its corresponding FXS interface control off-hook.
Further, the on-hook of FXS interface, gateway software detects its corresponding FXO interface, judges that the FXO interface is by this FXS interface control off-hook, by this FXO interface on-hook of software control.
The invention has the beneficial effects as follows that above method simplicity of design is used the gateway device prior art,, not only guarantee the existing dialing custom of user but also solved wrong charging problem by control FXO interface off-hook.
Description of drawings
Fig. 1 is a network environment schematic diagram of the present invention.
Fig. 2 is the software flow pattern of embodiment of the present invention.
Embodiment
As shown in Figure 2, FXO interface n is tied to FXS interface m by configuration, can be directly by FXO interface n dialing when customer call FXS interface m thereby guaranteed.When FXS interface m user by dialing the phone of FXS interface t correspondence in the net during off-hook, gateway software is by searching configuration file, learn the corresponding FXO interface of this FXS interface m n, the state of judging this FXO interface n is for idle, by software control FXO interface n off-hook, be equivalent to that this subscriber's line takies on the telephone network this moment, when the FXS interface m user of outside line customer call FXO interface n correspondence, the calling subscriber will hear busy tone after finishing number, does not just have the problem of blindly waiting for or chargeing at once.If during above FXS interface m off-hook, judge when this FXO interface n is being taken by other FXS interface exhalation of not setting binding relationship, this moment is only with the state and the FXS interface m current state that write down FXO interface n and monitor, because when the FXS interface m user of outside line customer call FXO interface n correspondence, the line is busy owing to the FXO interface, system can send busy tone automatically, call out and to take when taking out stitches when detecting FXO interface n, judge the state of its corresponding FXS interface m, if FXS interface m is busy, then with reason software control FXO interface n off-hook, otherwise as corresponding operating.
When FXS interface m on-hook, gateway software detects finds that its corresponding FXO interface n is just at off hook state, and the sign judgement FXS interface n according to default is not the off-hook that is used and only be interface m control by other interface, so just FXS interface n is carried out the on-hook operation, thereby return to initial condition.
For fear of owing to implement the present invention, behind the FXO interface n off-hook of the busy and software control correspondence of FXS interface m, having influence on other FXS interface telephone sets breathes out from FXO interface n, use the disconnected action of sudden strain of a muscle on the gateway to solve this problem, that is to say, when other FXS interfaces will be when interface n breathes out, earlier interface n is dodged and break, after sudden strain of a muscle was disconnected, the PSTN switch can send dialing tone to interface n again, and other interfaces can dial in to the PSTN network from interface n again so at once.