The SendSipKeepAlive API procedure can be used to send "NULL" SIP protocol messages to any destination you require. A "NULL" SIP message contains a single carriage return - line feed pair (<CR><LF>).

This capability is most often used to keep open a NAT router session when your application communicates with its SIP proxy server. If your SIP proxy cannot handle NULL SIP messages without generating warnings or errors, then you can keep your NAT router session open by registering with the SIP proxy at an interval that is shorter than your NAT router session. Using the SendSipKeepAlive API procedure is preferable to re-registering because it takes less processing power on the part of your VOIP application and your proxy server.

Namespace:  LanScape
Assembly:  LMEVoipManaged (in LMEVoipManaged.dll) Version: 6.0.5226.26700

Syntax

C#
public VoipMediaEngine..::.TELEPHONY_RETURN_VALUE SendSipKeepAlive(
	string Host,
	uint Port,
	bool EnableState,
	int KeepAliveSeconds
)
Visual Basic (Declaration)
Public Function SendSipKeepAlive ( _
	Host As String, _
	Port As UInteger, _
	EnableState As Boolean, _
	KeepAliveSeconds As Integer _
) As VoipMediaEngine..::.TELEPHONY_RETURN_VALUE
Visual C++
public:
VoipMediaEngine..::.TELEPHONY_RETURN_VALUE SendSipKeepAlive(
	String^ Host, 
	unsigned int Port, 
	bool EnableState, 
	int KeepAliveSeconds
)
J#
public VoipMediaEngine..::.TELEPHONY_RETURN_VALUE SendSipKeepAlive(
	String Host,
	UInt32 Port,
	boolean EnableState,
	int KeepAliveSeconds
)

Parameters

Host
Type: System..::.String
The IP address or network name of the destination. Generally set to the IP or name of your SIP proxy/registrar server.
Port
Type: System..::.UInt32
The UDP port of the destination. Generally set to the SIP port of your SIP proxy/registrar server.
EnableState
Type: System..::.Boolean
If set to a non zero value, "NULL" SIP message "Keep-alive" will be enabled.
KeepAliveSeconds
Type: System..::.Int32
The period in seconds that will be used to send NULL SIP messages.

Return Value

If the function succeeds, the return value will be SipSuccess.

If the function fails, the return value will be one of the following values as specified by the VoipMediaEngine..::.TELEPHONY_RETURN_VALUE data type.

Return ValueDescription
SipCallFailure
This value is returned by telephony API procedures to indicate general API failure. This error value is used as a "catch all error". If you receive this error, check to make sure that all parameters specified in the API procedure call are correct. Particularly, verify that pointers to memory regions are valid. This error return value is only used if a mapping to another specific error value does not exist.

(API return value)

SipInvalidHandle
Application software specified an invalid telephony handle in one of the API procedures. This usually indicates memory corruption on the part of application software.

(API return value)

SipBadParameter
One of the telephony API procedures was called by application software and was passed a pointer to an invalid memory address. Normally this error will occur when application software passes NULL pointer values to the telephony API. For managed code applications, you should never see this error unless your process space has exhausted memory.

(API return value)

SipUnknownHost
A network address was specified as a UNC name and DNS was used to obtain the destination IP address. DNS could not resolve the UNC network name. Make sure the spelling you specified for the destination machine is correct.

(API return value)

SipThreadCreationError
The telephony engine attempted to create an internal thread object. The thread creation failed. Make sure your system has enough free resources (memory) to perform the operations you are requesting from the telephony engine. Thread creation errors are generally associated with the application process space consuming too much system memory. To resolve this error, you may want to consider disabling certain features of the media engine such as conference calling. You can also reduce memory requirements if you reduce the maximum signal length of internal media engine signal paths by specifying a smaller number for the MaxMixerLinebuffers member of the VoipMediaEngine..::.START_SIP_TELEPHONY_PARAMS structure that is passed to the StartSipTelephony(VoipMediaEngine..::.START_SIP_TELEPHONY_PARAMS) and ReStartSipTelephony(VoipMediaEngine..::.START_SIP_TELEPHONY_PARAMS) API procedures. Reducing the default stack size for threads in your application may also allow your process space to consume less system memory.

(API return value, PHONE_LINE_NOTIFICATION)

Remarks

None.

See Also