Michael Soulier
Michael Soulier

Reputation: 821

SIPp call between two registered UACs

I'm testing a B2BUA, and trying to do so with SIPp, but its assumptions are killing me. I need both sipp instances to register with a B2BUA, and the one to call the other. SIPp won't permit this, as the one called must apparently be in UAS mode, and if in UAS mode, you can't run out of call scenario files, so I can't do it that way either.

Basically both scenarios start with a register, and then one attempts and invite while the other waits for it. SIPp is not ok with this.

I am simulating two sets, 16001 and 16002.

scenario for 16001:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!-- UC360 INVITE/200/ACK/BYE/200 sample UAC scenario -->

<scenario name="Basic UC360 UAC">

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:16001@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 REGISTER
      Contact: <sip:16001@[local_ip]:[local_port];line=10d9fd07f9eb2d0>
      Allow: INVITE, ACK, BYE, OPTIONS, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, INFO, MESSAGE
      Max-Forwards: 70
      User-Agent: Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Expires: 3600
      Supported: path
      Content-Length: 0

    ]]>
  </send>

  <recv response="100" optional="true">
  </recv>

  <recv response="401" auth="true">
  </recv>

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:16001@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 2 REGISTER
      Contact: <sip:16001@[local_ip]:[local_port];line=10d9fd07f9eb2d0>
      [authentication username=16001 password=asdfzxcvqwer]
      Allow: INVITE, ACK, BYE, OPTIONS, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, INFO, MESSAGE
      Max-Forwards: 70
      User-Agent: Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Expires: 3600
      Supported: path
      Content-Length: 0

    ]]>
  </send>

  <recv response="200">
  </recv>

  <send retrans="500">
    <![CDATA[

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: 16001 <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 10 INVITE
      Contact: <sip:16001@[local_ip]:[local_port]>
      Content-Type: application/sdp
      Max-Forwards: 70
      User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      X-FrankenSIP-TCID: plca_wan_audioonly_rtp
      Session-Expires: 3600;refresher=uas
      Min-SE: 90
      Supported: timer
      Content-Length: [len]

      v=0
      o=16001 0 0 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[media_ip_type] [media_ip]
      t=0 0
      m=audio [media_port] RTP/AVP 0 9 103 8 101
      a=rtcp:[media_port+1]
      a=sendrecv
      a=rtpmap:0 PCMU/8000
      a=rtpmap:9 G722/16000
      a=fmtp:9 bitrate=64000
      a=rtpmap:103 G7221/16000
      a=fmtp:103 bitrate=32000
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-11,16

    ]]>
  </send>

  <recv response="100"
        optional="true">
  </recv>

  <recv response="401"
        auth="true">
  </recv>

  <send retrans="500">
    <![CDATA[

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: 16001 <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 10 INVITE
      Contact: <sip:16001@[local_ip]:[local_port]>
      Content-Type: application/sdp
      [authentication username=16001 password=asdfzxcvqwer]
      Max-Forwards: 70
      User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      X-FrankenSIP-TCID: plca_wan_audioonly_rtp
      Session-Expires: 3600;refresher=uas
      Min-SE: 90
      Supported: timer
      Content-Length: [len]

      v=0
      o=16001 0 0 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[media_ip_type] [media_ip]
      t=0 0
      m=audio [media_port] RTP/AVP 0 9 103 8 101
      a=rtcp:[media_port+1]
      a=sendrecv
      a=rtpmap:0 PCMU/8000
      a=rtpmap:9 G722/16000
      a=fmtp:9 bitrate=64000
      a=rtpmap:103 G7221/16000
      a=fmtp:103 bitrate=32000
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-11,16

    ]]>
  </send>

  <recv response="100"
        optional="true">
  </recv>

  <recv response="180">
  </recv>

  <recv response="200">
  </recv>

  <!-- NOTE:  [branch-5] is used to specify reuse of same [branch] value that was used five messages earlier (e.g. INVITE) -->
  <send>
    <![CDATA[

      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch-5]
      From: "16001" <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 10 ACK
      User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1) 
      Content-Length: 0

    ]]>
  </send>

  <pause milliseconds="450" />

  <send retrans="500">
    <![CDATA[

      BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch-1]
      From: "16001" <sip:16001@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:[service]@[remote_ip]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 11 BYE
      Contact: <sip:16001@[local_ip]:[local_port]>
      Max-Forwards: 70
      X-FrankenSIP-TCID: plca_wan_audioonly_rtp
      User-Agent: VIRTUAL Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Content-Length: 0

    ]]>
  </send>

  <recv response="200">
  </recv>  

  <!-- definition of the response time repartition table (unit is ms)   -->
  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

  <!-- definition of the call length repartition table (unit is ms)     -->
  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>

and for 16002:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="Basic MCD UAS">

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:16002@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:16002@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 REGISTER
      Contact: <sip:16002@[local_ip]:[local_port];line=10d9fd07f9eb2d0>
      Allow: INVITE, ACK, BYE, OPTIONS, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, INFO, MESSAGE
      Max-Forwards: 70
      User-Agent: Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Expires: 3600
      Supported: path
      Content-Length: 0

    ]]>
  </send>

  <recv response="100" optional="true">
  </recv>

  <recv response="401" auth="true">
  </recv>

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:16002@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:16002@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 2 REGISTER
      Contact: <sip:16002@[local_ip]:[local_port];line=10d9fd07f9eb2d0>
      [authentication username=16002 password=asdfzxcvqwer]
      Allow: INVITE, ACK, BYE, OPTIONS, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, INFO, MESSAGE
      Max-Forwards: 70
      User-Agent: Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Expires: 3600
      Supported: path
      Content-Length: 0

    ]]>
  </send>

  <recv response="200">
  </recv>

  <recv request="INVITE" crlf="true">
  </recv>

  <send>
    <![CDATA[

      SIP/2.0 180 Ringing
      [last_Via:]
      [last_From:]
      [last_To:]
      [last_Call-ID:]
      [last_CSeq:]
      Server: VIRTUAL Mitel-3300-ICP 12.0.1.99
      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
      Content-Length: 0

    ]]>
  </send>

  <send retrans="500">
    <![CDATA[

      SIP/2.0 200 OK
      [last_Via:]
      [last_From:]
      [last_To:];tag=[call_number]
      [last_Call-ID:]
      [last_CSeq:]
      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
      Server: VIRTUAL Mitel-3300-ICP 12.0.1.99
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=16002 0 0 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[media_ip_type] [media_ip]
      t=0 0
      m=audio [media_port] RTP/AVP 0 9 103 8 101
      a=rtcp:[media_port+1]
      a=sendrecv
      a=rtpmap:0 PCMU/8000
      a=rtpmap:9 G722/16000
      a=fmtp:9 bitrate=64000
      a=rtpmap:103 G7221/16000
      a=fmtp:103 bitrate=32000
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-11,16

    ]]>
  </send>

  <recv request="ACK">
  </recv>

  <recv request="BYE">
  </recv>
  
  <send>
    <![CDATA[
      SIP/2.0 200 OK
      [last_Via:]
      [last_From:]
      [last_To:]
      [last_Call-ID:]
      [last_CSeq:]
      Server: VIRTUAL Mitel-3300-ICP 12.0.1.99
      Content-Length: 0
    ]]>
  </send>

  <!-- definition of the response time repartition table (unit is ms)   -->
  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

  <!-- definition of the call length repartition table (unit is ms)     -->
  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>

This fails due to this error from 16002:

2023-02-07 17:02:49.664581 1675807369.664581: Discarding message which can't be mapped to a known SIPp call: INVITE sip:[email protected]:5060;line=10d9fd07f9eb2d0 SIP/2.0

Thanks.

Upvotes: 2

Views: 1076

Answers (2)

dmbhatti
dmbhatti

Reputation: 314

I would handle this by separating the REGISTER part into a 3rd script e.g uac_register.xml and run it once for each agent separately (16001, 16002) with the corresponding Contact headers having locations of where you intend to run the 16001 and 16002 agents later.

This way you get your registrations and preserve the nature of your 16002 UAS. Registration and Calling are two separate actions and it's better to keep them separate.

Hope this helps.

Sample uac_register.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!-- UC360 INVITE/200/ACK/BYE/200 sample UAC scenario -->

<scenario name="REGISTER UAC">

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[service]@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 REGISTER
      Contact: <sip:[service]@[local_ip]:[local_port];line=10d9fd07f9eb2d0>
      Allow: INVITE, ACK, BYE, OPTIONS, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, INFO, MESSAGE
      Max-Forwards: 70
      User-Agent: Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Expires: 3600
      Supported: path
      Content-Length: 0

    ]]>
  </send>

  <recv response="100" optional="true"/>

  <recv response="401" auth="true"/>

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[service]@[remote_ip]:[remote_port]>;tag=[call_number]
      To: <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 2 REGISTER
      Contact: <sip:[service]@[local_ip]:[local_port];line=10d9fd07f9eb2d0>
      [authentication]
      Allow: INVITE, ACK, BYE, OPTIONS, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, INFO, MESSAGE
      Max-Forwards: 70
      User-Agent: Mitel-UC-Endpoint (Mitel UC360 Collaboration Point/2.1.0.99;  08:00:0F:74:80:E1)
      Expires: 3600
      Supported: path
      Content-Length: 0

    ]]>
  </send>

  <recv response="200"/>
</scenario>

Sample command:

/path/to/sipp -f /path/to/uac_register.xml -t t1 <remote ip>:<remote port> -i <local ip> -p <local port> -m 1 -l 1 -s 16001 -ap asdfzxcvqwer

Upvotes: 0

miconda
miconda

Reputation: 1817

Given that sipp cannot do it alone, if your test cases are for SIP over UDP, then you can use another tool like sipsak or sipexer to do the registration for UAS side:

When UDP is used, there is no problem to send the REGISTER, wait for response, then the UAC (at this phase sipsak or sipexer) shuts down. The contact is kept by the server for the duration of the Expires header value.

Then you start sipp on the same local port as provided to sipsak or sipexer, with UAS scenario which no longer includes the registration part.

All these tools should allow to specify the local port (the port to listen on that shows up also in Contact header).

If you need a specific set of headers in the REGISTER sent by UAS side, sipexer has support for pretty flexible SIP message templates. Iirc, sipsak supports reading the SIP message from a file.

Disclaimer: I am the author of sipexer, but also a long time user of sipp and sipsak.

Upvotes: 0

Related Questions