User Tools

Site Tools


cookbooks:5.2.x:core

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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:19]
joelsdc
cookbooks:5.2.x:core [2019/10/30 00:28]
joelsdc
Line 3114: Line 3114:
   }   }
 </code> </code>
 +==== 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, send(), log(), textops::search()).
 +
 +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, or locally generated messages (e.g. via fifo uac).
 +
 +Example:
 +
 +<code c>
 +  onsend_route {
 +    if(to_ip==1.2.3.4 && !isflagset(12)){
 +      log(1, "message blocked\n");
 +      drop;
 +    }
 +  }
 +</code>
 +
 +  * snd_ip, snd_port - behave like src_ip/src_port, but contain the ip/port Kamailio will use to send the message
 +  * to_ip, to_port - like above, but contain the ip/port the message will be sent to (not to be confused with dst_ip/dst_port, which are the destination of the original received request: Kamailio's ip and port on which the message was received)
 +  * snd_proto, snd_af - behave like proto/af but contain the protocol/address family that Kamailio will use to send the message
 +  * msg:len - when used in an onsend_route, msg:len will contain the length of the message on the wire (after all the changes in the script are applied, Vias are added a.s.o) and not the lentgh of the original message.
 +
 +==== event_route ====
 +
 +Generic type of route executed when specific events happen.
 +
 +Prototype: event_route[groupid:eventid]
 +  * groupid - should be the name of the module that triggers the event
 +  * eventid - some meaningful short text describing the event
cookbooks/5.2.x/core.txt ยท Last modified: 2020/04/03 09:34 by henningw