88{
91 char *contact_name;
94 int res = 0;
95
99 );
100
101
104 return -1;
105 }
106
108
111 return -1;
112 }
113
116 return -1;
117 }
118
120 if (!pjsip_sorcery) {
122 return -1;
123 }
124
125
126 if ((contact_name = strstr(
args.contact_name,
"@@"))) {
127 size_t aor_name_len = contact_name -
args.contact_name;
128 char aor_name[aor_name_len + 1];
130
131
132 strncpy(aor_name,
args.contact_name, aor_name_len);
133 aor_name[aor_name_len] = '\0';
134
136 if (!aor_obj) {
138 return -1;
139 }
140
142 } else {
144 }
145
146 if (!contact_obj) {
148 return -1;
149 }
150
152
153 if (!strcmp(
args.field_name,
"status")) {
155 }
else if (!strcmp(
args.field_name,
"rtt")) {
156 if (!contact_status || contact_status->status !=
AVAILABLE) {
158 } else {
160 }
161 } else {
164
166
167 if (!change_set) {
169 return -1;
170 }
171
172 for (it_change_set = change_set; it_change_set; it_change_set = it_change_set->
next) {
173 if (!strcmp(it_change_set->
name,
args.field_name)) {
175 break;
176 }
177 }
178
179 if (!it_change_set) {
181
182 res = 1;
183 }
184
186 }
187
188 return res;
189}
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
struct ast_sorcery * ast_sip_get_sorcery(void)
Get a pointer to the SIP sorcery structure.
struct ast_sip_contact_status * ast_sip_get_contact_status(const struct ast_sip_contact *contact)
Retrieve the current status for a contact.
const char * ast_sip_get_contact_status_label(const enum ast_sip_contact_status_type status)
translate ast_sip_contact_status_type to character string.
#define ast_sorcery_objectset_create(sorcery, object)
Create an object set (KVP list) for an object.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Full structure for sorcery.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.