# Patent

## Title
Method of call trace on media gateway of next generation network

## Abstract

The present invention discloses a method of call trace on an NGN MG. According to the present invention, the softswitch device adds an extended trace indication to an H.248 message related to the call to be traced; the MG determines whether the received H.248 message needs to be traced according to the extended trace indication; and if the H.248 message needs to be traced, trace the call to which the transaction in the H.248 message belongs. By the method, the MG can trace the entire calling process of a call.

## Background
This application is a continuation of International Patent Application No. PCT/CN2005/001224, filed Aug. 10, 2005, which claims priority to Chinese Patent Application No. 200410059166.7, filed Aug. 11, 2004, all of which are hereby incorporated by reference.


FIELD OF THE TECHNOLOGY
The present invention relates to next generation network (NGN) technology, and more particularly, to the technique for tracing a call process on a media gateway (MG) in NGN.
BACKGROUND OF THE INVENTION
Conventional communication networks for transmitting voice signals are usually based on Public Switched Telephone Network (PSTN) using a Time Division Multiplexing (TDM) technique. This kind of communication network gives priority to circuit switching, and voice services are transmitted and controlled by switches. The structure of a switch in a conventional TDM-based circuit switching network is shown in FIG. 1, wherein Signaling System 7 (SS7) is widely used in call controlling.
Along with a fast development of data services, conventional circuit switching networks bring much inconvenience to data service users, such as a high communication cost, a low net surfing speed, a long waiting time, a poor transmitting quality, and difficulties of implementing new services. On the other hand, along with the development of communication techniques, it becomes more and more possible that one data network is the bearer of all services. It is in such a situation that the NGN is put forward and has seen fast development in recent years. The NGN has gradually changed the conventional PSTN circuit switching based network to a packet switching based network. This kind of packet switching based network can carry all kinds of services of the previous PSTN network, and at the same time, offload a great deal of data transmission to an Asynchronous Transfer Mode (ATM)/Internet Protocol (IP) network to release the burden of the PSTN. Moreover, based on new properties of ATM/IP, many new services are provided and functions of many old services are enhanced. In this sense, the NGN is an outcome of combining the TDM based PSTN voice network and the ATM/IP based packet network, which makes it possible to transmit voice, video, data and other integrated services in one new network. Moreover, the NGN adopts a softswitch technique in which service control is separated from media service bearers, which greatly enhances the processing capability of network equipments so that more voice services can be processed and the network can be the bearer of more kinds of services.
International Telecommunication Union-Telecommunication Standardization Sector (ITU-T) gave the following definitions of the NGN in February, 2004: the NGN is a packet network, which provides various services including telecommunication services, and can implement a separation of service functions from bottom-layer transmitting techniques by means of various bandwidths and transmitting techniques with the capability of Quality of Service (QoS); the NGN allows users to freely access networks of different service providers, and supports a universal mobility, which brings consistency and unity in use of the services by users.
A physical model of the NGN which adopts softswitch technique is shown in FIG. 2. The softswitch in FIG. 2 controls MGs through a control protocol such as H.248/Media Gateway Control Protocol (MGCP). The SS7 only runs on the softswitch, and the H.323/Bearer Independent Call Control (BICC)/Session Initiation Protocol (SIP) and other protocols also run on the softswitch while each MG only performs resource operations.
According to the H.248 protocol, the media resource operations on the MG are performed by taking a termination as an operating unit, and termination operations are mainly performed in a context.
The message transmission mechanism of the H.248 protocol is shown in FIG. 3. Those skilled in the art would know that the basic operation unit of an H.248 protocol message is a transaction, which includes several operations to the context and the terminations. A transaction is uniquely identified by a transaction ID (a long word of 32 bits). A combination of several transactions of the softswitch will comprise all the H.248 commands of an entire calling process.
In the MG operations based on H.248 messages, a process of adding terminations T1 and T2 and deleting T2 in a context C1 is shown in FIG. 4. In the figure, the words shown above each arrow illustrates the H.248 message used in each step while the words shown below each arrow gives an explanation of the corresponding H.248 message used in this step.
Detailed description of the H.248 protocol can be found in “Megaco Protocol Version 1.0□RFC3015□” or ITU-T H.248 Specification.
In the above process, once a fault, such as a call setup failure, occurs, the MG must trace the entire process of the call, and output the interacted H.248 messages and the internal resource operations so as to locate and solve the fault. However, since the number of calls and resource operations implemented in an MG is huge, and the timing of these calls and resource operations is interleaved, if information of all the interacted H.248 messages and internal resource operations are outputted, the signaling interaction of the entire process of each call can not be distinguished. Therefore, filters have to be set so that only the signaling interaction of H.248 messages and internal resource operations associated with the call being traced are output.
In the prior art, in order to trace a call on an NGN MG, two technical schemes are often used, wherein both the schemes involve creating a trace task and setting tracing conditions in the MG manually. The implementation of the two technical schemes is as follows:
Technical scheme 1: manually set up a trace task in the MG to trace a designated context. After the reception of an H.248 message by the MG, analyze the context, and judge whether the call that the message belongs to needs to be traced, if the call needs to be traced, output the H.248 messages received and sent and output the internal operation process of the MG associated to the context for use in analyzing the internal processing of the MG.
Technical scheme 2: manually set up a trace task in the MG to trace a designated termination. After the reception of an H.248 message by the MG, analyze the termination in the message, and judge whether the associated call needs to be traced, if the call needs to be traced, output the H.248 messages received and sent and output the internal operation process of the MG associated to the termination for use in analyzing the internal processing of the MG.
In actual applications, both of the two technical schemes have such problems as that the processes of some calls are difficult to trace, the defined tracing conditions are hard to detect and a trace is difficult to implement when there are too many associated contexts or terminations in one call and all the information of which should be outputted.
SUMMARY OF THE INVENTION
In view of the above, the present invention provides a method for tracing a call by a next generation network (NGN) MG, by which the MG is capable of tracing the entire process of any call completely.
The method of tracing a call by an NGN MG in accordance with this invention includes the following steps:
a softswitch device adds an extended trace indication in the H.248 message relating to the call that needs to be traced; and
the MG determines, according to the extended trace indication, whether the call to which the transaction in the received H.248 message belongs needs to be traced, if yes, trace the call to which the transaction in the H.248 message belongs.
It can be seen by comparison that the differences between the present invention and the prior art are that, according to the present invention, a trace ID is set in the H.248 message by the softswitch and contents needing to be traced and outputted are designated, and the message with a trace ID will be traced by the MG.
The above differences bring a few advantages, that is, since a trace ID is set by the softswitch, via which the tracing by the MG is controlled, the shortcomings brought by tracing via a designated context or termination by the MG is overcome, and as a result, a plurality of calls can be traced at the same time, and the tracing information can be outputted respectively and distinctively. The technical scheme of the present invention is simple to implement, and the H.248 messages and internal processing traced are complete and clear. Moreover, according to the present invention, it is possible to output all the signaling interaction of H.248 and the steps of internal resource operations of the call being traced, which makes fault analyzing and fault locating convenient.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic diagram of the structure of a switch in a conventional TDM based circuit switching network;
FIG. 2 is a schematic diagram of a physical model of the NGN adopting the softswitch technique;
FIG. 3 is a schematic diagram of the message mechanism in the H.248 protocol;
FIG. 4 is a schematic diagram illustrating the process of adding terminations T1 and T2 and the process of deleting termination T2 in the context C1 through the H.248 messages and operations in the MG;
FIG. 5 is a flowchart of tracing a call by an NGN MG according to a preferred embodiment of the present invention.



DETAILED DESCRIPTION OF THE INVENTION
As mentioned above, both of the two technical schemes in the prior art have problems such as that the processes of some calls are difficult to trace, the defined tracing conditions are hard to detect and a trace is difficult to implement when there are too many associated contexts or terminations in one call and all the information of which should be outputted.
The reasons for the above problems are as follows: in terms of technical scheme 1, first, for those call messages without an express designation of context, e.g. the Add.Req ($, T1) message used when the softswitch instructs the MG to select a context by itself, if tracing of the context is needed in this case, the message must be buffered by the MG, until a context is allocated, and then the tracing output can be obtained after a context matching, which is very difficult to implement.
Second, it is very difficult for users to confirm the allocation of contexts in the MG, if an context designated by the user has been already allocated, the previous messages and operations are unable to be traced (except that all the history messages and operations are buffered, which is unfeasible in practice), and if the context designated by the user can not be allocated until after a long time, there will be a waste of waiting time, which makes it difficult to designate a context.
Third, in practical applications, the processes of some calls are very complicated with many contexts associated, and tracing only one context can not give a complete reflection of the processing in the MG. Since the context associations are determined by the softswitch, the MG is unable to forecast the tracing relationship and unable to pre-designate each of the contexts manually. If the context associations are implemented by software in the MG, the processing will be made very complicated and the call tracing will be made difficult to implement.
Due to the same reason, technical scheme 2 has the same problems as messages without the express information about a designated termination are difficult to trace, designated terminations are difficult to choose, and termination associations are difficult to trace.
In order to solve the above problem, the present invention provides a method for tracing a call by an NGN MG. And detailed descriptions of the present invention will be given hereinafter with reference to accompanying drawings and preferred embodiments.
First, the basic principle of the invention will be described.
Since it is the softswitch that handles specific signaling, it is easy for the softswitch to determine the transactions that are associated with a certain call. If the tracing of the entire process of the call needs to be set up, the call can be traced just by indicating the associated transactions to be traced in the H.248 message sent from the softswitch to the MG, and at the same time, the MG can output the calling process being traced and the internal operating processes of the MG in the H.248 messages received and sent. The outputted information will show the entire handling process of a call in the MG.
Based on the above, the softswitch can instruct the MG to trace a call through an extended H.248 message communicated between the softswitch and the MG, and the MG outputs the communicated H.248 message and the internal resource operations of the entire handling process of the call being traced so that the complete call tracing by an MG of the NGN can be realized.
In order to realize the above idea, the transaction head of the H.248 message is extended according to the present invention to indicate to the MG by an on-off indicator that the call to which the transaction belongs needs to be traced. In this way, the MG can determine whether to trace the related call at the initial stage of analyzing the H.248 message, which greatly improves the efficiency. If no such an on-off tracing indicator is set, the MG needs to analyze to a deeper layer of the H.248 message to determine whether to trace the call, which would reduce the efficiency of tracing. At the same time, an H.248 call tracing extended package is defined to support the tracing of a plurality of calls simultaneously, and the package carries some context and control information which is necessary for displaying the traced information. The package can be defined in a termination state descriptor. According to the present invention, the MG can clearly output all of the calling information associating with the call being traced from the H.248 messages received and sent and output the related internal operations of the MG. Refer to FIG. 3 for a better understanding of the basic principle of the present invention as well as such concepts as message, transaction, context, command and descriptor of the H.248 protocol and the relations there between. It should be noted that, although an H.248 message can carry a plurality of transactions according to the H.248 protocol, most service providers, for convenience and high efficiency in implementation, carry only one transaction in one massage and one transaction conducts operations on the related contexts of only one call. In this case, the traced call information is the H.248 message itself.
If the above situation does not come into existence, e.g. there is a plurality of transactions carried in one H.248 message, the on-off tracing indicator set on the transaction head is needed in order to trace the transactions that needs to be traced. If there is a plurality of contexts of different calls carried in one transaction, such different calls should have a logical or restricting relation between themselves according to the definition of transaction in the H.248 protocol. Therefore, it will be meaningful to output the information of the whole transaction to analyze the processing of a call concerned by users.
A detailed description of a preferred embodiment of the present invention will be given hereinafter for a better understanding of the scheme of the invention.
According to the invention, the softswitch needs to extend the H.248 message to be sent to the MG in order to realize call tracing by the NGN MG.
First, in the H.248 message, an on-off tracing indicator is carried via the extended transaction head to indicate which transaction needs to be traced. According to a preferred embodiment of the present invention, the on-off tracing indicator is defined in the transaction ID. If the highest bit of transaction ID of the message sent to the MG by the softswitch is set to be 1, it is indicated that the transaction needs to be traced while the transaction need not be traced if the bit mentioned above is set to 0, wherein 0 is the default value of the on-off tracing indicator.
Secondly, a call tracing extended package is defined in the H.248 message, and the package carries identities for use in tracing multiple calls simultaneously, and the package also carries the content information and other control information that is necessary for displaying the output of traced information. Each termination relating to the call that needs to be traced carries the associated contents of this call tracing extended package in the appropriate commands of the H.248 message when it is allowed by the protocol to carry the package. The case that no extended package is allowed to be carried will be explained after description of the embodiment. In a preferred embodiment of this invention, the call tracing extended package is defined in the termination state descriptor, and the main properties of this call tracing extended package can be defined as follows:
Call Trace Package
1 Overall Description
Package Name: Call trace
Package ID: trace (temporarily defined to be 0x00A0) [Editor's note: this needs to be registered with IANA]
Description: this package allows call trace function in MG to be realized useful and convenient.
Version: 1
Extends: none
2 Properties
Property Name: Trace ID
Property ID: trid (0x0001)
Description: this value is a trace ID, which is used on the gateway to start simultaneously traces by multiple users. The call information of the same trace ID will be outputted to one trace window to observe the call processing simultaneously conducted by multiple users.
Type: Integer
Possible values: 0 to 0xFFFFFFFE
Defined in: Termination State
Characteristics: Read/Write
Property Name: User information
Property ID: usrinfo (0x0002)
Description: this value is the related user information, which is the additional information that is needed for displaying the traced information in the trace window, e.g. the telephone number. At the termination of the calling side, the calling telephone information is carried, and at the termination of the called side, the called telephone information is carried. According this information, the user information relating to the call information can be easily understood.
Type: List of String
Defined in: Termination State
Characteristics: Read/Write
Property Name: Trace depth
Property ID: trd (0x0003)
Description: this value is an indication of the trace depth, and the larger the value is, the stronger the trace function is. For example, 1 indicates a common grade of trace, wherein the output information only includes the call information in the H.248 message needed to be traced and the MG internal operations; 2 indicates that a tracing item is added on the basis of 1, for example, tracing the in-band negotiation signaling associated with the call (e.g. if fax or Modem negotiation has been performed, in-band negotiation signaling on the voice path of the user could be traced).
Type: Integer
Possible values: 1 to 10
Defined in: Termination State
Characteristics: Read/Write
Those skilled in the art could understand that, after the H.248 message is extended according to the method mentioned above, the MG can determine whether to trace the call information of the transaction according to the on-off tracing indication in the transaction head, and output the tracing results of different calls, respectively, according to the call tracing extended package carried by the H.248 message so that all the call information and internal operations of the gateway during the designated call process can be traced.
The flowchart of a call trace performed by the NGN MG in a preferred embodiment of the present invention is shown in FIG. 5.
Step 110: the MG receives an H.248 message sent by the softswitch.
It should be noted that the H.248 message received in this step has extended the current H.248 protocol, and the method of extending the current H.248 protocol is the same as described above.
Step 120: the MG analyzes the message, and determines whether the call that the transaction in the message belongs to needs to be traced, if the call needs to be traced, proceed to step 130, otherwise, proceed to step 160.
In this step, whether the call needs to be traced is determined according to the on-off tracing indicator carried in the transaction head.
Step 130: the MG analyzes the H.248 call tracing extended package, and outputs the information in the received message about the call being traced to a corresponding trace window according to the trace ID.
It should be noted that the call tracing extended package is inserted to a corresponding position in the H.248 message by the softswitch according to the need of the call that needs to be traced.
Step 140: the MG processes the commands in the message, performs corresponding resource operations, and then outputs the operation results to the corresponding trace window according to the trace ID, wherein the information contents that need to be outputted are defined by the call tracing extended package.
Step 150: the MG sends an H.248 response message to the softswitch and outputs the information of the call being traced to the corresponding trace window according to the trace ID. It should be noted that the H.248 response message used in this step is completely the same as the H.248 response message in the current protocol. By now, the processing of the message that needs to be traced has been completed and the procedure of message processing ends.
Step 160: the MG processes the commands in the message and performs corresponding resource operations.
Step 170: the MG sends an H.248 response message to the softswitch.
It should be noted that processing operations in step 160 and step 170 are the processing of the messages that need not be traced, which are completely the same as those in the prior art. After step 170, processing of the messages that need not be traced is completed and the procedure of message processing ends.
Those skilled in the art could understand that the Properties, Events, Signals, Statistics and other information of the call tracing extended package can be further enriched, so that the tracing method could be enhanced and enriched. If no such a call tracing extended package is defined, the call trace function can not be properly realized. It should be noted in particular that the start and end of a call trace can be controlled via signals instead of setting the on-off tracing indicator in the transaction head of the H.248 message as mentioned in claim 2 of this invention while a similar effect of call trace can be obtained. However, according to this method of control a call trace via signals, the MG has to analyze to a deeper layer of the H.248 message, thus the efficiency of the call trace is relatively low.
It should be noted in addition, because of the limitations of the H.248 protocol, not all the commands can carry an extended package (herein, the extended package refers to a common extended package, not the specific call tracing extended package defined in the present invention). In the process of tracing the H.248 message without a call tracing extended package, the following mechanisms can be adopted without affecting the call trace function.
1) As the initial commands of a call (including such commands as Add and Modify) can carry the call tracing extended package, the MG can associate such contents as the Trace ID, the User Info, and the Trace Depth in the received call tracing extended package with the Termination ID and Context ID related to the call, and make a record of the association.
2) In case that no extended package can be carried, the MG can look up all the related information of the call tracing extended package corresponding to the call being traced according to the termination ID and context ID related to the call information, so that the functions of the call trace will not be affected.
Although the present invention has been illustrated and described with reference to preferred embodiments, those skilled in the art understand that modifications in form and detail could be made to such embodiments without departure from the spirit and scope of the present invention as defined by the appended Claims.

## Claims

1. A method of call trace on a Next Generation Network (NGN) Media Gateway (MG), comprising:
receiving, by the MG, an H.248 message from a soft-switch, wherein the H.248 message is added with a trace indicator and an Trace ID of a call that needs to be traced, wherein the trace indicator is used for indicating the MG whether the H.248 message relates to the call that needs to be traced, and the Trace ID is carried in a call tracing package set for supporting simultaneous multi-call tracing;
determining, by the MG, whether the call to which a transaction in the received H.248 message belongs needs to be traced according to the trace indicator;
tracing the call to which the transaction in the H.248 message belongs; and
outputting different calls according to the Trace ID carried in the call tracing package respectively.

2. The method according to claim 1, wherein the trace indicator is an on-off trace indicator set in the transaction head of the H.248 message that needs to be traced;
the MG determines whether there is the on-off trace indicator in the transaction head of the H.248 message, and determines whether to trace the information of the call to which the appropriate transaction belongs.

3. The method according to claim 1, wherein the call tracing package is carried in the H.248 message that needs to be traced; and
calling information, additional contents and destination to be traced and to be outputted by the MG are determined by the contents of the call tracing package.

4. The method according to claim 2, wherein the on-off tracing indicator is set in the transaction identity (ID) of the H.248 message, and a default setting of the on-off tracing indicator is off.

5. The method according to claim 3, wherein the call tracing package further carries additional contents needed for displaying the tracing output.

6. The method according to claim 4, wherein the call needs to be traced when the highest bit of the transaction ID is set to 1, while the call need not be traced when the bit thereof is set to 0, and the default setting of the bit is 0.

7. The method according to claim 3, wherein the softswitch device sets the on-off trace indicator according to the call that needs to be traced, and inserts the call tracing package to a corresponding position in the H.248 message.

8. The method according to claim 3, wherein the step of tracing the call to which the transaction in the H.248 message belongs comprises:
the MG analyzing the call tracing extended package of the received H.248 message, and outputting the call information to be traced in the H.248 message to the corresponding trace window according to the Trace ID in the call tracing package; and
the MG processing the H.248 message and implementing corresponding resource operations, and then outputting the operation results to the corresponding trace window according to the Trace ID in the call tracing package.

9. The method according to claim 8, further comprising:
the MG sending a response message to the softswitch device and outputting the call information to be traced in the response message to the corresponding trace window.

10. The method according to claim 1, comprising outputting to one trace window different calls according to the Trace ID carried in the call tracing package.

11. A communication system, comprising a softswitch and a media gateway which communicates with the softswitch, wherein,
the softswitch device is configured to add a trace indicator and an Trace ID of a call that needs to be traced to an H.248 message, and send the H.248 message to the media gateway, wherein the trace indicator is used for indicating the media gateway whether the H.248 message relates to the call that needs to be traced, and the Trace ID is carried in a call tracing packet set for supporting simultaneous multi-call tracing;
the media gateway is configured to:
receive the H.248 message, determine whether the call to which a transaction in the received H.248 belongs needs to be traced according to the trace indicator;
trace the call to which the transaction in the H.248 message belongs; and
output different calls according to the Trace ID carried in the call tracing package respectively.

12. The communication system according to claim 11, wherein the trace indicator is an on-off trace indicator set in the transaction head of the H.248 message that needs to be traced;
the media gateway determines whether there is the on-off trace indicator in the transaction head of the H.248 message, and determines whether to trace the information of the call to which the appropriate transaction belongs.

13. The communication system according to claim 11, wherein the call tracing package is carried in the H.248 message that needs to be traced; and
calling information, additional contents and destination to be traced and to be outputted by the media gateway are determined by the contents of the call tracing package.

14. The communication system according to claim 12, wherein the on-off tracing indicator is set in the transaction identity (ID) of the H.248 message, and a default setting of the on-off tracing indicator is off.

15. The communication system according to claim 13, wherein the call tracing package further carries additional contents needed for displaying the tracing output.

16. The communication system according to claim 14, wherein the call needs to be traced when the highest bit of the transaction ID is set to 1, while the call need not be traced when the bit thereof is set to 0, and the default setting of the bit is 0.

17. The communication system according to claim 13, wherein the softswitch device sets the on-off trace indicator according to the call that needs to be traced, and inserts the call tracing package to a corresponding position in the H.248 message.

18. The communication system according to claim 13, wherein
the media gateway analyzes the call tracing extended package of the received H.248 message, and outputs the call information to be traced in the H.248 message to the corresponding trace window according to the Trace ID in the call tracing package; and
the media gateway processes the H.248 message and implements corresponding resource operations, and then outputs the operation results to the corresponding trace window according to the Trace ID in the call tracing package.

19. The communication system according to claim 18, wherein the media gateway sends a response message to the softswitch device and outputs the call information to be traced in the response message to the corresponding trace window.

20. The communication system according to claim 11, wherein the media gateway outputs to one trace window different calls according to the Trace ID carried in the call tracing package.