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

2018-03-08 Thread Daniel-Constantin Mierla
Closed #1474.

-- 
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#event-1511268917___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


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

2018-03-06 Thread Daniel-Constantin Mierla
If you have time soon, you can propose a PR with the option 2. Otherwise I will 
look into it whenever I get a chance, likely not today and not sure for the 
rest of the week.

-- 
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#issuecomment-371034301___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


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

2018-03-06 Thread aalba6675
In a pure KEMI script environment, printing `onsend_rt.rlist` gives
```
Breakpoint 5, run_onsend (orig_msg=0x7f622816c8b0, dst=0x7ffe78d13560, 
buf=0x7f622816fcf8 "ACK 
sip:conf-095ed1b8-a768-4af4-8ba8-a56bc139574c@10.13.20.20:5090;transport=udp 
SIP/2.0\r\nVia: SIP/2.0/UDP 
10.13.20.15;branch=z9hG4bKa2a.0092296879fe327cb9fbf6547f44d466.0;i=f\r\nVia: 
SIP/2.0/TLS 10.13."..., len=587) at core/onsend.h:73
73  if (onsend_rt.rlist[DEFAULT_RT]){
$2 = (struct action *) 0x0
```

-- 
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#issuecomment-371032705___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


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

2018-03-06 Thread aalba6675
### 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___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev