X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=chan_lcr.c;h=4e93db13f1323ab76928edb8253389cbce247e56;hp=ef4873931ffc73b5a6b29ec535d4f3f918fa47bc;hb=refs%2Fheads%2Fholger%2Fcleaning-rebased;hpb=9f9b721735aa20e3362b7f6c451830b90f012c28 diff --git a/chan_lcr.c b/chan_lcr.c index ef48739..4e93db1 100644 --- a/chan_lcr.c +++ b/chan_lcr.c @@ -136,6 +136,13 @@ it is called from ast_channel process which has already locked ast_channel. #ifdef LCR_FOR_ASTERISK #include #endif + +/* + * Fwd declare struct ast_channel to get rid of gcc warning about + * incompatible pointer type passed to ast_register_application2. + */ +struct ast_channel; + #include #include #include @@ -161,8 +168,9 @@ it is called from ast_channel process which has already locked ast_channel. #include #include #include +#if ASTERISK_VERSION_NUM < 110000 #include - +#endif #include "extension.h" #include "message.h" #include "callerid.h" @@ -959,11 +967,12 @@ static void lcr_in_setup(struct chan_call *call, int message_type, union paramet #if ASTERISK_VERSION_NUM < 110000 ast->tech_pvt = call; ast->tech = &lcr_tech; + ast->fds[0] = call->pipe[0]; #else ast_channel_tech_pvt_set(ast, call); ast_channel_tech_set(ast, &lcr_tech); + ast_channel_set_fd(ast, 0, call->pipe[0]); #endif - ast->fds[0] = call->pipe[0]; /* fill setup information */ if (param->setup.dialinginfo.id) @@ -2079,7 +2088,7 @@ static #if ASTERISK_VERSION_NUM < 100000 struct ast_channel *lcr_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause) #else -struct ast_channel *lcr_request(const char *type, struct ast_format_cap *format, struct ast_channel *requestor, void *data, int *cause) +struct ast_channel *lcr_request(const char *type, struct ast_format_cap *format, const struct ast_channel *requestor, void *data, int *cause) #endif #else struct ast_channel *lcr_request(const char *type, int format, void *data, int *cause) @@ -2088,8 +2097,8 @@ struct ast_channel *lcr_request(const char *type, int format, void *data, int *c char exten[256], *dial, *interface, *opt; struct ast_channel *ast; struct chan_call *call; - struct ast_party_redirecting *req_redir; - struct ast_party_caller *req_caller; + const struct ast_party_redirecting *req_redir; + const struct ast_party_caller *req_caller; ast_mutex_lock(&chan_lock); CDEBUG(NULL, NULL, "Received request from Asterisk. (data=%s)\n", (char *)data); @@ -2179,10 +2188,11 @@ struct ast_channel *lcr_request(const char *type, int format, void *data, int *c call->ast = ast; #if ASTERISK_VERSION_NUM < 110000 ast->tech_pvt = call; + ast->fds[0] = call->pipe[0]; #else ast_channel_tech_pvt_set(ast, call); + ast_channel_set_fd(ast, 0, call->pipe[0]); #endif - ast->fds[0] = call->pipe[0]; call->pbx_started = 0; /* set state */ call->state = CHAN_LCR_STATE_OUT_PREPARE; @@ -2731,10 +2741,11 @@ static int lcr_hangup(struct ast_channel *ast) /* disconnect asterisk, maybe not required */ #if ASTERISK_VERSION_NUM < 110000 ast->tech_pvt = NULL; + ast->fds[0] = -1; #else ast_channel_tech_pvt_set(ast, NULL); + ast_channel_set_fd(ast, 0, -1); #endif - ast->fds[0] = -1; if (call->ref) { /* release */ CDEBUG(call, ast, "Releasing ref and freeing call instance.\n"); @@ -2944,7 +2955,7 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz union parameter newparam; int res = 0; struct chan_call *call; - const struct tone_zone_sound *ts = NULL; + const struct ast_tone_zone_sound *ts = NULL; ast_mutex_lock(&chan_lock); #if ASTERISK_VERSION_NUM < 110000