SIP Methods
Line 1: | Line 1: | ||
This page describes the Sip methods that are handled by default in Yate and how to enable the ones that are not generically handled. | This page describes the Sip methods that are handled by default in Yate and how to enable the ones that are not generically handled. | ||
− | + | == What is a SIP Request Method? == | |
− | + | == SIP Methods in Yate == | |
− | + | === Generically handled Methods === | |
Some standard SIP methods can be handled generically in Yate like INVITE, CANCEL, ACK, BYE, REFER, OPTIONS and REGISTER.<br> | Some standard SIP methods can be handled generically in Yate like INVITE, CANCEL, ACK, BYE, REFER, OPTIONS and REGISTER.<br> | ||
Line 11: | Line 11: | ||
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]]). | 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]]). | ||
− | + | ===Enabling additional methods=== | |
Use section [methods] from [[SIP Configuration File|ysipchan.conf]] to allow/restrict the processing of specific SIP methods. For enabled methods yate will generate internal messages with name [[SIP_Generic_Message|sip.<methodname>]] that can be handled from other modules. | Use section [methods] from [[SIP Configuration File|ysipchan.conf]] to allow/restrict the processing of specific SIP methods. For enabled methods yate will generate internal messages with name [[SIP_Generic_Message|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. | This example allows chat and short files transfer between Twinkle clients using MESSAGE request method. | ||
Line 63: | Line 63: | ||
publish=yes | publish=yes | ||
− | + | ===== Enable SUBSCRIBE Method===== | |
ysipchan.conf | ysipchan.conf |
Revision as of 11:07, 9 November 2012
This page describes the Sip methods that are handled by default in Yate and how to enable the ones that are not generically handled.
Contents |
What is a SIP Request Method?
SIP Methods in Yate
Generically handled Methods
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).
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}\(.*\)=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=;\ 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