diff options
author | Terry Wilson <twilson@digium.com> | 2012-01-24 20:12:09 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2012-01-24 20:12:09 +0000 |
commit | 99cae5b7508f30a308afbbacf92ad306a30f68df (patch) | |
tree | bdca00ce837e60a5f9a16fed06d02f6e77235035 /main/cel.c | |
parent | 2144ba5df2813609024964c4c2d9060b30d5cd43 (diff) |
Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.
Review: https://reviewboard.asterisk.org/r/1661/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cel.c')
-rw-r--r-- | main/cel.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/main/cel.c b/main/cel.c index 534faed50..6e8215f20 100644 --- a/main/cel.c +++ b/main/cel.c @@ -373,7 +373,7 @@ static int linkedid_match(void *obj, void *arg, void *data, int flags) int res; ast_channel_lock(c); - res = (c != find_dat->chan && c->linkedid && !strcmp(find_dat->linkedid, c->linkedid)); + res = (c != find_dat->chan && ast_channel_linkedid(c) && !strcmp(find_dat->linkedid, ast_channel_linkedid(c))); ast_channel_unlock(c); return res ? CMP_MATCH | CMP_STOP : 0; @@ -381,7 +381,7 @@ static int linkedid_match(void *obj, void *arg, void *data, int flags) void ast_cel_check_retire_linkedid(struct ast_channel *chan) { - const char *linkedid = chan->linkedid; + const char *linkedid = ast_channel_linkedid(chan); struct channel_find_data find_dat; /* make sure we need to do all this work */ @@ -459,11 +459,11 @@ struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event ast_copy_string(tchan->exten, record.extension, sizeof(tchan->exten)); ast_copy_string(tchan->context, record.context, sizeof(tchan->context)); ast_channel_name_set(tchan, record.channel_name); - ast_string_field_set(tchan, uniqueid, record.unique_id); - ast_string_field_set(tchan, linkedid, record.linked_id); - ast_string_field_set(tchan, accountcode, record.account_code); - ast_string_field_set(tchan, peeraccount, record.peer_account); - ast_string_field_set(tchan, userfield, record.user_field); + ast_channel_uniqueid_set(tchan, record.unique_id); + ast_channel_linkedid_set(tchan, record.linked_id); + ast_channel_accountcode_set(tchan, record.account_code); + ast_channel_peeraccount_set(tchan, record.peer_account); + ast_channel_userfield_set(tchan, record.user_field); if ((newvariable = ast_var_assign("BRIDGEPEER", record.peer))) { AST_LIST_INSERT_HEAD(headp, newvariable, entries); @@ -561,11 +561,11 @@ int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event AST_EVENT_IE_CEL_APPNAME, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->appl, ""), AST_EVENT_IE_CEL_APPDATA, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->data, ""), AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, chan->amaflags, - AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, chan->accountcode, - AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, chan->peeraccount, - AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, chan->uniqueid, - AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, chan->linkedid, - AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, chan->userfield, + AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, ast_channel_accountcode(chan), + AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, ast_channel_peeraccount(chan), + AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, ast_channel_uniqueid(chan), + AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, ast_channel_linkedid(chan), + AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, ast_channel_userfield(chan), AST_EVENT_IE_CEL_EXTRA, AST_EVENT_IE_PLTYPE_STR, extra, AST_EVENT_IE_CEL_PEER, AST_EVENT_IE_PLTYPE_STR, peername, AST_EVENT_IE_END); |