|
|
@ -8342,6 +8342,9 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
|
|
|
|
peer->pokefreqnotok = DEFAULT_FREQ_NOTOK;
|
|
|
|
peer->pokefreqnotok = DEFAULT_FREQ_NOTOK;
|
|
|
|
ast_string_field_set(peer,context,"");
|
|
|
|
ast_string_field_set(peer,context,"");
|
|
|
|
ast_string_field_set(peer,peercontext,"");
|
|
|
|
ast_string_field_set(peer,peercontext,"");
|
|
|
|
|
|
|
|
ast_clear_flag(peer, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
ast_string_field_set(peer, cid_name, "");
|
|
|
|
|
|
|
|
ast_string_field_set(peer, cid_num, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!v) {
|
|
|
|
if (!v) {
|
|
|
@ -8446,18 +8449,24 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
|
|
|
|
} else if (!strcasecmp(v->name, "disallow")) {
|
|
|
|
} else if (!strcasecmp(v->name, "disallow")) {
|
|
|
|
ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, 0);
|
|
|
|
ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, 0);
|
|
|
|
} else if (!strcasecmp(v->name, "callerid")) {
|
|
|
|
} else if (!strcasecmp(v->name, "callerid")) {
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(v->value)) {
|
|
|
|
char name2[80];
|
|
|
|
char name2[80];
|
|
|
|
char num2[80];
|
|
|
|
char num2[80];
|
|
|
|
ast_callerid_split(v->value, name2, 80, num2, 80);
|
|
|
|
ast_callerid_split(v->value, name2, 80, num2, 80);
|
|
|
|
ast_string_field_set(peer, cid_name, name2);
|
|
|
|
ast_string_field_set(peer, cid_name, name2);
|
|
|
|
ast_string_field_set(peer, cid_num, num2);
|
|
|
|
ast_string_field_set(peer, cid_num, num2);
|
|
|
|
ast_set_flag(peer, IAX_HASCALLERID);
|
|
|
|
ast_set_flag(peer, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(v->name, "fullname")) {
|
|
|
|
} else if (!strcasecmp(v->name, "fullname")) {
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(v->value)) {
|
|
|
|
ast_string_field_set(peer, cid_name, v->value);
|
|
|
|
ast_string_field_set(peer, cid_name, v->value);
|
|
|
|
ast_set_flag(peer, IAX_HASCALLERID);
|
|
|
|
ast_set_flag(peer, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(v->name, "cid_number")) {
|
|
|
|
} else if (!strcasecmp(v->name, "cid_number")) {
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(v->value)) {
|
|
|
|
ast_string_field_set(peer, cid_num, v->value);
|
|
|
|
ast_string_field_set(peer, cid_num, v->value);
|
|
|
|
ast_set_flag(peer, IAX_HASCALLERID);
|
|
|
|
ast_set_flag(peer, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(v->name, "sendani")) {
|
|
|
|
} else if (!strcasecmp(v->name, "sendani")) {
|
|
|
|
ast_set2_flag(peer, ast_true(v->value), IAX_SENDANI);
|
|
|
|
ast_set2_flag(peer, ast_true(v->value), IAX_SENDANI);
|
|
|
|
} else if (!strcasecmp(v->name, "inkeys")) {
|
|
|
|
} else if (!strcasecmp(v->name, "inkeys")) {
|
|
|
@ -8565,6 +8574,9 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, st
|
|
|
|
ast_string_field_set(user, name, name);
|
|
|
|
ast_string_field_set(user, name, name);
|
|
|
|
ast_string_field_set(user, language, language);
|
|
|
|
ast_string_field_set(user, language, language);
|
|
|
|
ast_copy_flags(user, &globalflags, IAX_USEJITTERBUF | IAX_FORCEJITTERBUF | IAX_CODEC_USER_FIRST | IAX_CODEC_NOPREFS | IAX_CODEC_NOCAP);
|
|
|
|
ast_copy_flags(user, &globalflags, IAX_USEJITTERBUF | IAX_FORCEJITTERBUF | IAX_CODEC_USER_FIRST | IAX_CODEC_NOPREFS | IAX_CODEC_NOCAP);
|
|
|
|
|
|
|
|
ast_clear_flag(user, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
ast_string_field_set(user, cid_name, "");
|
|
|
|
|
|
|
|
ast_string_field_set(user, cid_num, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!v) {
|
|
|
|
if (!v) {
|
|
|
|
v = alt;
|
|
|
|
v = alt;
|
|
|
@ -8641,18 +8653,24 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, st
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
ast_string_field_set(user, secret, v->value);
|
|
|
|
ast_string_field_set(user, secret, v->value);
|
|
|
|
} else if (!strcasecmp(v->name, "callerid")) {
|
|
|
|
} else if (!strcasecmp(v->name, "callerid")) {
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(v->value) && strcasecmp(v->value, "asreceived")) {
|
|
|
|
char name2[80];
|
|
|
|
char name2[80];
|
|
|
|
char num2[80];
|
|
|
|
char num2[80];
|
|
|
|
ast_callerid_split(v->value, name2, 80, num2, 80);
|
|
|
|
ast_callerid_split(v->value, name2, sizeof(name2), num2, sizeof(num2));
|
|
|
|
ast_string_field_set(user, cid_name, name2);
|
|
|
|
ast_string_field_set(user, cid_name, name2);
|
|
|
|
ast_string_field_set(user, cid_num, num2);
|
|
|
|
ast_string_field_set(user, cid_num, num2);
|
|
|
|
ast_set_flag(user, IAX_HASCALLERID);
|
|
|
|
ast_set_flag(user, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(v->name, "fullname")) {
|
|
|
|
} else if (!strcasecmp(v->name, "fullname")) {
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(v->value)) {
|
|
|
|
ast_string_field_set(user, cid_name, v->value);
|
|
|
|
ast_string_field_set(user, cid_name, v->value);
|
|
|
|
ast_set_flag(user, IAX_HASCALLERID);
|
|
|
|
ast_set_flag(user, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(v->name, "cid_number")) {
|
|
|
|
} else if (!strcasecmp(v->name, "cid_number")) {
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(v->value)) {
|
|
|
|
ast_string_field_set(user, cid_num, v->value);
|
|
|
|
ast_string_field_set(user, cid_num, v->value);
|
|
|
|
ast_set_flag(user, IAX_HASCALLERID);
|
|
|
|
ast_set_flag(user, IAX_HASCALLERID);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(v->name, "accountcode")) {
|
|
|
|
} else if (!strcasecmp(v->name, "accountcode")) {
|
|
|
|
ast_string_field_set(user, accountcode, v->value);
|
|
|
|
ast_string_field_set(user, accountcode, v->value);
|
|
|
|
} else if (!strcasecmp(v->name, "mohinterpret")) {
|
|
|
|
} else if (!strcasecmp(v->name, "mohinterpret")) {
|
|
|
|