flow:
  - start|DEFAULT_ROUTE:
  - start|ROUTE_ENTRY:
  - return|ROUTE_ENTRY:
  - start|ROUTE_NET_INFO:
  - return|ROUTE_NET_INFO:
  - start|ROUTE_CHECK_TEL_URI:
      $x_hdr(From): <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=\w+
      $x_hdr(Diversion): <tel:\+43111222333>;reason=unconditional;privacy=off;counter=1
      $x_hdr(P-Asserted-Identity): <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>
      $x_tu: tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]
  - exit|ROUTE_CHECK_TEL_URI:
      $x_hdr(From): <sip:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test;user=phone>;tag=\w+
      $x_hdr(Diversion): <sip:\+43111222333@invite-redirect-tel-uri.scenarios.test;user=phone>;reason=unconditional;privacy=off;counter=1
      $x_hdr(P-Asserted-Identity): <sip:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test;user=phone>
      $x_tu: sip:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]@invite-redirect-tel-uri.scenarios.test
  - start|ROUTE_PRX_REQUEST:
  - start|ROUTE_INITVARS:
  - return|ROUTE_INITVARS:
  - start|ROUTE_INVITE:
  - start|ROUTE_LOAD_CALLEE_DOMAIN_PREF:
  - start|ROUTE_CLEAR_CALLEE_DOMAIN_PREF:
  - return|ROUTE_CLEAR_CALLEE_DOMAIN_PREF:
  - return|ROUTE_LOAD_CALLEE_DOMAIN_PREF:
  - start|ROUTE_FIND_CALLER:
  - start|ROUTE_AUTH:
  - start|ROUTE_AUTH_HELPER:
  - return|ROUTE_AUTH_HELPER:
  - start|ROUTE_ADD_CALLINFO_REPLY:
  - start|ROUTE_ADD_CALLINFO_CALLER_PRIMARY:
  - return|ROUTE_ADD_CALLINFO_CALLER_PRIMARY:
  - return|ROUTE_ADD_CALLINFO_REPLY:
  - return|ROUTE_AUTH:
  - return|ROUTE_FIND_CALLER:
  - start|ROUTE_LOAD_CALLER_PREF:
  - start|ROUTE_CLEAR_CALLER_PREF:
  - return|ROUTE_CLEAR_CALLER_PREF:
  - start|ROUTE_CHECK_UA:
  - return|ROUTE_CHECK_UA:
  - start|ROUTE_LOAD_CALLER_CONTRACT_PREF:
  - return|ROUTE_LOAD_CALLER_CONTRACT_PREF:
  - return|ROUTE_LOAD_CALLER_PREF:
  - start|ROUTE_DLG_MANAGE:
  - return|ROUTE_DLG_MANAGE:
  - start|ROUTE_APPLY_HEADER_RULES:
  - return|ROUTE_APPLY_HEADER_RULES:
  - start|ROUTE_GET_CALLER_CLI:
  - return|ROUTE_GET_CALLER_CLI:
  - start|ROUTE_GET_FORWARDER_CLI:
  - return|ROUTE_GET_FORWARDER_CLI:
  - start|ROUTE_CLIR:
  - return|ROUTE_CLIR:
  - start|ROUTE_CALLER_BLOCK_CLI:
  - return|ROUTE_CALLER_BLOCK_CLI:
  - start|ROUTE_CHECK_USERPROV_CLI:
  - start|ROUTE_CHECK_CLI_ALLOWED:
  - return|ROUTE_CHECK_CLI_ALLOWED:
  - return|ROUTE_CHECK_USERPROV_CLI:
  - start|ROUTE_FIND_CALLEE:
  - start|ROUTE_CLEAR_CALLEE_PREF:
  - return|ROUTE_CLEAR_CALLEE_PREF:
  - start|ROUTE_LOAD_CALLEE_PREF:
  - start|ROUTE_LOAD_CALLEE_CONTRACT_PREF:
  - return|ROUTE_LOAD_CALLEE_CONTRACT_PREF:
  - start|ROUTE_SET_CALLEE_DIALOG:
  - start|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_SET_CALLEE_DIALOG:
  - start|ROUTE_BLOCK_IN:
  - return|ROUTE_BLOCK_IN:
  - return|ROUTE_LOAD_CALLEE_PREF:
  - start|ROUTE_NCOS_CHECK:
  - start|ROUTE_NCOS:
  - return|ROUTE_NCOS:
  - start|ROUTE_NCOS:
  - return|ROUTE_NCOS:
  - start|ROUTE_NCOS:
  - return|ROUTE_NCOS:
  - start|ROUTE_NCOS:
  - return|ROUTE_NCOS:
  - return|ROUTE_NCOS_CHECK:
  - start|ROUTE_BLOCK_OUT:
  - return|ROUTE_BLOCK_OUT:
  - start|ROUTE_CHECK_PBX:
  - return|ROUTE_CHECK_PBX:
  - start|ROUTE_CALLEE_DISPATCH:
  - start|ROUTE_INVITE_TO_INT:
  - start|ROUTE_APPLY_HEADER_RULES:
  - return|ROUTE_APPLY_HEADER_RULES:
  - start|ROUTE_CF_CFU:
  - return|ROUTE_CF_CFU:
  - start|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_CNT_DLG_CHECK:
  - start|ROUTE_CHECK_LOCATIONS:
  - start|ROUTE_LOOKUP_SUBSCRIBER_LOCATIONS:
  - return|ROUTE_LOOKUP_SUBSCRIBER_LOCATIONS:
  - start|ROUTE_OUTBOUND:
  - start|ROUTE_SET_CALLER_DIALOG:
  - start|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_SET_CALLER_DIALOG:
  - start|ROUTE_ACC_CALLER:
  - start|ROUTE_SET_ACC_CALLER_CALL_COUNTERS:
  - return|ROUTE_SET_ACC_CALLER_CALL_COUNTERS:
  - return|ROUTE_ACC_CALLER:
  - start|ROUTE_ACC_CALLEE:
  - start|ROUTE_SET_ACC_CALLEE_CALL_COUNTERS:
  - return|ROUTE_SET_ACC_CALLEE_CALL_COUNTERS:
  - return|ROUTE_ACC_CALLEE:
  - start|ROUTE_ADD_AOC_HEADER:
  - return|ROUTE_ADD_AOC_HEADER:
  - start|BRANCH_ROUTE_SBC:
  - start|ROUTE_LOAD_CALLEE_CONTRACT_PREF:
  - return|ROUTE_LOAD_CALLEE_CONTRACT_PREF:
  - start|ROUTE_SET_CALLEE_DIALOG:
  - start|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_CNT_DLG_CHECK:
  - return|ROUTE_SET_CALLEE_DIALOG:
  - start|ROUTE_SET_BRANCH_HDRS:
  - start|ROUTE_PREPARE_UA:
  - return|ROUTE_PREPARE_UA:
  - return|ROUTE_SET_BRANCH_HDRS:
  - start|ROUTE_SET_RUSER:
  - return|ROUTE_SET_RUSER:
  - start|ROUTE_BRANCH_ACC_RTP:
  - return|ROUTE_BRANCH_ACC_RTP:
  - start|ROUTE_FILTER_PRACK:
  - return|ROUTE_FILTER_PRACK:
  - start|ROUTE_PREPARE_SST:
  - return|ROUTE_PREPARE_SST:
  - start|ROUTE_PREPARE_MOH:
  - return|ROUTE_PREPARE_MOH:
  - start|ROUTE_SET_CALLER_CLI:
  - start|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_PREPARE_CALLER_CLI:
  - start|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_PREPARE_CALLER_CLI:
  - start|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_PREPARE_CALLER_CLI:
  - start|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_PREPARE_CALLER_CLI:
  - start|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_PREPARE_CALLER_CLI:
  - start|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_PREPARE_CALLER_CLI:
  - return|ROUTE_SET_CALLER_CLI:
  - start|ROUTE_SET_CALLEE:
  - return|ROUTE_SET_CALLEE:
  - start|ROUTE_ADD_CALLINFO:
  - start|ROUTE_ADD_CALLINFO_CALLER_PRIMARY:
  - return|ROUTE_ADD_CALLINFO_CALLER_PRIMARY:
  - start|ROUTE_ADD_CALLINFO_CALLEE_PRIMARY:
  - return|ROUTE_ADD_CALLINFO_CALLEE_PRIMARY:
  - return|ROUTE_ADD_CALLINFO:
  - start|ROUTE_APPLY_HEADER_RULES:
  - return|ROUTE_APPLY_HEADER_RULES:
  - return|BRANCH_ROUTE_SBC:
  - start|DEFAULT_SEND:
  - exit|DEFAULT_SEND:
  - exit|DEFAULT_SEND:
  - start|ROUTE_EXIT:
  - start|ROUTE_RUNTIME:
  - return|ROUTE_RUNTIME:
  - exit|ROUTE_EXIT:
sip_in:
  # INVITE sip:+590590779990@sip.dauphintelecom.com
  # From: <tel:+33967451213>;tag=<something>
  # To: <tel:+59099909590779990>
  # Diversion: <tel:+33148381230>;reason=<something>;privacy=<something>;counter=<something>
  # P-Asserted-Identity: tel:+33967451213  <-- no angles around tel value
  - '^INVITE sip:[% scenarios.0.responders.0.username %]@'
  - 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
  - 'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>'
  - 'Diversion: <tel:\+43111222333'
  - 'P-Asserted-Identity: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>'
  - 'CSeq: \d+ INVITE'
  - 'Contact: <sip:[% scenarios.0.username %]@[% scenarios.0.ip %]:[% scenarios.0.port %](;[^>]+)?>'
  - 'Max-Forwards: 69'
  - 'Content-Type: application/sdp'
  # PAI has no angles around tel value
sip_out:
  # From: <tel:+33967451213>;tag=<something>
  # To: <tel:+59099909590779990>
  - [
      '^SIP/2.0 100 Trying',
      'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+',
      'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]',
      'CSeq: \d+ INVITE',
      'Content-Length: 0'
    ]
  - [
      'SIP/2.0 101 Connecting',
      'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+',
      'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]',
      'CSeq: \d+ INVITE',
      'Content-Length: 0'
    ]
  # INVITE sip:590590779990@74.116.94.226:5060
  # From: <sip:0967451213@gp.dauphintelecom.com;user=phone>;tag=<something>
  # To: <sip:590590779990@74.116.94.226:5060>
  # Diversion: <sip:+33148381230@sip.dauphintelecom.com;user=phone>
  - [
      '^INVITE sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.ip %]',
      'From: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test',
      'To: <sip:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]@invite-redirect-tel-uri.scenarios.test',
      '_:NOT:_Diversion: \w+',
      'P-Asserted-Identity: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test',
      'CSeq: \d+ INVITE',
      'Contact: <sip:[% scenarios.0.username %]@[% scenarios.0.ip %]:[% scenarios.0.port %](;[^>]+)?>',
      'Content-Type: application/sdp'
    ]
