[Asterisk-Users] Service codes for MGCP channels

Mark Spencer markster at digium.com
Thu Nov 20 09:32:53 MST 2003


Let me clarify my feelings:

I believe the API should look something like this:

struct ast_features {
	/* Private data for features, which ones are enabled, state
	   information, etc */
};

/* Apply var/value pair to the feature set, return 0 on success, -1 if
   this isn't a feature variable, or -2 if it is a feature variable but
   had improper syntax, etc */
int ast_feature_apply(struct ast_feature *feats, char *var, char *value);

/* Checks if the extension "exten" matches a feature which is permitted
   for the given feature set.  Returns 1 if it is present, 0 if it might
   match, and -1 if there is no match (i presume no equivalent of
   "matchmore" need be available for features?) */
int ast_feature_checkmatch(struct ast_feature *feats, char *exten);

/* Handle feature on a channel if it is in fact it matched as above.
   Returns 0 on success, -1 on failure or if hangup is needed */
int ast_feature_handle(char *chan, struct ast_feature *feats, char *exten);

Note that not all features can be implemented this way (e.g. three way
calling, etc), as they involve intimate knowledge of the underlying
channel.

Features would then be configured through /etc/asterisk/features.conf in
terms of remapping them, but would NOT be configured through
extensions.conf.

Mark




More information about the asterisk-users mailing list