The StartEventSubscription function can be called by application software to subscribe to an event
offered by another telephony device or application.
Namespace:
LanScapeNote: |
---|
If you want to subscribe to events offered by another telephony device, you must call the SipTelephonyEnable()()() API procedure prior to calling the StartEventSubscription(VoipMediaEngine, String, String, String, UInt32, Boolean, String, String, UInt32, UInt32, UInt32) API procedure . |
Assembly: LMEVoipManaged (in LMEVoipManaged.dll) Version: 6.0.5226.26700
Syntax
C# |
---|
public VoipMediaEngine..::.TELEPHONY_RETURN_VALUE StartEventSubscription( VoipMediaEngine MediaEngine, string LocalPhoneName, string DestUserNameOrPhoneNumber, string DestinationAddress, uint DestinationSipPort, bool SubscribeThroughProxy, string EventName, string EventParameter, uint SubscriptionIntervalSeconds, uint SubscriptionResponseTimeoutMs, uint SubscriptionRetryTimeoutSeconds ) |
Visual Basic (Declaration) |
---|
Public Function StartEventSubscription ( _ MediaEngine As VoipMediaEngine, _ LocalPhoneName As String, _ DestUserNameOrPhoneNumber As String, _ DestinationAddress As String, _ DestinationSipPort As UInteger, _ SubscribeThroughProxy As Boolean, _ EventName As String, _ EventParameter As String, _ SubscriptionIntervalSeconds As UInteger, _ SubscriptionResponseTimeoutMs As UInteger, _ SubscriptionRetryTimeoutSeconds As UInteger _ ) As VoipMediaEngine..::.TELEPHONY_RETURN_VALUE |
Visual C++ |
---|
public: VoipMediaEngine..::.TELEPHONY_RETURN_VALUE StartEventSubscription( VoipMediaEngine^ MediaEngine, String^ LocalPhoneName, String^ DestUserNameOrPhoneNumber, String^ DestinationAddress, unsigned int DestinationSipPort, bool SubscribeThroughProxy, String^ EventName, String^ EventParameter, unsigned int SubscriptionIntervalSeconds, unsigned int SubscriptionResponseTimeoutMs, unsigned int SubscriptionRetryTimeoutSeconds ) |
J# |
---|
public VoipMediaEngine..::.TELEPHONY_RETURN_VALUE StartEventSubscription( VoipMediaEngine MediaEngine, String LocalPhoneName, String DestUserNameOrPhoneNumber, String DestinationAddress, UInt32 DestinationSipPort, boolean SubscribeThroughProxy, String EventName, String EventParameter, UInt32 SubscriptionIntervalSeconds, UInt32 SubscriptionResponseTimeoutMs, UInt32 SubscriptionRetryTimeoutSeconds ) |
Parameters
- MediaEngine
- Type: LanScape..::.VoipMediaEngine
An instance of the media engine.
- LocalPhoneName
- Type: System..::.String
The "Phone" name of the your media engine. This is generally set to the same phone name as what was specified when the media engine was created. Depending on the application however, you can specify any name that is appropriate. From the standpoint of the transmitted SIP SUBSCRIBE message that gets generated, the value specified here is used as the "user name" in the SIP SUBSCRIBE message's "From" header field.
- DestUserNameOrPhoneNumber
- Type: System..::.String
The name of the destination telephony device offering the event.
- DestinationAddress
- Type: System..::.String
The UNC network name or IP address of the device offering the event. If sip proxy support has been enabled, the parameter pDestinationAddress should be set to your sip domain name. If it is not, the configured proxy will not be used and the event subscription will be sent directly to this address.
- DestinationSipPort
- Type: System..::.UInt32
The SIP port of the device offering the event. If sip proxy support has been enabled, this parameter should be set to zero unless you are subscribing to an event in which you do not want to use the configured proxy (i.e. parameter DestinationAddress is not set to the sip domain name.
- SubscribeThroughProxy
- Type: System..::.Boolean
If non zero, the event subscription request will be sent to your configured proxy server. It will be the proxy server's responsibility to route the request to the destination.
- EventName
- Type: System..::.String
The NULL terminated character string specifying the name of the event to subscribe to.
- EventParameter
- Type: System..::.String
A NULL terminated character string that specifies whatever generic parameter string your application requires. This event parameter string is appended to the transmitted SUBSCRIBE SIP message "Event:" header.
- SubscriptionIntervalSeconds
- Type: System..::.UInt32
The number of seconds the event subscription will persist.
- SubscriptionResponseTimeoutMs
- Type: System..::.UInt32
The time in Ms to wait for the far end to respond to the subscription request.
- SubscriptionRetryTimeoutSeconds
- Type: System..::.UInt32
The time in Ms to wait before retrying a failed subscription request.
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 Value | Description |
---|---|
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) |
SipSubscriptionAlreadyExists |
An application has attempted to subscribe to an event that is offered by another telephony device.
The media engine has determined that the application has already subscribed to the particular event
and the latest subscription request is redundant.
(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) |
SipProxyNotEnabled |
Indicates that an operation was attempted that requires a proxy server to be configured and enabled.
However, proxy support has not yet been enabled.
(API return value) |
SipMemoryError |
The telephony engine attempted to allocate system memory but the allocation failed. Make sure the
host system has enough virtual memory. Increasing the amount of virtual memory can remove these
errors, however if critical telephony engine code has been swapped out to disk and is not resident
in physical memory, you may experience degraded audio/video performance. If you want to remove
this error and obtain the best possible audio/video performance, make sure the host system has
enough physical memory.
To resolve this error, you may also 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 class that is passed to the StartSipTelephony(VoipMediaEngine..::.START_SIP_TELEPHONY_PARAMS)
and ReStartSipTelephony(VoipMediaEngine..::.START_SIP_TELEPHONY_PARAMS) API procedures.
(API return value, PHONE_LINE_NOTIFICATION) |
SipEventError |
This error occurs when an instance of the telephony engine is being created. It indicates that the
operating system refused to created an event required by the SIP stack. Make sure the host system you
are using has enough free resources and memory to support telephony operations.
(API return value) |
SipDomainNameNotDefined |
Application software has configured proxy services but has not specified a SIP domain name
using the EnableSipDomain(String) API procedure. This error can be generated for the following
API procedures: TransferLine(String, String, Int32, Int32), MakeCall(String, String, UInt32, Int32, Boolean, UInt32), MakeCallUri(String, Boolean, Int32, Boolean, UInt32),
and EnableSipRegisterServer(String, Boolean, Boolean, String, UInt32, UInt32, UInt32, UInt32, Boolean).
(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.