This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
cookbooks:5.2.x:core [2019/10/30 00:18] joelsdc |
cookbooks:5.2.x:core [2019/10/30 00:30] joelsdc |
||
---|---|---|---|
Line 3013: | Line 3013: | ||
The sub-route blocks allow to make the configuration file modular, simplifying the logic and helping to avoid duplication of actions. | The sub-route blocks allow to make the configuration file modular, simplifying the logic and helping to avoid duplication of actions. | ||
- | |||
==== branch_route ==== | ==== branch_route ==== | ||
Line 3115: | Line 3114: | ||
} | } | ||
</ | </ | ||
+ | ==== onsend_route ==== | ||
+ | |||
+ | The route is executed in when a SIP request is sent out. Only a limited number of commands are allowed (drop, if + all the checks, msg flag manipulations, | ||
+ | |||
+ | In this route the final destination of the message is available and can be checked (with snd_ip, snd_port, to_ip, to_port, snd_proto, snd_af). | ||
+ | |||
+ | This route is executed only when forwarding requests - it is not executed for replies, retransmissions, | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | onsend_route { | ||
+ | if(to_ip==1.2.3.4 && !isflagset(12)){ | ||
+ | log(1, " | ||
+ | drop; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * snd_ip, snd_port - behave like src_ip/ | ||
+ | * to_ip, to_port - like above, but contain the ip/port the message will be sent to (not to be confused with dst_ip/ | ||
+ | * snd_proto, snd_af - behave like proto/af but contain the protocol/ | ||
+ | * msg:len - when used in an onsend_route, | ||
+ | |||
+ | ==== event_route ==== | ||
+ | |||
+ | Generic type of route executed when specific events happen. | ||
+ | |||
+ | Prototype: event_route[groupid: | ||
+ | * groupid - should be the name of the module that triggers the event | ||
+ | * eventid - some meaningful short text describing the event | ||
+ | |||
+ | |||
+ | Implementations: | ||
+ | |||
+ | * **event_route[core: | ||
+ |