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

July 2024

  • 1 participants
  • 1379 discussions
[S] Change in pysim[master]: pySim.transport: Fix proactive_handler from_dict() calls
by laforge 13 Jul '24

13 Jul '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37482?usp=email ) Change subject: pySim.transport: Fix proactive_handler from_dict() calls ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37482?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2aa19ef6a19085d77c1b4f2d434a01ee241bd9a8 Gerrit-Change-Number: 37482 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sat, 13 Jul 2024 21:23:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in pysim[master]: pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing
by laforge 13 Jul '24

13 Jul '24
Attention is currently required from: dexter, fixeria, osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37456?usp=email ) Change subject: pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing ...................................................................... Patch Set 4: (3 comments) File pySim-smpp2sim.py: https://gerrit.osmocom.org/c/pysim/+/37456/comment/0f3c0ac2_24de28bf PS3, Line 34: from pprint > no longer used? Done https://gerrit.osmocom.org/c/pysim/+/37456/comment/4d98bae2_0d031b15 PS3, Line 41: from zope.interface import implementer > curious: what package this belongs to? I believe it's an upstraeam dependency of twisted. https://docs.twisted.org/en/twisted-17.5.0/core/howto/components.html https://gerrit.osmocom.org/c/pysim/+/37456/comment/b51c83ef_1a7910bf PS3, Line 59: logger = logging.getLogger(__name__) > so you have a module local logger module (which is good), but still mostly using the root logger (`l […] Done -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37456?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ie5bae9d823bca6f6c658bd455303f63bace2258c Gerrit-Change-Number: 37456 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Sat, 13 Jul 2024 21:09:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pySim.transport: Fix proactive_handler from_dict() calls
by laforge 13 Jul '24

13 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37482?usp=email ) Change subject: pySim.transport: Fix proactive_handler from_dict() calls ...................................................................... pySim.transport: Fix proactive_handler from_dict() calls Change-Id: I2aa19ef6a19085d77c1b4f2d434a01ee241bd9a8 --- M pySim/transport/__init__.py 1 file changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/82/37482/1 diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index dd06af8..5ae9428 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -187,9 +187,11 @@ # they could be appended after the Result; if the first is a # Result, that cuold replace the one built here. self.proactive_handler.receive_fetch_raw(pcmd, parsed) - result.from_dict({'general_result': 'performed_successfully', 'additional_information': ''}) + result.from_dict({'result': {'general_result': 'performed_successfully', + 'additional_information': ''}}) else: - result.from_dict({'general_result': 'command_beyond_terminal_capability', 'additional_information': ''}) + result.from_dict({'result': {'general_result': 'command_beyond_terminal_capability', + 'additional_information': ''}}) # Send response immediately, thus also flushing out any further # proactive commands that the card already wants to send @@ -200,7 +202,8 @@ (command_details,) = [c for c in pcmd.decoded.children if isinstance(c, CommandDetails)] # The Device Identities are fixed. (TS 102 223 V4.0.0 Section 6.8.2) device_identities = DeviceIdentities() - device_identities.from_dict({'source_dev_id': 'terminal', 'dest_dev_id': 'uicc'}) + device_identities.from_dict({'device_identities': {'source_dev_id': 'terminal', 'dest_dev_id': + 'uicc'}}) # Testing hint: The value of tail does not influence the behavior # of an SJA2 that sent ans SMS, so this is implemented only -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37482?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2aa19ef6a19085d77c1b4f2d434a01ee241bd9a8 Gerrit-Change-Number: 37482 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.ota: Handle cases where 'secured_data' is empty
by laforge 13 Jul '24

13 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37483?usp=email ) Change subject: pySim.ota: Handle cases where 'secured_data' is empty ...................................................................... pySim.ota: Handle cases where 'secured_data' is empty while it's true that in situations where response_status == 'por_ok' we are guaranteed to have a 'secured_data' key in the dict, its value could well be b'', which in turn causes us to run into an exception, calling a decoder on an empty byte value; let's avoid that. Change-Id: I7c919f9987585d3b42347c54bd3082a54b8c2a0a --- M pySim/ota.py 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/83/37483/1 diff --git a/pySim/ota.py b/pySim/ota.py index c3a7512..00a4b6b 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -478,7 +478,7 @@ raise OtaCheckError('Unknown por_rc_cc_ds: %s' % spi['por_rc_cc_ds']) # TODO: ExpandedRemoteResponse according to TS 102 226 5.2.2 - if res.response_status == 'por_ok': + if res.response_status == 'por_ok' and len(res['secured_data']): dec = CompactRemoteResp.parse(res['secured_data']) else: dec = None -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37483?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I7c919f9987585d3b42347c54bd3082a54b8c2a0a Gerrit-Change-Number: 37483 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.commands: Check return value of TERMINAL PROFILE command
by laforge 13 Jul '24

13 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37485?usp=email ) Change subject: pySim.commands: Check return value of TERMINAL PROFILE command ...................................................................... pySim.commands: Check return value of TERMINAL PROFILE command Change-Id: Iaede74caf22970869c2c85b42d1e6f70d52c65cb --- M pySim/commands.py 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/85/37485/1 diff --git a/pySim/commands.py b/pySim/commands.py index c0ac1d7..40b0980 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -759,7 +759,7 @@ payload : payload as hex string """ data_length = len(payload) // 2 - data, sw = self.send_apdu(('80100000%02x' % data_length) + payload) + data, sw = self.send_apdu_checksw(('80100000%02x' % data_length) + payload) return (data, sw) # ETSI TS 102 221 11.1.22 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37485?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Iaede74caf22970869c2c85b42d1e6f70d52c65cb Gerrit-Change-Number: 37485 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in pysim[master]: pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing
by laforge 13 Jul '24

13 Jul '24
Attention is currently required from: dexter, osmith. Hello Jenkins Builder, dexter, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/37456?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing ...................................................................... pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing The pySim-smpp2sim.py program exposes two interfaces: * SMPP server-side port, so external programs can rx/tx SMS * APDU interface towards the SIM card It therefore emulates the SMSC, Core Network, RAND and UE parts that would normally be encountered in an OTA setup. Change-Id: Ie5bae9d823bca6f6c658bd455303f63bace2258c --- M docs/index.rst A docs/smpp2sim.rst A pySim-smpp2sim.py M pySim/cat.py M pySim/sms.py M requirements.txt M setup.py 7 files changed, 403 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/56/37456/4 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37456?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ie5bae9d823bca6f6c658bd455303f63bace2258c Gerrit-Change-Number: 37456 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: pySim.ota: Raise exception if encoded length would exceed 140 bytes
by laforge 13 Jul '24

13 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37484?usp=email ) Change subject: pySim.ota: Raise exception if encoded length would exceed 140 bytes ...................................................................... pySim.ota: Raise exception if encoded length would exceed 140 bytes SMS cannot exceed 140 bytes, and TS 31.115 explicitly states that larger messages must use multi-part SMS, which we don't yet implement here. Change-Id: I8a1543838be2add1c3cfdf7155676cf2b9827e6e --- M pySim/ota.py 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/84/37484/1 diff --git a/pySim/ota.py b/pySim/ota.py index 00a4b6b..751461a 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -386,6 +386,9 @@ #print("envelope_data: %s" % b2h(envelope_data)) + if len(envelope_data) > 140: + raise ValueError('Cannot encode command in a single SMS; Fragmentation not implemented') + return envelope_data def decode_cmd(self, otak: OtaKeyset, encoded: bytes) -> Tuple[bytes, dict, bytes]: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37484?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I8a1543838be2add1c3cfdf7155676cf2b9827e6e Gerrit-Change-Number: 37484 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.globalplatform: Add 'http' submodule for GP Amd B RAM over HTTPS
by laforge 13 Jul '24

13 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37486?usp=email ) Change subject: pySim.globalplatform: Add 'http' submodule for GP Amd B RAM over HTTPS ...................................................................... pySim.globalplatform: Add 'http' submodule for GP Amd B RAM over HTTPS This implements the first parts of the "GlobalPlatform Remote Application Management over HTTP Card Specification v2.3 - Amendment B, Versoin 1.2". Specifically, this patch covers the TLV definitions for the OTA message used for HTTPS session triggering. This also adds some more unit test coverage to pySim.cat, based on real-world data that was captured nested inside the HTTPS Administration session triggering parameters. Change-Id: Ia7d7bd6df41bdf1249011bad9a9a38b7669edc54 --- M pySim/cat.py A pySim/global_platform/http.py M tests/test_tlvs.py 3 files changed, 127 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/86/37486/1 diff --git a/pySim/cat.py b/pySim/cat.py index a9a0b72..141f5f2 100644 --- a/pySim/cat.py +++ b/pySim/cat.py @@ -267,6 +267,9 @@ # TS 102 223 Section 8.15 class TextString(COMPR_TLV_IE, tag=0x8D): + _test_de_encode = [ + ( '8d090470617373776f7264', {'dcs': 4, 'text_string': '70617373776f7264'} ), + ] _construct = Struct('dcs'/Int8ub, # TS 03.38 'text_string'/HexAdapter(GreedyBytes)) @@ -444,6 +447,9 @@ # TS 102 223 Section 8.52 class BearerDescription(COMPR_TLV_IE, tag=0xB5): + _test_de_encode = [ + ( 'b50103', {'bearer_parameters': '', 'bearer_type': 'default'} ), + ] # TS 31.111 Section 8.52.1 BearerParsCs = Struct('data_rate'/Int8ub, 'bearer_service'/Int8ub, @@ -506,11 +512,17 @@ # TS 102 223 Section 8.58 class OtherAddress(COMPR_TLV_IE, tag = 0xBE): + _test_de_encode = [ + ( 'be052101020304', {'address': '01020304', 'type_of_address': 'ipv4'} ), + ] _construct = Struct('type_of_address'/Enum(Int8ub, ipv4=0x21, ipv6=0x57), 'address'/HexAdapter(GreedyBytes)) # TS 102 223 Section 8.59 class UiccTransportLevel(COMPR_TLV_IE, tag = 0xBC): + _test_de_encode = [ + ( 'bc03028000', {'port_number': 32768, 'protocol_type': 'tcp_uicc_client_remote'} ), + ] _construct = Struct('protocol_type'/Enum(Int8ub, udp_uicc_client_remote=1, tcp_uicc_client_remote=2, tcp_uicc_server=3, udp_uicc_client_local=4, tcp_uicc_client_local=5, direct_channel=6), @@ -557,6 +569,9 @@ # TS 102 223 Section 8.70 class NetworkAccessName(COMPR_TLV_IE, tag=0xC7): + _test_de_encode = [ + ( 'c704036e6161', '036e6161' ), + ] _construct = HexAdapter(GreedyBytes) # TS 102 223 Section 8.72 diff --git a/pySim/global_platform/http.py b/pySim/global_platform/http.py new file mode 100644 index 0000000..f0e98aa --- /dev/null +++ b/pySim/global_platform/http.py @@ -0,0 +1,93 @@ +"""GlobalPlatform Remote Application Management over HTTP Card Specification v2.3 - Amendment B. +Also known as SCP81 for SIM/USIM/UICC/eUICC/eSIM OTA. +""" + +# (C) 2024 by Harald Welte <laforge(a)osmocom.org> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +from construct import Struct, Int8ub, Int16ub, Bytes, GreedyBytes, GreedyString, BytesInteger +from construct import this, len_, Rebuild, Const +from construct import Optional as COptional + +from pySim.tlv import BER_TLV_IE +from pySim import cat + + +# Table 3-3 + Section 3.8.1 +class RasConnectionParams(BER_TLV_IE, tag=0x84, nested=cat.OpenChannel.nested_collection_cls.possible_nested): + pass + +# Table 3-3 + Section 3.8.2 +class SecurityParams(BER_TLV_IE, tag=0x85): + _test_de_encode = [ + ( '850804deadbeef020040', {'kid': 64,'kvn': 0, 'psk_id': b'\xde\xad\xbe\xef', 'sha_type': None} ) + ] + _construct = Struct('_psk_id_len'/Rebuild(Int8ub, len_(this.psk_id)), 'psk_id'/Bytes(this._psk_id_len), + '_kid_kvn_len'/Const(2, Int8ub), 'kvn'/Int8ub, 'kid'/Int8ub, + 'sha_type'/COptional(Int8ub)) + +# Table 3-3 + ? +class ExtendedSecurityParams(BER_TLV_IE, tag=0xA5): + _construct = GreedyBytes + +# Table 3-3 + Section 3.8.3 +class SessionRetryPolicyParams(BER_TLV_IE, tag=0x86): + _construct = Struct('retry_counter'/Int16ub, + 'retry_waiting_delay'/BytesInteger(5), + 'retry_report_failure'/COptional(GreedyBytes)) + +# Table 3-3 + Section 3.8.4 +class AdminHostParam(BER_TLV_IE, tag=0x8A): + _test_de_encode = [ + ( '8a0a61646d696e2e686f7374', 'admin.host' ), + ] + _construct = GreedyString('utf-8') + +# Table 3-3 + Section 3.8.5 +class AgentIdParam(BER_TLV_IE, tag=0x8B): + _construct = GreedyString('utf-8') + +# Table 3-3 + Section 3.8.6 +class AdminUriParam(BER_TLV_IE, tag=0x8C): + _test_de_encode = [ + ( '8c1668747470733a2f2f61646d696e2e686f73742f757269', 'https://admin.host/uri' ), + ] + _construct = GreedyString('utf-8') + +# Table 3-3 +class HttpPostParams(BER_TLV_IE, tag=0x89, nested=[AdminHostParam, AgentIdParam, AdminUriParam]): + pass + +# Table 3-3 +class AdmSessionParams(BER_TLV_IE, tag=0x83, nested=[RasConnectionParams, SecurityParams, + ExtendedSecurityParams, SessionRetryPolicyParams, + HttpPostParams]): + pass + +# Table 3-3 + Section 3.11.4 +class RasFqdn(BER_TLV_IE, tag=0xD6): + _construct = GreedyBytes # FIXME: DNS String + +# Table 3-3 + Section 3.11.7 +class DnsConnectionParams(BER_TLV_IE, tag=0xFA, nested=cat.OpenChannel.nested_collection_cls.possible_nested): + pass + +# Table 3-3 +class DnsResolutionParams(BER_TLV_IE, tag=0xB3, nested=[RasFqdn, DnsConnectionParams]): + pass + +# Table 3-3 +class AdmSessTriggerParams(BER_TLV_IE, tag=0x81, nested=[AdmSessionParams, DnsResolutionParams]): + pass diff --git a/tests/test_tlvs.py b/tests/test_tlvs.py index a0dd107..429b966 100755 --- a/tests/test_tlvs.py +++ b/tests/test_tlvs.py @@ -31,6 +31,7 @@ import pySim.gsm_r import pySim.cdma_ruim import pySim.global_platform +import pySim.global_platform.http if 'unittest.util' in __import__('sys').modules: # Show full diff in self.assertEqual. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37486?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ia7d7bd6df41bdf1249011bad9a9a38b7669edc54 Gerrit-Change-Number: 37486 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in pysim[master]: pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing
by laforge 12 Jul '24

12 Jul '24
Attention is currently required from: dexter, osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37456?usp=email ) Change subject: pySim-smpp2sim.py: Simulate SMSC+CN+RAN+UE for OTA testing ...................................................................... Patch Set 3: (1 comment) Patchset: PS3: > the pip failure about the mismatching name seems to be not present on later pip versions. […] strange enough, I can manually install the package using "pip install git+https://github.com/jookies/smpp.twisted" on debian11 and debian12 here. @osmith@sysmocom.de any ideas why our build host would behave differently? -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37456?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ie5bae9d823bca6f6c658bd455303f63bace2258c Gerrit-Change-Number: 37456 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 12 Jul 2024 17:06:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: MT call: Move Tx INVITE to helper function
by pespin 12 Jul '24

12 Jul '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37480?usp=email ) Change subject: asterisk: IMS: MT call: Move Tx INVITE to helper function ...................................................................... asterisk: IMS: MT call: Move Tx INVITE to helper function This helper function will be used by another function expecting an INVITE reject in a follow-up patch. Change-Id: If9657e88304fd7b3558737fdc807bae59cddc8a2 --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 45 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/80/37480/1 diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index 6a1328d..d4c9da2 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -1120,32 +1120,21 @@ return via; } -/* IMS Core starts a call towards the peer: 3GPP TS 24.229 5.1.3.1 */ -function f_IMS_mt_call_setup() runs on IMS_ConnHdlr +private function f_IMS_mt_call_tx_invite(Via via) runs on IMS_ConnHdlr { var template (value) PDU_SIP_Request req; - var template (present) PDU_SIP_Response exp; var template (present) From from_addr_exp; var template (present) To to_addr_exp; - var Via via; - var template (omit) Require require := omit; var template (omit) Min_SE min_SE := omit; var template (omit) Session_expires session_expires := omit; var template (omit) Supported supported := omit; var OptionTag_List supported_list := {}; var charstring tx_sdp; - var default d_trying, d_ringing; - var Contact calling_contact, called_contact; - var integer sip_seq_nr; + var Contact calling_contact; /* RFC 3261 8.1.1.3 From */ - g_pars.subscr.cp.from_addr := valueof(ts_From(g_pars.subscr.cp.calling.addr, g_pars.subscr.cp.calling.params)); - g_pars.subscr.cp.from_addr.fromParams := f_sip_param_set(g_pars.subscr.cp.from_addr.fromParams, "tag", f_sip_rand_tag()); - g_pars.subscr.cp.to_addr := valueof(ts_To(g_pars.subscr.cp.called.addr, g_pars.subscr.cp.called.params)); from_addr_exp := tr_From(tr_Addr_Union_from_val(g_pars.subscr.cp.from_addr.addressField), *); to_addr_exp := tr_To(tr_Addr_Union_from_val(g_pars.subscr.cp.to_addr.addressField), *); - via := f_IMS_gen_new_Via(); - calling_contact := valueof(ts_Contact({ ts_ContactAddress(g_pars.subscr.cp.calling.addr, omit) })); @@ -1172,13 +1161,12 @@ supported := ts_Supported(supported_list); } - sip_seq_nr := g_pars.subscr.cp.sip_seq_nr; req := ts_SIP_INVITE(g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, via, calling_contact, - sip_seq_nr, + g_pars.subscr.cp.sip_seq_nr, accept := ts_Accept({ ts_AcceptBody("application/sdp"), ts_AcceptBody("application/3gpp-ims+xml") }), min_SE := min_SE, session_expires := session_expires, @@ -1186,6 +1174,36 @@ body := tx_sdp); SIP.send(req); +} + +/* IMS Core starts a call towards the peer: 3GPP TS 24.229 5.1.3.1 */ +function f_IMS_mt_call_setup() runs on IMS_ConnHdlr +{ + var template (value) PDU_SIP_Request req; + var template (present) PDU_SIP_Response exp; + var template (present) From from_addr_exp; + var template (present) To to_addr_exp; + var Via via; + var template (omit) Require require := omit; + var charstring tx_sdp; + var default d_trying, d_ringing; + var Contact calling_contact, called_contact; + var integer sip_seq_nr; + + /* RFC 3261 8.1.1.3 From */ + g_pars.subscr.cp.from_addr := valueof(ts_From(g_pars.subscr.cp.calling.addr, g_pars.subscr.cp.calling.params)); + g_pars.subscr.cp.from_addr.fromParams := f_sip_param_set(g_pars.subscr.cp.from_addr.fromParams, "tag", f_sip_rand_tag()); + g_pars.subscr.cp.to_addr := valueof(ts_To(g_pars.subscr.cp.called.addr, g_pars.subscr.cp.called.params)); + from_addr_exp := tr_From(tr_Addr_Union_from_val(g_pars.subscr.cp.from_addr.addressField), *); + to_addr_exp := tr_To(tr_Addr_Union_from_val(g_pars.subscr.cp.to_addr.addressField), *); + calling_contact := valueof(ts_Contact({ + ts_ContactAddress(g_pars.subscr.cp.calling.addr, omit) + })); + via := f_IMS_gen_new_Via(); + + f_IMS_mt_call_tx_invite(via); + + sip_seq_nr := g_pars.subscr.cp.sip_seq_nr; /* Conditionally match and accept 100 Trying. */ exp := tr_SIP_Response_Trying(g_pars.subscr.cp.sip_call_id, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37480?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: If9657e88304fd7b3558737fdc807bae59cddc8a2 Gerrit-Change-Number: 37480 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.