lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2024

  • 1 participants
  • 1566 discussions
[M] Change in osmo-ttcn3-hacks[master]: asterisk: Validate precondition in SDP of MO calls
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37258?usp=email ) Change subject: asterisk: Validate precondition in SDP of MO calls ...................................................................... asterisk: Validate precondition in SDP of MO calls Change-Id: If37aa4146e02279120bc4856255fb845086fa5a8 --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 90 insertions(+), 6 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 7a9f11f..32a35f4 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -544,7 +544,13 @@ [fail_others] as_SIP_fail_resp(sip_expect_str); } -private function f_gen_sdp() runs on IMS_ConnHdlr return charstring { +type enumerated IMS_gen_sdp_state { + IMS_GEN_SDP_None, + IMS_GEN_SDP_MT_Session_Progress, + IMS_GEN_SDP_MT_UPDATE_200OK +} + +private function f_gen_sdp(IMS_gen_sdp_state st := IMS_GEN_SDP_None) runs on IMS_ConnHdlr return charstring { var charstring sdp := "v=0\r\n" & "o=0502 2390 1824 IN IP4 " & g_pars.subscr.cp.local_rtp_addr & "\r\n" & @@ -568,6 +574,25 @@ "a=rtcp:" & int2str(g_pars.subscr.cp.local_rtp_port + 1) & "\r\n" & "a=rtcp-fb:* trr-int 1000\r\n" & "a=rtcp-fb:* ccm tmmbr\r\n"; + select (st) { + case (IMS_GEN_SDP_None) { + } + case (IMS_GEN_SDP_MT_Session_Progress) { + sdp := sdp & + "a=curr:qos local none\r\n" & + "a=curr:qos remote none\r\n" & + "a=des:qos mandatory local sendrecv\r\n" & + "a=des:qos mandatory remote sendrecv\r\n" & + "a=conf:qos remote sendrecv\r\n"; + } + case (IMS_GEN_SDP_MT_UPDATE_200OK) { + sdp := sdp & + "a=curr:qos local sendrecv\r\n" & + "a=curr:qos remote sendrecv\r\n" & + "a=des:qos mandatory local sendrecv\r\n" & + "a=des:qos mandatory remote sendrecv\r\n"; + } + } return sdp; } @@ -1200,7 +1225,7 @@ [] SIP.receive(exp_req) -> value g_rx_sip_req { var template (value) PDU_SIP_Response tx_resp; var Via via; - var charstring tx_sdp; + var template (omit) charstring tx_sdp; var boolean peer_support_precondition := match(g_rx_sip_req.msgHeader.supported.optionsTags, superset("100rel", "precondition")); @@ -1232,13 +1257,30 @@ COORD.send(IMS_COORD_CMD_CALL_TRYING); } - tx_sdp := f_gen_sdp(); - /* Use precondition ? */ if (g_pars.subscr.cp.require_precondition_ext or (g_pars.subscr.cp.support_precondition_ext and peer_support_precondition)) { + var template (present) SDP_attribute_list preconds; + /* Validate SDP in INVITE contains the preconditions: + * a=curr:qos local none + * a=curr:qos remote none + * a=des:qos mandatory local sendrecv + * a=des:qos optional remote sendrecv + */ + preconds := superset( + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_none), + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_none), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_optional, c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_sendrecv)); + if (not ispresent(g_pars.subscr.cp.peer_sdp.attributes) or + not match(g_pars.subscr.cp.peer_sdp.attributes, preconds)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Unexpected precondition attrs in INVITE : ", + g_pars.subscr.cp.peer_sdp.attributes)); + } + /* Tx 183 Session Progress */ - /* TODO: add a=curr:qos, a=des:qos and a=conf:qos fields to SDP */ + tx_sdp := f_gen_sdp(IMS_GEN_SDP_MT_Session_Progress); tx_resp := ts_SIP_Response_SessionProgress(g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, @@ -1281,8 +1323,26 @@ body := ?); as_SIP_expect_req(exp_req); + /* Validate SDP in UPDATE contains the preconditions: + * a=curr:qos local sendrecv + * a=curr:qos remote none + * a=des:qos mandatory local sendrecv + * a=des:qos mandatory remote sendrecv + */ + preconds := superset( + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_none), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_sendrecv)); + if (not ispresent(g_pars.subscr.cp.peer_sdp.attributes) or + not match(g_pars.subscr.cp.peer_sdp.attributes, preconds)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Unexpected precondition attrs in UPDATE: ", + g_pars.subscr.cp.peer_sdp.attributes)); + } + /* Tx 200 OK (UPDATE) */ - /* TODO: add a=curr:qos, a=des:qos and a=conf:qos fields to SDP */ + tx_sdp := f_gen_sdp(IMS_GEN_SDP_MT_UPDATE_200OK); tx_resp := ts_SIP_Response(g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, @@ -1294,6 +1354,20 @@ SIP.send(tx_resp); g_pars.subscr.cp.sip_seq_nr := g_pars.subscr.cp.sip_seq_nr + 1; + /* 200 OK (INVITE) has no SDP if we use precondition: */ + tx_sdp := omit; + } else { + /* Check no precondition is sent in SDP */ + if (ispresent(g_pars.subscr.cp.peer_sdp.attributes) and + match (g_pars.subscr.cp.peer_sdp.attributes, superset(tr_SDP_curr_present, + tr_SDP_des_present, + tr_SDP_conf_present))) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Unexpected precondition attrs in INVITE: ", + g_pars.subscr.cp.peer_sdp.attributes)); + } + /* 200 OK (INVITE) has SDP if no precondition is used: */ + tx_sdp := f_gen_sdp(); } /* Tx 180 Ringing */ @@ -1306,6 +1380,7 @@ /* Tx 200 OK */ + tx_sdp := f_gen_sdp(); tx_resp := ts_SIP_Response(g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37258?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If37aa4146e02279120bc4856255fb845086fa5a8 Gerrit-Change-Number: 37258 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: Implement AMI Action DedicatedBearerStatus
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37252?usp=email ) Change subject: asterisk: Implement AMI Action DedicatedBearerStatus ...................................................................... asterisk: Implement AMI Action DedicatedBearerStatus Related: SYS#6879 Change-Id: I49c216f8874fe63480414096d9c03a1af00a0fc2 --- M asterisk/AMI_Functions.ttcn M asterisk/Asterisk_Tests.ttcn M asterisk/IMS_ConnectionHandler.ttcn 3 files changed, 156 insertions(+), 30 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/AMI_Functions.ttcn b/asterisk/AMI_Functions.ttcn index 16cf71f..d31d316 100644 --- a/asterisk/AMI_Functions.ttcn +++ b/asterisk/AMI_Functions.ttcn @@ -27,7 +27,9 @@ const charstring AMI_FIELD_ACTION := "Action"; const charstring AMI_FIELD_ACTION_ID := "ActionID"; +const charstring AMI_FIELD_CHANNEL := "Channel"; const charstring AMI_FIELD_CHAN_TYPE := "ChannelType"; +const charstring AMI_FIELD_CONTEXT := "Context"; const charstring AMI_FIELD_DOMAIN := "Domain"; const charstring AMI_FIELD_EVENT := "Event"; const charstring AMI_FIELD_INFO := "Info"; @@ -88,8 +90,12 @@ template (value) AMI_Field ts_AMI_Field_ActionId(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_ACTION_ID, val); template (value) AMI_Field +ts_AMI_Field_Channel(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_CHANNEL, val); +template (value) AMI_Field ts_AMI_Field_ChannelType(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_CHAN_TYPE, val); template (value) AMI_Field +ts_AMI_Field_Context(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_CONTEXT, val); +template (value) AMI_Field ts_AMI_Field_Domain(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_DOMAIN, val); template (value) AMI_Field ts_AMI_Field_Event(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_EVENT, val); @@ -124,8 +130,12 @@ template (present) AMI_Field tr_AMI_Field_ActionId(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_ACTION_ID, val); template (present) AMI_Field +tr_AMI_Field_Channel(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_CHANNEL, val); +template (present) AMI_Field tr_AMI_Field_ChannelType(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_CHAN_TYPE, val); template (present) AMI_Field +tr_AMI_Field_Context(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_CONTEXT, val); +template (present) AMI_Field tr_AMI_Field_Domain(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_DOMAIN, val); template (present) AMI_Field tr_AMI_Field_Event(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_EVENT, val); @@ -203,6 +213,21 @@ ts_AMI_Field_IK(ik) }; +/* Action: DedicatedBearerStatus + * ActionID: <value> + * Channel: <value> + * Status: <value> + */ +template (value) AMI_Msg +ts_AMI_Action_DedicatedBearerStatus(template (value) charstring channel, + template (value) charstring status, + template (value) charstring action_id := "0001") := { + ts_AMI_Field_Action("DedicatedBearerStatus"), + ts_AMI_Field_ActionId(action_id), + ts_AMI_Field_Channel(channel), + ts_AMI_Field_Status(status) +}; + /* Action: Login * Username: <value> * Secret: <value> @@ -357,6 +382,44 @@ tr_AMI_Field_Status(status) ); +/* Event: Newchannel + * Privilege: call,all + * Channel: PJSIP/volte_ims-00000001 + * ChannelState: 0 + * ChannelStateDesc: Down + * CallerIDNum: <unknown> + * CallerIDName: <unknown> + * ConnectedLineNum: <unknown> + * ConnectedLineName: <unknown> + * Language: en + * AccountCode: + * Context: volte_ims + * Exten: s + * Priority: 1 + * Uniqueid: 1718732522.1 + * LinkEvent: Newstate + * Privilege: call,all + * Channel: PJSIP/volte_ims-00000001 + * ChannelState: 5 + * ChannelStateDesc: Ringing + * CallerIDNum: 90829 + * CallerIDName: <unknown> + * ConnectedLineNum: 0501 + * ConnectedLineName: <unknown> + * Language: en + * AccountCode: + * Context: volte_ims + * Exten: 90829 + * Priority: 1 + * Uniqueid: 1718732522.1 + * Linkedid: 1718732522.0 + */ +template (present) AMI_Msg +tr_AMI_Event_Newchannel(template (present) charstring context := ?) := superset( + tr_AMI_Field_Event("Newchannel"), + tr_AMI_Field_Context(context) +); + /*********************** * Adapter: ***********************/ @@ -625,34 +688,39 @@ [fail_others] as_ami_rx_fail(pt, msg_expect); } +function f_ami_wait_rx_msg(AMI_Msg_PT pt, + template (present) AMI_Msg msg_expect := ?, + boolean fail_others := true, + float rx_timeout := 10.0) return AMI_Msg { + var AMI_Msg ami_msg; + timer tAMI; + + tAMI.start(rx_timeout); + alt { + [] pt.receive(msg_expect) -> value ami_msg; + [not fail_others] as_ami_rx_ignore(pt); + [fail_others] as_ami_rx_fail(pt, msg_expect); + [] tAMI.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("AMI msg timeout: ", msg_expect)); + } + } + tAMI.stop; + return ami_msg; +} + function f_ami_transceive_match(AMI_Msg_PT pt, template (value) AMI_Msg tx_msg, template (present) AMI_Msg exp_ret := ?, boolean fail_others := true, float rx_timeout := 10.0) return AMI_Msg { - var AMI_Msg rx_msg; - timer T; - - T.start(rx_timeout); pt.send(tx_msg); - alt { - [] pt.receive(exp_ret) -> value rx_msg; - [not fail_others] pt.receive(AMI_Msg:?) -> value rx_msg { - log("AMI: Ignoring Rx msg ", rx_msg); - repeat; - } - [fail_others] as_ami_rx_fail(pt, exp_ret); - [] T.timeout { - Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - log2str("AMI Response timeout: ", tx_msg)); - } - } - T.stop; - return rx_msg; + return f_ami_wait_rx_msg(pt, exp_ret, fail_others, rx_timeout); } function f_ami_transceive_match_response_success(AMI_Msg_PT pt, - template (value) AMI_Msg tx_msg) { + template (value) AMI_Msg tx_msg, + boolean fail_others := true) { var template (present) AMI_Msg exp_resp; var template (omit) charstring action_id := f_ami_msg_get_value(valueof(tx_msg), AMI_FIELD_ACTION_ID); if (isvalue(action_id)) { @@ -660,7 +728,7 @@ } else { exp_resp := tr_AMI_Response_Success; } - f_ami_transceive_match(pt, tx_msg, exp_resp); + f_ami_transceive_match(pt, tx_msg, exp_resp, fail_others := fail_others); } function f_ami_action_login(AMI_Msg_PT pt, charstring username, charstring secret) { @@ -675,6 +743,15 @@ f_ami_transceive_match_response_success(pt, ts_AMI_Action_PJSIPAccessNetworkInfo(registration, info, reg_action_id)); } +function f_ami_action_DedicatedBearerStatus(AMI_Msg_PT pt, + template (value) charstring channel, + template (value) charstring status, + boolean fail_others := true) { + var charstring reg_action_id := f_gen_action_id(); + f_ami_transceive_match_response_success(pt, ts_AMI_Action_DedicatedBearerStatus(channel, status, reg_action_id), + fail_others := fail_others); +} + function f_ami_action_PJSIPRegister(AMI_Msg_PT pt, charstring register) { var charstring reg_action_id := f_gen_action_id(); f_ami_transceive_match_response_success(pt, ts_AMI_Action_PJSIPRegister(register, reg_action_id)); diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn index 596848b..cee7adc 100644 --- a/asterisk/Asterisk_Tests.ttcn +++ b/asterisk/Asterisk_Tests.ttcn @@ -581,6 +581,7 @@ var IMS_ConnHdlrPars ims_pars; var SIPConnHdlr vc_conn_sip; var IMS_ConnHdlr vc_conn_ims; + var AMI_Msg ami_msg; const charstring c_ext_msisdn := "90829"; f_init(); @@ -597,6 +598,7 @@ ts_UserInfo(c_ext_msisdn))); ims_pars.subscr.cp.support_precondition_ext := use_precondition_ext; ims_pars.subscr.cp.require_precondition_ext := use_precondition_ext; + ims_pars.subscr.cp.mo.tx_coord_cmd_invite_trying := true; vc_conn_ims := f_start_handler_IMS(refers(f_TC_ims_call_mo_IMS_ConnHdlr), ims_pars); vc_conn_sip := f_start_handler(refers(f_TC_internal_call_mo), sip_pars); @@ -606,11 +608,18 @@ f_AMI_IMS_register(ims_pars); COORD.send(COORD_CMD_START) to vc_conn_sip; + + IMS_COORD.receive(IMS_COORD_CMD_CALL_TRYING) from vc_conn_ims; + ami_msg := f_ami_wait_rx_msg(AMI_CLIENT, + tr_AMI_Event_Newchannel(mp_volte_ims_outbound_registration), + fail_others := false); + f_ami_action_DedicatedBearerStatus(AMI_CLIENT, + f_ami_msg_get_value(ami_msg, AMI_FIELD_CHANNEL), + "Up", fail_others := false); + COORD.receive(COORD_CMD_CALL_ESTABLISHED) from vc_conn_sip; IMS_COORD.receive(COORD_CMD_CALL_ESTABLISHED) from vc_conn_ims; - /* TODO: "Action: DedicatedBearerStatus" */ - /* Call on-going */ f_sleep(1.0); @@ -655,6 +664,7 @@ var IMS_ConnHdlrPars ims_pars; var SIPConnHdlr vc_conn_sip; var IMS_ConnHdlr vc_conn_ims; + var AMI_Msg ami_msg; const charstring c_ext_msisdn := "90829"; f_init(); @@ -672,6 +682,7 @@ ts_UserInfo(ims_pars.subscr.msisdn))); ims_pars.subscr.cp.support_precondition_ext := use_precondition_ext; ims_pars.subscr.cp.require_precondition_ext := use_precondition_ext; + ims_pars.subscr.cp.mt.tx_coord_cmd_session_progress := use_precondition_ext; vc_conn_ims := f_start_handler_IMS(refers(f_TC_ims_call_mt_IMS_ConnHdlr), ims_pars); vc_conn_sip := f_start_handler(refers(f_TC_internal_call_mt), sip_pars); @@ -682,11 +693,20 @@ IMS_COORD.receive(IMS_COORD_CMD_REGISTERED) from vc_conn_ims; IMS_COORD.send(IMS_COORD_CMD_START) to vc_conn_ims; + + ami_msg := f_ami_wait_rx_msg(AMI_CLIENT, + tr_AMI_Event_Newchannel(mp_volte_ims_outbound_registration), + fail_others := false); + if (ims_pars.subscr.cp.mt.tx_coord_cmd_session_progress) { + IMS_COORD.receive(IMS_COORD_CMD_CALL_SESSION_PROGRESS) from vc_conn_ims; + } + f_ami_action_DedicatedBearerStatus(AMI_CLIENT, + f_ami_msg_get_value(ami_msg, AMI_FIELD_CHANNEL), + "Up", fail_others := false); + IMS_COORD.receive(IMS_COORD_CMD_CALL_ESTABLISHED) from vc_conn_ims; COORD.receive(COORD_CMD_CALL_ESTABLISHED) from vc_conn_sip; - /* TODO: "Action: DedicatedBearerStatus" */ - /* Call on-going */ f_sleep(1.0); diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index dd3223c..7a9f11f 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -47,6 +47,8 @@ const charstring IMS_COORD_CMD_START := "IMS_COORD_CMD_START"; const charstring IMS_COORD_CMD_CALL_ESTABLISHED := "IMS_COORD_CMD_CALL_ESTABLISHED"; const charstring IMS_COORD_CMD_HANGUP := "IMS_COORD_CMD_HANGUP"; +const charstring IMS_COORD_CMD_CALL_TRYING := "IMS_COORD_CMD_CALL_TRYING"; +const charstring IMS_COORD_CMD_CALL_SESSION_PROGRESS := "IMS_COORD_CMD_CALL_SESSION_PROGRESS"; type component IMS_ConnHdlr extends SIP_ConnHdlr { var charstring g_name; @@ -113,15 +115,20 @@ } type record of IMS_ConnHdlrPars IMS_ConnHdlrParsList; +type record IMS_CallParsMO { + /* Whether to COORD.send(IMS_COORD_CMD_CALL_TRYING) when receiving an INVITE from UE. */ + boolean tx_coord_cmd_invite_trying +} +template (value) IMS_CallParsMO t_IMS_CallParsMO := { + tx_coord_cmd_invite_trying := false +} + type record IMS_CallParsMT { - /* Whether to wait for COORD.receive(COORD_CMD_PICKUP) before accepting the call. */ - boolean wait_coord_cmd_pickup, - /* Whether to expect CANCEL instead of ACK as answer to our OK */ - boolean exp_cancel + /* Whether to COORD.send(IMS_COORD_CMD_CALL_SESSION_PROGRESS) when receiving an 183 Session Progress from UE. */ + boolean tx_coord_cmd_session_progress } template (value) IMS_CallParsMT t_IMS_CallParsMT := { - wait_coord_cmd_pickup := false, - exp_cancel := false + tx_coord_cmd_session_progress := false } type record IMS_CallPars { @@ -141,6 +148,7 @@ boolean support_precondition_ext, boolean require_precondition_ext, SDP_Message peer_sdp optional, + IMS_CallParsMO mo, IMS_CallParsMT mt } @@ -160,6 +168,7 @@ support_precondition_ext := true, require_precondition_ext := false, peer_sdp := omit, + mo := t_IMS_CallParsMO, mt := t_IMS_CallParsMT } @@ -1043,6 +1052,11 @@ body := omit); SIP.send(req); + if (g_pars.subscr.cp.mt.tx_coord_cmd_session_progress) { + /* Signal used to inform that Dedicated bearer can be established: */ + COORD.send(IMS_COORD_CMD_CALL_SESSION_PROGRESS); + } + /* Rx 200 OK (PRACK) */ exp := tr_SIP_Response(g_pars.subscr.cp.sip_call_id, from_addr_exp, @@ -1213,6 +1227,11 @@ userAgent := omit); SIP.send(tx_resp); + if (g_pars.subscr.cp.mo.tx_coord_cmd_invite_trying) { + /* Signal used to inform that Dedicated bearer can be established: */ + COORD.send(IMS_COORD_CMD_CALL_TRYING); + } + tx_sdp := f_gen_sdp(); /* Use precondition ? */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37252?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I49c216f8874fe63480414096d9c03a1af00a0fc2 Gerrit-Change-Number: 37252 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: Validate precondition in SDP of MT calls
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37259?usp=email ) Change subject: asterisk: Validate precondition in SDP of MT calls ...................................................................... asterisk: Validate precondition in SDP of MT calls Change-Id: Ibfdc7e61a72655cd89d5d3f0f1d8798325ae1403 --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 71 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 32a35f4..d08dad4 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -546,6 +546,8 @@ type enumerated IMS_gen_sdp_state { IMS_GEN_SDP_None, + IMS_GEN_SDP_MO_INVITE, + IMS_GEN_SDP_MO_UPDATE, IMS_GEN_SDP_MT_Session_Progress, IMS_GEN_SDP_MT_UPDATE_200OK } @@ -577,6 +579,20 @@ select (st) { case (IMS_GEN_SDP_None) { } + case (IMS_GEN_SDP_MO_INVITE) { + sdp := sdp & + "a=curr:qos local none\r\n" & + "a=curr:qos remote none\r\n" & + "a=des:qos mandatory local sendrecv\r\n" & + "a=des:qos optional remote sendrecv\r\n"; + } + case (IMS_GEN_SDP_MO_UPDATE) { + sdp := sdp & + "a=curr:qos local sendrecv\r\n" & + "a=curr:qos remote none\r\n" & + "a=des:qos mandatory local sendrecv\r\n" & + "a=des:qos mandatory remote sendrecv\r\n"; + } case (IMS_GEN_SDP_MT_Session_Progress) { sdp := sdp & "a=curr:qos local none\r\n" & @@ -998,7 +1014,7 @@ var Via via; var template (omit) Require require := omit; var template (omit) Supported supported := omit; - var charstring tx_sdp := f_gen_sdp(); + var charstring tx_sdp; var default d_trying, d_ringing; var charstring branch_value; var Contact calling_contact; @@ -1024,6 +1040,10 @@ /* indicate the support for "reliable provisional response" * and "preconditions mechanism" */ supported := ts_Supported({ "100rel", "precondition" }); + tx_sdp := f_gen_sdp(IMS_GEN_SDP_MO_INVITE); + } else { + /* Don't add any preconditions to SDP: */ + tx_sdp := f_gen_sdp(IMS_GEN_SDP_None); } req := ts_SIP_INVITE(g_pars.subscr.cp.sip_call_id, @@ -1046,6 +1066,7 @@ d_trying := activate(as_SIP_ignore_resp(exp)); if (g_pars.subscr.cp.require_precondition_ext) { + var template (present) SDP_attribute_list preconds; /* Rx 183 Session Progress */ exp := tr_SIP_Response_SessionProgress( g_pars.subscr.cp.sip_call_id, @@ -1064,6 +1085,26 @@ } } + /* Validate SDP in Session Progress contains the preconditions: + * a=curr:qos local none + * a=curr:qos remote none + * a=des:qos mandatory local sendrecv + * a=des:qos mandatory remote sendrecv + * a=conf:qos remote sendrecv + */ + preconds := superset( + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_none), + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_none), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_conf(c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_sendrecv)); + if (not ispresent(g_pars.subscr.cp.peer_sdp.attributes) or + not match(g_pars.subscr.cp.peer_sdp.attributes, preconds)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Unexpected precondition attrs in Session Progress : ", + g_pars.subscr.cp.peer_sdp.attributes)); + } + /* Tx PRACK */ req := ts_SIP_PRACK(g_pars.subscr.cp.to_addr.addressField.nameAddr.addrSpec, g_pars.subscr.cp.sip_call_id, @@ -1094,6 +1135,7 @@ as_SIP_expect_resp(exp, fail_others := false); /* Tx UPDATE */ + tx_sdp := f_gen_sdp(IMS_GEN_SDP_MO_UPDATE); req := ts_SIP_UPDATE(g_pars.subscr.cp.to_addr.addressField.nameAddr.addrSpec, g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, @@ -1116,6 +1158,24 @@ body := ?); as_SIP_expect_resp(exp, fail_others := false); + /* Validate SDP in 200 OK (UPDATE) contains the preconditions: + * a=curr:qos local sendrecv + * a=curr:qos remote sendrecv + * a=des:qos mandatory local sendrecv + * a=des:qos mandatory remote sendrecv + */ + preconds := superset( + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_curr(c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_local, c_SDP_PRECON_DIR_TAG_sendrecv), + tr_SDP_des(c_SDP_PRECON_STRENGTH_TAG_mandatory, c_SDP_PRECON_STATUS_TYPE_remote, c_SDP_PRECON_DIR_TAG_sendrecv)); + if (not ispresent(g_pars.subscr.cp.peer_sdp.attributes) or + not match(g_pars.subscr.cp.peer_sdp.attributes, preconds)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Unexpected precondition attrs in 200 OK (UPDATE): ", + g_pars.subscr.cp.peer_sdp.attributes)); + } + g_pars.subscr.cp.sip_seq_nr := g_rx_sip_resp.msgHeader.cSeq.seqNumber + 1; } @@ -1136,7 +1196,7 @@ *, "INVITE", 200, g_pars.subscr.cp.sip_seq_nr, "OK", - body := ?); + body := *); as_SIP_expect_resp(exp, fail_others := false); deactivate(d_trying); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37259?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ibfdc7e61a72655cd89d5d3f0f1d8798325ae1403 Gerrit-Change-Number: 37259 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: validate audio tag present in INVITE Contact header
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37269?usp=email ) Change subject: asterisk: IMS: validate audio tag present in INVITE Contact header ...................................................................... asterisk: IMS: validate audio tag present in INVITE Contact header Related: SYS#6984 Change-Id: I36011f36f0dd3f9ddafd658d003373bd63d1ae1b --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 45 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index d08dad4..b9a9852 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -338,7 +338,7 @@ f_sip_digest_validate_Authorization_AKAv1MD5(authorization, method, g_pars.subscr.auth.res); } - +/* GSMA IR-92 2.2.1 SIP Registration Procedure */ private function f_ims_validate_register_contact(Contact rx_contact) runs on IMS_ConnHdlr { /* IMS contact shows up like this: @@ -435,6 +435,34 @@ } } +/* GSMA IR.92 2.2.4 Call Establishment and Termination */ +private function f_ims_validate_INVITE_Contact(Contact rx_contact) runs on IMS_ConnHdlr +{ + /* INVITE Contact header shows up like this: + * Contact: <sip:e05d8e82-8565-47b5-aca5-5f6b9164b074@192.168.101.2:44823>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";audio;+g.3gpp.mid-call;+g.3gpp.srvcc-alerting;+g.3gpp.ps2cs-srvcc-orig-pre-alerting + */ + if (ischosen(rx_contact.contactBody.wildcard)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected Contact wildcard := ", rx_contact)); + } + var ContactAddress_List caddrs := rx_contact.contactBody.contactAddresses; + if (lengthof(caddrs) == 0) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected empty Contact Address list")); + } + for (var integer i := 0; i < lengthof(caddrs); i := i + 1) { + var ContactAddress caddr := caddrs[i]; + /* "The UE must include the audio media feature tag, as defined in IETF RFC 3840, + * in the Contact header field of the SIP INVITE request, and in the Contact header + * field of the SIP response to the SIP INVITE request" */ + if (not ispresent(caddr.contactParams)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected empty Contact attributes (omit)")); + } + f_sip_param_match_value_or_fail(caddr.contactParams, "audio", omit); + } +} + private function f_ims_parse_security_client(Security_client security_client) runs on IMS_ConnHdlr { var boolean found := false; @@ -1187,7 +1215,7 @@ g_pars.subscr.cp.sip_seq_nr, "INVITE"); d_ringing := activate(as_SIP_ignore_resp(exp)); - /* Wait for OK answer */ + /* Wait for 200 OK (INVITE) answer */ exp := tr_SIP_Response( g_pars.subscr.cp.sip_call_id, from_addr_exp, @@ -1202,6 +1230,9 @@ deactivate(d_trying); deactivate(d_ringing); + /* Make sure "audio" tag set in Contact header */ + f_ims_validate_INVITE_Contact(g_rx_sip_resp.msgHeader.contact); + /* Update To with the tags received from peer: */ g_pars.subscr.cp.to_addr := g_rx_sip_resp.msgHeader.toField; @@ -1294,6 +1325,8 @@ via := g_rx_sip_req.msgHeader.via; f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); + f_ims_validate_INVITE_Contact(g_rx_sip_req.msgHeader.contact); + if (g_pars.subscr.cp.require_precondition_ext and not peer_support_precondition) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str(g_name & ": Missing '100rel,precondition' in INVITE Supported header: ", -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37269?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I36011f36f0dd3f9ddafd658d003373bd63d1ae1b Gerrit-Change-Number: 37269 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: validate sendrecv audio attr in INVITE SDP
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37271?usp=email ) Change subject: asterisk: IMS: validate sendrecv audio attr in INVITE SDP ...................................................................... asterisk: IMS: validate sendrecv audio attr in INVITE SDP Related: SYS#6984 Change-Id: I52f421a8168f6f55e182409751ec537c0f5147a8 --- M asterisk/IMS_ConnectionHandler.ttcn M library/SDP_Templates.ttcn 2 files changed, 35 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index b9a9852..58ca87a 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -463,6 +463,22 @@ } } +/* GSMA IR.92 2.2.4 Call Establishment and Termination */ +private function f_ims_validate_INVITE_SDP(SDP_Message sdp) runs on IMS_ConnHdlr +{ + /* "The UE must indicate in the SDP of the initial INVITE that the audio media + * is send-receive i.e. either by including the direction attribute "a=sendrecv" + * or by omitting the direction attributes. */ + if (ispresent(sdp.attributes)) { + if (match (sdp.attributes, superset(tr_SDP_recvonly)) or + match (sdp.attributes, superset(tr_SDP_sendonly))) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Unexpected SDP direction attribute != sendrecv: ", + sdp.attributes)); + } + } +} + private function f_ims_parse_security_client(Security_client security_client) runs on IMS_ConnHdlr { var boolean found := false; @@ -1326,6 +1342,7 @@ f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); f_ims_validate_INVITE_Contact(g_rx_sip_req.msgHeader.contact); + f_ims_validate_INVITE_SDP(g_pars.subscr.cp.peer_sdp); if (g_pars.subscr.cp.require_precondition_ext and not peer_support_precondition) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, diff --git a/library/SDP_Templates.ttcn b/library/SDP_Templates.ttcn index ece6147..ef91953 100644 --- a/library/SDP_Templates.ttcn +++ b/library/SDP_Templates.ttcn @@ -147,6 +147,14 @@ } } +template (present) SDP_attribute tr_SDP_recvonly := { + recvonly := {} +} + +template (present) SDP_attribute tr_SDP_sendonly := { + sendonly := {} +} + /* rfc3312 */ const charstring c_SDP_PRECON_TYPE_qos := "qos"; const charstring c_SDP_PRECON_STRENGTH_TAG_mandatory := "mandatory"; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37271?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I52f421a8168f6f55e182409751ec537c0f5147a8 Gerrit-Change-Number: 37271 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: validate ICSI present in INVITE Contact header
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37273?usp=email ) Change subject: asterisk: IMS: validate ICSI present in INVITE Contact header ...................................................................... asterisk: IMS: validate ICSI present in INVITE Contact header Related: SYS#6984 Change-Id: I630f0aaef0436ea1c12e8fffef7a5c657cfcc35c --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 16 insertions(+), 3 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 58ca87a..4f87f95 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -452,13 +452,16 @@ } for (var integer i := 0; i < lengthof(caddrs); i := i + 1) { var ContactAddress caddr := caddrs[i]; - /* "The UE must include the audio media feature tag, as defined in IETF RFC 3840, - * in the Contact header field of the SIP INVITE request, and in the Contact header - * field of the SIP response to the SIP INVITE request" */ if (not ispresent(caddr.contactParams)) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str(g_name & ": Received unexpected empty Contact attributes (omit)")); } + /* GSMA FCM.01 3.2.3.3: "The INVITE request contains Within the Contact header [...] the IMS + * Communication Service Identifier's (ICSI) for IMS Multimedia Telephony" */ + f_sip_param_match_value_or_fail(caddr.contactParams, "+g.3gpp.icsi-ref", "\"urn\\%3Aurn-7\\%3A3gpp-service.ims.icsi.mmtel\""); + /* "The UE must include the audio media feature tag, as defined in IETF RFC 3840, + * in the Contact header field of the SIP INVITE request, and in the Contact header + * field of the SIP response to the SIP INVITE request" */ f_sip_param_match_value_or_fail(caddr.contactParams, "audio", omit); } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37273?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I630f0aaef0436ea1c12e8fffef7a5c657cfcc35c Gerrit-Change-Number: 37273 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: validate P-Preferred-Service in INVITE
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37274?usp=email ) Change subject: asterisk: IMS: validate P-Preferred-Service in INVITE ...................................................................... asterisk: IMS: validate P-Preferred-Service in INVITE Change-Id: Iaa219d7b16965b27cd62ec27d810cb490dbc7a5a --- M asterisk/IMS_ConnectionHandler.ttcn M library/SIP_Templates.ttcn 2 files changed, 47 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 4f87f95..69e8abf 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -466,6 +466,37 @@ } } +/* Validate P-Preferred-Service: GSMA FCM.01 3.2.3.3 */ +private function f_ims_validate_invite_P_Preferred_Service(PDU_SIP_Request req, + boolean exp_present := true) runs on IMS_ConnHdlr + +{ + if (not exp_present) { + if (ispresent(g_rx_sip_req.msgHeader.p_preferred_service)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected [rfc6050] P-Preferred-Service := ", + g_rx_sip_req.msgHeader.p_preferred_service)); + } + return; + } + + /* exp_present: */ + var template (present) P_Preferred_Service expl_tmpl := + tr_P_Preferred_Service({ "urn:urn-7:3gpp-service.ims.icsi.mmtel" }); + + if (not ispresent(g_rx_sip_req.msgHeader.p_preferred_service)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received no P-Access-Info vs exp := ", + expl_tmpl)); + } + if (not match(g_rx_sip_req.msgHeader.p_preferred_service, expl_tmpl)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected P-Preferred-Service := ", + g_rx_sip_req.msgHeader.p_preferred_service, + "\nvs exp := ", expl_tmpl)); + } +} + /* GSMA IR.92 2.2.4 Call Establishment and Termination */ private function f_ims_validate_INVITE_SDP(SDP_Message sdp) runs on IMS_ConnHdlr { @@ -1344,6 +1375,7 @@ via := g_rx_sip_req.msgHeader.via; f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); + f_ims_validate_invite_P_Preferred_Service(g_rx_sip_req, exp_present := true); f_ims_validate_INVITE_Contact(g_rx_sip_req.msgHeader.contact); f_ims_validate_INVITE_SDP(g_pars.subscr.cp.peer_sdp); diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn index d0210d1..ce5998b 100644 --- a/library/SIP_Templates.ttcn +++ b/library/SIP_Templates.ttcn @@ -284,6 +284,12 @@ p_assoc_uris := p_assoc_uris } +// [RFC6050] +template (present) P_Preferred_Service tr_P_Preferred_Service(template (present) Service_ID_List p_ps := ?) := { + fieldName := P_PREFERRED_SERVICE_E, + p_ps := p_ps +} + // RFC 3262 template (value) RAck ts_RAck(template (value) integer response_num, template (value) integer seq_nr, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37274?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Iaa219d7b16965b27cd62ec27d810cb490dbc7a5a Gerrit-Change-Number: 37274 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: library/SDP_Templates: Add templates for precondition qos attributes
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37257?usp=email ) Change subject: library/SDP_Templates: Add templates for precondition qos attributes ...................................................................... library/SDP_Templates: Add templates for precondition qos attributes Change-Id: I656ec1fa77bf3390a690fb0ed385d0be95c0f6b4 --- M library/SDP_Templates.ttcn 1 file changed, 86 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/library/SDP_Templates.ttcn b/library/SDP_Templates.ttcn index 525da8e..ece6147 100644 --- a/library/SDP_Templates.ttcn +++ b/library/SDP_Templates.ttcn @@ -147,6 +147,83 @@ } } +/* rfc3312 */ +const charstring c_SDP_PRECON_TYPE_qos := "qos"; +const charstring c_SDP_PRECON_STRENGTH_TAG_mandatory := "mandatory"; +const charstring c_SDP_PRECON_STRENGTH_TAG_optional := "optional"; +const charstring c_SDP_PRECON_STRENGTH_TAG_none := "none"; +const charstring c_SDP_PRECON_STRENGTH_TAG_failure := "failure"; +const charstring c_SDP_PRECON_STRENGTH_TAG_unknown := "unknown"; +const charstring c_SDP_PRECON_STATUS_TYPE_e2e := "e2e"; +const charstring c_SDP_PRECON_STATUS_TYPE_local := "local"; +const charstring c_SDP_PRECON_STATUS_TYPE_remote := "remote"; +const charstring c_SDP_PRECON_DIR_TAG_none := "none"; +const charstring c_SDP_PRECON_DIR_TAG_send := "send"; +const charstring c_SDP_PRECON_DIR_TAG_recv := "recv"; +const charstring c_SDP_PRECON_DIR_TAG_sendrecv := "sendrecv"; + +template (present) SDP_attribute tr_SDP_curr(charstring status_type, + charstring dir_tag, + charstring precondition_type := c_SDP_PRECON_TYPE_qos) := { + curr := { + attr_value := precondition_type & " " & status_type & " " & dir_tag + } +} +template (present) SDP_attribute tr_SDP_curr_present := { + curr := { + attr_value := ? + } +} +template (value) SDP_attribute ts_SDP_curr(charstring status_type, + charstring dir_tag, + charstring precondition_type := c_SDP_PRECON_TYPE_qos) := { + curr := { + attr_value := precondition_type & " " & status_type & " " & dir_tag + } +} + +template (present) SDP_attribute tr_SDP_des(charstring status_type, + charstring strength_tag, + charstring dir_tag, + charstring precondition_type := c_SDP_PRECON_TYPE_qos) := { + curr := { + attr_value := precondition_type & " " & strength_tag & " " & status_type & " " & dir_tag + } +} +template (present) SDP_attribute tr_SDP_des_present := { + des := { + attr_value := ? + } +} +template (value) SDP_attribute ts_SDP_des(charstring status_type, + charstring strength_tag, + charstring dir_tag, + charstring precondition_type := c_SDP_PRECON_TYPE_qos) := { + des := { + attr_value := precondition_type & " " & strength_tag & " " & status_type & " " & dir_tag + } +} + +template (present) SDP_attribute tr_SDP_conf(charstring status_type, + charstring dir_tag, + charstring precondition_type := c_SDP_PRECON_TYPE_qos) := { + conf := { + attr_value := precondition_type & " " & status_type & " " & dir_tag + } +} +template (present) SDP_attribute tr_SDP_conf_present := { + conf := { + attr_value := ? + } +} +template (value) SDP_attribute ts_SDP_conf(charstring status_type, + charstring dir_tag, + charstring precondition_type := c_SDP_PRECON_TYPE_qos) := { + conf := { + attr_value := precondition_type & " " & status_type & " " & dir_tag + } +} + function f_sdp_addr2addrtype(charstring addr) return charstring { for (var integer i := 0; i < lengthof(addr); i := i + 1) { if (addr[i] == ":") { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37257?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I656ec1fa77bf3390a690fb0ed385d0be95c0f6b4 Gerrit-Change-Number: 37257 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: check Contact attributes on IMS side
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37260?usp=email ) Change subject: asterisk: check Contact attributes on IMS side ...................................................................... asterisk: check Contact attributes on IMS side Related: SYS#6877 Related: SYS#6981 Change-Id: I866d89ec137d264e257b05226900b744a93c257e --- M asterisk/Asterisk_Tests.ttcn M asterisk/IMS_ConnectionHandler.ttcn 2 files changed, 86 insertions(+), 13 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn index 30f04fd..05b1638 100644 --- a/asterisk/Asterisk_Tests.ttcn +++ b/asterisk/Asterisk_Tests.ttcn @@ -39,6 +39,7 @@ integer mp_local_ims_port := 5060; charstring mp_ims_domain := "ims.mnc001.mcc238.3gppnetwork.org" charstring mp_ims_imsi := "238010000090828"; + charstring mp_ims_imei := "35876110-027790-0"; /* Asterisk AMI: */ charstring mp_ami_remote_host := "127.0.0.1"; @@ -86,6 +87,7 @@ mp_local_ims_port, mp_ims_domain, mp_ims_imsi, + mp_ims_imei, cp := cp); return valueof(pars); } diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index d396268..4f3cbb7 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -73,9 +73,12 @@ charstring remote_sip_host optional, uint16_t remote_sip_port optional, charstring imsi, + charstring imei, charstring display_name, charstring password, charstring msisdn, + boolean support_video, + boolean support_smsip, /* Expected User-Location-Info in P-Access-Network-Info */ charstring uli_str, IMS_AuthVector auth, @@ -160,6 +163,7 @@ uint16_t local_sip_port, charstring domain, charstring imsi, + charstring imei, charstring msisdn := "90828", charstring display_name := "Anonymous", charstring password := "secret", @@ -167,9 +171,12 @@ remote_sip_host := omit, remote_sip_port := omit, imsi := imsi, + imei := imei, display_name := f_sip_str_quote(display_name), password := password, msisdn := msisdn, + support_video := false, + support_smsip := false, uli_str := "2380100010000101", auth := { /* The Nonce field is the Base64 encoded version of the RAND value and concatenated with the AUTN: */ @@ -207,6 +214,7 @@ uint16_t local_sip_port, charstring domain, charstring imsi, + charstring imei, template (omit) IMS_CallPars cp := omit) := { t_guard := 60.0, realm := domain, @@ -215,7 +223,9 @@ registrar_sip_req_uri := valueof(ts_SipUrlHost(domain)), local_via := ts_Via_from(ts_HostPort(local_sip_host, local_sip_port)), server_name := valueof(ts_Server({c_sip_server_name})), - subscr := t_IMS_SubscrPars(local_sip_host, local_sip_port, domain := domain, imsi := imsi, cp := cp) + subscr := t_IMS_SubscrPars(local_sip_host, local_sip_port, + domain := domain, imsi := imsi, + imei := imei, cp := cp) } private altstep as_Tguard() runs on IMS_ConnHdlr { @@ -316,19 +326,69 @@ } -private function f_ims_validate_register_contact(Contact rx_contact) +private function f_ims_validate_register_contact(Contact rx_contact) runs on IMS_ConnHdlr { -/* IMS contact shows up like this: - * Contact: <sip:8adf9f3d-9342-4060-aa4f-a909f37fd6f6@192.168.101.2:5060>;+g.3gpp.accesstype="cellular2";video;audio;+g.3gpp.smsip;+g.3gpp.nw-init-ussi;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";+sip.instance="<urn:gsma:imei:35589811-338445-0>" - */ - /* TODO: "that the UE must include the IMS Communication Service Identifier (ICSI) -in the contact: header to indicate IMS Multimedia Telephony." */ - /* TODO: "The UE must include an IMEI URN in the +sip.instance header field -parameter of the contact: header." */ - /* TODO: "If the UE supports SMS over IP, it must include the feature tag -“+g.3gpp.smsip” in the contact: header." */ - /* TODO: "If the UE supports conversational audio and video service, then this must -be indicated by adding a “video” media feature tag to the contact: header." */ + /* IMS contact shows up like this: + * Contact: <sip:8adf9f3d-9342-4060-aa4f-a909f37fd6f6@192.168.101.2:5060>;+g.3gpp.accesstype="cellular2";video;audio;+g.3gpp.smsip;+g.3gpp.nw-init-ussi;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";+sip.instance="<urn:gsma:imei:35589811-338445-0>" + */ + if (ischosen(rx_contact.contactBody.wildcard)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected Contact wildcard := ", rx_contact)); + } + var ContactAddress_List caddrs := rx_contact.contactBody.contactAddresses; + if (lengthof(caddrs) == 0) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected empty Contact Address list")); + } + for (var integer i := 0; i < lengthof(caddrs); i := i + 1) { + var ContactAddress caddr := caddrs[i]; + var template (omit) GenericParam param_tpl; + var boolean rx_supported; + if (not ispresent(caddr.contactParams)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received unexpected empty Contact attributes (omit)")); + } + f_sip_param_match_value_or_fail(caddr.contactParams, "+g.3gpp.icsi-ref", "\"urn\\%3Aurn-7\\%3A3gpp-service.ims.icsi.mmtel\""); + f_sip_param_match_value_or_fail(caddr.contactParams, "+sip.instance", "\"<urn:gsma:imei:" & g_pars.subscr.imei & ">\""); + f_sip_param_match_value_or_fail(caddr.contactParams, "audio", omit); + + /* Check video support */ + param_tpl := f_sip_param_find(caddr.contactParams, "video"); + rx_supported := not istemplatekind(param_tpl, "omit"); + if (rx_supported) { + /* This attribute never has a value: */ + if (not istemplatekind(param_tpl.paramValue, "omit")) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received Contact with 'video' attribute containing a value := ", rx_contact)); + } + if (not g_pars.subscr.support_video) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received Contact with unexpected 'video' attribute := ", rx_contact)); + } + } else if (g_pars.subscr.support_video) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received Contact with missing 'video' attribute := ", rx_contact)); + } + + /* Check smsip support */ + param_tpl := f_sip_param_find(caddr.contactParams, "+g.3gpp.smsip"); + rx_supported := not istemplatekind(param_tpl, "omit"); + if (rx_supported) { + /* This attribute never has a value: */ + if (not istemplatekind(param_tpl.paramValue, "omit")) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received Contact with '+g.3gpp.smsip' attribute containing a value := ", rx_contact)); + } + if (not g_pars.subscr.support_smsip) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received Contact with unexpected '+g.3gpp.smsip' attribute := ", rx_contact)); + } + } else if (g_pars.subscr.support_smsip) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Received Contact with missing '+g.3gpp.smsip' attribute := ", rx_contact)); + } + } + } /* Validate P-Access-Network-Info: RFC7315 6.4 */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37260?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I866d89ec137d264e257b05226900b744a93c257e Gerrit-Change-Number: 37260 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: test Precondition extension in IMS MO call
by pespin 25 Jun '24

25 Jun '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37248?usp=email ) Change subject: asterisk: test Precondition extension in IMS MO call ...................................................................... asterisk: test Precondition extension in IMS MO call Related: SYS#6969 Change-Id: I1e26f3bb9e54be5b5e15a003b2000ae3e88b9027 --- M asterisk/Asterisk_Tests.ttcn M asterisk/IMS_ConnectionHandler.ttcn M asterisk/expected-results.xml M library/SIP_Templates.ttcn 4 files changed, 209 insertions(+), 10 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn index 05b1638..981d5f1 100644 --- a/asterisk/Asterisk_Tests.ttcn +++ b/asterisk/Asterisk_Tests.ttcn @@ -49,7 +49,7 @@ charstring mp_ami_user := "test_user"; charstring mp_ami_secret := "1234"; charstring mp_volte_ims_outbound_registration := "volte_ims"; - /* Current default by pjproject (timeout_timer_val) to 32s, and not changed by Asterisk */ + /* Current default by pjproject (timeout_timer_val) is set to 32s, and not changed by Asterisk */ integer mp_volte_ims_outbound_register_timeout := 32; } @@ -561,8 +561,8 @@ true, false); } -/* Test SIP registration of local clients */ -private function f_TC_ims_call_mo(charstring id) runs on IMS_ConnHdlr { +/* Test IMS MO call emulating an MT which doesn't support precondition */ +private function f_TC_ims_call_mo_IMS_ConnHdlr(charstring id) runs on IMS_ConnHdlr { f_create_sip_expect(valueof(ts_SipUrl_from_Addr_Union(g_pars.subscr.registrar_sip_record.addr))); if (ispresent(g_pars.subscr.cp.called)) { f_create_sip_expect(valueof(ts_SipUrl_from_Addr_Union(g_pars.subscr.cp.called.addr))); @@ -576,7 +576,7 @@ setverdict(pass); as_IMS_unregister(); } -testcase TC_ims_call_mo() runs on test_CT { +private function f_TC_ims_call_mo(boolean use_precondition_ext) runs on test_CT { var SIPConnHdlrPars sip_pars; var IMS_ConnHdlrPars ims_pars; var SIPConnHdlr vc_conn_sip; @@ -595,8 +595,10 @@ ts_UserInfo(ims_pars.subscr.msisdn))); ims_pars.subscr.cp.called := valueof(ts_SipAddr(ts_HostPort(ims_pars.realm), ts_UserInfo(c_ext_msisdn))); + ims_pars.subscr.cp.support_precondition_ext := use_precondition_ext; + ims_pars.subscr.cp.require_precondition_ext := use_precondition_ext; - vc_conn_ims := f_start_handler_IMS(refers(f_TC_ims_call_mo), ims_pars); + vc_conn_ims := f_start_handler_IMS(refers(f_TC_ims_call_mo_IMS_ConnHdlr), ims_pars); vc_conn_sip := f_start_handler(refers(f_TC_internal_call_mo), sip_pars); COORD.receive(COORD_CMD_REGISTERED) from vc_conn_sip; @@ -623,6 +625,12 @@ vc_conn_ims.done; f_shutdown(); } +testcase TC_ims_call_mo() runs on test_CT { + f_TC_ims_call_mo(true); +} +testcase TC_ims_call_mo_noprecondition() runs on test_CT { + f_TC_ims_call_mo(false); +} /* Test SIP registration of local clients */ private function f_TC_ims_call_mt(charstring id) runs on IMS_ConnHdlr { @@ -706,6 +714,7 @@ execute( TC_ims_registration_timeout_protected_100Trying() ); execute( TC_ims_registration_timeout_protected_200OK() ); execute( TC_ims_call_mo() ); + execute( TC_ims_call_mo_noprecondition() ); execute( TC_ims_call_mt() ); } diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 4f3cbb7..860b799 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -138,6 +138,8 @@ charstring local_rtp_addr, uint16_t local_rtp_port, + boolean support_precondition_ext, + boolean require_precondition_ext, SDP_Message peer_sdp optional, IMS_CallParsMT mt } @@ -155,6 +157,8 @@ sip_body := omit, local_rtp_addr := local_rtp_addr, local_rtp_port := local_rtp_port, + support_precondition_ext := true, + require_precondition_ext := false, peer_sdp := omit, mt := t_IMS_CallParsMT } @@ -1104,24 +1108,106 @@ var template (value) PDU_SIP_Response tx_resp; var Via via; var charstring tx_sdp; + var boolean peer_support_precondition := match(g_rx_sip_req.msgHeader.supported.optionsTags, + superset("100rel", "precondition")); /* Obtain params: */ f_ConnHdlr_parse_initial_SIP_INVITE(g_rx_sip_req); via := g_rx_sip_req.msgHeader.via; f_ims_validate_register_P_Access_Network_info(g_rx_sip_req, exp_present := true); + if (g_pars.subscr.cp.require_precondition_ext and not peer_support_precondition) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(g_name & ": Missing '100rel,precondition' in INVITE Supported header: ", + g_rx_sip_req.msgHeader.supported)); + } - - /* Tx 180 Ringing */ - tx_resp := ts_SIP_Response_Ringing(g_pars.subscr.cp.sip_call_id, + /* Tx 100 Tyring */ + tx_resp := ts_SIP_Response_Trying(g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, via, - g_pars.subscr.cp.sip_seq_nr); + g_pars.subscr.cp.sip_seq_nr, + "INVITE", + allow := omit, + server := g_pars.server_name, + userAgent := omit); SIP.send(tx_resp); - /* Tx 200 OK */ tx_sdp := f_gen_sdp(); + + /* Use precondition ? */ + if (g_pars.subscr.cp.require_precondition_ext or + (g_pars.subscr.cp.support_precondition_ext and peer_support_precondition)) { + /* Tx 183 Session Progress */ + /* TODO: add a=curr:qos, a=des:qos and a=conf:qos fields to SDP */ + tx_resp := ts_SIP_Response_SessionProgress(g_pars.subscr.cp.sip_call_id, + g_pars.subscr.cp.from_addr, + g_pars.subscr.cp.to_addr, + via, + g_pars.subscr.cp.sip_seq_nr, + rseq := ts_RSeq(1), + body := tx_sdp); + SIP.send(tx_resp); + + /* Rx PRACK */ + exp_req := tr_SIP_PRACK(f_tr_SipUrl_opt_defport(ts_SipUrl_from_Addr_Union(g_pars.subscr.cp.called.addr)), + g_pars.subscr.cp.sip_call_id, + g_pars.subscr.cp.from_addr, + g_pars.subscr.cp.to_addr, + f_tr_Via_response(via), + g_pars.subscr.cp.sip_seq_nr + 1, + rack := tr_RAck(1, g_pars.subscr.cp.sip_seq_nr, "INVITE"), + body := omit); + as_SIP_expect_req(exp_req); + + /* Tx 200 OK (PRACK) */ + tx_resp := ts_SIP_Response(g_pars.subscr.cp.sip_call_id, + g_pars.subscr.cp.from_addr, + g_pars.subscr.cp.to_addr, + "PRACK", 200, + g_pars.subscr.cp.sip_seq_nr, + "OK", + via, + body := omit); + SIP.send(tx_resp); + + /* Rx UPDATE */ + exp_req := tr_SIP_UPDATE(f_tr_SipUrl_opt_defport(ts_SipUrl_from_Addr_Union(g_pars.subscr.cp.called.addr)), + g_pars.subscr.cp.sip_call_id, + g_pars.subscr.cp.from_addr, + g_pars.subscr.cp.to_addr, + f_tr_Via_response(via), + g_pars.subscr.cp.sip_seq_nr + 1, + require := tr_Require(superset("precondition")), + body := ?); + as_SIP_expect_req(exp_req); + + /* Tx 200 OK (UPDATE) */ + /* TODO: add a=curr:qos, a=des:qos and a=conf:qos fields to SDP */ + tx_resp := ts_SIP_Response(g_pars.subscr.cp.sip_call_id, + g_pars.subscr.cp.from_addr, + g_pars.subscr.cp.to_addr, + "UPDATE", 200, + g_pars.subscr.cp.sip_seq_nr, + "OK", + via, + body := tx_sdp); + SIP.send(tx_resp); + + g_pars.subscr.cp.sip_seq_nr := g_pars.subscr.cp.sip_seq_nr + 1; + } + + /* Tx 180 Ringing */ + tx_resp := ts_SIP_Response_Ringing(g_pars.subscr.cp.sip_call_id, + g_pars.subscr.cp.from_addr, + g_pars.subscr.cp.to_addr, + via, + g_pars.subscr.cp.sip_seq_nr); + SIP.send(tx_resp); + + + /* Tx 200 OK */ tx_resp := ts_SIP_Response(g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, diff --git a/asterisk/expected-results.xml b/asterisk/expected-results.xml index 6b5def5..e9d2b82 100644 --- a/asterisk/expected-results.xml +++ b/asterisk/expected-results.xml @@ -13,5 +13,6 @@ <testcase classname='Asterisk_Tests' name='TC_ims_registration_timeout_protected_100Trying' time='MASKED'/> <testcase classname='Asterisk_Tests' name='TC_ims_registration_timeout_protected_200OK' time='MASKED'/> <testcase classname='Asterisk_Tests' name='TC_ims_call_mo' time='MASKED'/> + <testcase classname='Asterisk_Tests' name='TC_ims_call_mo_noprecondition' time='MASKED'/> <testcase classname='Asterisk_Tests' name='TC_ims_call_mt' time='MASKED'/> </testsuite> diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn index 77d4ee0..cfe21eb 100644 --- a/library/SIP_Templates.ttcn +++ b/library/SIP_Templates.ttcn @@ -284,6 +284,24 @@ p_assoc_uris := p_assoc_uris } +// RFC 3262 +template (value) RAck ts_RAck(template (value) integer response_num, + template (value) integer seq_nr, + template (value) charstring method := "INVITE") := { + fieldName := RACK_E, + response_num := response_num, + seqNumber := seq_nr, + method := method +} +template (present) RAck tr_RAck(template (present) integer response_num := ?, + template (present) integer seq_nr := ?, + template (present) charstring method := ?) := { + fieldName := RACK_E, + response_num := response_num, + seqNumber := seq_nr, + method := method +} + // [20.32] template (value) Require ts_Require(template (value) OptionTag_List optionsTags := {}) := { fieldName := REQUIRE_E, @@ -294,6 +312,16 @@ optionsTags := optionsTags } +// RFC 3262 +template (value) RSeq ts_RSeq(template (value) integer response_num) := { + fieldName := RSEQ_E, + response_num := response_num +} +template (present) RSeq tr_RSeq(template (present) integer response_num := ?) := { + fieldName := RSEQ_E, + response_num := response_num +} + // [20.35 RFC2616 14.38] template (value) Server ts_Server(template (value) ServerVal_List serverBody := {}) := { fieldName := SERVER_E, @@ -652,7 +680,9 @@ template (omit) Allow allow := ts_Allow(c_SIP_defaultMethods), template (omit) Expires expires := omit, template (omit) P_Associated_Uri p_associated_uri := omit, + template (omit) RAck rack := omit, template (omit) Require require := omit, + template (omit) RSeq rseq := omit, template (omit) Security_client security_client := omit, template (omit) Security_server security_server := omit, template (omit) Server server := omit, @@ -677,7 +707,9 @@ expires := expires, fromField := from_addr, p_associated_uri := p_associated_uri, + rack := rack, require := require, + rseq := rseq, security_client := security_client, security_server := security_server, server := server, @@ -702,6 +734,7 @@ template Authorization authorization := *, template Expires expires := *, template P_Associated_Uri p_associated_uri := *, + template RAck rack := *, template Require require := *, template Security_client security_client := *, template Security_server security_server := *, @@ -727,6 +760,7 @@ expires := expires, fromField := from_addr, p_associated_uri := p_associated_uri, + rack := rack, require := require, security_client := security_client, security_server := security_server, @@ -905,6 +939,42 @@ payload := omit } +template (present) PDU_SIP_Request +tr_SIP_PRACK(template (present) SipUrl uri, + template CallidString call_id, + template From from_addr, + template To to_addr, + template Via via, + template integer seq_nr, + template RAck rack := tr_RAck(?, ?, ?), + template charstring body := *) := { + requestLine := tr_SIP_ReqLine(PRACK_E, uri), + msgHeader := tr_SIP_msgh_std(call_id, from_addr, to_addr, *, + via, + "PRACK", seq_nr, + rack := rack), + messageBody := body, + payload := omit +} + +template (present) PDU_SIP_Request +tr_SIP_UPDATE(template (present) SipUrl uri, + template CallidString call_id, + template From from_addr, + template To to_addr, + template Via via, + template integer seq_nr, + template Require require := *, + template charstring body) := { + requestLine := tr_SIP_ReqLine(UPDATE_E, uri), + msgHeader := tr_SIP_msgh_std(call_id, from_addr, to_addr, *, + via, + "UPDATE", seq_nr, + require := require), + messageBody := body, + payload := omit +} + template (value) PDU_SIP_Response ts_SIP_Response(template (value) CallidString call_id, template (value) From from_addr, @@ -979,6 +1049,29 @@ payload := omit } +/* 183 Session Progress */ +template (value) PDU_SIP_Response +ts_SIP_Response_SessionProgress( + template (value) CallidString call_id, + template (value) From from_addr, + template (value) To to_addr, + Via via, + integer seq_nr, + charstring method := "INVITE", + template (omit) Require require := ts_Require({"100rel", "precondition"}), + template (omit) RSeq rseq := ts_RSeq(1), + template (omit) charstring body := omit) := { + statusLine := ts_SIP_StatusLine(183, "Session Progress"), + msgHeader := ts_SIP_msgh_std(call_id, from_addr, to_addr, omit, method, seq_nr, + via, + content_length := f_ContentLength(body), + content_type := f_ContentTypeOrOmit(ts_CT_SDP, body), + require := require, + rseq := rseq), + messageBody := body, + payload := omit +} + /* 401 Unauthorized */ template (value) PDU_SIP_Response ts_SIP_Response_Unauthorized( -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37248?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I1e26f3bb9e54be5b5e15a003b2000ae3e88b9027 Gerrit-Change-Number: 37248 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.