Commit 769ecc6f authored by Grzegorz Sluja's avatar Grzegorz Sluja
Browse files

asterisk: Fix the issue about missing displayname in 'From' header

To set the displayname in 'From' header we use this line in dialplan:
Set(CALLERID(name)=|DISPLAYNAME|)
where DISPLAYNAME is asterisk.sip{i}.displayname from uci config.
The thing is for pjsip we also added 'from_user' config option in
pjsip_endpoint configuration what cause the user in the 'From' header
is overriding by this value always.
Remove 'from_user' config to allow displayname being shown properly and
add other configuration to set properly the user in Contact header and
Reffered-by header.
parent 7aa9f147
......@@ -13,7 +13,7 @@ PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_VERSION:=5393b20c80953a1a141b1d2d1af0bc91d4753a78
PKG_SOURCE_VERSION:=f06b09f371a17df6c397c9b5bed942a71b7582f6
PKG_SOURCE:=asterisk-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/asterisk.git
PKG_SOURCE_PROTO:=git
......
......@@ -6,6 +6,7 @@ type = global
debug = yes
user_agent = |USERAGENT|
endpoint_identifier_order = header, anonymous, ip
use_callerid_contact = yes
[system]
type = system
......
......@@ -5,7 +5,7 @@ dtmf_mode = |DTMFMODE|
tos_audio = |TOS_AUDIO|
tos_video = |TOS_VIDEO|
from_domain = |DOMAIN|
from_user = |USER|
callerid = |DISPLAYNAME| <|USER|>
disallow = all
|ALLOW|
outbound_auth = |NAME|
......@@ -19,4 +19,5 @@ identify_by = header
incoming_mwi_mailbox = |MAILBOX|
messages_waiting = |MESSAGES|
mwi_dialtone_state = |MWI_DIALTONE|
contact_user = |USER|
set_var=SIPREFERREDBYHDR=|USER|@|DOMAIN|
......@@ -243,6 +243,7 @@ configure_sip_provider() {
local mwi_dialtone_state
local server_uri
local port
local displayname
config_get enabled $1 enabled "0"
config_get outbound_proxy $1 outbound_proxy ""
......@@ -267,7 +268,7 @@ configure_sip_provider() {
config_get messages_waiting $1 messages_waiting "no"
config_get mwi_enabled call_features mwi_enabled "0"
config_get mwi_dialtone_state $1 mwi_dialtone_state "on"
config_get displayname $1 displayname ""
# This is a hack to fix security issue #14962
user=${user//"'"/}
......@@ -350,6 +351,8 @@ configure_sip_provider() {
else
sed -i "s/|DOMAIN|/$domain/" $WORK_DIR/pjsip_endpoint
fi
sed -i "s/|DISPLAYNAME|/$(escape_sed_substitution $displayname)/" $WORK_DIR/pjsip_endpoint
sed -i "s/|USER|/$(escape_sed_substitution $user)/" $WORK_DIR/pjsip_endpoint
# Force ulaw/alaw if fax, otherwise read selected codecs
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment