Calling control flow testing tool and method based on MGCP
Technical field
The present invention relates to technical field of telecommunications, relate in particular to calling control flow simulation test instrument and method based on MGCP.
Background technology
Along with the development of broadband internet, support the Access Network product of voice over ip feature to replace the every nook and cranny that traditional fixed-line telephone network access device is deployed to the world, broadband access network and speech business are provided simultaneously.MGCP MGCP and MEGACO/H.248 agreement generally supported and used in the soft switch (Softswitch) of operator and IMS (IP Multimedia Subsystem) system as important voip signaling control protocol, and broadband access equipment possesses Softswitch/IMS equipment with existing network, and to carry out the ability that VoIP agreement interconnects be often the networking condition of operator.But because each system equipment manufacturer is to the difference in the understanding of VoIP agreement and realization, the intercommunication of VoIP agreement all can have problems conventionally, often will spend a large amount of manpower and materials and solve.
One of solution is in the past to use existing network Softswitch/IMS testing of equipment, this need to obtain in advance the operator that possesses test condition and permit and come and go repeatedly and could effectively verify product function, during equipment research and development or the problem of finding during deployed with devices cannot be verified timely and effectively.This condition often cannot obtain, and is also to meet the demand of carrying out interoperability test with the numerous Softswitch/IMS of producer systems.
Next is to buy commercial media gateway controller MGC (Media Gateway Controller) signaling emulator to carry out emulation testing according to existing Softswitch/IMS calling control flow.Its basic implementation procedure is:
1, calling control flow is write:
1) each transmission of manual edit or receipt message, also can copy the message that sends or receive in existing procedure;
2) protocol parameter of each transmission or receipt message is configured;
3) the various timers of each transmission or receipt message are configured;
4) running parameter in each transmission or receipt message is identified;
5) configuration rule of receipt message is configured;
6) next step action receiving and send after message is carried out to logic connection.
2, test script environment configurations
3, Run Script
4, check result
Although commercial MGC complete function, control flexibly, but test script is write complexity, requires a great deal of time on debug script, inefficiency, the inter-communicating problem of particularly equipment being found in operation process cannot be accomplished efficiently reappear fast and locate.
Summary of the invention
The object of the present invention is to provide the tool and method of a kind of simple and efficient MGCP and the emulation testing of MEGACO/H.248 call signaling control flow, to address the above problem.
A calling control flow testing tool based on MGCP, comprises
Test script generation module, for generating test script;
Test script input module, for obtaining the test script that will move from described test script generation module, reads in the message of test script, records the position record that current file reads simultaneously;
Send message processing module, for receiving the input of described test script input module, current message analysis of reading in is obtained to the relevant raw information that message comprises the preprocessed original state information of upgrading relevant end points, carry out association analysis with the end points real-time status information of having preserved simultaneously, to sending those protocol keywords that belong to dynamic change in message, by real-time status information, carry out match and replace;
Receipt message processing module, for the message that media gateway is sended over, analyze, and the relevant endpoint status information of obtaining is preserved, if this message is the message that sends wait-for-response in message queue, the request message of clear to send message queue, and trigger described test script input module and read in next message;
Information receiving and transmitting module, for receiving the input of described transmission message processing module, send media gateway controlling message and receiving media gateway messages, when receiving effective message packet, obtain source IP address and the source port of message, if mate predefined Devices to test IP address and port, this message is delivered to described receipt message processing module and carries out analyzing and processing;
Information receiving and transmitting and error message output module, with described test script input module, described transmission message processing module, described receipt message processing module and described information receiving and transmitting module are connected, for the message that receives and send or run-time error information etc. are printed to screen or file.
Described test script generation module generates test script automatically, the text type script file that calling control flow packet capturing file generated can directly be moved, text type script file is read and write to the message blocks of packet capturing file, between message blocks, use specific comments symbol to separate, and the delay parameter that the time delay spacing using between current message and a upper message sends as current message deposit in the lump.
Described testing tool is provided with an endpoint status table of distinguishing with Endpoint ID, comprises and preserves the variable of end points reset condition and the variable of the current real-time running state of end points.
Further, described transmission message processing module comprises successively connected transmission messaging protocol decoding submodule, and end points reset condition is upgraded submodule, sends message arrangement parameter and processes submodule, sends message dynamic keyword and upgrades submodule.Described transmission messaging protocol decoding submodule parses the keyword that the needs in current message upgrade, described end points reset condition is upgraded submodule the keyword message comprising in current transmission message is saved in the reset condition variable in corresponding endpoint status table, and the transmission sign that will use when current message is sent is also saved in reset condition variable; If there is not the state table that this Endpoint ID is corresponding in described endpoint status table, in described endpoint status table, create the state table that this Endpoint ID is corresponding.Described transmission message dynamic keyword upgrades submodule and according to the real-time running state variable update in endpoint status table, sends the keyword of message.Described transmission message arrangement parameter is processed submodule and for each, is sent the parameter of message arrangement for the treatment of user.
Described receipt message processing module comprises successively connected protocol-decoding submodule, end points real-time running state upgrades submodule, protocol-decoding submodule in described receipt message processing module obtains the keyword in current media gateway response message, sends into described end points real-time running state and upgrades submodule processing; Described end points real-time running state upgrades submodule the keyword message under each end points comprising in the current response message receiving is updated in the real-time running state variable of corresponding end points in described endpoint status table.
Further, described receipt message processing module comprises respectively and to upgrade with described end points real-time running state that submodule is connected:
Registration response submodule, for responding registration message;
Onhook event response submodule, for responding on-hook message;
Heartbeat event response submodule, for responding heartbeat message.
Further, described keyword comprises: message header, transmits sign, association identification, Endpoint ID, connection identifier, Session Description Protocol piece.
A calling control flow method of testing based on MGCP, comprises step:
Step 1, operation testing tool, configuration testing parameter, opens automatic-answering back device and starts media gateway and register to testing tool, and testing tool is registered from dynamic response;
Step 2, testing tool generate test script, select test script and operational mode;
Step 3, testing tool are opened bring into operation script read first message of one or more test script files;
Before step 4, testing tool transmission message, first carry out protocol-decoding and obtain end points reset condition, upgrade original state variable in endpoint status table, complete the rear transmission of the keyword match renewal message that sends message;
Step 5, media gateway handles media gateway controlling information and sending media gateway message;
Step 6, testing tool receiving media gateway messages, carry out source codec analysis, upgrades end points real-time running state variable;
Whether step 7, testing tool are analyzed receipt message is response corresponding to media gateway controlling message that step 504 sends, if and script do not finish, start to read next message and enter the next message transmission of step 4 beginning, if script finishes, finish test; Response message if not corresponding, enters step 8
Step 8, testing tool are analyzed whether registration message of receipt message, if will start corresponding registration response; Testing tool is analyzed whether heartbeat message of receipt message, if will start corresponding heartbeat response; Testing tool is analyzed whether on-hook message of receipt message, is to start corresponding on-hook response;
Step 9, transmission generic response.
Further, described step 4 comprises:
A, carry out protocol-decoding and obtain the keyword that needs in current message upgrade, comprise Endpoint ID;
If there is the state table that the Endpoint ID described in step a is corresponding in b endpoint status table, according to the keyword obtaining, upgrade the reset condition variable in described endpoint status table; Otherwise newly-increased endpoint status table corresponding to described Endpoint ID;
C, the keyword match that sends message is updated to the keyword in the real time execution variable in the endpoint status table that described Endpoint ID is corresponding.
Further, described step 6 comprises:
E, carry out protocol-decoding and obtain the keyword in response message, comprise and transmit sign;
F, in described endpoint status table, search described transmission and identify corresponding endpoint status table, and the keyword in the response message obtaining is updated to described transmission identifies in the real-time running state variable of corresponding endpoint status table.
Further, described keyword comprises: message header, transmits sign, association identification, Endpoint ID, connection identifier, Session Description Protocol piece.
The present invention is directed to the feature of MGCP and MEGACO/H.248 agreement, by the analyzing and processing of a small amount of key variables in simulated call control message and equipment under test real-time response message being completed to the simulation process of calling control flow.Tester writes test script only need to organize necessary call control message file, do not need to add extra control parameter, particularly the on-the-spot calling control flow (packet capturing of wireshark software) providing can directly be converted to test script use, reduce the workload of writing with debug script, greatly improved operating efficiency.
Accompanying drawing explanation
Fig. 1 is testing tool modular structure figure of the present invention;
Fig. 2 is that the present invention sends message processing module figure;
Fig. 3 is receipt message processing module figure of the present invention;
Fig. 4 the present invention realizes message dynamic keyword mates more new diagram;
Fig. 5 the present invention is based on the calling control flow method of testing flow chart of MGCP.
Embodiment
The present invention is mainly that by the associated feature being connected with realtime transmission protocol RTP (Real-timeTransportProtocol) of specific order establishment in message, (MGCP is CRCX order for MGCP (MGCP and MEGACO/H.248 agreement), MEGACO/H.248 is ADD order), by setting up incidence relation between physical endpoint that the association of CRCX in call flow script and ADD message establishing and RTP connection identifier and media gateway MG (MediaGatway) have been created in real time and RTP connection identifier, when sending message, dynamic protocol keyword is wherein replaced to processing, thereby complete the simulation process of calling control flow.(MGCP is connection identifier Connection Id, and MEGACO/H.248 is interim Endpoint ID Ephemeral Termination Id)
Fig. 1 has shown the modular structure that the testing tool realized by the present invention mainly comprises, and these modules comprise: test script generation module; Test script reads in module; Be responsible for sending the information receiving and transmitting module of media gateway controlling MGC (Media Gateway Controller) message and receiving media gateway MG response message; Receipt message processing module; Send message processing module; Information receiving and transmitting and wrong output module, and endpoint status table.
In the testing tool of realizing in the present invention, need to safeguard an endpoint status table of distinguishing with Endpoint ID (Termination Id or EndPoint Id), comprise and preserve the variable of end points reset condition and the variable of the current real-time running state of end points.
Test script generation module: script generates supports the mode of hand-coding also to support automatically to generate test script.Automatically generating test script is the text type script file that calling control flow packet capturing file generated can directly be moved.Text is read and write to this module by the message blocks of packet capturing file, use specific comments symbol to separate, and the delay parameter that the time delay spacing using between current message and a upper message sends as current message deposits in the lump between message blocks.Script file form is simple, is convenient to manual edit and revises.
Test script input module: be responsible for obtaining the one or more test script file names that will move first message that starts to read in first script file, record the position record that current file reads simultaneously.
Send message processing module: current message analysis of reading in is obtained to the preprocessed original state information that relevant raw information that message comprises is upgraded relevant end points, carry out association analysis with the end points real-time status information of having preserved simultaneously, to sending those protocol keywords that belong to dynamic change in message, by real-time status information, carry out match and replace.Fig. 2 has shown transmission message processing module, and this module comprises transmission messaging protocol decoding submodule, for carrying out protocol-decoding to sending message; End points reset condition is upgraded submodule, for decoded preprocessed original state information is updated to endpoint status table; Transmission message arrangement parameter is processed submodule, is responsible for processing user's configuration parameter, and user may have the extra parameter of configuration for the message of each transmission, as transmission delay, and the destination address that appointment sends and port etc.; Send message dynamic keyword and upgrade submodule, for carrying out keyword renewal to sending message.
Receipt message processing module: the message that media gateway is sended over is analyzed, and the relevant endpoint status information of obtaining is preserved, if this message is the message that sends wait-for-response in message queue, the request message of clear to send message queue, and triggering test script input module reads in next message.Fig. 3 has shown receipt message processing module, and this module comprises protocol-decoding submodule, for response message is carried out to protocol-decoding; End points real-time running state upgrades submodule, for by decoded real-time status information updating to endpoint status table; Registration response submodule, response registration message; Onhook event response submodule, response on-hook message; Heartbeat event response submodule, response heartbeat message.
Information receiving and transmitting module: send media gateway controlling message and receiving media gateway messages, mainly complete the socket communication port of setting up messaging, wait to be sent or receipt message.While sending a request message, set up request message queue.Receipt message is carried out to MGCP or megaco protocol is tentatively identified, avoid receiving incoherent message.When receiving effective message packet, obtain source IP address and the source port of message, if mate predefined Devices to test IP address and port, this message is delivered to receipt message processing module and carries out analyzing and processing.
Information receiving and transmitting and error message output module: the message that receives and send or run-time error information etc. are printed to screen or file.
In call control message based on MGCP or megaco protocol, having some protocol keywords is that each test is not identical with per call, as transmit sign (Transaction Id), association identification (Context Id), physical endpoint sign (Physical Termination Id/Endpoint Id), connection identifier (Connection Id), interim Endpoint ID (Ephemeral Termination Id) and Session Description Protocol piece SDP.Key technology of the present invention is how simply to complete efficiently to send coupling and the renewal that these that comprise in message belong to the keyword that protocol dynamic changes, and forms an effectively transmission message.
Fig. 4 has shown the dynamic keyword match and replace schematic diagram (mainly take megaco protocol as example, MGCP agreement has the similar principle that realizes) that the present invention proposes, and specific implementation step is as follows:
Step 401, reset condition variable obtain by sending message processing module, protocol-decoding submodule in message transmission processing module obtains the keyword that the needs in current message upgrade, as message header (the message identifier Mid of MEGACO), Transaction Id, Context Id, PhysicalTermination Id/Endpoint Id, Connection Id, SDP information etc., wait for that end points reset condition renewal submodule is for further processing;
Step 402, in end points reset condition is upgraded submodule, search endpoint status table, if find endpoint status table corresponding to Endpoint ID in step 401 keyword, the keyword message under the end points comprising in current transmission message is saved in the reset condition variable of corresponding endpoint status table, if endpoint status table corresponding to this Endpoint ID do not exist, does not just create the endpoint status table that this Endpoint ID is corresponding; The transmission sign (Transaction Id) that will use when current message is sent is also saved in reset condition variable, this transmits sign Transaction id is a keyword in message, belong to protocol parameter, it is all unique that each message sending transmits sign, this parameter is that testing tool automatically produces, and is used for reset condition and the real-time status of end points in association status table.
Step 403, real-time running state variable obtain by receipt message processing module, protocol-decoding submodule in receipt message processing module obtains keyword in current media gateway response message as Transaction Id, Context Id, Physical Termination Id/Endpoint Id, SDP information etc., wait for that end points real-time running state upgrades submodule and is for further processing;
Step 404, end points real-time running state upgrade submodule the current keyword message containing under the end points comprising in the response message that the transmission described in 402 identifies in steps receiving are updated in corresponding end points real-time running state variable.
Step 405, transmission message dynamic keyword upgrade submodule and upgrade dynamic keyword in transmission message, are ready for sending.
So far set up the associated of the reset condition of end points and real-time status, media gateway controlling has been sent to keyword match that message carries out and upgrade and can realize.Non-dynamic keyword can upgrade according to preset value as MEGACO message header Mid and physical endpoint sign (Physical Termination Id and Endpoint Id); The testing tool that dynamic keyword Transaction Id is realized by the present invention generates automatically.
Dynamic keyword Context Id can find real-time Context Id to complete renewal according to the original Context Id information of preserving in Termination state table; Send dynamic keyword Ephemeral Termination Id in message directly in matched and searched Termination state table original Termination Id variable find current real-time Ephemeral Termination Id to upgrade; Dynamic keyword Connection Id can find according to the original Connection Id in Termination state table the Connection Id of real time execution to complete dynamic keyword renewal; Send the renewal that the renewal of dynamic keyword IP address that in message, SDP comprises and port can complete real-time status by searching the IP address of mating in Termination reset condition variable and port.
If need to support the test of a plurality of media gateway, can in Termination state table, increase the variable that records Termination Real-Time IP address and port, the matching condition that increases IP address and port when dynamic variable matched and searched can realize.
Fig. 5 is the testing tool operational process that the present invention realizes.Below in conjunction with Fig. 5, further to the present invention is based on the step refinement of the calling control flow method of testing of MGCP, set forth:
Step 501, operation testing tool, configuration media gateway controlling address and port, media gateway controlling Id, allows media gateway IP address and the port of registration, and actual user's Endpoint ID mapping relations in subscriber endpoints sign and media gateway in calling control flow message;
Step 502, testing tool are opened automatic-answering back device and are started media gateway and register to testing tool, and testing tool is registered from dynamic response;
Step 503, manual edit or automatically generate test script;
Step 504, testing tool are selected test script and operational mode: operation manually or automatically;
Step 505, testing tool are opened bring into operation script read first message of one or more test script files;
Step 506, testing tool message are first carried out protocol-decoding before sending and are obtained end points reset condition;
Step 507, testing tool upgrade end points reset condition variable;
Step 508, testing tool complete the keyword match renewal that sends message;
Step 509, testing tool send message according to the operational mode automatic or manual of selecting;
Step 510, media gateway handles media gateway controlling message or transmission media gateway request message;
Step 511, testing tool receiving media gateway messages;
Step 512, testing tool carry out source codec analysis;
Step 513, testing tool upgrade end points real-time running state variable;
Step 514, testing tool are analyzed receipt message response corresponding to media gateway controlling message whether step 509 sends; Be to carry out next step, otherwise enter step 517;
Step 515, judge whether script finishes, if script finishes, finish test, otherwise enter next step;
Step 516, start to read next message and enter step 506 and start next message and send;
Step 517, testing tool are analyzed whether registration message of receipt message, if will start corresponding registration response;
Step 518, testing tool are analyzed whether heartbeat message of receipt message, if will start corresponding heartbeat response;
Step 519, testing tool are analyzed whether on-hook message of receipt message, are to start corresponding on-hook response, if require automatically to delete associations, are connected with RTP, can send the associated message being connected with RTP of automatic deletion after on-hook response;
Step 520, transmission generic response.
Wherein step 507 is carried out the keyword that protocol-decoding obtains the needs renewal in current message, comprise Endpoint ID, if there is described state table corresponding to Endpoint ID in endpoint status table, upgrade the reset condition variable in described endpoint status table according to the keyword obtaining; Otherwise newly-increased endpoint status table corresponding to described Endpoint ID.
Described keyword comprises: message header, transmits sign, association identification, Endpoint ID, connection identifier, Session Description Protocol piece.
The above is only the preferred embodiment of the present invention, it should be pointed out that the those skilled in the art for the art, and the present invention can also have various modifications and variations.Under the premise without departing from the principles of the invention, any modification of doing, be equal to replacement, improvement etc., within protection scope of the present invention all should be included in.