[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Alex Balashov via sr-users
EVAPI is quite low-overhead.—Sent from mobile, apologies for brevity and errors.On Apr 8, 2024, at 12:34 PM, Sergio Charrua  wrote:@Alex Balashov I thought about EVAPI but I'm afraid it will bring a lot of unnecessary CPU overload, and in my case I need to have maximum CPS on this server (used for as STIR/SHAKEN with a REST API...)-Will have a try with EVAPI.Sérgio CharruaOn Mon, Apr 8, 2024 at 6:14 PM Alex Balashov via sr-users  wrote:

> On Apr 8, 2024, at 11:12 AM, Sergio Charrua via sr-users  wrote:
> 
> Also, as this is a stateless script, is there another way of using async http or making http requests to a REST API without having to use TM Module? 

You can always use an outside service, which communicates with Kamailio asynchronously via a variety of channels. See the various message brokers, EVAPI, etc.

-- 
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Sergio Charrua via sr-users
@Alex Balashov 

I thought about EVAPI but I'm afraid it will bring a lot of unnecessary CPU
overload, and in my case I need to have maximum CPS on this server (used
for as STIR/SHAKEN with a REST API...)-
Will have a try with EVAPI.

*Sérgio Charrua*

On Mon, Apr 8, 2024 at 6:14 PM Alex Balashov via sr-users <
sr-users@lists.kamailio.org> wrote:

>
>
> > On Apr 8, 2024, at 11:12 AM, Sergio Charrua via sr-users <
> sr-users@lists.kamailio.org> wrote:
> >
> > Also, as this is a stateless script, is there another way of using async
> http or making http requests to a REST API without having to use TM Module?
>
> You can always use an outside service, which communicates with Kamailio
> asynchronously via a variety of channels. See the various message brokers,
> EVAPI, etc.
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web: https://evaristesys.com
> Tel: +1-706-510-6800
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Sergio Charrua via sr-users
@Ben Kaufman :  thanks, I will try that!

@Nick Digalaks : isn't that necessary to have a correct http async
transaction? the async_http module does make/need the TM module to be
loadedand all examples I got for the async_http module had t_newtran()
method added prior to executing http request

*Sérgio Charrua*



On Mon, Apr 8, 2024 at 6:20 PM Nick Digalakis  wrote:

> I didn't test this, but why are you calling t_newtran(); if you only want
> to send the 300 response?
>
> On Apr 8, 2024 18:12, Sergio Charrua via sr-users <
> sr-users@lists.kamailio.org> wrote:
>
> Hi all!
>
>
> For testing purposes, while I am waiting for the ST/SH REST API to be
> available from other teams, I developed a small python REST API that
> returns a mockup of a JSON object with some of the required values.
> The kamailio script, completely stateless as I do not need to keep track
> of the sessions, iterates through one of the JSON branches and adds the
> destination URLs to the Contact header and replies a SIP 300 Multiple
> Choices.
> This works: the UAC does receive the SIP response with the Contacts , but
> it also receives a SIP 500 error message right after, and I can't figure
> out why. And i bet this is simple to solve
> Any clue? I'm aware I'm not processing ACK messages, but the sl_send_reply
> 403 should do the trick right? ... at least while testing
>
> Also, as this is a stateless script, is there another way of using async
> http or making http requests to a REST API without having to use TM Module?
>
> Thanks in advance.
>
> The kamailio script is has follows:
>
> #!KAMAILIO
> /* add API http timeout */
> #!define HTTP_API_TIMEOUT 5000
> #!define HTTP_API_ROUTING_ENDPOINT "http://some_python_rest_api/get_route;
> ### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
> debug=4
> log_stderror=no
> memdbg=5
> memlog=5
> log_facility=LOG_LOCAL0
> log_prefix="{$mt $hdr(CSeq) $ci} "
> /* number of SIP routing processes */
> children=2
> /* set paths to location of modules */
> loadmodule "tm.so"
> loadmodule "jsonrpcs.so"
> loadmodule "kex.so"
> loadmodule "corex.so"
> loadmodule "sl.so"
> loadmodule "db_mysql.so"
> loadmodule "rr.so"
> loadmodule "pv.so"
> loadmodule "maxfwd.so"
> loadmodule "ipops.so"
> loadmodule "textops.so"
> loadmodule "siputils.so"
> loadmodule "xlog.so"
> loadmodule "sanity.so"
> loadmodule "ctl.so"
> loadmodule "cfg_rpc.so"
> loadmodule "uac.so"
> loadmodule "counters.so"
> loadmodule "http_async_client.so"
> loadmodule "jansson.so"
> loadmodule "usrloc.so"
> /* listen addresses */
> listen=udp:10.20.0.2:5060
> listen=udp:10.20.0.2:5062
> advertised_address="10.20.0.2";
> # - http_async_client params -
> modparam("http_async_client", "workers", HTTP_ASYNC_CLIENT_WORKERS)
> modparam("http_async_client", "connection_timeout", 2000)
> request_route {
>   #route(HANDLE_DMQ);
>   route(HANDLE_OPTIONS);
>   if (is_method("INVITE"))
>   {
> xlog("L_INFO","MAIN - calling TO_CARRIER");
> route(TO_CARRIER);
> exit;
>   }
>   else{
> sl_send_reply("401","UNAUTHORIZED");
>   }
> }
> route[TO_CARRIER]{
> xlog("L_INFO","TO_CARRIER - calling RELAY_API");
> route(RELAY_API);   #Route relay
> xlog("L_INFO","TO_CARRIER - return");
> return;
> }
> # Relay request using the API (response)
> route[RELAY_API_RESPONSE] {
> xlog("L_INFO","RELAY_API_RESPONSE - got response from REST API");
> if ($http_ok==1 && $http_rs==200)
> {
> xlog("L_INFO","RELAY_API_RESPONSE - HTTP RESPONSE:
> $http_rb\n");
> if (jansson_get("json", $http_rb, "$var(json)")) {
> xlog("L_INFO","RELAY_API_RESPONSE - JSON =
> $var(json)");
> $var(count) = 0;
> jansson_array_size("routes", $var(json),
> "$var(size)");
> xlog("L_INFO","RELAY_API_RESPONSE -
> jansson_array_size");
>
>
> while ( $var(count) < $var(size) ){
>
>
> jansson_get("routes[$var(count)].headers.to.uri", $var(rtjson), "$var(v)");
>
> xlog("L_INFO","JSON - routes[$var(count)]
> - $var(v)");
>
> #$(avp(mycontacts)[$var(count)]) =
> $avp(mycontacts) + $var(v) + "\r\n";
>
> $avp(mycontacts) = $avp(mycontacts) +
> $var(v) + ";";
>
>
>
> *append_to_reply("Contact: <" + $var(v)
> +">"+ "\r\n"); /*     IS THERE A BETTER ?? . */*
>
>
>
> $var(count) = $var(count) + 1;
>
> }
>
>
> xlog("L_INFO","RELAY_API_RESPONSE - RELAY");
> xlog("L_INFO","MAIN - calling REPLY_302");
> route(REPLY_302);
> return;
> }
> }
> send_reply(500, "API Not Available - http response = $http_rs
> $http_ok");
> exit;
> }
> 

[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Nick Digalakis via sr-users
I didn't test this, but why are you calling t_newtran(); if you only want to send the 300 response? On Apr 8, 2024 18:12, Sergio Charrua via sr-users  wrote:Hi all!For testing purposes, while I am waiting for the ST/SH REST API to be available from other teams, I developed a small python REST API that returns a mockup of a JSON object with some of the required values. The kamailio script, completely stateless as I do not need to keep track of the sessions, iterates through one of the JSON branches and adds the destination URLs to the Contact header and replies a SIP 300 Multiple Choices.This works: the UAC does receive the SIP response with the Contacts , but it also receives a SIP 500 error message right after, and I can't figure out why. And i bet this is simple to solve Any clue? I'm aware I'm not processing ACK messages, but the sl_send_reply 403 should do the trick right? ... at least while testingAlso, as this is a stateless script, is there another way of using async http or making http requests to a REST API without having to use TM Module? Thanks in advance.The kamailio script is has follows:#!KAMAILIO/* add API http timeout */#!define HTTP_API_TIMEOUT 5000#!define HTTP_API_ROUTING_ENDPOINT "http://some_python_rest_api/get_route"### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERRdebug=4log_stderror=nomemdbg=5memlog=5log_facility=LOG_LOCAL0log_prefix="{$mt $hdr(CSeq) $ci} "/* number of SIP routing processes */children=2/* set paths to location of modules */loadmodule "tm.so"loadmodule "jsonrpcs.so"loadmodule "kex.so"loadmodule "corex.so"loadmodule "sl.so"loadmodule "db_mysql.so"loadmodule "rr.so"loadmodule "pv.so"loadmodule "maxfwd.so"loadmodule "ipops.so"loadmodule "textops.so"loadmodule "siputils.so"loadmodule "xlog.so"loadmodule "sanity.so"loadmodule "ctl.so"loadmodule "cfg_rpc.so"loadmodule "uac.so"loadmodule "counters.so"loadmodule "http_async_client.so"loadmodule "jansson.so"loadmodule "usrloc.so"/* listen addresses */listen=udp:10.20.0.2:5060listen=udp:10.20.0.2:5062advertised_address="10.20.0.2";# - http_async_client params -modparam("http_async_client", "workers", HTTP_ASYNC_CLIENT_WORKERS)modparam("http_async_client", "connection_timeout", 2000)request_route {  #route(HANDLE_DMQ);  route(HANDLE_OPTIONS);  if (is_method("INVITE"))  {    xlog("L_INFO","MAIN - calling TO_CARRIER");    route(TO_CARRIER);    exit;  }  else{        sl_send_reply("401","UNAUTHORIZED");  }}route[TO_CARRIER]{        xlog("L_INFO","TO_CARRIER - calling RELAY_API");        route(RELAY_API);                   #Route relay        xlog("L_INFO","TO_CARRIER - return");        return;}# Relay request using the API (response)route[RELAY_API_RESPONSE] {    xlog("L_INFO","RELAY_API_RESPONSE - got response from REST API");        if ($http_ok==1 && $http_rs==200)        {                xlog("L_INFO","RELAY_API_RESPONSE - HTTP RESPONSE: $http_rb\n");                if (jansson_get("json", $http_rb, "$var(json)")) {                        xlog("L_INFO","RELAY_API_RESPONSE - JSON = $var(json)");                        $var(count) = 0;                        jansson_array_size("routes", $var(json), "$var(size)");                        xlog("L_INFO","RELAY_API_RESPONSE - jansson_array_size");                                            while ( $var(count) < $var(size) ){                                jansson_get("routes[$var(count)].headers.to.uri", $var(rtjson), "$var(v)");                                xlog("L_INFO","JSON - routes[$var(count)] - $var(v)");                                #$(avp(mycontacts)[$var(count)]) = $avp(mycontacts) + $var(v) + "\r\n";                                $avp(mycontacts) = $avp(mycontacts) + $var(v) + ";";                                 append_to_reply("Contact: <" + $var(v)  +">"+ "\r\n"); /*     IS THERE A BETTER ?? . */                                 $var(count) = $var(count) + 1;                        }                                                xlog("L_INFO","RELAY_API_RESPONSE - RELAY");                        xlog("L_INFO","MAIN - calling REPLY_302");                        route(REPLY_302);                        return;                }        }        send_reply(500, "API Not Available - http response = $http_rs $http_ok");        exit;}route[RELAY_API] {        xlog("L_INFO","RELAY_API - from_ip $si:$sp from_number $fU to_number $ru");        $http_req(all) = $null;        $http_req(suspend) = 1;        $http_req(timeout) = HTTP_API_TIMEOUT;        $http_req(method) = "POST";        $http_req(hdr) = "Content-Type: application/json";        jansson_set("string","from_ip",$si, "$var(http_routing_query)");        jansson_set("string","from_port",$sp, "$var(http_routing_query)");        jansson_set("string","from_number",$fU, "$var(http_routing_query)");        jansson_set("string","to_number",$ru , "$var(http_routing_query)");        xlog("L_INFO","RELAY_API - API ASYNC ROUTING REQUEST: $var(http_routing_query)\n");        $http_req(body) = 

[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Ben Kaufman via sr-users
> The kamailio script, completely stateless as I do not need to keep track of 
> the sessions, iterates through one of the JSON branches and adds the 
> destination URLs to the Contact header and replies a SIP 300 Multiple Choices.


The term 'stateless' in the scope of a SIP proxy doesn't mean to keep track of 
the session (or the dialog).  It means tracking the state of the transaction.  
In order to pause the current transaction and resume it (using 
http_async_query()), a stateful transaction must be created within Kamailio - 
and you've done this when you call `t_newtran()`.  As a recommendation, rather 
than using `sl_send_reply()`, `t_reply()`, or `t_send_reply()`, just  use 
`send_reply()`, which will send the reply statelessly if there's no 
transaction, and statefully if there is a transaction.


If you want to make your replies LOOK stateless to request source, disable 
automatic 100 Trying from the TM module.



Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com




SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768
[img]
[img]
[img]


From: Sergio Charrua via sr-users 
Sent: Monday, April 8, 2024 10:13 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Sergio Charrua 
Subject: [SR-Users] making HTTP requests in stateless redirects


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi all!


For testing purposes, while I am waiting for the ST/SH REST API to be available 
from other teams, I developed a small python REST API that returns a mockup of 
a JSON object with some of the required values.
The kamailio script, completely stateless as I do not need to keep track of the 
sessions, iterates through one of the JSON branches and adds the destination 
URLs to the Contact header and replies a SIP 300 Multiple Choices.
This works: the UAC does receive the SIP response with the Contacts , but it 
also receives a SIP 500 error message right after, and I can't figure out why. 
And i bet this is simple to solve
Any clue? I'm aware I'm not processing ACK messages, but the sl_send_reply 403 
should do the trick right? ... at least while testing

Also, as this is a stateless script, is there another way of using async http 
or making http requests to a REST API without having to use TM Module?

Thanks in advance.

The kamailio script is has follows:

#!KAMAILIO
/* add API http timeout */
#!define HTTP_API_TIMEOUT 5000
#!define HTTP_API_ROUTING_ENDPOINT "http://some_python_rest_api/get_route;
### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
debug=4
log_stderror=no
memdbg=5
memlog=5
log_facility=LOG_LOCAL0
log_prefix="{$mt $hdr(CSeq) $ci} "
/* number of SIP routing processes */
children=2
/* set paths to location of modules */
loadmodule "tm.so"
loadmodule "jsonrpcs.so"
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "sl.so"
loadmodule "db_mysql.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "ipops.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
loadmodule "uac.so"
loadmodule "counters.so"
loadmodule "http_async_client.so"
loadmodule "jansson.so"
loadmodule "usrloc.so"
/* listen addresses */
listen=udp:10.20.0.2:5060
listen=udp:10.20.0.2:5062
advertised_address="10.20.0.2";
# - http_async_client params -
modparam("http_async_client", "workers", HTTP_ASYNC_CLIENT_WORKERS)
modparam("http_async_client", "connection_timeout", 2000)
request_route {
  #route(HANDLE_DMQ);
  route(HANDLE_OPTIONS);
  if (is_method("INVITE"))
  {
xlog("L_INFO","MAIN - calling TO_CARRIER");
route(TO_CARRIER);
exit;
  }
  else{
sl_send_reply("401","UNAUTHORIZED");
  }
}
route[TO_CARRIER]{
xlog("L_INFO","TO_CARRIER - calling RELAY_API");
route(RELAY_API);   #Route relay
xlog("L_INFO","TO_CARRIER - return");
return;
}
# Relay request using the API (response)
route[RELAY_API_RESPONSE] {
xlog("L_INFO","RELAY_API_RESPONSE - got response from REST API");
if ($http_ok==1 && $http_rs==200)
{
xlog("L_INFO","RELAY_API_RESPONSE - HTTP RESPONSE: $http_rb\n");
if (jansson_get("json", $http_rb, "$var(json)")) {
xlog("L_INFO","RELAY_API_RESPONSE - JSON = $var(json)");
$var(count) = 0;
jansson_array_size("routes", $var(json), "$var(size)");
xlog("L_INFO","RELAY_API_RESPONSE - 
jansson_array_size");

while ( $var(count) < $var(size) ){

jansson_get("routes[$var(count)].headers.to.uri", $var(rtjson), "$var(v)");

[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Alex Balashov via sr-users


> On Apr 8, 2024, at 11:12 AM, Sergio Charrua via sr-users 
>  wrote:
> 
> Also, as this is a stateless script, is there another way of using async http 
> or making http requests to a REST API without having to use TM Module? 

You can always use an outside service, which communicates with Kamailio 
asynchronously via a variety of channels. See the various message brokers, 
EVAPI, etc.

-- 
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] making HTTP requests in stateless redirects

2024-04-08 Thread Sergio Charrua via sr-users
Hi all!


For testing purposes, while I am waiting for the ST/SH REST API to be
available from other teams, I developed a small python REST API that
returns a mockup of a JSON object with some of the required values.
The kamailio script, completely stateless as I do not need to keep track of
the sessions, iterates through one of the JSON branches and adds the
destination URLs to the Contact header and replies a SIP 300 Multiple
Choices.
This works: the UAC does receive the SIP response with the Contacts , but
it also receives a SIP 500 error message right after, and I can't figure
out why. And i bet this is simple to solve
Any clue? I'm aware I'm not processing ACK messages, but the sl_send_reply
403 should do the trick right? ... at least while testing

Also, as this is a stateless script, is there another way of using async
http or making http requests to a REST API without having to use TM Module?

Thanks in advance.

The kamailio script is has follows:

#!KAMAILIO
> /* add API http timeout */
> #!define HTTP_API_TIMEOUT 5000
> #!define HTTP_API_ROUTING_ENDPOINT "http://some_python_rest_api/get_route;
> ### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
> debug=4
> log_stderror=no
> memdbg=5
> memlog=5
> log_facility=LOG_LOCAL0
> log_prefix="{$mt $hdr(CSeq) $ci} "
> /* number of SIP routing processes */
> children=2
> /* set paths to location of modules */
> loadmodule "tm.so"
> loadmodule "jsonrpcs.so"
> loadmodule "kex.so"
> loadmodule "corex.so"
> loadmodule "sl.so"
> loadmodule "db_mysql.so"
> loadmodule "rr.so"
> loadmodule "pv.so"
> loadmodule "maxfwd.so"
> loadmodule "ipops.so"
> loadmodule "textops.so"
> loadmodule "siputils.so"
> loadmodule "xlog.so"
> loadmodule "sanity.so"
> loadmodule "ctl.so"
> loadmodule "cfg_rpc.so"
> loadmodule "uac.so"
> loadmodule "counters.so"
> loadmodule "http_async_client.so"
> loadmodule "jansson.so"
> loadmodule "usrloc.so"
> /* listen addresses */
> listen=udp:10.20.0.2:5060
> listen=udp:10.20.0.2:5062
> advertised_address="10.20.0.2";
> # - http_async_client params -
> modparam("http_async_client", "workers", HTTP_ASYNC_CLIENT_WORKERS)
> modparam("http_async_client", "connection_timeout", 2000)
> request_route {
>   #route(HANDLE_DMQ);
>   route(HANDLE_OPTIONS);
>   if (is_method("INVITE"))
>   {
> xlog("L_INFO","MAIN - calling TO_CARRIER");
> route(TO_CARRIER);
> exit;
>   }
>   else{
> sl_send_reply("401","UNAUTHORIZED");
>   }
> }
> route[TO_CARRIER]{
> xlog("L_INFO","TO_CARRIER - calling RELAY_API");
> route(RELAY_API);   #Route relay
> xlog("L_INFO","TO_CARRIER - return");
> return;
> }
> # Relay request using the API (response)
> route[RELAY_API_RESPONSE] {
> xlog("L_INFO","RELAY_API_RESPONSE - got response from REST API");
> if ($http_ok==1 && $http_rs==200)
> {
> xlog("L_INFO","RELAY_API_RESPONSE - HTTP RESPONSE:
> $http_rb\n");
> if (jansson_get("json", $http_rb, "$var(json)")) {
> xlog("L_INFO","RELAY_API_RESPONSE - JSON =
> $var(json)");
> $var(count) = 0;
> jansson_array_size("routes", $var(json),
> "$var(size)");
> xlog("L_INFO","RELAY_API_RESPONSE -
> jansson_array_size");
>
>>
>> while ( $var(count) < $var(size) ){
>
>
>> jansson_get("routes[$var(count)].headers.to.uri", $var(rtjson), "$var(v)");
>
> xlog("L_INFO","JSON - routes[$var(count)]
>> - $var(v)");
>
> #$(avp(mycontacts)[$var(count)]) =
>> $avp(mycontacts) + $var(v) + "\r\n";
>
> $avp(mycontacts) = $avp(mycontacts) +
>> $var(v) + ";";
>
>

> *append_to_reply("Contact: <" + $var(v)
>> +">"+ "\r\n"); /*     IS THERE A BETTER ?? . */*
>
>

> $var(count) = $var(count) + 1;
>
> }
>
>
> xlog("L_INFO","RELAY_API_RESPONSE - RELAY");
> xlog("L_INFO","MAIN - calling REPLY_302");
> route(REPLY_302);
> return;
> }
> }
> send_reply(500, "API Not Available - http response = $http_rs
> $http_ok");
> exit;
> }
> route[RELAY_API] {

xlog("L_INFO","RELAY_API - from_ip $si:$sp from_number $fU
> to_number $ru");
> $http_req(all) = $null;
> $http_req(suspend) = 1;
> $http_req(timeout) = HTTP_API_TIMEOUT;
> $http_req(method) = "POST";
> $http_req(hdr) = "Content-Type: application/json";
> jansson_set("string","from_ip",$si, "$var(http_routing_query)");
> jansson_set("string","from_port",$sp, "$var(http_routing_query)");
> jansson_set("string","from_number",$fU,
> "$var(http_routing_query)");
> jansson_set("string","to_number",$ru , 

[SR-Users] Solution found: Race condition in dialog on 422 reply deletes variables.

2024-04-08 Thread Benoit Panizzon via sr-users
Hi all

I have found another solution:

Don't use: setflag(FLT_DLG);

call dlg_manage() on every message entering request_route before trying
to set dlg_vars.

On a 422 reply I now get two CDR, but that is OK as long as I have
correct dlg_vars on the second almost identical call (endpoint
immediately re-sending the invite with smaller session timer) which is
then connected and which I need for billing.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio Admin Book email

2024-04-08 Thread sadik.oualla.mohamed--- via sr-users
Hello Daniel,

Following your feedback regarding the incomplete address in my  request, I have 
resubmitted the form with the corrected address format and included "N/A" for 
the VAT number, as I am located outside the EU (in Morocco).

I think that the updated details meet the requirements, but please let me know 
if there's anything further needed from my side to process the purchase 
successfully.

Thank you for your attention to this matter, and I look forward to your 
confirmation.

Sincerely yours, 
Mohamed.
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio Admin Book email

2024-04-08 Thread Daniel-Constantin Mierla via sr-users
Hello,

as you can see on the page with the form for requesting to purchase the
book, incomplete requests are not making it through:

"The requests with invalid or incomplete values for the required fields
are ignored."

Searching over the discarded requests, the provided address in your
message is incomplete. Those details are required by Eu/German laws for
invoice and income taxes.

Cheers,
Daniel

On 07.04.24 23:15, sadik.oualla.mohamed--- via sr-users wrote:
> Hello,
>
> Last week, I submitted a request on the Asipto website to purchase the 
> Kamailio Admin Book and received an automatic confirmation email. However, I 
> have not received any further instructions on how to complete the purchase. I 
> replied to the automatic email to follow up, but still, there has been no 
> response. I need to get the book as soon as possible.
>
> Please note, I am writing from a different email address than the one I used 
> to make the request on Asipto's site. If there are any issues with their 
> contact email, or if further verification is needed, please let me know how 
> to proceed securely without sharing personal details publicly on this list.
>
> Regards,
> Mohamed.
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio World Conference, April 18-19, 2024, Berlin -- kamailioworld.com

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Unable to remove/modify/replace "Contact SIP header'

2024-04-08 Thread SAMUEL MOYA TINOCO via sr-users
Hi, 
I'm not sure if it fits what you want to do but you can check topos module to 
change contact header 
https://www.kamailio.org/docs/modules/devel/modules/topos.html
 


-Mensaje original-
De: ramaseshi.kolli--- via sr-users  
Enviado el: domingo, 7 de abril de 2024 15:41
Para: sr-users@lists.kamailio.org
CC: ramaseshi.ko...@gmail.com
Asunto: [SR-Users] Unable to remove/modify/replace "Contact SIP header'

Hi All,
My requirement is when incoming call comes from internal user in i want to put 
kamailio ip and port in Contact header and forward or dispatch request to sip 
trunk carrier but i am unable to do so using KEMI frame work LUA. Can someone 
please give some pointer please?

KSR.textops.remove_hf("Contact");
KSR.textopsx.assign_hf_value("Contact","");
KSR.rtpengine.rtpengine_manage0();
if KSR.tm.t_relay()<0 then
KSR.sl.sl_reply_error();
end
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] customizing the ds_ping_interval dispatcher parameter for destination

2024-04-08 Thread Giuseppe Pandolfi via sr-users
Hi,
I have one question about dispatcher module in kamailio V.5.3.1.
Why the ds_ping_interval parameter is only global value? Is it possible 
introduce the customization value for single destination?
Customization from destination is already possible for ds_ping_from parameter 
using special attributes in destination list file or db table, is it possible 
introduce the same management for ds_ping_interval?

Thanks,
Giuseppe



NOTA BENE: Le informazioni contenute nel presente messaggio, compresi gli 
eventuali allegati, sono strettamente confidenziali ed indirizzate unicamente 
al destinatario indicato. Qualora non foste il destinatario Vi invitiamo a 
cancellare il messaggio, ed ogni eventuale documento allegato, non divulgare il 
contenuto a terze persone ed a volerci avvisare a mezzo posta elettronica. 
Grazie. A TLC S.r.l. tratta i vostri dati personali nel rispetto della 
normativa vigente in materia di Privacy (D.Lgs.196/2003 modificato dal 
D.Lgs.101/2018 e GDPR Regolamento UE n.679/2016). Per consultare l’Informativa 
completa la invitiamo a visitare il nostro sito web 
“www.aethra.com”



PLEASE NOTE: This message and any attachments are confidential and may contain 
privileged information. If you are not the intended recipient, you are kindly 
requested to cancel it, not to disclose the contents to any other person and to 
notify the sender immediately by return e-mail. Thanks. A TLC S.r.l. collects 
your personal data in compliance with applicable data protection laws (D.Lgs. 
196/2003 amended by Legislative Decree 101/018 and GDPR EU Regulation n. 
679/2016).  Please visit our website ”www.aethra.com” to 
consult the complete Policy.



__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: