diff options
author | Terry Wilson <twilson@digium.com> | 2012-02-20 23:43:27 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2012-02-20 23:43:27 +0000 |
commit | 57f42bd74f78d5022631b2ba2269892f8a3a384a (patch) | |
tree | 3283ec4ac88c5b3c267f4490b410e5331911f2bb /channels/chan_nbs.c | |
parent | 25e5eb3b96e6d9bcbb2fc02fbd879ae21104c1f5 (diff) |
ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_nbs.c')
-rw-r--r-- | channels/chan_nbs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c index 4bb88e661..882e165f8 100644 --- a/channels/chan_nbs.c +++ b/channels/chan_nbs.c @@ -87,9 +87,9 @@ static int nbs_call(struct ast_channel *ast, const char *dest, int timeout) { struct nbs_pvt *p; - p = ast->tech_pvt; + p = ast_channel_tech_pvt(ast); - if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) { + if ((ast_channel_state(ast) != AST_STATE_DOWN) && (ast_channel_state(ast) != AST_STATE_RESERVED)) { ast_log(LOG_WARNING, "nbs_call called on %s, neither down nor reserved\n", ast_channel_name(ast)); return -1; } @@ -164,21 +164,21 @@ static struct nbs_pvt *nbs_alloc(const char *data) static int nbs_hangup(struct ast_channel *ast) { struct nbs_pvt *p; - p = ast->tech_pvt; + p = ast_channel_tech_pvt(ast); ast_debug(1, "nbs_hangup(%s)\n", ast_channel_name(ast)); - if (!ast->tech_pvt) { + if (!ast_channel_tech_pvt(ast)) { ast_log(LOG_WARNING, "Asked to hangup channel not connected\n"); return 0; } nbs_destroy(p); - ast->tech_pvt = NULL; + ast_channel_tech_pvt_set(ast, NULL); ast_setstate(ast, AST_STATE_DOWN); return 0; } static struct ast_frame *nbs_xread(struct ast_channel *ast) { - struct nbs_pvt *p = ast->tech_pvt; + struct nbs_pvt *p = ast_channel_tech_pvt(ast); /* Some nice norms */ @@ -198,7 +198,7 @@ static struct ast_frame *nbs_xread(struct ast_channel *ast) static int nbs_xwrite(struct ast_channel *ast, struct ast_frame *frame) { - struct nbs_pvt *p = ast->tech_pvt; + struct nbs_pvt *p = ast_channel_tech_pvt(ast); /* Write a frame of (presumably voice) data */ if (frame->frametype != AST_FRAME_VOICE) { if (frame->frametype != AST_FRAME_IMAGE) @@ -209,7 +209,7 @@ static int nbs_xwrite(struct ast_channel *ast, struct ast_frame *frame) ast_log(LOG_WARNING, "Cannot handle frames in %s format\n", ast_getformatname(&frame->subclass.format)); return 0; } - if (ast->_state != AST_STATE_UP) { + if (ast_channel_state(ast) != AST_STATE_UP) { /* Don't try tos end audio on-hook */ return 0; } @@ -223,17 +223,17 @@ static struct ast_channel *nbs_new(struct nbs_pvt *i, int state, const char *lin struct ast_channel *tmp; tmp = ast_channel_alloc(1, state, 0, 0, "", "s", context, linkedid, 0, "NBS/%s", i->stream); if (tmp) { - tmp->tech = &nbs_tech; + ast_channel_tech_set(tmp, &nbs_tech); ast_channel_set_fd(tmp, 0, nbs_fd(i->nbs)); - ast_format_cap_add(tmp->nativeformats, &prefformat); + ast_format_cap_add(ast_channel_nativeformats(tmp), &prefformat); ast_format_copy(&tmp->rawreadformat, &prefformat); ast_format_copy(&tmp->rawwriteformat, &prefformat); ast_format_copy(&tmp->writeformat, &prefformat); ast_format_copy(&tmp->readformat, &prefformat); if (state == AST_STATE_RING) - tmp->rings = 1; - tmp->tech_pvt = i; + ast_channel_rings_set(tmp, 1); + ast_channel_tech_pvt_set(tmp, i); ast_channel_context_set(tmp, context); ast_channel_exten_set(tmp, "s"); ast_channel_language_set(tmp, ""); |