Sipper 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/sipper/README.rb +26 -0
- data/sipper/b2bua_controller.rb +163 -0
- data/sipper/b2bua_session_mixin.rb +24 -0
- data/sipper/base_controller.rb +425 -0
- data/sipper/bin/common.rb +42 -0
- data/sipper/bin/generate.rb +70 -0
- data/sipper/bin/project.rb +44 -0
- data/sipper/bin/run.rb +85 -0
- data/sipper/bin/run_smoke.rb +8 -0
- data/sipper/config/log4r.xml +71 -0
- data/sipper/controller_class_loader.rb +29 -0
- data/sipper/controller_selector.rb +119 -0
- data/sipper/controllers/invite_controller.rb +30 -0
- data/sipper/controllers/order.yaml +3 -0
- data/sipper/custom_message.rb +4 -0
- data/sipper/detached_session.rb +11 -0
- data/sipper/docs/manual.txt +1621 -0
- data/sipper/generators/README +12 -0
- data/sipper/generators/gen_controller.rb +228 -0
- data/sipper/generators/gen_project.rb +45 -0
- data/sipper/generators/gen_test.rb +72 -0
- data/sipper/generators/project_template_dir/Rakefile +56 -0
- data/sipper/generators/project_template_dir/config/sipper.cfg +31 -0
- data/sipper/generators/project_template_dir/controllers/README.txt +2 -0
- data/sipper/generators/project_template_dir/dot_sipper.proj +2 -0
- data/sipper/generators/project_template_dir/logs/README.txt +2 -0
- data/sipper/generators/project_template_dir/tests/README.txt +2 -0
- data/sipper/lib/smc/statemap.rb +194 -0
- data/sipper/logs/dialog_info_store +0 -0
- data/sipper/logs/r.cmd +6 -0
- data/sipper/logs/r.sh +6 -0
- data/sipper/media/sipper_media_client.rb +268 -0
- data/sipper/media/sipper_media_event.rb +43 -0
- data/sipper/media/sipper_media_manager.rb +145 -0
- data/sipper/media/sipper_media_proxy.rb +60 -0
- data/sipper/media/sipper_offer_answer.rb +285 -0
- data/sipper/message.rb +512 -0
- data/sipper/modified_pattern_formatter.rb +119 -0
- data/sipper/proxy_controller.rb +143 -0
- data/sipper/registration.rb +52 -0
- data/sipper/request.rb +109 -0
- data/sipper/response.rb +123 -0
- data/sipper/ruby_ext/module.rb +27 -0
- data/sipper/ruby_ext/mutable_class.rb +17 -0
- data/sipper/ruby_ext/object.rb +38 -0
- data/sipper/ruby_ext/pqueue.rb +190 -0
- data/sipper/ruby_ext/snapshot.rb +201 -0
- data/sipper/ruby_ext/string.rb +18 -0
- data/sipper/ruby_ext/time.rb +9 -0
- data/sipper/run/run_sipper1.rb +28 -0
- data/sipper/run/run_sipper2.rb +56 -0
- data/sipper/sdp/sdp.rb +257 -0
- data/sipper/sdp/sdp_generator.rb +131 -0
- data/sipper/sdp/sdp_parser.rb +136 -0
- data/sipper/session.rb +1952 -0
- data/sipper/session_manager.rb +170 -0
- data/sipper/session_recorder.rb +190 -0
- data/sipper/session_state/DialogState.sm +54 -0
- data/sipper/session_state/DialogState_sm.rb +337 -0
- data/sipper/session_state/dialog_routes.rb +141 -0
- data/sipper/sip_headers/header.rb +632 -0
- data/sipper/sip_headers/sipuri.rb +352 -0
- data/sipper/sip_logger.rb +65 -0
- data/sipper/sip_message_router.rb +231 -0
- data/sipper/sip_test_driver_controller.rb +10 -0
- data/sipper/sipper.rb +329 -0
- data/sipper/sipper_assertions.rb +21 -0
- data/sipper/sipper_configurator.rb +376 -0
- data/sipper/sipper_http/sipper_http_request_dispatcher.rb +71 -0
- data/sipper/sipper_http/sipper_http_response.rb +25 -0
- data/sipper/stray_message_manager.rb +40 -0
- data/sipper/test_completion_signaling_helper.rb +77 -0
- data/sipper/transaction/Ict.sm +59 -0
- data/sipper/transaction/Ict_sm.rb +430 -0
- data/sipper/transaction/Ist.sm +74 -0
- data/sipper/transaction/Ist_sm.rb +460 -0
- data/sipper/transaction/Nict.sm +51 -0
- data/sipper/transaction/Nict_sm.rb +325 -0
- data/sipper/transaction/Nist.sm +59 -0
- data/sipper/transaction/Nist_sm.rb +356 -0
- data/sipper/transaction/invite_client_transaction.rb +274 -0
- data/sipper/transaction/invite_server_transaction.rb +319 -0
- data/sipper/transaction/non_invite_client_transaction.rb +230 -0
- data/sipper/transaction/non_invite_server_transaction.rb +263 -0
- data/sipper/transaction/state_machine_wrapper.rb +58 -0
- data/sipper/transaction/transaction.rb +212 -0
- data/sipper/transport/base_transport.rb +84 -0
- data/sipper/transport/rel_unrel.rb +19 -0
- data/sipper/transport/transport_and_route_resolver.rb +67 -0
- data/sipper/transport/udp_transport.rb +156 -0
- data/sipper/transport_manager.rb +33 -0
- data/sipper/udp_session.rb +17 -0
- data/sipper/util/command_element.rb +62 -0
- data/sipper/util/compact_converter.rb +50 -0
- data/sipper/util/counter.rb +26 -0
- data/sipper/util/digest/digest_authorizer.rb +204 -0
- data/sipper/util/expectation_parser.rb +164 -0
- data/sipper/util/locator.rb +31 -0
- data/sipper/util/message_fill.rb +58 -0
- data/sipper/util/persistence/ps_sipper_map.rb +63 -0
- data/sipper/util/persistence/sipper_map.rb +41 -0
- data/sipper/util/sipper_util.rb +305 -0
- data/sipper/util/timer/sip_timer_helper.rb +26 -0
- data/sipper/util/timer/timer_manager.rb +80 -0
- data/sipper/util/timer/timer_task.rb +56 -0
- data/sipper/util/validations.rb +44 -0
- data/sipper/version.rb +10 -0
- data/sipper_test/_test_media_uas.rb +79 -0
- data/sipper_test/base_test_case.rb +31 -0
- data/sipper_test/c_134.txt +7 -0
- data/sipper_test/driven_sip_test_case.rb +96 -0
- data/sipper_test/gold.txt +10 -0
- data/sipper_test/gold_res.txt +8 -0
- data/sipper_test/gold_sub.txt +9 -0
- data/sipper_test/hello_sipper.au +0 -0
- data/sipper_test/in_sipper.au +0 -0
- data/sipper_test/nonrr_proxy.rb +17 -0
- data/sipper_test/order_tests.yaml +4 -0
- data/sipper_test/rake_res.txt +399 -0
- data/sipper_test/rr_proxy.rb +17 -0
- data/sipper_test/run_test.cmd +94 -0
- data/sipper_test/sip_test_case.rb +104 -0
- data/sipper_test/test2xx_retransmission.rb +80 -0
- data/sipper_test/test2xx_retransmission_with_limit.rb +81 -0
- data/sipper_test/test2xx_retransmission_with_nist.rb +91 -0
- data/sipper_test/test2xx_retransmission_with_txns.rb +94 -0
- data/sipper_test/test_address_header.rb +66 -0
- data/sipper_test/test_b2bua1.rb +130 -0
- data/sipper_test/test_b2bua2.rb +120 -0
- data/sipper_test/test_b2bua3.rb +160 -0
- data/sipper_test/test_b2bua4.rb +130 -0
- data/sipper_test/test_base_controller.rb +110 -0
- data/sipper_test/test_base_transport.rb +37 -0
- data/sipper_test/test_cancel.rb +21 -0
- data/sipper_test/test_cancel_after2xx.rb +81 -0
- data/sipper_test/test_cancel_retransmission.rb +105 -0
- data/sipper_test/test_cancel_with481.rb +83 -0
- data/sipper_test/test_cancel_with487.rb +70 -0
- data/sipper_test/test_cancel_with_ist_without_nist.rb +99 -0
- data/sipper_test/test_cancel_with_nist.rb +84 -0
- data/sipper_test/test_cancel_without487.rb +77 -0
- data/sipper_test/test_command_element.rb +38 -0
- data/sipper_test/test_compact_converter.rb +33 -0
- data/sipper_test/test_controller_class_loader.rb +37 -0
- data/sipper_test/test_controller_selector.rb +53 -0
- data/sipper_test/test_controller_using_compact_headers.rb +74 -0
- data/sipper_test/test_controller_using_header_order.rb +85 -0
- data/sipper_test/test_controller_using_ict.rb +64 -0
- data/sipper_test/test_controller_using_ict_with_non_success.rb +72 -0
- data/sipper_test/test_controller_using_ict_with_tcbh.rb +24 -0
- data/sipper_test/test_controller_using_ict_with_tcbh_no_action.rb +24 -0
- data/sipper_test/test_controller_using_ist.rb +70 -0
- data/sipper_test/test_controller_using_ist_with_tcbh.rb +24 -0
- data/sipper_test/test_controller_using_nict.rb +115 -0
- data/sipper_test/test_controller_using_nict_with_tcbh.rb +24 -0
- data/sipper_test/test_controller_using_nist.rb +63 -0
- data/sipper_test/test_controller_using_pre_existing_rs0.rb +73 -0
- data/sipper_test/test_controller_using_pre_existing_rs1.rb +75 -0
- data/sipper_test/test_controller_using_pre_existing_rs2.rb +71 -0
- data/sipper_test/test_controller_using_route_set.rb +86 -0
- data/sipper_test/test_controller_with_sdp.rb +80 -0
- data/sipper_test/test_controllers/cancel/order.yaml +2 -0
- data/sipper_test/test_controllers/cancel/uac_cancel_controller.rb +35 -0
- data/sipper_test/test_controllers/cancel/uas_cancel_controller.rb +25 -0
- data/sipper_test/test_controllers/class_loading/ordered/first_ordered_controller.rb +5 -0
- data/sipper_test/test_controllers/class_loading/ordered/order.yaml +3 -0
- data/sipper_test/test_controllers/class_loading/ordered/recond_ordered_controller.rb +6 -0
- data/sipper_test/test_controllers/class_loading/ordered/second_ordered_controller.rb +6 -0
- data/sipper_test/test_controllers/class_loading/unordered/first_unordered_controller.rb +7 -0
- data/sipper_test/test_controllers/class_loading/unordered/second_unordered_controller.rb +6 -0
- data/sipper_test/test_controllers/ctrl_trhandler/lib/transport_filters/my_transport_handler.rb +22 -0
- data/sipper_test/test_controllers/ctrl_trhandler/uac_tr_handler_controller.rb +27 -0
- data/sipper_test/test_controllers/ctrl_trhandler/uas_tr_handler_controller.rb +21 -0
- data/sipper_test/test_controllers/ete/order.yaml +1 -0
- data/sipper_test/test_controllers/ete/uac_controller.rb +39 -0
- data/sipper_test/test_controllers/ete/uas_controller.rb +34 -0
- data/sipper_test/test_controllers/extensions/extension_uac_controller.rb +24 -0
- data/sipper_test/test_controllers/extensions/extension_uas_controller.rb +35 -0
- data/sipper_test/test_controllers/extensions/lib/sipper_extensions/my_from_extension.rb +16 -0
- data/sipper_test/test_controllers/ict_tcbh/lib/transaction_handlers/app_ict_handler.rb +23 -0
- data/sipper_test/test_controllers/ict_tcbh/uac_ict_tcbh_controller.rb +27 -0
- data/sipper_test/test_controllers/ict_tcbh/uac_ict_tcbh_no_action_controller.rb +28 -0
- data/sipper_test/test_controllers/ict_tcbh/uas_ict_tcbh_controller.rb +29 -0
- data/sipper_test/test_controllers/ict_tcbh/uas_ict_tcbh_no_action_controller.rb +31 -0
- data/sipper_test/test_controllers/ist_tcbh/lib/app_ist_handler.rb +13 -0
- data/sipper_test/test_controllers/ist_tcbh/uac_ist_tcbh_controller.rb +22 -0
- data/sipper_test/test_controllers/ist_tcbh/uas_ist_tcbh_controller.rb +31 -0
- data/sipper_test/test_controllers/multi_trhandlers/lib/transport_filters/in_order.yaml +2 -0
- data/sipper_test/test_controllers/multi_trhandlers/lib/transport_filters/my_transport_handler1.rb +21 -0
- data/sipper_test/test_controllers/multi_trhandlers/lib/transport_filters/my_transport_handler2.rb +21 -0
- data/sipper_test/test_controllers/multi_trhandlers/lib/transport_filters/out_order.yaml +2 -0
- data/sipper_test/test_controllers/multi_trhandlers/uac_multi_tr_handler_controller.rb +27 -0
- data/sipper_test/test_controllers/multi_trhandlers/uas_multi_tr_handler_controller.rb +29 -0
- data/sipper_test/test_controllers/multiple/lib/blank_test.rb +2 -0
- data/sipper_test/test_controllers/multiple/uac_info_controller.rb +21 -0
- data/sipper_test/test_controllers/multiple/uac_msg_controller.rb +20 -0
- data/sipper_test/test_controllers/multiple/uas_info_controller.rb +15 -0
- data/sipper_test/test_controllers/multiple/uas_msg_controller.rb +14 -0
- data/sipper_test/test_controllers/nict_tcbh/lib/transaction_handlers/app_nict_handler.rb +13 -0
- data/sipper_test/test_controllers/nict_tcbh/uac_nict_tcbh_controller.rb +26 -0
- data/sipper_test/test_controllers/nict_tcbh/uas_nict_tcbh_controller.rb +20 -0
- data/sipper_test/test_controllers/state_machine_based/lib/CreditControl.sm +43 -0
- data/sipper_test/test_controllers/state_machine_based/lib/CreditControl_sm.rb +194 -0
- data/sipper_test/test_controllers/state_machine_based/order.yaml +1 -0
- data/sipper_test/test_controllers/state_machine_based/uac_message_controller.rb +34 -0
- data/sipper_test/test_controllers/state_machine_based/uas_message_controller.rb +44 -0
- data/sipper_test/test_controllers/stray_message/lib/sipper_extensions/my_stray_handler.rb +9 -0
- data/sipper_test/test_controllers/stray_message/stray_uac_controller.rb +24 -0
- data/sipper_test/test_controllers/stray_message/stray_uas_controller.rb +31 -0
- data/sipper_test/test_controllers/string/order.yaml +1 -0
- data/sipper_test/test_controllers/string/uac_controller.rb +29 -0
- data/sipper_test/test_controllers/string/uas_controller.rb +22 -0
- data/sipper_test/test_controllers/test_controller.rb +24 -0
- data/sipper_test/test_detached_session1.rb +78 -0
- data/sipper_test/test_dialog_routes.rb +139 -0
- data/sipper_test/test_digest_challenge1.rb +89 -0
- data/sipper_test/test_digest_challenge2.rb +90 -0
- data/sipper_test/test_dynamic_parse.rb +249 -0
- data/sipper_test/test_empty_sdp.rb +89 -0
- data/sipper_test/test_ete.rb +37 -0
- data/sipper_test/test_expectation_parser.rb +76 -0
- data/sipper_test/test_extensions.rb +28 -0
- data/sipper_test/test_freeze.rb +81 -0
- data/sipper_test/test_generated.rb +90 -0
- data/sipper_test/test_header_parameters.rb +75 -0
- data/sipper_test/test_header_parse.rb +141 -0
- data/sipper_test/test_http_client1.rb +84 -0
- data/sipper_test/test_http_client2.rb +90 -0
- data/sipper_test/test_ict_with_timeout.rb +62 -0
- data/sipper_test/test_in_dialog_request.rb +61 -0
- data/sipper_test/test_inline_controller.rb +67 -0
- data/sipper_test/test_invite_client_transaction.rb +272 -0
- data/sipper_test/test_invite_replace.rb +147 -0
- data/sipper_test/test_invite_retransmission.rb +90 -0
- data/sipper_test/test_invite_server_transaction.rb +208 -0
- data/sipper_test/test_lower_cseq.rb +79 -0
- data/sipper_test/test_media.rb +52 -0
- data/sipper_test/test_message.rb +392 -0
- data/sipper_test/test_method_specific_response_handling.rb +81 -0
- data/sipper_test/test_multi_homed1.rb +127 -0
- data/sipper_test/test_multi_homed2.rb +109 -0
- data/sipper_test/test_multi_homed_duplicate.rb +87 -0
- data/sipper_test/test_multi_homed_with_detached.rb +88 -0
- data/sipper_test/test_multiple.rb +49 -0
- data/sipper_test/test_multiple_contacts.rb +89 -0
- data/sipper_test/test_non2xx_retransmission_with_ist.rb +87 -0
- data/sipper_test/test_non_invite_client_transaction.rb +210 -0
- data/sipper_test/test_non_invite_retransmission.rb +91 -0
- data/sipper_test/test_non_invite_server_transaction.rb +202 -0
- data/sipper_test/test_offer_answer_prack.rb +103 -0
- data/sipper_test/test_pickup.rb +258 -0
- data/sipper_test/test_prack.rb +105 -0
- data/sipper_test/test_prack_store_and_dispatch.rb +101 -0
- data/sipper_test/test_prack_timer.rb +105 -0
- data/sipper_test/test_ps_sipper_map.rb +56 -0
- data/sipper_test/test_re_invite_uas_ongoing_ict.rb +81 -0
- data/sipper_test/test_re_invite_uas_ongoing_ist.rb +84 -0
- data/sipper_test/test_re_invite_with_ongoing_ict.rb +101 -0
- data/sipper_test/test_re_invite_with_ongoing_ist.rb +89 -0
- data/sipper_test/test_recorder_swap.rb +157 -0
- data/sipper_test/test_refer.rb +121 -0
- data/sipper_test/test_registeration_clearing.rb +97 -0
- data/sipper_test/test_registrar.rb +109 -0
- data/sipper_test/test_registration_controller.rb +73 -0
- data/sipper_test/test_registration_timeout.rb +90 -0
- data/sipper_test/test_remote_controller.rb +39 -0
- data/sipper_test/test_remote_target_update_on2xx.rb +140 -0
- data/sipper_test/test_request.rb +106 -0
- data/sipper_test/test_response.rb +40 -0
- data/sipper_test/test_response_without_to_tag.rb +92 -0
- data/sipper_test/test_rport.rb +88 -0
- data/sipper_test/test_sdp.rb +91 -0
- data/sipper_test/test_sdp_parser.rb +145 -0
- data/sipper_test/test_session.rb +276 -0
- data/sipper_test/test_session_callback_handler.rb +68 -0
- data/sipper_test/test_session_lifetime.rb +66 -0
- data/sipper_test/test_session_manager.rb +141 -0
- data/sipper_test/test_session_recorder.rb +145 -0
- data/sipper_test/test_session_state_user_defined.rb +84 -0
- data/sipper_test/test_session_states.rb +91 -0
- data/sipper_test/test_simple_dialog_state.rb +86 -0
- data/sipper_test/test_simple_re_invite.rb +86 -0
- data/sipper_test/test_sip_uri.rb +234 -0
- data/sipper_test/test_sipper_util.rb +45 -0
- data/sipper_test/test_smc_controller.rb +17 -0
- data/sipper_test/test_smoke.rb +80 -0
- data/sipper_test/test_stray.rb +28 -0
- data/sipper_test/test_stray_inline.rb +89 -0
- data/sipper_test/test_stray_res_acked.rb +103 -0
- data/sipper_test/test_stray_respond.rb +104 -0
- data/sipper_test/test_stray_retry.rb +92 -0
- data/sipper_test/test_stray_retry_failure.rb +93 -0
- data/sipper_test/test_stray_retry_initial.rb +100 -0
- data/sipper_test/test_strict_router_with_angled.rb +84 -0
- data/sipper_test/test_string_record.rb +31 -0
- data/sipper_test/test_subscribe_notify.rb +141 -0
- data/sipper_test/test_subscribe_notify_client_timeout.rb +158 -0
- data/sipper_test/test_subscribe_notify_dialog.rb +146 -0
- data/sipper_test/test_subscribe_notify_expires.rb +155 -0
- data/sipper_test/test_subscribe_notify_multiple_subscription.rb +157 -0
- data/sipper_test/test_subscribe_notify_server_timeout.rb +144 -0
- data/sipper_test/test_subsequent_unsent.rb +88 -0
- data/sipper_test/test_target_refresh_proxy_detached.rb +128 -0
- data/sipper_test/test_target_refresh_proxy_udp.rb +130 -0
- data/sipper_test/test_target_refresh_rr_proxy_udp.rb +133 -0
- data/sipper_test/test_target_refresh_with_new_port.rb +158 -0
- data/sipper_test/test_target_refresh_with_proxy1.rb +113 -0
- data/sipper_test/test_target_refresh_with_rr_update_proxy.rb +145 -0
- data/sipper_test/test_target_refresh_with_update_proxy.rb +144 -0
- data/sipper_test/test_target_refresh_with_update_proxy2.rb +139 -0
- data/sipper_test/test_timer_manager.rb +71 -0
- data/sipper_test/test_timer_task.rb +60 -0
- data/sipper_test/test_transport_handler.rb +19 -0
- data/sipper_test/test_transport_multi_handler.rb +18 -0
- data/sipper_test/test_udp_transport.rb +119 -0
- data/sipper_test/test_unparsed.rb +70 -0
- data/sipper_test/test_validations.rb +69 -0
- data/sipper_test/test_with_rr_proxy.rb +111 -0
- data/sipper_test/testmediacontroller.rb +71 -0
- data/sipper_test/tracing.rb +23 -0
- data/sipper_test/transaction_test_helper.rb +176 -0
- data/sipper_test/transport_filters.rb +26 -0
- data/sipper_test/ts_sipper.rb +91 -0
- data/sipper_test/ts_smoke.rb +3 -0
- data/sipper_test/tt.cmd +20 -0
- metadata +455 -0
@@ -0,0 +1,274 @@
|
|
1
|
+
require 'transaction/Ict_sm'
|
2
|
+
require 'transaction/transaction'
|
3
|
+
require 'transaction/state_machine_wrapper'
|
4
|
+
require 'util/timer/sip_timer_helper'
|
5
|
+
require 'sip_logger'
|
6
|
+
require 'util/locator'
|
7
|
+
require 'ruby_ext/object'
|
8
|
+
require 'request'
|
9
|
+
require 'util/sipper_util'
|
10
|
+
|
11
|
+
module SIP
|
12
|
+
module Transaction
|
13
|
+
class InviteClientTransaction < SIP::Transaction::BaseTransaction
|
14
|
+
include SipLogger
|
15
|
+
|
16
|
+
# to be used for accessing msg for printing/recording
|
17
|
+
attr_accessor :msg_sent, :cancel_ctxn
|
18
|
+
|
19
|
+
# The transport to use, transport flags, remote ip and port
|
20
|
+
# the block is to be used to override the T1, T2, even TimerA etc. timer value.
|
21
|
+
# The block can for example have { self.t1 = 200; self.ta=100 } to override the
|
22
|
+
# T1, A on a transaction by transcation basis, otherwise the default is
|
23
|
+
# taken from SipperConfigurator or SIP::Transaction::BaseTransaction::T1
|
24
|
+
# in that order.
|
25
|
+
# Usage: TU creates transaction and starts invoking "Invocation Action"
|
26
|
+
# methods. Also for responses received, checks whether to consume them
|
27
|
+
# or not based on consume? method return value.
|
28
|
+
# There are four call backs into TU from ICT and they are notification on
|
29
|
+
# transport error and transaction timeout.
|
30
|
+
# There are 4 TU callbacks.
|
31
|
+
# (a) transaction_transport_err() gets called should ICT get a transport failure
|
32
|
+
# (b) transaction_timeout() gets called on timeout of transaction
|
33
|
+
# (c) transaction_transaction_cleanup() gets called on transaction termination.
|
34
|
+
# (d) transaction_wrong_state() if the transaction transition is tried in a wrong state
|
35
|
+
# i.e a message is either received or being tried to send out in a state where it is
|
36
|
+
# illegal to do so.
|
37
|
+
def initialize(tu, branch_id, txn_handler, transport, tp_flags, &block)
|
38
|
+
@transaction_name = :Ict # need to have this name defined for every transaction
|
39
|
+
@tu = tu
|
40
|
+
@branch_id = branch_id
|
41
|
+
@transport = transport
|
42
|
+
@txn_handler = txn_handler
|
43
|
+
@tp_flags = tp_flags
|
44
|
+
self.td = 0 if @transport.reliable? # one line later it can be overidden by arguments.
|
45
|
+
super(&block) # override timers
|
46
|
+
#@sm = Ict_sm.new(self)
|
47
|
+
SIP::Transaction::StateMachineWrapper.bootstrap_machine(self, Ict_sm)
|
48
|
+
@sm = SIP::Transaction::StateMachineWrapper.new(self, @txn_handler, Ict_sm)
|
49
|
+
logd("Created the Invite Client Transcation with #{@transport}")
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def cancel_ctxn=(ctxn)
|
54
|
+
@cancel_ctxn = ctxn
|
55
|
+
@ok_to_run_timerY = true
|
56
|
+
@sm.cancel_sent
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
# Need to handle this after the transition has happened and not in the
|
61
|
+
# _send_to_transport exception handler because state transition from
|
62
|
+
# within a transition is not possible in smc
|
63
|
+
def _check_transport_err
|
64
|
+
@sm.transport_err if @transport_err
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
#--- SM Invocation Actions <start>---------
|
69
|
+
|
70
|
+
#------------------
|
71
|
+
# The two methods txn_send and txn_received are two general purpose methods
|
72
|
+
# that will be called by the TU as against the transcation type specific
|
73
|
+
# methods defined on each type of transaction.
|
74
|
+
#
|
75
|
+
# ICT sends only INVITEs from TU
|
76
|
+
def txn_send(msg)
|
77
|
+
@message = msg # the msg is accessed from transaction
|
78
|
+
raise "ICT can only send INVITEs" unless (msg.is_request? && msg.method=="INVITE")
|
79
|
+
self._send_invite(msg)
|
80
|
+
end
|
81
|
+
|
82
|
+
# The ICT receives responses (provisional, success final, non-succes final)
|
83
|
+
def txn_received(msg)
|
84
|
+
@message = msg
|
85
|
+
raise "ICT can only receive responses" unless msg.is_response?
|
86
|
+
msg.set_request(@invite)
|
87
|
+
case msg.code
|
88
|
+
when 100..199
|
89
|
+
_provisional_received
|
90
|
+
when 200..299
|
91
|
+
_success_final_received(msg)
|
92
|
+
when 300..699
|
93
|
+
_non_success_final_received(msg)
|
94
|
+
else
|
95
|
+
raise "ICT cannot deal with response #{msg}"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
#------------------
|
99
|
+
|
100
|
+
# These method is to be invoked by the TU to send the invite
|
101
|
+
# The state machine drives the whole interaction by calling the
|
102
|
+
# callbacks.
|
103
|
+
|
104
|
+
def _send_invite(req)
|
105
|
+
@invite = req
|
106
|
+
@ok_to_run_timerA = true unless @transport.reliable?
|
107
|
+
@ok_to_run_timerB = true
|
108
|
+
@sm.invite
|
109
|
+
_check_transport_err
|
110
|
+
rescue Statemap::TransitionUndefinedException => e
|
111
|
+
loge "Cannot send invite in #{self.state} state for #{self}"
|
112
|
+
@tu.transaction_wrong_state(self) if @tu
|
113
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
def _provisional_received
|
118
|
+
@sm.provisional
|
119
|
+
_check_transport_err
|
120
|
+
rescue Statemap::TransitionUndefinedException => e
|
121
|
+
loge "Received a provisional in #{self.state} state for #{self}"
|
122
|
+
@tu.transaction_wrong_state(self) if @tu
|
123
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
# invoked by TU for a 300-699 class response
|
128
|
+
def _non_success_final_received(res)
|
129
|
+
@response = res
|
130
|
+
@sm.non_success_final
|
131
|
+
_check_transport_err
|
132
|
+
rescue Statemap::TransitionUndefinedException => e
|
133
|
+
loge "Received an non 2xx response in #{self.state} state for #{self}"
|
134
|
+
@tu.transaction_wrong_state(self) if @tu
|
135
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
136
|
+
end
|
137
|
+
|
138
|
+
def _success_final_received(res)
|
139
|
+
@response = res
|
140
|
+
@sm.success_final
|
141
|
+
_check_transport_err
|
142
|
+
rescue Statemap::TransitionUndefinedException => e
|
143
|
+
loge "Received a 2xx response in #{self.state} state for #{self}"
|
144
|
+
@tu.transaction_wrong_state(self) if @tu
|
145
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
146
|
+
end
|
147
|
+
|
148
|
+
#--- SM Invocation Actions <end>---------
|
149
|
+
|
150
|
+
|
151
|
+
#------ Timer callback------
|
152
|
+
def on_timer_expiration(timer_task)
|
153
|
+
super # check for invalidation
|
154
|
+
case timer_task.tid
|
155
|
+
when :ta
|
156
|
+
@sm.timer_A(timer_task.duration) if @ok_to_run_timerA
|
157
|
+
_check_transport_err
|
158
|
+
when :tb
|
159
|
+
@sm.timer_B if @ok_to_run_timerB
|
160
|
+
when :td
|
161
|
+
@sm.timer_D
|
162
|
+
when :ty
|
163
|
+
@sm.timer_Y if @ok_to_run_timerY
|
164
|
+
end
|
165
|
+
rescue Statemap::TransitionUndefinedException => e
|
166
|
+
loge "Timer #{timer_task.tid} got fired for #{self}"
|
167
|
+
@tu.transaction_wrong_state(self) if @tu
|
168
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
169
|
+
end
|
170
|
+
#----------------------------
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
#------SM Callbacks <start>--------
|
175
|
+
|
176
|
+
def __send_invite
|
177
|
+
logd "Sending INVITE from the Ict #{self}"
|
178
|
+
_send_to_transport(@invite)
|
179
|
+
end
|
180
|
+
|
181
|
+
def __start_A
|
182
|
+
return unless @ok_to_run_timerA
|
183
|
+
task = SIP::Locator[:Sth].schedule_for(self, :ta, nil, :transaction, self.ta)
|
184
|
+
logd("Starting Timer A #{task} from Ict #{self}")
|
185
|
+
end
|
186
|
+
|
187
|
+
def __start_B
|
188
|
+
return unless @ok_to_run_timerB
|
189
|
+
task = SIP::Locator[:Sth].schedule_for(self, :tb, nil, :transaction, self.tb)
|
190
|
+
logd("Starting Timer B #{task} from Ict #{self}")
|
191
|
+
end
|
192
|
+
|
193
|
+
def __start_D
|
194
|
+
task = SIP::Locator[:Sth].schedule_for(self, :td, nil, :transaction, self.td)
|
195
|
+
logd("Starting Timer D #{task} from Ict #{self}")
|
196
|
+
end
|
197
|
+
|
198
|
+
def __start_Y
|
199
|
+
return unless @ok_to_run_timerY
|
200
|
+
task = SIP::Locator[:Sth].schedule_for(self, :ty, nil, :transaction, self.ty)
|
201
|
+
logd("Starting Timer Y #{task} from Ict #{self}")
|
202
|
+
end
|
203
|
+
|
204
|
+
def __reset_A(t)
|
205
|
+
self.ta = 2*t
|
206
|
+
__start_A
|
207
|
+
end
|
208
|
+
|
209
|
+
def __timeout
|
210
|
+
logw("Transaction timeout happened")
|
211
|
+
@txn_handler.timeout(self) if @txn_handler && @txn_handler.respond_to?(:timeout)
|
212
|
+
@tu.transaction_timeout(self) if @tu
|
213
|
+
end
|
214
|
+
|
215
|
+
def __cancel_A
|
216
|
+
logd "canceling timer A"
|
217
|
+
@ok_to_run_timerA = false
|
218
|
+
end
|
219
|
+
|
220
|
+
def __cancel_B
|
221
|
+
logd "canceling timer B"
|
222
|
+
@ok_to_run_timerB = false
|
223
|
+
end
|
224
|
+
|
225
|
+
def __cancel_Y
|
226
|
+
logd "canceling timer Y"
|
227
|
+
@ok_to_run_timerY = false
|
228
|
+
end
|
229
|
+
|
230
|
+
def __consume_msg(b)
|
231
|
+
@consume = b
|
232
|
+
end
|
233
|
+
|
234
|
+
# see section 17.1.1.3 of RFC 3261
|
235
|
+
# this is ACK only for non 2xx final responses.
|
236
|
+
def __create_ack()
|
237
|
+
return if @ack
|
238
|
+
logd("Creating a ACK request for txn #{self}")
|
239
|
+
@ack = @tu.create_non_2xx_ack(@invite, @response) # tu is Session
|
240
|
+
logd "The ACK for the Txn #{self} is #{@ack}"
|
241
|
+
end
|
242
|
+
|
243
|
+
def __send_ack()
|
244
|
+
logd "Sending ACK from the Ict"
|
245
|
+
if @ack
|
246
|
+
_send_to_transport(@ack)
|
247
|
+
else
|
248
|
+
loge "Cannot send ACK from #{self} as no ACK is created so far"
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
def __transport_err
|
253
|
+
loge "A transport error was encountered for #{self} calling TU"
|
254
|
+
@txn_handler.transport_err(self) if @txn_handler && @txn_handler.respond_to?(:transport_err)
|
255
|
+
@tu.transaction_transport_err(self) if @tu
|
256
|
+
end
|
257
|
+
|
258
|
+
def __cleanup
|
259
|
+
logd "Cleanup called for #{self}"
|
260
|
+
@tu.transaction_cleanup(self) if @tu
|
261
|
+
@txn_handler.cleanup(self) if @txn_handler && @txn_handler.respond_to?(:cleanup)
|
262
|
+
end
|
263
|
+
#------SM Callbacks <end>--------
|
264
|
+
|
265
|
+
# mask callbacks defined for SM (see Transaction.rb)
|
266
|
+
mask_callbacks
|
267
|
+
|
268
|
+
private :_send_to_transport, :_check_transport_err
|
269
|
+
protected :_send_invite, :_provisional_received,
|
270
|
+
:_success_final_received, :_non_success_final_received
|
271
|
+
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
@@ -0,0 +1,319 @@
|
|
1
|
+
require 'transaction/Ist_sm'
|
2
|
+
require 'transaction/transaction'
|
3
|
+
require 'transaction/state_machine_wrapper'
|
4
|
+
require 'util/timer/sip_timer_helper'
|
5
|
+
require 'sip_logger'
|
6
|
+
require 'util/locator'
|
7
|
+
require 'ruby_ext/object'
|
8
|
+
require 'message'
|
9
|
+
require 'util/sipper_util'
|
10
|
+
|
11
|
+
module SIP
|
12
|
+
module Transaction
|
13
|
+
class InviteServerTransaction < SIP::Transaction::BaseTransaction
|
14
|
+
include SipLogger
|
15
|
+
include SipperUtil
|
16
|
+
|
17
|
+
# to be used for accessing msg for printing/recording
|
18
|
+
attr_accessor :msg_sent, :cancel_stxn
|
19
|
+
|
20
|
+
# The transport to use, transport flags, remote ip and port
|
21
|
+
# the block is to be used to override the T1, T2, even TimerG etc. timer value.
|
22
|
+
# The block can for example have { self.t1 = 200; self.tg=100 } to override the
|
23
|
+
# T1, A on a transaction by transcation basis, otherwise the default is
|
24
|
+
# taken from SipperConfigurator or SIP::Transaction::BaseTransaction::T1
|
25
|
+
# in that order.
|
26
|
+
# Usage: TU creates transaction and starts invoking "Invocation Action"
|
27
|
+
# methods. Also for requests received, checks whether to consume them
|
28
|
+
# or not based on consume? method return value.
|
29
|
+
# There are three call backs into TU from IST and they are notification on
|
30
|
+
# transport error and transaction timeout.
|
31
|
+
# There are 3 TU callbacks.
|
32
|
+
# (a) transaction_transport_err() gets called should IST get a transport failure
|
33
|
+
# (b) transaction_timeout() gets called on timeout of transaction
|
34
|
+
# (c) transaction_transaction_cleanup() gets called on transaction termination.
|
35
|
+
# (d) transaction_wrong_state() if the transaction transition is tried in a wrong state
|
36
|
+
# i.e a message is either received or being tried to send out in a state where it is
|
37
|
+
# illegal to do so.
|
38
|
+
#
|
39
|
+
def initialize(tu, branch_id, txn_handler, transport, tp_flags, &block)
|
40
|
+
@transaction_name = :Ist # need to have this name defined for every transaction
|
41
|
+
@tu = tu
|
42
|
+
@branch_id = branch_id
|
43
|
+
@transport = transport
|
44
|
+
@txn_handler = txn_handler
|
45
|
+
@tp_flags = tp_flags
|
46
|
+
self.ti = 0 if @transport.reliable? # one line later it can be overidden by arguments.
|
47
|
+
self.tz = 0 if @transport.reliable?
|
48
|
+
super(&block) # override timers
|
49
|
+
SIP::Transaction::StateMachineWrapper.bootstrap_machine(self, Ist_sm)
|
50
|
+
@sm = SIP::Transaction::StateMachineWrapper.new(self, @txn_handler, Ist_sm)
|
51
|
+
logd("Created the Invite Server Transcation with #{@transport}")
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def cancel_received(cancel, cstxn)
|
56
|
+
@cancel_stxn = cstxn
|
57
|
+
_cancel_received(cancel)
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
# Need to handle this after the transition has happened and not in the
|
62
|
+
# _send_to_transport exception handler because state transition from
|
63
|
+
# within a transition is not possible in smc
|
64
|
+
def _check_transport_err
|
65
|
+
@sm.transport_err if @transport_err
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
#--- SM Invocation Actions <start>---------
|
70
|
+
|
71
|
+
#------------------
|
72
|
+
# The two methods txn_send and txn_received are two general purpose methods
|
73
|
+
# that will be called by the TU as against the transcation type specific
|
74
|
+
# methods defined on each type of transaction.
|
75
|
+
#
|
76
|
+
# IST sends only responses from TU
|
77
|
+
def txn_send(msg)
|
78
|
+
@message = msg # the msg is accessed from transaction
|
79
|
+
raise "IST can only send respones" unless msg.is_response?
|
80
|
+
case msg.code
|
81
|
+
when 100..199
|
82
|
+
_send_provisional(msg)
|
83
|
+
when 200..299
|
84
|
+
_send_success_final(msg)
|
85
|
+
when 300..699
|
86
|
+
_send_non_success_final(msg)
|
87
|
+
else
|
88
|
+
raise "IST cannot deal with this response #{msg}"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# The IST receives requests INVITE and ACK/3xx-6xx only
|
93
|
+
def txn_received(msg)
|
94
|
+
@message = msg
|
95
|
+
raise "IST can only receive requests" unless msg.is_request?
|
96
|
+
case msg.method
|
97
|
+
when "INVITE"
|
98
|
+
_invite_received(msg)
|
99
|
+
when "ACK"
|
100
|
+
_ack_received(msg)
|
101
|
+
else
|
102
|
+
raise "IST cannot deal with this request #{msg}"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
#------------------
|
108
|
+
|
109
|
+
# These methods are to be invoked by the TU to send the responses
|
110
|
+
# The state machine drives the whole interaction by calling the
|
111
|
+
# callbacks.
|
112
|
+
|
113
|
+
def _send_provisional(msg)
|
114
|
+
@last_response_sent = msg
|
115
|
+
@sm.provisional(msg)
|
116
|
+
_check_transport_err
|
117
|
+
rescue Statemap::TransitionUndefinedException => e
|
118
|
+
loge "Cannot send provisional in #{self.state} state for #{self}"
|
119
|
+
@tu.transaction_wrong_state(self) if @tu
|
120
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
121
|
+
end
|
122
|
+
|
123
|
+
def _send_success_final(msg)
|
124
|
+
@last_response_sent = nil # we do not cache the 2xx response as TU deals with it
|
125
|
+
@sm.success_final(msg)
|
126
|
+
rescue Statemap::TransitionUndefinedException => e
|
127
|
+
loge "Cannot send 2xx in #{self.state} state for #{self}"
|
128
|
+
@tu.transaction_wrong_state(self) if @tu
|
129
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
130
|
+
end
|
131
|
+
|
132
|
+
def _send_non_success_final(msg)
|
133
|
+
@last_response_sent = msg
|
134
|
+
@ok_to_run_timerH = true unless @transport.reliable?
|
135
|
+
@ok_to_run_timerG = true
|
136
|
+
@sm.non_success_final(msg)
|
137
|
+
_check_transport_err
|
138
|
+
rescue Statemap::TransitionUndefinedException => e
|
139
|
+
loge "Cannot send non-success-final in #{self.state} state for #{self}"
|
140
|
+
@tu.transaction_wrong_state(self) if @tu
|
141
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
142
|
+
end
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
def _invite_received(msg)
|
147
|
+
@invite = msg unless @invite
|
148
|
+
@sm.invite
|
149
|
+
_check_transport_err
|
150
|
+
rescue Statemap::TransitionUndefinedException => e
|
151
|
+
loge "Received an INVITE in #{self.state} state for #{self}"
|
152
|
+
@tu.transaction_wrong_state(self) if @tu
|
153
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
154
|
+
end
|
155
|
+
|
156
|
+
def _ack_received(msg)
|
157
|
+
@sm.ack
|
158
|
+
_check_transport_err
|
159
|
+
rescue Statemap::TransitionUndefinedException => e
|
160
|
+
loge "Received an ACK in #{self.state} state for #{self}"
|
161
|
+
@tu.transaction_wrong_state(self) if @tu
|
162
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
163
|
+
end
|
164
|
+
|
165
|
+
def _cancel_received(msg)
|
166
|
+
@sm.cancel
|
167
|
+
_check_transport_err
|
168
|
+
rescue Statemap::TransitionUndefinedException => e
|
169
|
+
loge "Received a CANCEL in #{self.state} state for #{self}"
|
170
|
+
@tu.transaction_wrong_state(self) if @tu
|
171
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
172
|
+
end
|
173
|
+
|
174
|
+
|
175
|
+
#--- TU Invocation Actions <end>---------
|
176
|
+
|
177
|
+
|
178
|
+
#------ Timer callback------
|
179
|
+
def on_timer_expiration(timer_task)
|
180
|
+
super # check for invalidation
|
181
|
+
case timer_task.tid
|
182
|
+
when :th
|
183
|
+
@sm.timer_H if @ok_to_run_timerH
|
184
|
+
_check_transport_err
|
185
|
+
when :tg
|
186
|
+
@sm.timer_G(timer_task.duration) if @ok_to_run_timerG
|
187
|
+
when :ti
|
188
|
+
@sm.timer_I
|
189
|
+
when :tz
|
190
|
+
@sm.timer_Z
|
191
|
+
end
|
192
|
+
rescue Statemap::TransitionUndefinedException => e
|
193
|
+
loge "Timer #{timer_task.tid} got fired for #{self}"
|
194
|
+
@tu.transaction_wrong_state(self) if @tu
|
195
|
+
@txn_handler.wrong_state(self) if @txn_handler && @txn_handler.respond_to?(:wrong_state)
|
196
|
+
end
|
197
|
+
#----------------------------
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
#------SM Callbacks <start>--------
|
202
|
+
# in the order of appearance
|
203
|
+
def __send_trying
|
204
|
+
r = @tu.create_response(100, "Trying")
|
205
|
+
@last_sent_response = r
|
206
|
+
logd "Sending the 100 Trying response from Ist #{self}"
|
207
|
+
_send_to_transport(r)
|
208
|
+
end
|
209
|
+
|
210
|
+
def __consume_msg(b)
|
211
|
+
@consume = b
|
212
|
+
end
|
213
|
+
|
214
|
+
def __transport_err
|
215
|
+
loge "A transport error was encountered for #{self} calling TU"
|
216
|
+
@tu.transaction_transport_err(self) if @tu
|
217
|
+
@txn_handler.transport_err(self) if @txn_handler && @txn_handler.respond_to?(:transport_err)
|
218
|
+
end
|
219
|
+
|
220
|
+
def __send_provisional_response(r)
|
221
|
+
logd "Sending the provisional response #{r.code} from Ist #{self}"
|
222
|
+
@last_sent_response = r
|
223
|
+
_send_to_transport(r)
|
224
|
+
end
|
225
|
+
|
226
|
+
|
227
|
+
def __send_last_response
|
228
|
+
if @last_sent_response
|
229
|
+
logd "Sending the last response #{@last_sent_response.code} from Ist #{self}"
|
230
|
+
_send_to_transport(@last_sent_response)
|
231
|
+
else
|
232
|
+
logw("No last response available, not sending anything from #{self}")
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
def __send_success_response(r)
|
237
|
+
logd "Sending the 2xx response #{r.code} from Ist #{self}"
|
238
|
+
_send_to_transport(r)
|
239
|
+
end
|
240
|
+
|
241
|
+
def __send_non_success_final_response(r)
|
242
|
+
logd "Sending the non-sucess final response #{r.code} from Ist #{self}"
|
243
|
+
@last_sent_response = r
|
244
|
+
_send_to_transport(r)
|
245
|
+
end
|
246
|
+
|
247
|
+
|
248
|
+
def __create_and_send_487
|
249
|
+
r = @tu.rejection_response_with(487, @invite)
|
250
|
+
@last_sent_response = r
|
251
|
+
logd "Sending the 487 response from Ist #{self}"
|
252
|
+
_send_to_transport(r)
|
253
|
+
end
|
254
|
+
|
255
|
+
def __start_G
|
256
|
+
return unless @ok_to_run_timerG
|
257
|
+
task = SIP::Locator[:Sth].schedule_for(self, :tg, nil, :transaction, self.tg)
|
258
|
+
logd("Starting Timer G #{task} from Ist #{self}")
|
259
|
+
end
|
260
|
+
|
261
|
+
def __start_H
|
262
|
+
return unless @ok_to_run_timerH
|
263
|
+
task = SIP::Locator[:Sth].schedule_for(self, :th, nil, :transaction, self.th)
|
264
|
+
logd("Starting Timer H #{task} from Ist #{self}")
|
265
|
+
end
|
266
|
+
|
267
|
+
def __cancel_G
|
268
|
+
logd "canceling timer G"
|
269
|
+
@ok_to_run_timerG = false
|
270
|
+
end
|
271
|
+
|
272
|
+
def __cancel_H
|
273
|
+
logd "canceling timer H"
|
274
|
+
@ok_to_run_timerH = false
|
275
|
+
end
|
276
|
+
|
277
|
+
def __start_I
|
278
|
+
task = SIP::Locator[:Sth].schedule_for(self, :ti, nil, :transaction, self.ti)
|
279
|
+
logd("Starting Timer I #{task} from Ist #{self}")
|
280
|
+
end
|
281
|
+
|
282
|
+
def __start_Z
|
283
|
+
task = SIP::Locator[:Sth].schedule_for(self, :tz, nil, :transaction, self.tz)
|
284
|
+
logd("Starting Timer Z #{task} from Ist #{self}")
|
285
|
+
end
|
286
|
+
|
287
|
+
def __reset_G(t)
|
288
|
+
self.tg = [2*t, self.t2].min
|
289
|
+
__start_G
|
290
|
+
end
|
291
|
+
|
292
|
+
def __timeout
|
293
|
+
logw("Transaction timeout happened")
|
294
|
+
@tu.transaction_timeout(self) if @tu
|
295
|
+
@txn_handler.timeout(self) if @txn_handler && @txn_handler.respond_to?(:timeout)
|
296
|
+
end
|
297
|
+
|
298
|
+
def __wrong_state
|
299
|
+
log_and_raise "Cannot send response in wrong state #{self}"
|
300
|
+
end
|
301
|
+
|
302
|
+
|
303
|
+
def __cleanup
|
304
|
+
logd "Cleanup called for #{self}"
|
305
|
+
@tu.transaction_cleanup(self) if @tu
|
306
|
+
@txn_handler.cleanup(self) if @txn_handler && @txn_handler.respond_to?(:cleanup)
|
307
|
+
end
|
308
|
+
#------SM Callbacks <end>--------
|
309
|
+
|
310
|
+
# mask callbacks defined for SM (see Transaction.rb)
|
311
|
+
mask_callbacks
|
312
|
+
|
313
|
+
private :_send_to_transport, :_check_transport_err, :_send_non_success_final,
|
314
|
+
:_send_success_final, :_send_provisional, :_invite_received, :_ack_received
|
315
|
+
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|