SIP Methods

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Internally handled Methods)
(Internally handled Methods)
Line 41: Line 41:
 
** BYE
 
** BYE
 
* methods that are handled in the default configuration and that can be enabled/disabled from [general] section
 
* methods that are handled in the default configuration and that can be enabled/disabled from [general] section
** REFER - controled by ''transfer''
+
** INFO - controlled by ''info'' setting. If request is received during a dialog it's handled internally. Outside a dialog it's handled generically.
** OPTIONS
+
** OPTIONS - controlled by ''options'' setting.
 
+
* methods that are handled in the default configuration when yate is started in server mode, and are disabled when yate is started in client mode. They can be enabled/disabled from [general] section
:The above methods are handled internally by Yate if ysipchan is enabled in yate.conf, so that means that no message can be generated for them.
+
** REFER - controlled by ''transfer'' setting
* REFER - if is set true in section [general], it is handled from [transfer] section
+
** REGISTER - controlled by ''register''setting. If register=enabled then in [registrar] section defines how Yate will work as a SIP REGISTRAR. Before starting yate as SIP registrar set users in regfile.conf or in register.conf.  
* OPTIONS - default is true but can be handled from configuration in section [general]
+
* methods that are desabled in the default configuration but can be enabled/disabled from [general] section
* REGISTER - if is set true in section [general] ] then it can be handled in [registrar] section. But for this to work you must set users in regfile.conf or in register.conf.  
+
** PRACK - controlled by ''prack'' setting
* INFO - if method is received in a dialog it is handled internally
+
* PRACK - internally, is set by default to false
+
  
 
=== Generically handled Methods ===
 
=== Generically handled Methods ===

Revision as of 17:26, 9 November 2012

This page describes the SIP Methods that are handled internally in Yate and how to enable the ones that are generically handled.

Contents

What is a SIP Request Method?

A SIP request method defines the nature and the purpose of the SIP request.

This the list of SIP request methods:

  • INVITE - Requests a session.
  • ACK - Final response to the INVITE
  • OPTIONS - Ask for server capabilities
  • BYE - Terminates a session
  • PRACK - Similar to ACK, but a provisional confirmation.
  • CANCEL - Cancel any pending requests.
  • REGISTER - Registers the client with the server according to the address in the To he
  • INFO - Sends information in the middle of a session that doesn't modify the session's state.
  • SUBSCRIBE -Subscribes the device for an event notification.
  • NOTIFY - Notifies all subscribers of an event.
  • PUBLISH - Publishes an event to a server.
  • REFER - Asks the client to issue a SIP request, typically a call transfer.
  • MESSAGE - Sends an instant message using SIP.
  • UPDATE - Modifies a session's state without altering the dialog state.

SIP Methods in Yate

In Yate some SIP requests are handled internally while others are handled generically.

When a SIP request comes in Yate, depending on the request method it will be either handled in ysipchan module(internally handled), or an internal yate message named sip.methodname will be sent(generically handled).

Generically handled methods are not handled in ysipchan module. A yate message is sent for them and the handling is done in other modules/external scripts. Some methods have yate modules that handle them while others don't, so you need to define the handling of the message in a custom way when enabling them.

Internally handled Methods

Internally handled request methods are requests handled directly by ysipchan module. Yate messages like sip.methodname won't be generated for them.

The methods are handled internally by Yate:

  • methods that are always handled when ysipchan module is enabled
    • INVITE
    • CANCEL
    • ACK
    • BYE
  • methods that are handled in the default configuration and that can be enabled/disabled from [general] section
    • INFO - controlled by info setting. If request is received during a dialog it's handled internally. Outside a dialog it's handled generically.
    • OPTIONS - controlled by options setting.
  • methods that are handled in the default configuration when yate is started in server mode, and are disabled when yate is started in client mode. They can be enabled/disabled from [general] section
    • REFER - controlled by transfer setting
    • REGISTER - controlled by registersetting. If register=enabled then in [registrar] section defines how Yate will work as a SIP REGISTRAR. Before starting yate as SIP registrar set users in regfile.conf or in register.conf.
  • methods that are desabled in the default configuration but can be enabled/disabled from [general] section
    • PRACK - controlled by prack setting

Generically handled Methods

  • INFO - this SIP method if is dialogless is handled generically (by using parameter lazy100 in ysipchan.conf).


Enabling additional Methods

Use section [methods] from ysipchan.conf to allow/restrict the processing of specific SIP methods. For enabled methods yate will generate internal messages with name sip.<methodname> that can be handled from other modules.

Examples

Enable MESSAGE Method

This example allows chat and short files transfer between Twinkle clients using MESSAGE Request Method.

A MESSAGE request method transports instant messages using SIP.

regexroute.conf:

[extra]
sip.message=120
sip.publish=120
msg.route=25
msg.execute=90

[sip.message]
${xsip_type}^$=415
.*=echo Got SIP MESSAGE type '${xsip_type}' ${xsip_body_encoding} from '${username}': ${xsip_body}
.*=enqueue msg.execute;caller=${caller};called=${called};\
 domain=${domain};callto=lateroute/${called};\
 body_encoding=${xsip_body_encoding};type=${xsip_type};text=${xsip_body}
.*=200
 
[sip.publish]
${xsip_type}^application/pidf+xml$^=415
${xsip_body}<status><basic>\(.*\)</basic></status>=echo Got SIP PRESENCE from '${username}': 
.*=200

[msg.route]
.*=rename call.route;message=msg.route

[msg.execute]
${callto}^sip/\(sip:.*\)$=rename xsip.generate;\
method=MESSAGE;uri=;sip_From=<sip:${caller}@${domain$nosuch.dom}>;\
xsip_type=${type$text/plain};xsip_body_encoding=${body_encoding};\
xsip_body=${text}


In ysipchan.conf:

[general]
maxpkt=4096
generate=yes

[methods]
message=yes
publish=yes
Enable SUBSCRIBE Method

ysipchan.conf

[methods]
subscribe=yes

You then configure the allowed events for subscribing in sipfeatures.conf and define the logic for SUBSCRIBE/NOTIFY in subscription.conf.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers