diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-01 23:05:28 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-01 23:05:28 +0000 |
commit | 21d21f89c04ebaad6822311ceadd13275b357513 (patch) | |
tree | 86a6664b5cba70b924fdd1cef2ecbf93226e7d58 /channels/chan_features.c | |
parent | 4d4470fe1560a6d00b17db78798f0cc9790fe74b (diff) |
use string fields for some stuff in ast_channel
const-ify some more APIs
remove 'type' field from ast_channel, in favor of the one in the channel's tech structure
allow string field module users to specify the 'chunk size' for pool allocations
update chan_alsa to be compatible with recent const-ification patches
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9060 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_features.c')
-rw-r--r-- | channels/chan_features.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/channels/chan_features.c b/channels/chan_features.c index 5f6ff2ca6..f8047d323 100644 --- a/channels/chan_features.c +++ b/channels/chan_features.c @@ -61,9 +61,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/app.h" #include "asterisk/musiconhold.h" #include "asterisk/manager.h" +#include "asterisk/stringfields.h" static const char desc[] = "Feature Proxy Channel"; -static const char type[] = "Feature"; static const char tdesc[] = "Feature Proxy Channel Driver"; static int usecnt =0; @@ -106,7 +106,7 @@ static int features_indicate(struct ast_channel *ast, int condition); static int features_fixup(struct ast_channel *oldchan, struct ast_channel *newchan); static const struct ast_channel_tech features_tech = { - .type = type, + .type = "Feature", .description = tdesc, .capabilities = -1, .requester = features_request, @@ -349,8 +349,8 @@ static int features_call(struct ast_channel *ast, char *dest, int timeout) p->subchan->cid.cid_ani = NULL; p->subchan->cid.cid_pres = p->owner->cid.cid_pres; - strncpy(p->subchan->language, p->owner->language, sizeof(p->subchan->language) - 1); - strncpy(p->subchan->accountcode, p->owner->accountcode, sizeof(p->subchan->accountcode) - 1); + ast_string_field_set(p->subchan, language, p->owner->language); + ast_string_field_set(p->subchan, accountcode, p->owner->accountcode); p->subchan->cdrflags = p->owner->cdrflags; res = ast_call(p->subchan, dest2, timeout); update_features(p, x); @@ -464,7 +464,7 @@ static struct ast_channel *features_new(struct feature_pvt *p, int state, int in } tmp->tech = &features_tech; for (x=1;x<4;x++) { - snprintf(tmp->name, sizeof(tmp->name), "Feature/%s/%s-%d", p->tech, p->dest, x); + ast_string_field_build(tmp, name, "Feature/%s/%s-%d", p->tech, p->dest, x); for (y=0;y<3;y++) { if (y == index) continue; @@ -474,7 +474,6 @@ static struct ast_channel *features_new(struct feature_pvt *p, int state, int in if (y >= 3) break; } - tmp->type = type; ast_setstate(tmp, state); tmp->writeformat = p->subchan->writeformat; tmp->rawwriteformat = p->subchan->rawwriteformat; @@ -540,7 +539,7 @@ int load_module() { /* Make sure we can register our sip channel type */ if (ast_channel_register(&features_tech)) { - ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); + ast_log(LOG_ERROR, "Unable to register channel class 'Feature'\n"); return -1; } ast_cli_register(&cli_show_features); |