Re: [SR-Users] uac_replace_from() and multiple branches
Hello, the reason for writing the error message seems to be that you execute the uac_replace_from() for requests within dialog (e.g., re-INVITE, BYE). In auto-restore mode it has to be done only for the initial request (first INVITE of the call), then the module does automatically the changes for requests within the dialog and the responses. You should add a condition like: if(!has_totag()) { ... } Cheers, Daniel On 15.08.19 16:06, John Quick wrote: > v5.2.3 of Kamailio. Serial forking is used to route calls to a multiple > destinations as described in documentation for the TM module. > Also using the DIALOG module - my script calls dlg_manage() before loading > the serialised branches. > I need to be able to substitute the username part of the From header and > have been trying this with calls to uac_replace_from(). > modparam("uac", "restore_mode", "auto") > modparam("uac", "restore_dlg", 1) > > There is no problem if all branches use one substituted From username, in > which case my script calls uac_replace_from() in the main route. > uac_replace_from("sip:" + $avp(route:src) + "@" + $fd); > > However, I may need to substitute a different value for each branch. Can > this be done? > > I tried moving the call to uac_replace_from() into the branch route, but > then I get an error when the final BYE is received: > ERROR: uac [replace.c:281]: replace_uri(): decline FROM replacing in > sequential request in auto mode (has TO tag) > > Is there a simple solution to this please? Hoping I can still use UAC auto > restore mode because manual restore looks quite tedious/complex. > > Thanks. > > John Quick > Smartvox Limited > www.smartvox.co.uk > > > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] uac_replace_from() and multiple branches
Hi John, Nevertheless, and despite the error on BYE (not immediately sure of the cause—do you have rr:append_fromtag set?), calling uac_replace_from() in a branch_route is the correct solution to the problem. It will cause the message changes wrought by ‘uac’ to be reverted to the original message buffer, plus any permanent changes, upon the initiation of a new branch attempt. — Alex — Sent from mobile, with due apologies for brevity and errors. > On Aug 15, 2019, at 10:06 AM, John Quick wrote: > > v5.2.3 of Kamailio. Serial forking is used to route calls to a multiple > destinations as described in documentation for the TM module. > Also using the DIALOG module - my script calls dlg_manage() before loading > the serialised branches. > I need to be able to substitute the username part of the From header and > have been trying this with calls to uac_replace_from(). > modparam("uac", "restore_mode", "auto") > modparam("uac", "restore_dlg", 1) > > There is no problem if all branches use one substituted From username, in > which case my script calls uac_replace_from() in the main route. > uac_replace_from("sip:" + $avp(route:src) + "@" + $fd); > > However, I may need to substitute a different value for each branch. Can > this be done? > > I tried moving the call to uac_replace_from() into the branch route, but > then I get an error when the final BYE is received: > ERROR: uac [replace.c:281]: replace_uri(): decline FROM replacing in > sequential request in auto mode (has TO tag) > > Is there a simple solution to this please? Hoping I can still use UAC auto > restore mode because manual restore looks quite tedious/complex. > > Thanks. > > John Quick > Smartvox Limited > www.smartvox.co.uk > > > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] uac_replace_from() and multiple branches
v5.2.3 of Kamailio. Serial forking is used to route calls to a multiple destinations as described in documentation for the TM module. Also using the DIALOG module - my script calls dlg_manage() before loading the serialised branches. I need to be able to substitute the username part of the From header and have been trying this with calls to uac_replace_from(). modparam("uac", "restore_mode", "auto") modparam("uac", "restore_dlg", 1) There is no problem if all branches use one substituted From username, in which case my script calls uac_replace_from() in the main route. uac_replace_from("sip:" + $avp(route:src) + "@" + $fd); However, I may need to substitute a different value for each branch. Can this be done? I tried moving the call to uac_replace_from() into the branch route, but then I get an error when the final BYE is received: ERROR: uac [replace.c:281]: replace_uri(): decline FROM replacing in sequential request in auto mode (has TO tag) Is there a simple solution to this please? Hoping I can still use UAC auto restore mode because manual restore looks quite tedious/complex. Thanks. John Quick Smartvox Limited www.smartvox.co.uk ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] pike parameters doup when have dinamyc ip clients and scanners
On 15.08.19 11:05, Daniel Tryba wrote: > On Wed, Aug 14, 2019 at 02:52:45PM -0400, PICCORO McKAY Lenz wrote: >>> In my setups I have a limit of 64 requests per 2s. But I also have >>> whitelist (with/via the permissions module) for known high traffic >>> ipaddresses. Dimensioning the pike module for the known high traffic >>> hosts kind of defeats the purpose of using pike to detect strange >>> unwanted traffic. The correct numbers depend on your endpoints. >>> >> i cannot use whitelist due my experiment are for all dinamyc ip clients >> so what its the meaning of "depend on your endpoints" ? > You need to dimension pike to at least normal expected traffic from your > endpoints (and the max number of concurrent channels). If all your > endpoints are residential phonelines, you might expect 1 or 2 active > calls. In the worst case scenario you might "a few" call setups per > second, so maybe bursts of 10 messages per second. > > But if you know you have a call center with 50 phones, with a queue to > accept bursts you might have more than 50 call setups in a worst case > scenario in a second so you might get 150 messages per second from this > endpoint (the queue answers directly, so 1 invite might result in a 100 > trying, 180 ringing and a 200 OK within a second) > > Since there is only 1 setting for pike you have to account for the > highest number of legit messages possible. > > If you want to keep the pike max number of message lower, you'll need to > be creative. Like dynamically create a whitelist of known "excessive" > trunks (by username) and exclude the ipaddresses they register from from > pike. Jumping in to point that pipelimit can be an alternative to pike for more dynamic needs. Pike is optimized for source IP addresses, but not as flexible as pipelimit, which can track traffic rates per what-ever-defined key, like user id, ip address, method type, etc ... With pipelimit one can define new "pipe" on-the-fly in routing block, not restricted to static definition via modparam. Cheers, Daniel -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] pike parameters doup when have dinamyc ip clients and scanners
On Wed, Aug 14, 2019 at 02:52:45PM -0400, PICCORO McKAY Lenz wrote: > > In my setups I have a limit of 64 requests per 2s. But I also have > > whitelist (with/via the permissions module) for known high traffic > > ipaddresses. Dimensioning the pike module for the known high traffic > > hosts kind of defeats the purpose of using pike to detect strange > > unwanted traffic. The correct numbers depend on your endpoints. > > > i cannot use whitelist due my experiment are for all dinamyc ip clients > so what its the meaning of "depend on your endpoints" ? You need to dimension pike to at least normal expected traffic from your endpoints (and the max number of concurrent channels). If all your endpoints are residential phonelines, you might expect 1 or 2 active calls. In the worst case scenario you might "a few" call setups per second, so maybe bursts of 10 messages per second. But if you know you have a call center with 50 phones, with a queue to accept bursts you might have more than 50 call setups in a worst case scenario in a second so you might get 150 messages per second from this endpoint (the queue answers directly, so 1 invite might result in a 100 trying, 180 ringing and a 200 OK within a second) Since there is only 1 setting for pike you have to account for the highest number of legit messages possible. If you want to keep the pike max number of message lower, you'll need to be creative. Like dynamically create a whitelist of known "excessive" trunks (by username) and exclude the ipaddresses they register from from pike. ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users