A kind of calling-control method and voice gateways based on the voice Internet protocol
Technical field
The present invention relates to voice Internet protocol (VOIP) technology, relate in particular to a kind of calling-control method and voice gateways based on VOIP.
Background technology
Along with the fast development and the extensive use of network technology, utilize Internet resources to realize that the VOIP business of voice communication is more widespread.For the intercommunication between public switch telephone network (PSTN) phone of realizing IP phone and using always, the FXS voice gateways that employing has FXS (FXS) port connect the plain old telephone terminal, make the plain old telephone terminal can be used as the IP phone terminal and are linked in the IP network; The FXO voice gateways that employing has FXO (FXO) port connect the pstn telephone terminal, and bridge joint PSTN and IP network.By FXS voice gateways and FXO voice gateways, realize the intercommunication of IP phone terminal and pstn telephone terminal.
Based on the consideration of networking and user's use aspect, usually FXS port and fxo port are bound at present, form the FXS-FXO voice gateways of binding mode.A kind of form of the FXS-FXO voice gateways of binding mode is bound FXS port and fxo port in the FXS/FXO mixing voice gateway, and by the exchanges data between time gas exchange technology realization two-port; Another kind of form is that FXS port and fxo port in FXS voice gateways and the FXO voice gateways are bound, and exists IP to connect between the two-port after the binding, and voice signal needs the process compress speech to handle in the process of transmission and Echo Cancellation is handled.
It is the realization IP phone terminal of example and the schematic network structure of pstn telephone terminal mutual that Fig. 1 shows with FXS/FXO voice mixing gateway.Referring to Fig. 1, P1, P2, P3 and P4 are the IP phone terminal, and P5 and P6 are the pstn telephone terminal.When pstn telephone terminal P5 as the calling party, IP phone terminal P1 is during as the callee, calling party P5 off-hook, the user dials the telephone number of callee P1, PBX in the PSTN network (PBX) sends bell signal and comprises that the caller identification information of caller rs number transmits (CID) signal to the fxo port of voice mixing gateway, fxo port is received off-hook behind the above-mentioned signal, send ring-back tone to PBX, and the connection of setting up the FXS port of binding mutually with this fxo port, the FXS port sends bell signal to IP phone terminal P1, behind callee's off-hook, realize voice communication.As seen, speech data arrives the IP phone terminal that is connected with the FXS port through after FXO and the FXS port.
When the pstn telephone terminal was the calling party, when the fxo port off-hook, PBX detected off-hook event by the mode that detects electric current, and begins to charge at present.Like this, if IP phone terminal just off-hook conversation of a period of time behind the fxo port off-hook as the callee, then in the time between fxo port off-hook and IP phone terminal off-hook, do not converse in calling and called side, and PBX chargeed to this section period, and the actual air time is less than chargeable time; Under the situation that nobody replys as callee's IP phone terminal, PBX begins to charge from the fxo port off-hook constantly, behind calling party's pstn telephone hanging up terminal, just stop to charge, this moment does not converse in calling and called side, but PBX but charges, and has formed short ticket.As seen, existing call control procedure meeting causes the accuracy of call meters lower, causes false the charging, has damaged user benefit.
In addition, if callee's IP phone terminal with other IP phone terminal calls, the FXS port is in off hook state, when the pstn telephone terminal makes a call, PBX sends bell signal and CID signal to fxo port, because generally the CID signal is sending between the bell signal for the first time and for the second time, so FXO receives off-hook behind the bell signal, return ring-back tone by PBX to calling party's pstn telephone terminal, and after receiving the CID signal, detect the state of FXS port.Suppose that the bell signal time span is 1 second, the transmission after the ring first time finishes 0.5 second of CID signal for the first time, the time span of this signal is 1 second, what then PBX returned to the calling party in 2.5 seconds behind the FXO off-hook is ring-back tone, after this determine that the FXS port is in fxo port on-hook behind the off hook state, PBX plays busy tone to the calling party.Not only can between fxo port off-hook and on-hook, cause false the charging in this case, but also can make calling part user hear that earlier ring-back tone hears busy tone again, not meet user's the custom that is to use.
Summary of the invention
In view of this, the invention provides a kind of calling-control method, guarantee the accuracy that pstn telephone terminal and IP phone call between terminals are chargeed based on VOIP.
Based in the calling-control method of inventive concept the state of the FXS FXS port of the state of FXO fxo port and binding being consistent, this method comprises:
A. calling party's public switch telephone network pstn telephone terminal call callee Internet protocol IP telephone terminal, when the fxo port of calling party's pstn telephone terminal correspondence is in idle condition, PBX PBX calls out the FXS port with this fxo port binding by fxo port;
B. when callee's IP phone terminal off-hook, described FXS port and fxo port are converted to off hook state.
Preferably, further comprise host module between described FXS port and the fxo port, then the FXS port that the described PBX of steps A calls out and this fxo port is bound comprises:
PBX sends bell signal to fxo port, and fxo port indicates calling party's pstn telephone terminal to host module and makes a call; Host module is determined the FXS port with described fxo port binding, and makes a call to this FXS port.
Wherein, step B is described is converted to off hook state with FXS port and described fxo port and is:
The FXS port translation is an off hook state, and indicates the FXS port to host module and be in off hook state, and host module control is converted to off hook state with the fxo port of described FXS port binding.
Preferably, after the described step B, further comprise:
Calling party's pstn telephone terminal and callee's IP phone terminal transmit speech data by described fxo port and FXS port, and when calling party's pstn telephone terminal or callee's IP phone hanging up terminal, described FXS port and fxo port are converted to idle condition.
Wherein, describedly FXS port and fxo port be converted to idle condition comprise:
B1. judge on-hook side for calling party's pstn telephone terminal or callee's IP phone terminal, if be calling party's pstn telephone terminal, execution in step B2 then, otherwise, execution in step B3;
B2.PBX indicates calling party's pstn telephone hanging up terminal to described fxo port, fxo port is converted to idle condition, after host module detects fxo port and is in idle condition, controlling described FXS port translation is idle condition, the FXS port sends the signal of expression end of conversation to callee's IP phone terminal, and finishes this calling control flow;
B3. described FXS port translation is an idle condition, after host module detects this FXS port and is in idle condition, control described fxo port and be converted to idle condition, after PBX detects this FXO and is in idle condition, send the signal of expression end of conversation to calling party's pstn telephone terminal.
The present invention also provides a kind of voice gateways that are used for above-mentioned calling-control method, and these voice gateways comprise: the FXO fxo port of binding and FXS FXS port, wherein
Fxo port is used for the state according to the FXS port, carries out state exchange, receives the calling of public switch telephone network PSTN network when idle condition, and the notice that expression calling party pstn telephone terminal is made a call sends;
The FXS port is used to receive the notice that comes from fxo port, makes a call according to the Internet protocol IP telephone terminal of the notice that receives to correspondence, behind callee's IP phone terminal off-hook, is converted to off hook state by idle condition.
Preferably, described voice gateways further comprise:
Host module between described fxo port and described FXS port, this host module is used to preserve the corresponding relation of described FXS port and fxo port, determine FXS port with the fxo port binding, detect the state of fxo port and FXS port, state according to the FXS port sends the transition status signal to fxo port, receive in the notice of fxo port, and the notice that will receive sends to the FXS port of binding with this fxo port.
Wherein, described fxo port is further used for receiving the speech data that comes from described FXS port, the speech data that receives is sent to described pstn telephone terminal, and receive the speech data that comes from described pstn telephone terminal, the speech data that receives is sent to the FXS port;
Described FXS port is further used for receiving the speech data that comes from described IP phone terminal, the speech data that receives is sent to described fxo port, and receive the speech data that comes from fxo port, the speech data that receives is sent to described IP phone terminal.
Preferably, described fxo port is further used for receiving the on-hook signal that comes from described pstn telephone terminal when off hook state, be converted to idle condition, and notice host module pstn telephone hanging up terminal, receive the signal of the expression end of conversation that host module sends and change idle condition over to by off hook state;
The FXS port is further used for receiving the on-hook signal that comes from described IP phone terminal when off hook state, be converted to idle condition, notice host module described IP phone hanging up terminal receives the signal of the expression end of conversation that host module sends and changes idle condition over to by off hook state;
Host module is further used for receiving the notice of the described pstn telephone hanging up terminal of the expression that comes from fxo port, send the signal of expression end of conversation to the FXS port, reception comes from the signal of the described IP phone hanging up terminal of expression of FXS port, and sends the signal of expression end of conversation to fxo port.
Wherein, described fxo port and described FXS port are arranged in FXS/FXO voice mixing gateway, and perhaps, described fxo port is arranged in the FXO voice gateways, and described FXS port is arranged in the FXS voice gateways.
Use the present invention, can guarantee the billing accuracy in the pstn telephone terminal call IP phone terminal procedures.Particularly, the present invention has following beneficial effect:
Among the present invention fxo port under the control of host module, be consistent with the state of the FXS port of binding mutually, and only behind callee's IP phone terminal off-hook, fxo port just enters off hook state by off-hook, PBX begins calling party's pstn telephone terminal is chargeed after detecting the fxo port off-hook.Like this, be calling party, IP phone terminal PBX during in the pstn telephone terminal for the callee, the time started that PBX charges is consistent with the time of callee's off-hook conversation, therefore can avoid the generation of false charging phenomenon effectively, has guaranteed the accuracy of charging.
Among the present invention when the FXS port since callee's IP phone terminal owing to conversing when being in off hook state with other IP phone terminals, the fxo port that host module will be bound mutually is converted to off hook state, if this moment, the pstn telephone terminal made a call to the callee, then PBX detects fxo port and is in off hook state, and directly plays busy tone to the calling party.Like this, PBX can be owing to the CID signal be between twice bell signal that the calling party sends, and plays busy tone again to calling party's playing RBT earlier.As seen the call control character among the present invention share the family custom, has improved user experience effectively.
Description of drawings
To make clearer above-mentioned and other feature and advantage of the present invention of those of ordinary skill in the art by describe exemplary embodiment of the present invention in detail with reference to accompanying drawing below, in the accompanying drawing:
Fig. 1 is for realizing the schematic network structure of IP phone terminal and pstn telephone terminal mutual by FXO/FXS voice mixing gateway;
Fig. 2 among the present invention based on the exemplary process diagram of the calling-control method of VOIP;
Fig. 3 is the flow chart of calling-control method in the embodiment of the invention;
Fig. 4 is the schematic network structure that realizes IP phone terminal and pstn telephone terminal mutual in the embodiment of the invention by the FXO voice gateways FXS voice gateways of binding;
Fig. 5 is the structural representation of voice gateways in the embodiment of the invention.
Embodiment
For making purpose of the present invention, technical scheme clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
The present invention is a kind of calling-control method based on VOIP, its basic thought is: when the FXS port is in off hook state owing to IP phone terminal and other IP phone terminal calls, fxo port off-hook with this FXS port correspondence, and when the pstn telephone terminal makes a call to the IP phone terminal as the callee as the calling party, after callee's off-hook, with the fxo port off-hook.
Fig. 2 shows the exemplary process diagram according to the calling-control method of inventive concept.Referring to Fig. 2, this method is consistent the state of the FXS port of the state of fxo port and binding, then carries out according to following steps and calls out control:
In step 201, calling party's pstn telephone terminal call callee IP phone terminal, when the fxo port of this calling party's correspondence was in idle condition, PBX made a call to the FXS port with this fxo port binding by fxo port and host module;
In step 202, when callee's IP phone terminal off-hook, FXS and fxo port are converted to off hook state.
FXS port and fxo port bound among the present invention both can be arranged in same FXS/FXO voice mixing gateway, can lay respectively at again in separate the FXS voice gateways and FXO voice gateways.Be example with FXS/FXO voice mixing gateway below, the calling-control method of foundation inventive concept is described.
Present embodiment is based on network shown in Figure 1, and wherein bound FXS port and fxo port are arranged in FXS/FXO voice mixing gateway, have host module between FXS port and the fxo port, and PBX is arranged in the PSTN network.Fig. 3 show the pstn telephone terminal as calling party, IP phone terminal the flow chart of the calling-control method in the present embodiment during as the callee.As shown in Figure 3, this method comprises:
In step 301, calling party's pstn telephone makes a call to callee's IP phone terminal.
In step 302~303, after PBX receives the calling that comes from calling party's pstn telephone terminal, judge whether the fxo port of this calling party's correspondence is in idle condition, if then execution in step 304; Otherwise this PBX sends the signal that expression can't be conversed to calling party's pstn telephone terminal, and finishes this calling control flow.
In the present embodiment the FXS port owing to corresponding IP phone terminal and other IP phone terminals converse be in off hook state, when still being in idle condition with the fxo port of this FXS port binding, host module is off hook state by this fxo port off-hook of control with the state exchange of this fxo port.When the FXS port was in idle condition owing to corresponding IP phone terminal finishes conversation, host module was controlled the fxo port on-hook of this FXS port correspondence again.So, the state of fxo port is consistent with state with its FXS port of binding mutually.Therefore in this step, by the state of FXS port is judged, determine the state of FXS port and fxo port.And the FXS port is in fxo port that off hook state shows mutually binding off-hook, and then PBX is by sending the signal that can't converse such as expressions such as busy tones, informs that calling party PSTN terminal can't successfully call out.
In step 304~305, PBX generates the CID signal of caller pstn telephone terminal correspondence, send bell signal and CID signal to fxo port, the host module of fxo port in the voice mixing gateway indicates calling party's pstn telephone terminal and makes a call, and the CID signal that receives is submitted to host module.
In step 306~307, host module is determined the FXS port with the fxo port binding, and makes a call to this FXS port, and the FXS port sends bell signal to callee's IP phone terminal after receiving calling from host module.
Because fxo port is bundled in FXS, it is the FXS port that there is unique correspondence in fxo port, and the corresponding relation between port is kept in the host module, and therefore, host module can arrive corresponding FXS port according to the information searching of the fxo port that receives bell signal.
In step 308~309, fxo port is judged whether off-hook of callee, if then execution in step 310; Otherwise PBX continues to calling party's playing RBT before calling party's on-hook, and finishes this calling control flow.
Not under the situation of off-hook, the FXS port still is in idle condition the callee, and fxo port also keeps idle condition, thereby the electric current of fxo port can not change.When PBX changes at the electric current that does not detect fxo port, then constantly to calling party's playing RBT.Do not converse when the callee has off-hook for a long time, then calling party's on-hook finishes this calling.
In step 310, FXS port off-hook, host module is controlled the fxo port off-hook of this FXS port correspondence by after detecting definite FXS port off-hook, and PBX begins to charge.
Because the conversation of callee's IP phone terminal off-hook, then FXS enters off hook state by off-hook in this step.After this FXS port can be notified host module by the mode that reports off-hook event, and the fxo port that host module is controlled this FXS port correspondence again changes off hook state over to.Simultaneously, after PBX detects the fxo port off-hook, judge that calling party and callee begin conversation, so PBX charges to the calling party.As seen, after fxo port only remains callee's off-hook conversation in the present embodiment, just enter off hook state, so the time charge starting of PBX calling and called both sides time of beginning to converse just.
In step 311~314, calling party and callee transmit speech data by fxo port and FXS port, judge whether on-hook of calling party or callee, if calling party's on-hook, then PBX stops to charge, and indicates calling party's on-hook to fxo port, after the fxo port on-hook, the on-hook of host module control FXS port, the FXS port sends the signal of expression end of conversation to the callee, and finishes this calling control flow; If callee's on-hook, then FXS port on-hook, after host module detects the on-hook of FXS port, the on-hook of control fxo port, PBX stops to charge and to the signal that the calling party sends the expression end of conversation, finishing this calling control flow in the FXO on-hook; If calling party and callee be not on-hook all, then return execution in step 311.
The signal of the expression end of conversation that here, FXS or fxo port sent can be signals such as busy tone or on-hook pulse.
So far, finish calling control flow in the present embodiment.
Be the call control procedure that example is carried out for being arranged in same FXS/FXO voice mixing gateway with the FXS port that binds together and fxo port more than, FXS port and the fxo port of binding mutually also can lay respectively in separate the FXS voice gateways and FXO voice gateways.
Fig. 4 shows the network structure of fxo port when laying respectively in separate FXS voice gateways and the FXO voice gateways of FXS port and binding mutually.In network shown in Figure 4, comprise IP phone terminal P1, P2, P3 and P4, pstn telephone terminal P5 and P6, the FXS voice gateways A that links to each other with P2 with IP phone terminal P1, the FXS voice gateways B that links to each other with P4 with IP phone terminal P3, realize the router/switch that FXS voice gateways A and B communicate by letter with IP network, and link to each other with the pstn telephone terminal also the FXO voice gateways A and the FXO voice gateways B of bridge joint IP network and PSTN network.At this moment, the host module between FXS port and fxo port can be arranged in the FXO voice gateways, also can be used as independent device, independently exists with respect to above-mentioned FXS voice gateways and FXO voice gateways.Call control procedure under this situation and above-mentioned step 301 are to 311 similar, just in step 311, when calling party and callee pass through FXS port and fxo port transmitting audio data, fxo port sends to the FXS port after the speech data that comes from the calling party is compressed packing, the FXS port through after decompressing, sends to the callee again; The FXS port sends to fxo port after the speech data that comes from the callee is compressed packing, and fxo port through after decompressing, sends to the calling party again.
Present embodiment also provides a kind of voice gateways that can be used in the above-mentioned calling-control method.Fig. 5 shows the structural representation of voice gateways in the present embodiment.Referring to Fig. 5, these voice gateways comprise: host module and the fxo port that binds together and FXS port.Wherein, fxo port is used for the state according to the FXS port of binding mutually, carries out state exchange, receives the calling of public switch telephone network PSTN network when idle condition, will represent that the notice that calling party's pstn telephone terminal makes a call sends; The FXS port is used to receive the notice that comes from fxo port, makes a call according to the Internet protocol IP telephone terminal of the notice that receives to correspondence, behind callee's IP phone terminal off-hook, is converted to off hook state by idle condition.
Voice gateways in the present embodiment also comprise the host module between fxo port and FXS port, this host module is used to preserve the corresponding relation of FXS port and fxo port, determine FXS port with the fxo port binding, detect the state of fxo port and FXS port, state according to the FXS port sends the transition status signal to fxo port, receive in the notice of fxo port, and the notice that will receive sends to the FXS port of binding with this fxo port.
Voice gateways in the present embodiment are in the process of conversing in calling and called side, fxo port receives the speech data that comes from the FXS port, the speech data that receives is sent to described pstn telephone terminal, and receive the speech data that comes from the pstn telephone terminal, the speech data that receives is sent to the FXS port; The FXS port receives the speech data that comes from the IP phone terminal, and the speech data that receives is sent to described fxo port, and receives the speech data that comes from fxo port, and the speech data that receives is sent to the IP phone terminal.
In addition, fxo port receives the on-hook signal that comes from described pstn telephone terminal when off hook state, be converted to idle condition, and notice host module pstn telephone hanging up terminal, receive the signal of the expression end of conversation that host module sends and change idle condition over to by off hook state; The FXS port receives the on-hook signal that comes from described IP phone terminal when off hook state, be converted to idle condition, notice host module described IP phone hanging up terminal receives the signal of the expression end of conversation that host module sends and changes idle condition over to by off hook state; Correspondingly, host module receives the notice of the described pstn telephone hanging up terminal of expression that comes from fxo port, send the signal of expression end of conversation to the FXS port, reception comes from the signal of the described IP phone hanging up terminal of expression of FXS port, and sends the signal of expression end of conversation to fxo port.
Above-mentioned fxo port and described FXS port can be arranged in FXS/FXO voice mixing gateway, and this moment, host module was arranged in this voice mixing gateway or independent the existence; And above-mentioned fxo port and FXS port also can lay respectively in FXO voice gateways and the FXS voice gateways, and this moment, host module was arranged in FXS voice gateways or independent the existence.
As seen from the above technical solution, fxo port is under the control of host module among the present invention, be consistent with the state of the FXS port of binding mutually, and only behind callee's IP phone terminal off-hook, fxo port just enters off hook state by off-hook, PBX begins calling party's pstn telephone terminal is chargeed after detecting the fxo port off-hook.Like this, be calling party, IP phone terminal during in the pstn telephone terminal for the callee, the time started that PBX charges is consistent with the time of callee's off-hook conversation, therefore can avoid the generation of false charging phenomenon effectively, has guaranteed the accuracy of charging.
And, when the FXS port owing to callee's IP phone terminal and other IP phone terminals are conversed when being in off hook state, the fxo port that host module will be bound mutually is converted to off hook state, if this moment, the pstn telephone terminal made a call to the callee, then PBX detects fxo port and is in off hook state, thereby directly plays busy tone to the calling party.Like this, PBX can be owing to the CID signal be between twice bell signal that the calling party sends, and plays busy tone again to calling party's playing RBT earlier.As seen the call control character among the present invention share the family custom, has improved user experience effectively.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being made, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.