[sr-dev] [kamailio/kamailio] KEMI onsend_route method is not called (#1474)

aalba6675 notifications at github.com
Wed Mar 7 06:48:30 CET 2018


### Description

KEMI onsend_route is not called unless there is a placeholder/dummy routing block.
```
## without this block, core will never call KEMI->onsend_route
onsend_route {
 ## do nothing
}
```
### Troubleshooting

#### Reproduction
1. In KEMI create ksr_onsend_route(). Observe that this function is never invoked.

2. Add a route block:
```
onsend_route {
 ## do nothing
}
```
Now observe, that KEMI ksr_onsend_route() is called.

#### Debugging Data

#### Log Messages


#### SIP Traffic

### Possible Solutions
Not really a problem, just a surprise to the KEMI user. Possibly, document that in order for the KEMI function to be called, the configuration file needs a dummy routing block for onsend_route.

### Additional Information
The reason is the following logic: 
onsend.h:
`ret=keng->froute(orig_msg, ONSEND_ROUTE, NULL, NULL);`

This line is called only if `onsend_rt.rlist[DEFAULT_RT]` is non-NULL, but this array is initialized only if the `onsend_route` block exists.

  * **Kamailio Version** - 5.1, master


* **Operating System**:
Linux CentOS 7.4

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1474
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180307/ed7bec94/attachment-0001.html>


More information about the sr-dev mailing list