static void destroy_zt_pvt(struct zt_pvt **pvt)
{
struct zt_pvt *p = *pvt;
+ /* Remove channel from the list */
+ if(p->prev)
+ p->prev->next = p->next;
+ if(p->next)
+ p->next->prev = p->prev;
ast_mutex_destroy(&p->lock);
free(p);
*pvt = NULL;
Steve's code */
/* Check for callerid, digits, etc */
i->hasr2call = 1;
- chan = zt_new(i, AST_STATE_RING, 0, SUB_REAL, 0);
+ chan = zt_new(i, AST_STATE_RING, 0, SUB_REAL, 0, 0);
if (!chan) {
ast_log(LOG_WARNING, "Unable to create channel for channel %d\n", i->channel);
mfcr2_DropCall(i->r2, NULL, UC_NETWORK_CONGESTION);
fds[0].events = POLLIN;
poll(fds, 1, -1);
bytes=read(fd,buf,256);
- buf[(int)bytes]=0;
if(bytes>0){
int x;
+ buf[(int)bytes]=0;
ast_log(LOG_DEBUG, "WilCalu : Read Buf %s\n",buf);
sendbufptr=sendbuf;
for(x=0; lastbuf[x]!=0 && x<257; x++);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, stat, &err, msg, 100, &mlen);
SQLFreeHandle(SQL_HANDLE_ENV, obj->env);
+ ast_mutex_unlock(&obj->lock);
ast_log(LOG_WARNING, "res_odbc: Error SQLConnect=%d errno=%ld %s\n", res, err, msg);
return ODBC_FAIL;
} else {