View | Details | Raw Unified | Return to bug 235236 | Differences between
and this patch

Collapse All | Expand All

(-)channels/chan_sip.c (+14 lines)
Lines 31186-31191 static struct ast_variable *add_var(cons Link Here
31186
31186
31187
	if ((varval = strchr(varname, '='))) {
31187
	if ((varval = strchr(varname, '='))) {
31188
		*varval++ = '\0';
31188
		*varval++ = '\0';
31189
		struct ast_variable *prev = NULL;
31190
		for (tmpvar = list; tmpvar; prev = tmpvar, tmpvar = tmpvar->next) {
31191
			if(!strcmp(varname, tmpvar->name)) {
31192
			/* for duplicate entries use last in the list */
31193
			    if(prev == NULL) {
31194
				    list = tmpvar->next;
31195
			    } else {
31196
				    prev->next = tmpvar->next;
31197
			    }
31198
			    free(tmpvar);
31199
			    break;
31200
			}
31201
		}
31202
		tmpvar = NULL;
31189
		if ((tmpvar = ast_variable_new(varname, varval, ""))) {
31203
		if ((tmpvar = ast_variable_new(varname, varval, ""))) {
31190
			tmpvar->next = list;
31204
			tmpvar->next = list;
31191
			list = tmpvar;
31205
			list = tmpvar;
(-)channels/chan_iax2.c (+44 lines)
Lines 583-588 struct iax2_peer { Link Here
583
583
584
	struct stasis_subscription *mwi_event_sub;	/*!< This subscription lets pollmailboxes know which mailboxes need to be polled */
584
	struct stasis_subscription *mwi_event_sub;	/*!< This subscription lets pollmailboxes know which mailboxes need to be polled */
585
585
586
	struct ast_variable *vars;
586
	struct ast_acl_list *acl;
587
	struct ast_acl_list *acl;
587
	enum calltoken_peer_enum calltoken_required;	/*!< Is calltoken validation required or not, can be YES, NO, or AUTO */
588
	enum calltoken_peer_enum calltoken_required;	/*!< Is calltoken validation required or not, can be YES, NO, or AUTO */
588
589
Lines 3863-3868 static char *handle_cli_iax2_show_peer(s Link Here
3863
		ast_cli(a->fd, "  Addr->IP     : %s Port %s\n",  str_addr ? str_addr : "(Unspecified)", str_port);
3864
		ast_cli(a->fd, "  Addr->IP     : %s Port %s\n",  str_addr ? str_addr : "(Unspecified)", str_port);
3864
		ast_cli(a->fd, "  Defaddr->IP  : %s Port %s\n", str_defaddr, str_defport);
3865
		ast_cli(a->fd, "  Defaddr->IP  : %s Port %s\n", str_defaddr, str_defport);
3865
		ast_cli(a->fd, "  Username     : %s\n", peer->username);
3866
		ast_cli(a->fd, "  Username     : %s\n", peer->username);
3867
		if (peer->vars) {
3868
			ast_cli(a->fd, "  Variables    :\n");
3869
			struct ast_variable *v;
3870
			for (v = peer->vars; v; v = v->next)
3871
				ast_cli(a->fd, "                 %s = %s\n", v->name, v->value);
3872
		}
3873
3866
		ast_cli(a->fd, "  Codecs       : %s\n", iax2_getformatname_multiple(peer->capability, &codec_buf));
3874
		ast_cli(a->fd, "  Codecs       : %s\n", iax2_getformatname_multiple(peer->capability, &codec_buf));
3867
3875
3868
		if (iax2_codec_pref_string(&peer->prefs, cbuf, sizeof(cbuf)) < 0) {
3876
		if (iax2_codec_pref_string(&peer->prefs, cbuf, sizeof(cbuf)) < 0) {
Lines 13036-13041 static struct iax2_peer *build_peer(cons Link Here
13036
				} else {
13044
				} else {
13037
					ast_log(LOG_WARNING, "requirecalltoken must be set to a valid value. at line %d\n", v->lineno);
13045
					ast_log(LOG_WARNING, "requirecalltoken must be set to a valid value. at line %d\n", v->lineno);
13038
				}
13046
				}
13047
			} else if (!strcasecmp(v->name, "setvar")) {
13048
				char *varname = ast_strdupa(v->value);
13049
				char *varval;
13050
				if ((varval = strchr(varname, '='))) {
13051
					*varval++ = '\0';
13052
					struct ast_variable *cur = NULL, *prev = NULL, *tmpvar = NULL;
13053
					for (cur = peer->vars; cur; prev = cur, cur = cur->next) {
13054
						if(!strcmp(varname, cur->name)) {
13055
					/* for duplicate entries use last in the user */
13056
							if(prev == NULL)
13057
								peer->vars = cur->next;
13058
							else
13059
								prev->next = cur->next;
13060
							free(cur);
13061
							break;
13062
						}
13063
					}
13064
					if((tmpvar = ast_variable_new(varname, varval, ""))) {
13065
						tmpvar->next = peer->vars;
13066
						peer->vars = tmpvar;
13067
					}
13068
				}
13069
13039
			} /* else if (strcasecmp(v->name,"type")) */
13070
			} /* else if (strcasecmp(v->name,"type")) */
13040
			/*	ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
13071
			/*	ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
13041
			v = v->next;
13072
			v = v->next;
Lines 13177-13182 static struct iax2_user *build_user(cons Link Here
13177
				if ((varval = strchr(varname, '='))) {
13208
				if ((varval = strchr(varname, '='))) {
13178
					*varval = '\0';
13209
					*varval = '\0';
13179
					varval++;
13210
					varval++;
13211
					*varval++ = '\0';
13212
					struct ast_variable *cur = NULL, *prev = NULL;
13213
					for (cur = user->vars; cur; prev = cur, cur = cur->next) {
13214
						if(!strcmp(varname, cur->name)) {
13215
					/* for duplicate entries use last in the user */
13216
							if(prev == NULL)
13217
								user->vars = cur->next;
13218
							else
13219
								prev->next = cur->next;
13220
							free(cur);
13221
							break;
13222
						}
13223
					}
13180
					if((tmpvar = ast_variable_new(varname, varval, ""))) {
13224
					if((tmpvar = ast_variable_new(varname, varval, ""))) {
13181
						tmpvar->next = user->vars;
13225
						tmpvar->next = user->vars;
13182
						user->vars = tmpvar;
13226
						user->vars = tmpvar;

Return to bug 235236