1

I am trying to configure SIPp for a UAS scenario where I want to

  • check registration from the client app (correctly handle REGISTER request, check correct credentials)
  • handle incoming call (INVITE request)

The first part is working well, but when SIPp waits for the INVITE request, it jumps back to the registration part where it awaits for REGISTER request again, no idea why.

I put some logs into the SIPp XML configuration file and also enabled error & log tracking. Here is the command to run the SIPp:

sipp -sf sipp_register_auth_uas.xml -inf users.csv -infindex users.csv 0 -log_file sipp_register_auth_uas.log -trace_logs -trace_err -error_file error.log
$ cat users.csv
USERS
UserName1;123456
UserName2;654321

I noticed waiting for REGISTER log to appear again at the same time when actually the INVITE request was sent from the client side.

Also at that time this error was logged:

2022-02-14 10:57:21.758876 1644832641.758876: Aborting call on unexpected message for Call-Id '9cc42b8a-261f-482b-88dc-1f5619485f90': while expecting 'REGISTER' (index 1), received 'INVITE sip:UserName2@localhost SIP/2.0

Did I miss something in the configuration file? This seems to be a bug to me.

Here are complete logs / errors and also the XML config file:

$ cat sipp_register_auth_uas.logwaiting for REGISTER
waiting for REGISTER with auth
Received REGISTER from user -UserName1-
searching in file at line : Username: UserName1 Pass: 123456
waiting for INVITE
# Here is the issue, I noticed this "REGISTER" log to appear when actually the INVITE request was sent from the client side
waiting for REGISTER
$ head -n 20 error.log 
sipp: The following events occurred:
2022-02-14      10:57:21.758876 1644832641.758876: Aborting call on unexpected message for Call-Id '9cc42b8a-261f-482b-88dc-1f5619485f90': while expecting 'REGISTER' (index 1), received 'INVITE sip:UserName2@localhost SIP/2.0
Via: SIP/2.0/UDP 192.168.206.128:46104;rport;branch=z9hG4bKPjcab43dd9-296b-4cd8-bcbf-6667fc4fceda
Max-Forwards: 70
From: sip:UserName1@localhost;tag=2d706401-1200-4415-901a-0d01a2b0e3f2
To: sip:UserName2@localhost
Contact: <sip:UserName1@192.168.206.128:46104;ob>
Call-ID: 9cc42b8a-261f-482b-88dc-1f5619485f90
CSeq: 4665 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
Content-Type: application/sdp
Content-Length:   637

v=0
o=- 3853821441 3853821441 IN IP4 192.168.206.128
s=pjmedia
b=AS:84
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="Basic UAS registrar with authentication">

  <nop hide="true">
    <action>
      <log message="waiting for REGISTER"/>
    </action>
  </nop>


  <label id="badauth"/>

  <!-- avaiting registration -->
  <recv request="REGISTER" />

  <!-- Sending reg chalange -->
  <send><![CDATA[

      SIP/2.0 401 Authorization Required
      [last_Via:]
      [last_From:]
      [last_To:];tag=[pid]SIPpTag01[call_number]
      [last_Call-ID:]
      [last_CSeq:]
      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
      WWW-Authenticate: Digest realm="test.example.com", nonce="47ebe028cda119c35d4877b383027d28da013815"
      Content-Length: [len]

    ]]>
  </send>

  <nop hide="true">
    <action>
      <log message="waiting for REGISTER with auth"/>
    </action>
  </nop>

  <!-- expecting registration with auth included -->
  <recv request="REGISTER" >
        <action>
                <ereg regexp="Digest .*username=\"([^\"]*)\"" search_in="hdr" header="Authorization:" assign_to="junk,username" />
                <!--log message="junk: -[$junk]-, username: -[$username]-" /-->
                <lookup assign_to="line" file="users.csv" key="[$username]" />
                <assign assign_to="junk" value="0" />
                <log message="Received REGISTER from user -[$username]-" />
                <log message="searching in file at line [$line]: Username: [field0 line=\"[$line]\"] Pass: [field1 line=\"[$line]\"]"/>
                <verifyauth assign_to="authvalid" username="[field0 line=\"[$line]\"]" password="[field1 line=\"[$line]\"]" />
        </action>
  </recv>

  <nop hide="true" test="authvalid" next="goodauth"/>
  <nop hide="true" next="badauth"/>

  <label id="goodauth"/>
  <send>
    <![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]>
      Content-Length: 0
      Expires: 60
    ]]>
  </send>

  <nop hide="true">
    <action>
      <log message="waiting for INVITE"/>
    </action>
  </nop>

  <recv request="INVITE">
    <action>
      <log message="inside INVITE"/>
      <ereg regexp=".*" search_in="hdr" header="From" assign_to="remote_from"/>
      <log message="remote_from:"/>
      <ereg regexp="sip:(.*)>.*" search_in="hdr" header="Contact" assign_to="junk,remote_contact"/>
      <log message="Received INVITATION from: -[$remote_from], Contact: -[$remote_contact]-"/>
    </action>
  </recv>
 <Reference variables="junk"/>

  <nop hide="true">
    <action>
      <log message="Sending OK (after receiving INVITE)."/>
    </action>
  </nop>

  <send retrans="500">
    <![CDATA[
      SIP/2.0 200 OK
      [last_Via:]
      [last_From:]
      [last_To:];tag=[pid]SIPpTag01[call_number]
      [last_Call-ID:]
      [last_CSeq:]
      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=user1 53655765 2353687637 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
      a=rtpmap:0 PCMU/8000
    ]]>
  </send>

  <nop hide="true">
    <action>
      <log message="waiting for ACK"/>
    </action>
  </nop>

  <recv request="ACK" optional="true" crlf="true">
  </recv>

  <recv request="BYE" timeout="3000" ontimeout="send_bye">
  </recv>
  <send>
    <![CDATA[
      SIP/2.0 200 OK
      [last_Via:]
      [last_From:]
      [last_To:]
      [last_Call-ID:]
      [last_CSeq:]
      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
      Content-Length: 0
    ]]>
  </send>

  <nop>
    <action>
      <exec int_cmd="stop_now"/>
    </action>
  </nop>

  <label id="send_bye"/>

  <send retrans="500">
    <![CDATA[
      BYE [$remote_contact] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port]
      From: sipp  <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]
      To: [$remote_from]
      Call-ID: [call_id]
      Cseq: 2 BYE
      Contact: sip:sipp@[local_ip]:[local_port]
      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>
Martin Flaska
  • 673
  • 7
  • 10

1 Answers1

0

SIPp only supports one call-id value for a SIP exchange. I think you fill find in your error logs that the server is expecting a Register message (with the same call-id).

Since your invite is coming in with another call-id, SIPp is seeing that as an unexpected message.

You're best to run two separate scenarios, one for registration with auth, responding with a long enough expires timer, then run your other scenario, where calls are being processed.

SteveM
  • 1