[asterisk-commits] mmichelson: branch mmichelson/caller_id r384808 - /team/mmichelson/caller_id/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 4 19:02:21 CDT 2013
Author: mmichelson
Date: Thu Apr 4 19:02:18 2013
New Revision: 384808
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384808
Log:
Add caller ID tag option.
Modified:
team/mmichelson/caller_id/res/res_sip/sip_configuration.c
Modified: team/mmichelson/caller_id/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/caller_id/res/res_sip/sip_configuration.c?view=diff&rev=384808&r1=384807&r2=384808
==============================================================================
--- team/mmichelson/caller_id/res/res_sip/sip_configuration.c (original)
+++ team/mmichelson/caller_id/res/res_sip/sip_configuration.c Thu Apr 4 19:02:18 2013
@@ -246,6 +246,13 @@
endpoint->id.number.presentation = callingpres;
endpoint->id.name.presentation = callingpres;
return 0;
+}
+
+static int caller_id_tag_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
+{
+ struct ast_sip_endpoint *endpoint = obj;
+ endpoint->id.tag = ast_strdup(var->value);
+ return endpoint->id.tag ? 0 : -1;
}
static void *sip_nat_hook_alloc(const char *name)
@@ -315,6 +322,7 @@
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "disable_direct_media_on_nat", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, disable_direct_media_on_nat));
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "callerid", "", caller_id_handler, NULL, 0, 0);
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "callerid_privacy", "", caller_id_privacy_handler, NULL, 0, 0);
+ ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "callerid_tag", "", caller_id_tag_handler, NULL, 0, 0);
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "trust_external_id", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, trust_external_id));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_pai", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_pai));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_rpid", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_rpid));
More information about the asterisk-commits
mailing list