pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36905?usp=email )
Change subject: SIP_Templates: f_sip_SipUrl_to_str(): Print username if present ......................................................................
SIP_Templates: f_sip_SipUrl_to_str(): Print username if present
Since now user is printed, adapt existing user in Asterisk_Tests to use the proper field.
Change-Id: Ifb1470768222ddee1b1d96ecb9153412ed10fd42 --- M asterisk/IMS_ConnectionHandler.ttcn M library/SIP_Templates.ttcn 2 files changed, 17 insertions(+), 2 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve
diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 0d11922..091f5da 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -503,7 +503,7 @@ */ authorization := f_tr_Authorization_AKAv1MD5(valueof(wwwAuthenticate), g_pars.user & "@" & g_pars.realm, - f_sip_SipUrl_to_str(g_pars.registrar_sip_record.addr.nameAddr.addrSpec)); + f_sip_SipUrl_to_str(g_pars.registrar_sip_req_uri)); /* TODO: match Authorization from above: */ exp_req := tr_SIP_REGISTER(g_pars.registrar_sip_req_uri, diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn index 7da56bc..56404da 100644 --- a/library/SIP_Templates.ttcn +++ b/library/SIP_Templates.ttcn @@ -1426,7 +1426,11 @@ }
function f_sip_SipUrl_to_str(SipUrl uri) return charstring { - var charstring str := uri.scheme & ":" & f_sip_HostPort_to_str(uri.hostPort); + var charstring str := uri.scheme & ":"; + if (ispresent(uri.userInfo)) { + str := str & uri.userInfo.userOrTelephoneSubscriber & "@"; + } + str := str & f_sip_HostPort_to_str(uri.hostPort); return str; }