aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xchannels/chan_zap.c7
-rwxr-xr-xpbx/pbx_wilcalu.c2
-rwxr-xr-xres/res_odbc.c1
3 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index f2be86336..78233ab84 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -1796,6 +1796,11 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
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;
@@ -5529,7 +5534,7 @@ static int handle_init_r2_event(struct zt_pvt *i, mfcr2_event_t *e)
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);
diff --git a/pbx/pbx_wilcalu.c b/pbx/pbx_wilcalu.c
index b2f61454f..632c79fa8 100755
--- a/pbx/pbx_wilcalu.c
+++ b/pbx/pbx_wilcalu.c
@@ -82,10 +82,10 @@ static void *autodial(void *ignore)
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++);
diff --git a/res/res_odbc.c b/res/res_odbc.c
index dde43353f..520581a6d 100755
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -351,6 +351,7 @@ odbc_status odbc_obj_connect(odbc_obj * obj)
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 {