commit 1b8ab8a0adba28cad3616a8898e0a544f1c97a15 Author: Christian Weis Date: Tue Mar 22 15:20:47 2022 +0100 [core][web-ui]PHONE-1015: Enabled parameter contact_user for gateway endpoints diff --git a/opt/locaphone/etc/asterisk/lua/exttype/external.lua b/opt/locaphone/etc/asterisk/lua/exttype/external.lua index b3a58a4..c6d7e77 100644 --- a/opt/locaphone/etc/asterisk/lua/exttype/external.lua +++ b/opt/locaphone/etc/asterisk/lua/exttype/external.lua @@ -148,8 +148,13 @@ function _M:dial(context,extension,ccounter) if sendCallerid == "from" then -- we are already set else + local hostString = "locaphone.local" + if gw.host then + hostString = tostring(gw.host) + end + Channel["_sendCallerid"] = gw.sendCallerid - Channel["_CALLERID_STRING"] = "" + Channel["_CALLERID_STRING"] = "" end end @@ -538,7 +543,20 @@ function _M:setPai( gategrp ) idx = idx+1 end - local paiString = "" + local gatewayid + for k in pairs(gategrp.gateway) do + gatewayid = k + if k then + break + end + end + + local hostString = "locaphone.local" + if gatewayid then + hostString = gategrp.gateway[gatewayid].host + end + + local paiString = "" Channel["_PAI"] = paiString Log:debug("Asserted identity will be set to " .. paiString) diff --git a/opt/locaphone/inc/gs-fns/gs_gateway_config_get.php b/opt/locaphone/inc/gs-fns/gs_gateway_config_get.php index 30f278b..a8622df 100644 --- a/opt/locaphone/inc/gs-fns/gs_gateway_config_get.php +++ b/opt/locaphone/inc/gs-fns/gs_gateway_config_get.php @@ -42,7 +42,7 @@ function gs_gateway_config_get($gwid) $gwparamsections = array( "auth" => array("auth_type", "once_lifetime", "md5_cred", "password", "realm", "username"), "aor" => array("contact", "default_expiration", "mailboxes", "maximum_expiration", "max_contacts", "minimum_expiration", "remove_existing", "qualify_frequency", "qualify_timeout", "authenticate_qualify", "outbound_proxy"), - "endpoint" => array("100rel", "aggregate_mwi", "aors", "auth", "callerid", "callerid_privacy", "callerid_tag", "context", "direct_media_glare_mitigation", "direct_media_method", "connected_line_method", "direct_media", "disable_direct_media_on_nat", "dtmf_mode", "media_address", "force_rport", "ice_support", "identify_by", "redirect_method", "mailboxes", "moh_suggest", "outbound_auth", "outbound_proxy", "rewrite_contact", "rtp_ipv6", "rtp_symmetric", "send_diversion", "send_pai", "send_rpid", "rpid_immediate", "timers_min_se", "timers", "timers_sess_expires", "transport", "trust_id_inbound", "trust_id_outbound", "use_ptime", "use_avpf", "media_encryption", "media_encryption_optimistic", "g726_non_standard", "inband_progress", "call_group", "pickup_group", "named_call_group", "named_pickup_group", "device_state_busy_at", "t38_udptl", "t38_udptl_ec", "t38_udptl_maxdatagram", "fax_detect", "t38_udptl_nat", "t38_udptl_ipv6", "tone_zone", "language", "one_touch_recording", "record_on_feature", "record_off_feature", "allow_transfer", "sdp_owner", "sdp_session", "tos_audio", "tos_video", "cos_audio", "cos_video", "allow_subscribe", "sub_min_expire", "from_user", "mwi_from_user", "from_domain", "dtls_verify", "dtls_rekey", "dtls_cert_file", "dtls_private_key", "dtls_cipher", "dtls_ca_file", "dtls_ca_path", "dtls_setup", "dtls_fingerprint", "srtp_tag_32", "set_var", "rtp_keepalive", "rtp_timeout", "rtp_hold_timeout", "disallow", "allow", "trust_id_inbound", "trust_id_outbound"), + "endpoint" => array("100rel", "aggregate_mwi", "aors", "auth", "callerid", "callerid_privacy", "callerid_tag", "context", "direct_media_glare_mitigation", "direct_media_method", "connected_line_method", "direct_media", "disable_direct_media_on_nat", "dtmf_mode", "media_address", "force_rport", "ice_support", "identify_by", "redirect_method", "mailboxes", "moh_suggest", "outbound_auth", "outbound_proxy", "rewrite_contact", "rtp_ipv6", "rtp_symmetric", "send_diversion", "send_pai", "send_rpid", "rpid_immediate", "timers_min_se", "timers", "timers_sess_expires", "transport", "trust_id_inbound", "trust_id_outbound", "use_ptime", "use_avpf", "media_encryption", "media_encryption_optimistic", "g726_non_standard", "inband_progress", "call_group", "pickup_group", "named_call_group", "named_pickup_group", "device_state_busy_at", "t38_udptl", "t38_udptl_ec", "t38_udptl_maxdatagram", "fax_detect", "t38_udptl_nat", "t38_udptl_ipv6", "tone_zone", "language", "one_touch_recording", "record_on_feature", "record_off_feature", "allow_transfer", "sdp_owner", "sdp_session", "tos_audio", "tos_video", "cos_audio", "cos_video", "allow_subscribe", "sub_min_expire", "from_user", "mwi_from_user", "from_domain", "dtls_verify", "dtls_rekey", "dtls_cert_file", "dtls_private_key", "dtls_cipher", "dtls_ca_file", "dtls_ca_path", "dtls_setup", "dtls_fingerprint", "srtp_tag_32", "set_var", "rtp_keepalive", "rtp_timeout", "rtp_hold_timeout", "disallow", "allow", "trust_id_inbound", "trust_id_outbound", "contact_user"), "identify" => array("endpoint", "match"), "registration" => array("auth_rejection_permanent", "client_uri", "contact_user", "endpoint", "expiration", "line", "max_retries", "outbound_auth", "outbound_proxy", "retry_interval", "forbidden_retry_interval", "fatal_retry_interval", "server_uri", "transport") );