SIP Methods

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
In this page we will find out more about what messages are handled by ysipchan module.<br> In ysipchan.conf you can find a section called [methods] that allows Yate to process SIP methods by handling messages with name ''sip.methodname''.
+
Page that describes the Sip methods that are handled by default in Yate and how to enable the ones that are not generically handled.
<!--=== What are messages in Yate? ===
+
  
Messages are the main piece of Yate. They are used between modules insted of using functions. This is done mainly because if one module is changing to not have to change all the other modules that are dependent, and also because the debugging can be done in the engine much easier.
+
=== SIP Methods in Yate ===
  
A message is a holder for several components:
+
Some standard SIP methods can be handled generically in Yate like INVITE, CANCEL, ACK, BYE, REFER, OPTIONS and REGISTER.<br>
  
*    name - identifies the message type and allows matching it against the possible handlers
+
For example SIP method INFO in a dialog is handled internally by Yate but dialogless is handled generically (by using parameter lazy100 in [[SIP Configuration File|ysipchan.conf]]).
*    return value - a string that is used as returned value by the emitter of the message
+
*    time - the time the message was created. This is important if the messages are queued for an indefinite amount of time
+
*    parameters - an arbitrary number (including zero) of string values, each having a name. Each handler can take action based on specific parameters and/or modify them. Unknown parameters must be ignored.  
+
  
-->
 
<!--'''SIP requests''' are the codes used by Session Initiation Protocol for communication.
 
  
 +
In ysipchan.conf is section called [methods] that allows Yate to process SIP methods by handling messages with name [[Sip Generic|sip.<methodname>]] (written in lower case).
  
{|class="wikitable"
+
====Example====
|+ SIP requests
+
! Request name !! Description !! Defined in
+
|-
+
| INVITE || Indicates a client is being invited to participate in a call session. || RFC 3261
+
|-
+
| ACK || Confirms that the client has received a final response to an INVITE request. || RFC 3261
+
|-
+
| BYE || Terminates a call and can be sent by either the caller or the callee. || RFC 3261
+
|-
+
| CANCEL || Cancels any pending request. || RFC 3261
+
|-
+
| OPTIONS || Queries the capabilities of servers. || RFC 3261
+
|-
+
| REGISTER || Registers the address listed in the To header field with a SIP server. || RFC 3261
+
|-
+
| PRACK || Provisional acknowledgement. || RFC 3262
+
|-
+
| SUBSCRIBE || Subscribes for an Event of Notification from the Notifier. || RFC 3265
+
|-
+
| NOTIFY || Notify the subscriber of a new Event. || RFC 3265
+
|-
+
| PUBLISH || Publishes an event to the Server. || RFC 3903
+
|-
+
| INFO || Sends mid-session information that does not modify the session state. || RFC 6086
+
|-
+
| REFER || Asks recipient to issue SIP request (call transfer.) || RFC 3515
+
|-
+
| MESSAGE || Transports instant messages using SIP. || RFC 3428
+
|-
+
| UPDATE || Modifies the state of a session without changing the state of the dialog. || RFC 3311
+
|}
+
  
Some standard SIP methods can be handled generically in Yate:  
+
1) Enable SIP method: sip.message
  
- INVITE, CANCEL, ACK, BYE, REFER, OPTIONS and REGISTER are always handled internally<br>
 
- INFO in a dialog is handled internally, dialogless one is handled generically (using parameter lazy100 in [[SIP Configuration File|ysipchan.conf]])
 
-->
 
  
=== SIP Methods in Yate ===
+
ysipchan.conf
 +
 
 +
[methods]
 +
message=yes
  
Some standard SIP methods can be handled generically in Yate like INVITE, CANCEL, ACK, BYE, REFER, OPTIONS and REGISTER. SIP method INFO in a dialog is handled internally by Yate but dialogless is handled generically (using parameter lazy100 in [[SIP Configuration File|ysipchan.conf]]).
 
  
 +
In regexroute.conf
  
<!--
+
[extra]
==== Messages emitted ====
+
sip.message=120
* Channel related messages
+
** [[chan.startup]]
+
[sip.message]
** [[chan.hangup]]
+
.*=echo Got SIP MESSAGE type '${xsip_type}' ${xsip_body_encoding} from '${username}': ${xsip_body}
** [[chan.disconnected]]
+
** [[chan.dtmf]]
+
* Call related messages
+
** [[call.preroute]]
+
** [[call.route]]
+
** [[call.execute]]
+
** [[call.progress]]
+
** [[call.ringing]]
+
** [[call.answered]]
+
** [[call.update]]
+
* User related messages
+
** [[user.auth]]
+
** [[user.notify]]
+
** [[user.register]]
+
** [[user.unregister]]
+
* Specials
+
** [[chan.rtp]]-->
+
* [[Sip Generic|sip.<methodname>]] - where methodname is the name of the received SIP request
+
<!--** [[isup.decode]]-->
+
  
  
<!--
+
<!--* [[Sip Generic|sip.<methodname>]] - where methodname is the name of the received SIP request
==== Messages handled ====
+
* [[xsip.generate]] - is a message sent by a module (ysipchan module) requesting the transmission of a SIP request-->
* Channel related messages
+
** [[chan.masquerade]]
+
** [[chan.locate]]
+
* Call related messages
+
** [[call.route]]
+
** [[call.progress]]
+
** [[call.ringing]]
+
** [[call.answered]]
+
** [[call.update]]
+
** [[call.drop]]
+
* User related messages
+
** [[user.login]]
+
* Module control and housekeeping
+
** [[engine.timer]]
+
** [[engine.halt]]
+
** [[engine.status]]
+
** [[engine.command]]
+
* Specials -->
+
* [[xsip.generate]] - is a message sent by a module (ysipchan module) requesting the transmission of a SIP request
+

Revision as of 14:59, 7 November 2012

Page that describes the Sip methods that are handled by default in Yate and how to enable the ones that are not generically handled.

SIP Methods in Yate

Some standard SIP methods can be handled generically in Yate like INVITE, CANCEL, ACK, BYE, REFER, OPTIONS and REGISTER.

For example SIP method INFO in a dialog is handled internally by Yate but dialogless is handled generically (by using parameter lazy100 in ysipchan.conf).


In ysipchan.conf is section called [methods] that allows Yate to process SIP methods by handling messages with name sip.<methodname> (written in lower case).

Example

1) Enable SIP method: sip.message


ysipchan.conf

[methods]
message=yes


In regexroute.conf

[extra]
sip.message=120

[sip.message]
.*=echo Got SIP MESSAGE type '${xsip_type}' ${xsip_body_encoding} from '${username}': ${xsip_body}


Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers