Skip to content
Snippets Groups Projects
Commit 0e189382 authored by Lwithwma Brahma's avatar Lwithwma Brahma Committed by George Yang
Browse files

R#38290 VoIP: Registration fails when using outboundproxy

The outbound_proxy was added as per the asterisk doc.
https://wiki.asterisk.org/wiki/display/AST/PJSIP+with+Proxies

Change-Id: Id942ae1bae9f5e8242b7381d6e1cfd77601d3229
parent 53014fcf
No related branches found
No related tags found
1 merge request!115Fix #35275 (PART2) - TR104: Support multiple SIP accounts
[|NAME|] [|NAME|]
type = aor type = aor
contact = sip:|USER|@|SERVER_URI|:|PORT| contact = sip:|USER|@|SERVER_URI|:|PORT|
outbound_proxy = sip:|OUTBOUND_PROXY|\;lr
...@@ -10,6 +10,7 @@ disallow = all ...@@ -10,6 +10,7 @@ disallow = all
outgoing_call_offer_pref = local_merge outgoing_call_offer_pref = local_merge
incoming_call_offer_pref = remote_first incoming_call_offer_pref = remote_first
outbound_auth = |NAME| outbound_auth = |NAME|
outbound_proxy = sip:|OUTBOUND_PROXY|\;lr
aors = |NAME| aors = |NAME|
transport = transport-|TRANSPORT| transport = transport-|TRANSPORT|
media_encryption = |ENCRYPTION| media_encryption = |ENCRYPTION|
......
...@@ -4,6 +4,7 @@ server_uri = sip:|SERVER_URI|:|PORT| ...@@ -4,6 +4,7 @@ server_uri = sip:|SERVER_URI|:|PORT|
client_uri = sip:|USER|@|SERVER_URI|:|PORT| client_uri = sip:|USER|@|SERVER_URI|:|PORT|
contact_user = |USER| contact_user = |USER|
outbound_auth = |NAME| outbound_auth = |NAME|
outbound_proxy = sip:|OUTBOUND_PROXY|\;lr
auth_rejection_permanent = no auth_rejection_permanent = no
expiration = |DEFAULTEXPIRY| expiration = |DEFAULTEXPIRY|
retry_interval = |REGISTERTIMEOUT| retry_interval = |REGISTERTIMEOUT|
......
...@@ -309,14 +309,7 @@ configure_sip_provider() { ...@@ -309,14 +309,7 @@ configure_sip_provider() {
return return
fi fi
if [ -z "$outbound_proxy" ] ; then if [ -z "$host" ] ; then
server_uri=$host;
if [ "$transport" == "udp" -o "$transport" == "tcp" ] ; then
port=5060;
elif [ "$transport" == "tls" ] ; then
port=5061;
fi
else
server_uri=$outbound_proxy; server_uri=$outbound_proxy;
if [ -z "$outbound_proxy_port" ] ; then if [ -z "$outbound_proxy_port" ] ; then
if [ "$transport" == "udp" -o "$transport" == "tcp" ] ; then if [ "$transport" == "udp" -o "$transport" == "tcp" ] ; then
...@@ -327,6 +320,13 @@ configure_sip_provider() { ...@@ -327,6 +320,13 @@ configure_sip_provider() {
else else
port=$outbound_proxy_port; port=$outbound_proxy_port;
fi fi
else
server_uri=$host;
if [ "$transport" == "udp" -o "$transport" == "tcp" ] ; then
port=5060;
elif [ "$transport" == "tls" ] ; then
port=5061;
fi
fi fi
sed -i "s/|PORT|/$port/g" $WORK_DIR/pjsip_aor sed -i "s/|PORT|/$port/g" $WORK_DIR/pjsip_aor
...@@ -338,6 +338,12 @@ configure_sip_provider() { ...@@ -338,6 +338,12 @@ configure_sip_provider() {
sed -i "s/|PORT|/$port/g" $WORK_DIR/pjsip_aor sed -i "s/|PORT|/$port/g" $WORK_DIR/pjsip_aor
sed -i "s/|USER|/$user/" $WORK_DIR/pjsip_aor sed -i "s/|USER|/$user/" $WORK_DIR/pjsip_aor
if [ -z "$outbound_proxy" ] ; then
sed -i "/outbound_proxy = sip:|OUTBOUND_PROXY|/c\;outbound_proxy =" $WORK_DIR/pjsip_aor
else
sed -i "s/|OUTBOUND_PROXY|/$outbound_proxy/" $WORK_DIR/pjsip_aor
fi
cat $WORK_DIR/pjsip_aor >> $WORK_DIR/pjsip_aors.conf cat $WORK_DIR/pjsip_aor >> $WORK_DIR/pjsip_aors.conf
# Generating pjsip_auths.conf # Generating pjsip_auths.conf
...@@ -358,6 +364,12 @@ configure_sip_provider() { ...@@ -358,6 +364,12 @@ configure_sip_provider() {
sed -i "s/|NAME|/$1/g" $WORK_DIR/pjsip_endpoint sed -i "s/|NAME|/$1/g" $WORK_DIR/pjsip_endpoint
sed -i "s/|DTMFMODE|/$dtmf_mode/" $WORK_DIR/pjsip_endpoint sed -i "s/|DTMFMODE|/$dtmf_mode/" $WORK_DIR/pjsip_endpoint
if [ -z "$outbound_proxy" ] ; then
sed -i "/outbound_proxy = sip:|OUTBOUND_PROXY|/c\;outbound_proxy =" $WORK_DIR/pjsip_endpoint
else
sed -i "s/|OUTBOUND_PROXY|/$outbound_proxy/" $WORK_DIR/pjsip_endpoint
fi
if [ -z "$tos_audio" ] ; then if [ -z "$tos_audio" ] ; then
sed -i "s/tos_audio = |TOS_AUDIO|/;tos_audio = /g" $WORK_DIR/pjsip_endpoint sed -i "s/tos_audio = |TOS_AUDIO|/;tos_audio = /g" $WORK_DIR/pjsip_endpoint
else else
...@@ -426,6 +438,12 @@ configure_sip_provider() { ...@@ -426,6 +438,12 @@ configure_sip_provider() {
sed -i "s/|SERVER_URI|/$server_uri/g" $WORK_DIR/pjsip_registration sed -i "s/|SERVER_URI|/$server_uri/g" $WORK_DIR/pjsip_registration
sed -i "s/|PORT|/$port/g" $WORK_DIR/pjsip_registration sed -i "s/|PORT|/$port/g" $WORK_DIR/pjsip_registration
if [ -z "$outbound_proxy" ] ; then
sed -i "/outbound_proxy = sip:|OUTBOUND_PROXY|/c\;outbound_proxy =" $WORK_DIR/pjsip_registration
else
sed -i "s/|OUTBOUND_PROXY|/$outbound_proxy/" $WORK_DIR/pjsip_registration
fi
if [ -z "$defaultexpiry" ] ; then if [ -z "$defaultexpiry" ] ; then
sed -i "s/|DEFAULTEXPIRY|/3600/g" $WORK_DIR/pjsip_registration sed -i "s/|DEFAULTEXPIRY|/3600/g" $WORK_DIR/pjsip_registration
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment