Test SIP Messages

Introduction

The Test SIP Application (TestSipApp) serves as an endpoint for sending and receiving SIP test message content over TCP and UDP. This functionality is driven by a Lua Test script via the TestSipLuaAgent.

The TestSipLuaAgent sends IPC messages over the n2svcd message bus to control TestSipApp.

These messages have the following structure.

TEST-SIP-RECV

The TEST-SIP-RECV IPC message is generated by TestSipApp and sent to the Lua script via the agent. This is done when an inbound SIP message is received on-the-wire over TCP or UDP.

The Lua test script which receives the message is either:

The attributes of the TEST-SIP-RECV message are:

Field Type Description
call_id String [Required] The previously-claimed or registered SIP Call-ID value which caused this correlated payload to be directed to the claimant.
payload String [Required] The SIP message payload content.
originator_ip String [Required] The source IP address in IPv4 dot notation format.
originator_port Integer [Required] The source port number (TCP or UDP).
Currently, only UDP message receipt is supported.

TEST-SIP-SEND

The TEST-SIP-SEND is sent to the TestSipApp by another a Lua script wishing to place a SIP message payload on-the-wire.

The attributes of the TEST-SIP-SEND message are:

Field Type Description
call_id String [Required] The SIP Call-ID being either an in-progress Call-ID which is already claimed by this Lua script, or else a new SIP Call-ID which will be automatically owned and tracked henceforth.
payload String [Required] The SIP message (request or response) payload content to send.
destination_ip String [Required] The remote destination IP address in dot notation format.
The SIP message will be sent to this address.
Currently, only UDP transmission is supported.
destination_port Integer [Required] The remote destination TCP or UDP port number.
Currently, only UDP transmission is supported.
seconds Float Extends the Call-ID ownership time to be this many seconds from the time at which this message is processed.
(Default = do not extend the Call-ID ownership).

TEST-SIP-FAIL

The TEST-SIP-FAIL is sent by the TestSipApp by another application whenever a TEST-SIP-SEND is not able to write the SIP message onto the TCP or UDP socket.

The attributes of the TEST-SIP-FAIL message are:

Field Type Description
call_id String [Required] The SIP Call-ID from the original TEST-SIP-SEND.
reason String [Required] A short description of the reason for the failure to send.

TEST-SIP-REGISTER-INCALL

The TEST-SIP-REGISTER-INCALL is sent by the TestSipLuaAgent to the TestSipApp to notify that a new incoming SIP Request is expected to arrive soon. The TestSipApp will acknowledge receipt of the registration by returning a TEST-SIP-REGISTERED-INCALL IPC message back to the TestSipLuaAgent.

If and when the call does arrive, then the TestSipApp will assign ownership of the new call to the requesting Lua script, and will deliver the newly received message using TEST-SIP-RECV.

The registration has a lifetime of 5 seconds (not currently configurable). If no matching inbound SIP INVITE Request is received in this time, then the registration will be silently discarded.

The attributes of the TEST-SIP-REGISTER-INCALL message are:

Field Type Description
match Object [Required] A structure containing one or more of the following match attributes.
If one or more match fields are specified, then a match on any field will be considered a match.
calling_party String Calling party string for which this registration will match an incoming SIP INVITE.
This match is successful if the "user" part of the received From header URI is a case-insensitive match with the string given here.
The full string must match, there is currently no mechanism for wild-card, prefix, or partial match.
called_party String Called party string for which this registration will match an incoming SIP INVITE.
This match is successful if the "user" part of the received To header URI is a case-insensitive match with the string given here.
The full string must match, there is currently no mechanism for wild-card, prefix, or partial match.

TEST-SIP-REGISTERED-INCALL

The TEST-SIP-REGISTERED-INCALL is sent from the TestSipLuaAgent to confirm that the registration was received, and that the Lua test script can proceed with the processing which will result in the in call, secure that the registration is waiting to accept it.

The TEST-SIP-REGISTERED-INCALL message does not have any attributes.