summaryrefslogtreecommitdiffstats
path: root/src/user.cpp
diff options
context:
space:
mode:
authorGrzegorz Woźniak <grzegorz.wozniak@ailleron.com>2017-04-13 01:18:21 +0200
committerGrzegorz Woźniak <grzegorz.wozniak@ailleron.com>2017-04-13 01:18:21 +0200
commit02b644ee4779a46bb4224d61ecd908cd2f04b483 (patch)
tree85c2307a30294de27e5dd103c6e3e85b4c94b9f6 /src/user.cpp
parentc512a2a588a044b37782e43223b49093f998c6e8 (diff)
downloadtwinkle-02b644ee4779a46bb4224d61ecd908cd2f04b483.tar
twinkle-02b644ee4779a46bb4224d61ecd908cd2f04b483.tar.gz
twinkle-02b644ee4779a46bb4224d61ecd908cd2f04b483.tar.lz
twinkle-02b644ee4779a46bb4224d61ecd908cd2f04b483.tar.xz
twinkle-02b644ee4779a46bb4224d61ecd908cd2f04b483.zip
PAI Header option
Diffstat (limited to 'src/user.cpp')
-rw-r--r--src/user.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/user.cpp b/src/user.cpp
index 129fd55..588bb55 100644
--- a/src/user.cpp
+++ b/src/user.cpp
@@ -117,6 +117,7 @@ extern t_phone *phone;
#define FLD_ATTENDED_REFER_TO_AOR "attended_refer_to_aor"
#define FLD_ALLOW_XFER_CONSULT_INPROG "allow_xfer_consult_inprog"
#define FLD_SEND_P_PREFERRED_ID "send_p_preferred_id"
+#define FLD_SEND_P_ASSERTED_ID "send_p_asserted_id"
// Transport/NAT fields
#define FLD_SIP_TRANSPORT "sip_transport"
@@ -440,6 +441,7 @@ t_user::t_user() {
attended_refer_to_aor = false;
allow_transfer_consultation_inprog = false;
send_p_preferred_id = false;
+ send_p_asserted_id = false;
sip_transport = SIP_TRANS_AUTO;
sip_transport_udp_threshold = 1300; // RFC 3261 18.1.1
ringtone_file.clear();
@@ -544,6 +546,7 @@ t_user::t_user(const t_user &u) {
attended_refer_to_aor = u.attended_refer_to_aor;
allow_transfer_consultation_inprog = u.allow_transfer_consultation_inprog;
send_p_preferred_id = u.send_p_preferred_id;
+ send_p_asserted_id = u.send_p_asserted_id;
sip_transport = u.sip_transport;
sip_transport_udp_threshold = u.sip_transport_udp_threshold;
use_nat_public_ip = u.use_nat_public_ip;
@@ -1139,6 +1142,14 @@ bool t_user::get_send_p_preferred_id(void) const {
return result;
}
+bool t_user::get_send_p_asserted_id(void) const {
+ bool result;
+ mtx_user.lock();
+ result = send_p_asserted_id;
+ mtx_user.unlock();
+ return result;
+}
+
t_sip_transport t_user::get_sip_transport(void) const {
t_mutex_guard guard(mtx_user);
return sip_transport;
@@ -1873,6 +1884,12 @@ void t_user::set_send_p_preferred_id(bool b) {
mtx_user.unlock();
}
+void t_user::set_send_p_asserted_id(bool b) {
+ mtx_user.lock();
+ send_p_asserted_id = b;
+ mtx_user.unlock();
+}
+
void t_user::set_sip_transport(t_sip_transport transport) {
t_mutex_guard guard(mtx_user);
sip_transport = transport;
@@ -2325,6 +2342,8 @@ bool t_user::read_config(const string &filename, string &error_msg) {
allow_transfer_consultation_inprog = yesno2bool(value);
} else if (parameter == FLD_SEND_P_PREFERRED_ID) {
send_p_preferred_id = yesno2bool(value);
+ } else if (parameter == FLD_SEND_P_ASSERTED_ID) {
+ send_p_asserted_id = yesno2bool(value);
} else if (parameter == FLD_SIP_TRANSPORT) {
sip_transport = str2sip_transport(value);
} else if (parameter == FLD_SIP_TRANSPORT_UDP_THRESHOLD) {
@@ -2766,6 +2785,8 @@ bool t_user::write_config(const string &filename, string &error_msg) {
config << bool2yesno(allow_transfer_consultation_inprog) << endl;
config << FLD_SEND_P_PREFERRED_ID << '=';
config << bool2yesno(send_p_preferred_id) << endl;
+ config << FLD_SEND_P_ASSERTED_ID << '=';
+ config << bool2yesno(send_p_asserted_id) << endl;
config << endl;
// Write Transport/NAT settings