A TCAP application uses two dialog IDs that are 32-bit unsigned integers to reference a particular transaction:
Service user dialog ID (suDlgId)
Service provider dialog ID (spDlgId)
The service user dialog ID is assigned by the application on the first outgoing request for a particular transaction. This ID must be unique among all concurrently active transactions associated with a particular TCAP SAP (subsystem number). The content of this dialog ID is not checked by the TCAP protocol layer, but it is passed back and forth between the application and the TCAP layer on all subsequent requests or indications belonging to that transaction. The application can choose any value for the suDlgId such as an address or index to a data structure, to associate a message with its transaction. A suDlgId value can be reused by the application any time after the previous transaction using that value has completed.
The service provider dialog ID is assigned by the TCAP layer in the first incoming message associated with a particular transaction (either a new transaction indication or a response from a far SP). The application is expected to store this value and pass it back to the TCAP layer on all subsequent requests belonging to that transaction. On the first outgoing request for a transaction, and on any subsequent request prior to receiving an incoming message belonging to that transaction, the application must pass a spDlgId value of zero.