LibreSBC/Freeswitch change

alexxis

New Member
Jun 7, 2024
1
0
1
34
I'm working on a POC using LibreSBC which uses freeswitch and when sending test SIP INVITEs with the StarTrinity client and including the 'require: siprec' header, I immediately get a SIP 420 Bad extension with Unsupported: siprec

In https://github.com/freeswitch/sofia-sip/blob/master/libsofia-sip-ua/nua/nua_server.c#L85 I see that as part of the SIP processing that it checks the requires:

C:
if (nta_check_required(irq, sip, supported,
             SIPTAG_ALLOW(allow),
             SIPTAG_USER_AGENT_STR(user_agent),
             TAG_END()))
    return 420;

I just want to use LibreSBC to forward the SIP to another destination and only do some basic header checks and not worry about if the siprec is a supported feature or not. Is this possible? Or is there a way to configure the supported SIP features in LibreSBC or Freeswitch to include SIPREC? I haven't found an answer in the FS/LibreSBC documentation.

Or is it perhaps that FS doesn't flat out support SIPREC at all?

Below is the INVITE sent to LibreSBC and the debug output from FS with the response code:

Code:
INVITE sip:test@LIBRESBC_IP:5060 SIP/2.0
Via: SIP/2.0/tcp 10.3.114.21:54221;rport;branch=z9hG4bKPj3b88d26158d44252a96620b6c19c06ac
Max-Forwards: 70
From: sip:acmeSrc@LIBRESBC_IP;tag=e3815c571a904aefb10c78abddd3dfd9
To: sip:test@LIBRESBC_IP
Contact: <sip:acmeSrc@10.3.114.21:5070;transport=tcp>
Call-ID: 0eac16325a164eb6a4bb758e92c64b1a
CSeq: 23553 INVITE
Allow: INFO, PRACK, SUBSCRIBE, NOTIFY, REFER, INVITE, ACK, BYE, CANCEL, UPDATE
Supported: 100rel, timer
User-Agent: StarTrinity.SIP 2024-05-28 20.56 UTC
Require: siprec
Content-Type: multipart/mixed; boundary="unique-boundary-1"
Content-Length:  2471


--unique-boundary-1
Content-Type: application/sdp


v=0
o=- 3927004177 3927004177 IN IP4 10.3.114.21
s=o6.proxy.stream0
c=IN IP4 10.3.114.21
t=0 0
m=audio 16000 RTP/AVP 8 0 4 18 101
a=rtcp:16001 IN IP4 10.3.114.21
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=sendonly
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=label:117440541
m=audio 16002 RTP/AVP 8 0 4 18 101
a=rtcp:16003 IN IP4 10.3.114.21
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=sendonly
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=label:117440542


--unique-boundary-1
Content-Type: application/rs-metadata+xml
Content-Disposition: recording-session


<?xml version='1.0' encoding='UTF-8'?>
<recording xmlns='urn:ietf:params:xml:ns:recording'>
 <datamode>complete</datamode>
 <session id="/TfJbUhQQjdl07O4SXCBbg==">
  <associate-time>2021-10-06T16:46:55</associate-time>
 </session>
 <participant id="OPhVeF5RTGJLRVMPIXVn0A==" session="/TfJbUhQQjdl07O4SXCBbg==">
  <nameID aor="sip:470032@10.156.7.220">
   <name>470032</name>
  </nameID>
  <send>nLBrXTRKTm1FInZfRlp8/A==</send>
  <associate-time>2021-10-06T16:46:55</associate-time>
  <extensiondata xmlns:apkt="http://acmepacket.com/siprec/extensiondata">
   <apkt:callingParty>true</apkt:callingParty>
   <apkt:request-uri>sip:75017@10.156.9.188:5060</apkt:request-uri>
   <apkt:realm>PureCloud75xxx_realm</apkt:realm>
  </extensiondata>
 </participant>
 <participant id="D0c+GwMnR1V5RWAmghR43Q==" session="/TfJbUhQQjdl07O4SXCBbg==">
  <nameID aor="sip:75017@10.156.9.188">
   <name>75017</name>
  </nameID>
  <send>cZ3yX8/dRqZPW1FUDhsUTA==</send>
  <associate-time>2021-10-06T16:46:55</associate-time>
  <extensiondata xmlns:apkt="http://acmepacket.com/siprec/extensiondata">
   <apkt:callingParty>false</apkt:callingParty>
  <apkt:header label="x-inin-cnv">
   <value>484ee1b4-8ff0-4add-a7cd-7cb6786689f5</value>
   </apkt:header>
</extensiondata>
 </participant>
 <stream id="nLBrXTRKTm1FInZfRlp8/A==" session="/TfJbUhQQjdl07O4SXCBbg==">
  <label>117440541</label>
  <mode>separate</mode>
  <associate-time>2021-10-06T16:46:55</associate-time>
 </stream>
 <stream id="cZ3yX8/dRqZPW1FUDhsUTA==" session="/TfJbUhQQjdl07O4SXCBbg==">
  <label>117440542</label>
  <mode>separate</mode>
  <associate-time>2021-10-06T16:46:56</associate-time>
 </stream>
</recording>--unique-boundary-1--


tport.c:3059 tport_deliver() tport_deliver(0x7f5b8801ec60): msg 0x7f5b8801ef30 (3099 bytes) from tcp/SIP_SOURCE_IP:54221/sip next=(nil)
nta.c:2960 agent_recv_request() nta: received INVITE sip:test@LIBRESBC_IP:5060 SIP/2.0 (CSeq 23553) (load: 0 rps)
nta.c:3254 agent_check_request_via() nta: Via check: received=SIP_SOURCE_IP
nta.c:3165 agent_recv_request() nta: INVITE (23553) going to a default leg
nta.c:1369 set_timeout() nta: timer shortened to 2000 ms
nua_server.c:102 nua_stack_process_request() nua: nua_stack_process_request: entering
tport.c:3291 tport_tsend() tport_tsend(0x7f5b8801ec60) tpn = TCP/SIP_SOURCE_IP:54221
tport.c:3628 tport_vsend() tport_vsend(0x7f5b8801ec60): 521 bytes of 521 to tcp/SIP_SOURCE_IP:54221
tport.c:3526 tport_send_msg() tport_vsend returned 521
send 521 bytes to tcp/[SIP_SOURCE_IP]:54221 at 17:29:37.751005:
------------------------------------------------------------------------
SIP/2.0 420 Bad Extension
Via: SIP/2.0/TCP 10.3.114.21:54221;rport=54221;branch=z9hG4bKPj3b88d26158d44252a96620b6c19c06ac;received=SIP_SOURCE_IP
From: sip:acmeSrc@LIBRESBC_IP;tag=e3815c571a904aefb10c78abddd3dfd9
To: <sip:test@LIBRESBC_IP>;tag=Zy4mcFeX24Hva
Call-ID: 0eac16325a164eb6a4bb758e92c64b1a
CSeq: 23553 INVITE
User-Agent: LibreSBC
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REFER, PRACK, NOTIFY
Supported: 100rel, timer, path, replaces
Unsupported: siprec
Content-Length: 0