[OpenSIPS-Devel] [OpenSIPS/opensips] c549e6: [rest_client] trace rest requests and replies

2017-02-17 Thread ionutrazvanionita
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: c549e6ec04dd835315dd7134650e30d17309407d
  
https://github.com/OpenSIPS/opensips/commit/c549e6ec04dd835315dd7134650e30d17309407d
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M modules/proto_hep/hep.c
M modules/rest_client/rest_client.c
M modules/rest_client/rest_methods.c
M modules/rest_client/rest_methods.h

  Log Message:
  ---
  [rest_client] trace rest requests and replies


  Commit: 36c698d3a155d9a8c89e4fd5015f6c3f8f5e0be0
  
https://github.com/OpenSIPS/opensips/commit/36c698d3a155d9a8c89e4fd5015f6c3f8f5e0be0
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M modules/proto_hep/Makefile
A modules/proto_hep/cJSON/cJSON.c
A modules/proto_hep/cJSON/cJSON.h

  Log Message:
  ---
  [proto_hep] include cJSON library in proto_hep


  Commit: 158cc0645b93212cc4a7ce1155df36765d0276af
  
https://github.com/OpenSIPS/opensips/commit/158cc0645b93212cc4a7ce1155df36765d0276af
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M trace_api.h

  Log Message:
  ---
  [trace_api] export functions for adding HOMER6 compliant data

* export function to add multiple payloads, leaving
the impelemnting protocol to decide how to format this data;
* export function to add multiple correlations, except
from the protocol's correlation id;
* sip_context_trace function now leaves the possibility
to have a function in which the user can modify the message;


  Commit: b02e59557bfbe8a6a0daf358afc42ad8d9f35f67
  
https://github.com/OpenSIPS/opensips/commit/b02e59557bfbe8a6a0daf358afc42ad8d9f35f67
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M modules/proto_hep/hep.c
M modules/proto_hep/hep.h

  Log Message:
  ---
  [proto_hep] implement new trace api functions formatting to JSON

Users can now add multiple payloads and correlations using
the new functions from trace_api, which in proto_hep will be
added as JSON objects.


  Commit: 9d5d45525336759712782785b3512227651971af
  
https://github.com/OpenSIPS/opensips/commit/9d5d45525336759712782785b3512227651971af
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M modules/siptrace/siptrace.c
M modules/siptrace/siptrace.h

  Log Message:
  ---
  [siptrace] add data to message callback and sip payload as JSON

* sip_context_trace function now exports a function which
will give access to the trace_message structure and users will
be able to add/remove headers as they wish;
* sip message is now saved as JSON in the HEP message;


  Commit: ad793eabec7792de347038e0a706dc26add0a8df
  
https://github.com/OpenSIPS/opensips/commit/ad793eabec7792de347038e0a706dc26add0a8df
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M xlog.c
M xlog.h

  Log Message:
  ---
  [xlog] add trace message payload as JSON


  Commit: d4bb33c5732de2e41eea2c93ac71ca7e3af8a2e6
  
https://github.com/OpenSIPS/opensips/commit/d4bb33c5732de2e41eea2c93ac71ca7e3af8a2e6
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M mi/mi_trace.c
M mi/mi_trace.h

  Log Message:
  ---
  [mi] add mi trace payload as JSON


  Commit: aa17f82ec451ad08c5e4d784c1bfe3543d60500c
  
https://github.com/OpenSIPS/opensips/commit/aa17f82ec451ad08c5e4d784c1bfe3543d60500c
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M modules/rest_client/rest_methods.c
M modules/rest_client/rest_methods.h

  Log Message:
  ---
  [rest_client] add rest trace message payload as JSON


  Commit: 50197c741819de50f2c280243cd631fd166571a2
  
https://github.com/OpenSIPS/opensips/commit/50197c741819de50f2c280243cd631fd166571a2
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
A modules/proto_hep/cJSON.c
A modules/proto_hep/cJSON.h
R modules/proto_hep/cJSON/cJSON.c
R modules/proto_hep/cJSON/cJSON.h
M modules/proto_hep/hep.c

  Log Message:
  ---
  [proto_hep] fix json funcs file inclusions


  Commit: 23144403a50098bfb4d442c9ee2c1426a6465c8f
  
https://github.com/OpenSIPS/opensips/commit/23144403a50098bfb4d442c9ee2c1426a6465c8f
  Author: ionutrazvanionita 
  Date:   2017-02-17 (Fri, 17 Feb 2017)

  Changed paths:
M modules/proto_hep/hep.c
M modules/proto_hep/hep.h
M modules/proto_hep/proto_hep.c
M trace_api.h

  Log Message:
  

[OpenSIPS-Devel] Transactional REGISTER processing with 2.1

2017-02-17 Thread Maxim Sobolev
Hi guys,

We are underway to migrate from ancient SER-2.0.0 to more modern OpenSIPS
and one of the question that is still in my TODO list is implementing
transactional processing of the REGISTER requests. In the old SER we had
something along those lines:

route[3] {
# Ensure that all incoming messages contain auth info
xlog("L_INFO", "processing %rm received from %si:%sp");
if (!t_newtran()) {
sl_send_reply("500", "could not create transaction");
break;
};
if (!python_exec("www_authenticate")) {
xlog("L_INFO", "challenging %ct");
if (is_avp_set("s:digest_challenge")) {
append_to_reply("%$digest_challenge");
};
t_reply("401", "Unauthorized");
break;
};
   [some more unrelated processing and checks...]
xlog("L_INFO", "saving contact %ct into the database");
save_noreply("location");
if (is_avp_set("s:contact")) {
append_to_reply("%$contact");
};
t_reply("$code", "$reason");
}

The idea here is to avoid possibly costly DB lookup and other checks on
each possible re-transmit. What would be the proper way of doing this with
the OpenSIPS 2.1? Or if it's not possible to replicate such scheme, what
would be the best way to implement this which to get the change accepted
into the OpenSIPS mainline?

Any ideas, pointers, hints are greatly appreciated. Thanks in advance!

-Maxim
___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] Transactional REGISTER processing with 2.1

2017-02-17 Thread Maxim Sobolev
P.S. python_exec("www_authenticate") does not do any magic here, it's just
figures out the right domain to use based on some business rules and then
calls www_authenticate() with that parameter.

On Fri, Feb 17, 2017 at 11:12 AM, Maxim Sobolev 
wrote:

> Hi guys,
>
> We are underway to migrate from ancient SER-2.0.0 to more modern OpenSIPS
> and one of the question that is still in my TODO list is implementing
> transactional processing of the REGISTER requests. In the old SER we had
> something along those lines:
>
> route[3] {
> # Ensure that all incoming messages contain auth info
> xlog("L_INFO", "processing %rm received from %si:%sp");
> if (!t_newtran()) {
> sl_send_reply("500", "could not create transaction");
> break;
> };
> if (!python_exec("www_authenticate")) {
> xlog("L_INFO", "challenging %ct");
> if (is_avp_set("s:digest_challenge")) {
> append_to_reply("%$digest_challenge");
> };
> t_reply("401", "Unauthorized");
> break;
> };
>[some more unrelated processing and checks...]
> xlog("L_INFO", "saving contact %ct into the database");
> save_noreply("location");
> if (is_avp_set("s:contact")) {
> append_to_reply("%$contact");
> };
> t_reply("$code", "$reason");
> }
>
> The idea here is to avoid possibly costly DB lookup and other checks on
> each possible re-transmit. What would be the proper way of doing this with
> the OpenSIPS 2.1? Or if it's not possible to replicate such scheme, what
> would be the best way to implement this which to get the change accepted
> into the OpenSIPS mainline?
>
> Any ideas, pointers, hints are greatly appreciated. Thanks in advance!
>
> -Maxim
>



-- 
Maksym Sobolyev
Sippy Software, Inc.
Internet Telephony (VoIP) Experts
Tel (Canada): +1-778-783-0474
Tel (Toll-Free): +1-855-747-7779
Fax: +1-866-857-6942
Web: http://www.sippysoft.com
MSN: sa...@sippysoft.com
Skype: SippySoft
___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel