* Create a thread to report OSP usage * param ospvTransaction OSP transaction handle * param ospvReleaseCode Call release reason * param ospvDurating Call duration * param ospvStartTime Call start time * param ospvEndTime Call end time * param ospvAlertTime Call alert time * param ospvConnectTime Call connected time * param ospvIsPDDInfoPresent If post dial delay information avaliable *
| 86 | * param ospvReleaseSource Which side release the call |
| 87 | */ |
| 88 | void ospReportUsageWrapper( |
| 89 | OSPTTRANHANDLE ospvTransaction, |
| 90 | unsigned ospvReleaseCode, |
| 91 | unsigned ospvDuration, |
| 92 | time_t ospvStartTime, |
| 93 | time_t ospvEndTime, |
| 94 | time_t ospvAlertTime, |
| 95 | time_t ospvConnectTime, |
| 96 | unsigned ospvIsPDDInfoPresent, |
| 97 | unsigned ospvPostDialDelay, |
| 98 | OSPE_RELEASE ospvReleaseSource) |
| 99 | { |
| 100 | osp_usage* usage; |
| 101 | OSPTTHREADID threadid; |
| 102 | OSPTTHRATTR threadattr; |
| 103 | int errorcode; |
| 104 | |
| 105 | LM_DBG("schedule usage report for '%llu'\n", ospGetTransactionId(ospvTransaction)); |
| 106 | |
| 107 | usage = (osp_usage*)malloc(sizeof(osp_usage)); |
| 108 | |
| 109 | usage->transaction = ospvTransaction; |
| 110 | usage->cause = ospvReleaseCode; |
| 111 | usage->duration = ospvDuration; |
| 112 | usage->start = ospvStartTime; |
| 113 | usage->end = ospvEndTime; |
| 114 | usage->alert = ospvAlertTime; |
| 115 | usage->connect = ospvConnectTime; |
| 116 | usage->haspdd = ospvIsPDDInfoPresent; |
| 117 | usage->pdd = ospvPostDialDelay; |
| 118 | usage->release = ospvReleaseSource; |
| 119 | |
| 120 | OSPM_THRATTR_INIT(threadattr, errorcode); |
| 121 | |
| 122 | OSPM_SETDETACHED_STATE(threadattr, errorcode); |
| 123 | |
| 124 | OSPM_CREATE_THREAD(threadid, &threadattr, ospReportUsageWork, usage, errorcode); |
| 125 | |
| 126 | OSPM_THRATTR_DESTROY(threadattr); |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | * Report OSP usage thread function |
no test coverage detected