C-Netz: Move callref to transaction. Callref on SpK only when its busy.

Only when busy, the channel has callref. This is required for audio
routing. During setup, the callref assigned to transaction and kept
there until release to/from upper layer.
This commit is contained in:
Andreas Eversberg
2016-08-01 19:17:13 +02:00
parent 1a3e536010
commit ce7a98206a
3 changed files with 70 additions and 36 deletions

View File

@@ -162,6 +162,25 @@ transaction_t *search_transaction_number(cnetz_t *cnetz, uint8_t futln_nat, uint
return NULL;
}
transaction_t *search_transaction_callref(cnetz_t *cnetz, int callref)
{
transaction_t *trans = cnetz->trans_list;
/* just in case, this should not happen */
if (!callref)
return NULL;
while (trans) {
if (trans->callref == callref) {
const char *rufnummer = transaction2rufnummer(trans);
PDEBUG(DTRANS, DEBUG_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
return trans;
}
trans = trans->next;
}
return NULL;
}
static const char *trans_state_name(int state)
{
switch (state) {