Author Topic: SIP UPDATE support  (Read 7973 times)

idelac3

  • Newbie
  • *
  • Posts: 2
    • View Profile
SIP UPDATE support
« on: July 09, 2018, 12:40:55 AM »
Hi,

I would like to add support for SIP UPDATE message to Yate.

I see in source code, file ysipchan.cpp need additional line;

Code: [Select]
YateSIPEngine::YateSIPEngine(YateSIPEndPoint* ep) :
SIPEngine(s_cfg.getValue("general", "useragent")), m_ep(ep),
m_prack(false), m_info(false), m_foreignAuth(false) {
addAllowed("INVITE");
addAllowed("BYE");
addAllowed("CANCEL");

addAllowed("UPDATE");

But I don't know where to put code which will actually update parameters of media in SIP session when UPDATE message arrives.

Any suggestion ?

Igor

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: SIP UPDATE support
« Reply #1 on: July 09, 2018, 01:40:40 AM »
ysipchan.conf

[methods]
update=BOOLEAN

The value of parameter is a boolean (yes/no) indicating auth is required (this is the default) or not

idelac3

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SIP UPDATE support
« Reply #2 on: July 09, 2018, 03:13:25 AM »
thanks, it works.

However, I noticed that Yate replies on SIP UPDATE with 100 Trying:

Code: [Select]
------
<sip:INFO> 'udp:0.0.0.0:5060' received 789 bytes SIP message from 192.168.56.102:5060 [0x2449be0]
------
UPDATE sip:1001@192.168.56.1:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.102:5060;rport;branch=z9hG4bKPjdd9781d1-d31d-431a-a0b4-83e5ad36b7fd
From: "PhonerLite1" <sip:1002@192.168.56.102>;tag=7a8972c8-c040-4a69-b7d9-cfe0eb80d131
To: <sip:1001@192.168.56.1>;tag=394803623
Contact: <sip:b9804293-2d29-46fe-a58d-11ebe10cb442@192.168.56.102:5060>
Call-ID: f79080c4-937a-4ad6-b6fe-5d3187c4d141
CSeq: 6713 UPDATE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Content-Type: application/sdp
Content-Length:   240

v=0
o=- 2038308401 2038308402 IN IP4 192.168.56.102
s=Asterisk
c=IN IP4 192.168.56.101
t=0 0
m=audio 5062 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
------

<INFO> Auto changing RTP address from 192.168.56.102:10384 to 192.168.56.101:5062

and here is 100 Trying:

Code: [Select]
<sip:INFO> 'udp:0.0.0.0:5060' sending code 100 0x7f16f800b6a0 to 192.168.56.102:5060 [0x2449be0]
------
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.56.102:5060;rport=5060;branch=z9hG4bKPjdd9781d1-d31d-431a-a0b4-83e5ad36b7fd;received=192.168.56.102
From: "PhonerLite1" <sip:1002@192.168.56.102>;tag=7a8972c8-c040-4a69-b7d9-cfe0eb80d131
To: <sip:1001@192.168.56.1>;tag=394803623
Call-ID: f79080c4-937a-4ad6-b6fe-5d3187c4d141
CSeq: 6713 UPDATE
Server: YATE/4.2.0
Content-Length: 0

------

Do you know how to make Yate to replay with 200 OK for SIP UPDATE request ?

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: SIP UPDATE support
« Reply #3 on: July 09, 2018, 08:10:38 AM »
1xx messages are provisional, not final.

For custom methods (added in methods section, not handled internally) you must handle a sip.method_name message.
For your need you must handle the sip.update message and return true.

A simple regexroute would be:

[extra]
sip.update=50

[sip.update]
.*=return true