mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-27 13:44:16 +00:00
Merge branch 'master' into gsmopen01
This commit is contained in:
commit
f74ba1ae61
43 files changed
+877
-375
No files matched your search
@@ -1,3 +1,4 @@
|
||||
LIBS+=$(PA_LIBS)
|
||||
include $(top_srcdir)/build/modmake.rulesam
|
||||
|
||||
MODNAME=mod_portaudio
|
||||
|
||||
@@ -515,6 +515,13 @@ typedef enum {
|
||||
MEDIA_OPT_BYPASS_AFTER_ATT_XFER = (1 << 1)
|
||||
} sofia_media_options_t;
|
||||
|
||||
typedef enum {
|
||||
PAID_DEFAULT = 0,
|
||||
PAID_USER,
|
||||
PAID_USER_DOMAIN,
|
||||
PAID_VERBATIM
|
||||
} sofia_paid_type_t;
|
||||
|
||||
#define MAX_RTPIP 50
|
||||
|
||||
struct sofia_profile {
|
||||
@@ -652,6 +659,7 @@ struct sofia_profile {
|
||||
uint32_t sip_force_expires;
|
||||
uint32_t sip_expires_max_deviation;
|
||||
int ireg_seconds;
|
||||
sofia_paid_type_t paid_type;
|
||||
};
|
||||
|
||||
struct private_object {
|
||||
|
||||
@@ -3494,6 +3494,18 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
|
||||
} else {
|
||||
profile->sip_expires_max_deviation = 0;
|
||||
}
|
||||
} else if (!strcasecmp(var, "p-asserted-id-parse")) {
|
||||
if (!strncasecmp(val, "default", 7)) {
|
||||
profile->paid_type = PAID_DEFAULT;
|
||||
} else if (!strncasecmp(val, "user-only", 9)) {
|
||||
profile->paid_type = PAID_USER;
|
||||
} else if (!strncasecmp(val, "user-domain", 11)) {
|
||||
profile->paid_type = PAID_USER_DOMAIN;
|
||||
} else if (!strncasecmp(val, "verbatim", 8)) {
|
||||
profile->paid_type = PAID_VERBATIM;
|
||||
} else {
|
||||
profile->paid_type = PAID_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3753,6 +3765,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
|
||||
profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP;
|
||||
profile->te = 101;
|
||||
profile->ireg_seconds = IREG_SECONDS;
|
||||
profile->paid_type = PAID_DEFAULT;
|
||||
|
||||
|
||||
profile->tls_verify_policy = TPTLS_VERIFY_NONE;
|
||||
@@ -4568,6 +4581,18 @@ switch_status_t config_sofia(int reload, char *profile_name)
|
||||
} else {
|
||||
sofia_clear_pflag(profile, PFLAG_NO_CONNECTION_REUSE);
|
||||
}
|
||||
} else if (!strcasecmp(var, "p-asserted-id-parse")) {
|
||||
if (!strncasecmp(val, "default", 7)) {
|
||||
profile->paid_type = PAID_DEFAULT;
|
||||
} else if (!strncasecmp(val, "user-only", 9)) {
|
||||
profile->paid_type = PAID_USER;
|
||||
} else if (!strncasecmp(val, "user-domain", 11)) {
|
||||
profile->paid_type = PAID_USER_DOMAIN;
|
||||
} else if (!strncasecmp(val, "verbatim", 8)) {
|
||||
profile->paid_type = PAID_VERBATIM;
|
||||
} else {
|
||||
profile->paid_type = PAID_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7781,9 +7806,17 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
|
||||
if ((passerted = sip_p_asserted_identity(sip))) {
|
||||
if (passerted->paid_url && passerted->paid_url->url_user) {
|
||||
char *full_paid_header = sip_header_as_string(nh->nh_home, (void *) passerted);
|
||||
//char *full_paid_header = (char *)(passerted->paid_common->h_data);
|
||||
from_user = passerted->paid_url->url_user;
|
||||
if (!zstr(full_paid_header)) {
|
||||
switch_channel_set_variable(channel, "sip_P-Asserted-Identity", from_user);
|
||||
if (profile->paid_type == PAID_DEFAULT || profile->paid_type == PAID_USER) {
|
||||
switch_channel_set_variable(channel, "sip_P-Asserted-Identity", from_user);
|
||||
} else if (profile->paid_type == PAID_USER_DOMAIN) {
|
||||
switch_channel_set_variable(channel, "sip_P-Asserted-Identity",
|
||||
switch_core_session_sprintf(session, "%s@%s", passerted->paid_url->url_user, passerted->paid_url->url_host));
|
||||
} else if (profile->paid_type == PAID_VERBATIM) {
|
||||
switch_channel_set_variable(channel, "sip_P-Asserted-Identity", full_paid_header);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!zstr(passerted->paid_display)) {
|
||||
|
||||
@@ -7042,14 +7042,17 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua
|
||||
|
||||
|
||||
if (contact->m_url->url_params) {
|
||||
contact_str = switch_mprintf("%s <sip:%s@%s%s%s%s;%s>%s",
|
||||
contact_str = switch_mprintf("%s <sip:%s%s%s%s%s%s;%s>%s",
|
||||
display, contact->m_url->url_user,
|
||||
contact->m_url->url_user ? "@" : "",
|
||||
ipv6 ? "[" : "",
|
||||
contact_host, ipv6 ? "]" : "", new_port, contact->m_url->url_params, np->is_nat ? ";fs_nat=yes" : "");
|
||||
} else {
|
||||
contact_str = switch_mprintf("%s <sip:%s@%s%s%s%s>%s",
|
||||
contact_str = switch_mprintf("%s <sip:%s%s%s%s%s%s>%s",
|
||||
display,
|
||||
contact->m_url->url_user, ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : "");
|
||||
contact->m_url->url_user,
|
||||
contact->m_url->url_user ? "@" : "",
|
||||
ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2647,7 +2647,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||
if (!zstr(astate) && !zstr(uuid) &&
|
||||
helper && helper->stream.data && strcmp(helper->last_uuid, uuid) && strcasecmp(astate, "terminated") && strchr(uuid, '-')) {
|
||||
helper->stream.write_function(&helper->stream, "update sip_dialogs set state='%s' where hostname='%q' and profile_name='%q' and uuid='%s';",
|
||||
mod_sofia_globals.hostname, profile->name, astate, uuid);
|
||||
astate, mod_sofia_globals.hostname, profile->name, uuid);
|
||||
switch_copy_string(helper->last_uuid, uuid, sizeof(helper->last_uuid));
|
||||
}
|
||||
|
||||
@@ -2703,9 +2703,9 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||
rpid = "on-the-phone";
|
||||
force_status = 1;
|
||||
} else if (!strcmp(astate, "terminated") || !strcmp(astate, "hangup")) {
|
||||
rpid = "online";
|
||||
dialog_rpid = "";
|
||||
force_event_status = "Available";
|
||||
//rpid = "online";
|
||||
//dialog_rpid = "";
|
||||
//force_event_status = "Available";
|
||||
term = 1;
|
||||
}
|
||||
|
||||
@@ -2778,8 +2778,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||
|
||||
if (!zstr(uuid) && strchr(uuid, '-') && !zstr(status_line) && !zstr(rpid) && (zstr(register_source) || strcasecmp(register_source, "register"))) {
|
||||
char *sql = switch_mprintf("update sip_dialogs set rpid='%q',status='%q' where hostname='%q' and profile_name='%q' and uuid='%q'",
|
||||
mod_sofia_globals.hostname, profile->name,
|
||||
rpid, status_line, uuid);
|
||||
rpid, status_line,
|
||||
mod_sofia_globals.hostname, profile->name, uuid);
|
||||
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
|
||||
}
|
||||
}
|
||||
@@ -3588,8 +3588,8 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||
" from sip_subscriptions where hostname='%q' and profile_name='%q' and "
|
||||
"event='message-summary' and sip_user='%q' "
|
||||
"and (sip_host='%q' or presence_hosts like '%%%q%%')",
|
||||
mod_sofia_globals.hostname, profile->name,
|
||||
to_host, to_user, to_host, to_host))) {
|
||||
to_host, mod_sofia_globals.hostname, profile->name,
|
||||
to_user, to_host, to_host))) {
|
||||
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_reg_callback, profile);
|
||||
|
||||
switch_safe_free(sql);
|
||||
@@ -3880,16 +3880,24 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
||||
open_closed = basic->txt;
|
||||
}
|
||||
|
||||
if ((person = switch_xml_child(xml, "dm:person")) && (note = switch_xml_child(person, "dm:note"))) {
|
||||
note_txt = note->txt;
|
||||
if ((person = switch_xml_child(xml, "dm:person"))) {
|
||||
if ((note = switch_xml_child(person, "dm:note"))) {
|
||||
note_txt = note->txt;
|
||||
} else if ((note = switch_xml_child(person, "rpid:note"))) {
|
||||
note_txt = note->txt;
|
||||
}
|
||||
if ((act = switch_xml_child(person, "rpid:activities")) && act->child && act->child->name) {
|
||||
if ((rpid = strchr(act->child->name, ':'))) {
|
||||
rpid++;
|
||||
} else {
|
||||
rpid = act->child->name;
|
||||
}
|
||||
}
|
||||
if (zstr(note_txt)) note_txt = rpid;
|
||||
}
|
||||
|
||||
if (person && (act = switch_xml_child(person, "rpid:activities")) && act->child && act->child->name) {
|
||||
if ((rpid = strchr(act->child->name, ':'))) {
|
||||
rpid++;
|
||||
} else {
|
||||
rpid = act->child->name;
|
||||
}
|
||||
if (!strcasecmp(open_closed, "closed")) {
|
||||
rpid = note_txt = "Unregistered";
|
||||
}
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_MULTIREG) && !open) {
|
||||
|
||||
Reference in new issue
Block a user