Tapi General Programming Considances

xiaoxiao2021-03-06  39

I don't know how to translate the right, but the content is very similar to some norms and constraints when I design the architecture. Aunt and translated into TAPI program design conventions.

A Telephony Operation is divided into asynchronous and synchronized:

1) Asynchronous operation will use a DRV_REQUEST type DWREQUESTID as the first parameter. When the operation is executed, a part of the operation can be performed in the function call. After the function returns, the rest can be performed in another thread. The operation function will return a negative error Code or DWREQUESTID.

When the operation is finally completed, the execution thread calls async_completion, returns the Request ID and the error code.

This sentence does not understand: Service Providers Should Always Copy Input Data from Application Memory INTO Service Provider Memory Before Returning from an asynchronous function.

2) Synchronous operation does not require dwRequestid, no need to call async_completion

NOTE: If the operation completes very rapidly (or the original request returns very slowly), it is possible that the interrupt handler that runs when a physical operation completes may be triggered before the original request returns to the application or even to TAPI This behavior. Is allowed.

That..................

Two Memory Alloc

In the TAPI function call

The APP is responsible for allocating the memory required to deliver information, TAPI is only filled in this information.

DWTOTALSIZE indicates that the total size of the data structure is assigned by calling the app.

DWNEDEDSIZE indicates how many bytes need to accommodate returned information, assigned by TAPI.

DWUSERSIZE indicates the number of bytes actually used, filling in TAPI

When there is variable dimension information in the data structural parameters, if DWTOTALSIZE is smaller than the data structure secure the Header size, then LineerR / PhoneR_StructuRuRuRetoosmall is returned.

Note: All text strings, regardless of encoding, in variably sized structures shouth be null-terminated accounting to Normal C String-Handling Conventions.

转载请注明原文地址:https://www.9cbs.com/read-66702.html

New Post(0)