Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ru siproxd_orange-0.2/configure siproxd_orange-0.2.1/configure
- --- siproxd_orange-0.2/configure 2014-11-15 12:13:10.000000000 +0100
- +++ siproxd_orange-0.2.1/configure 2015-01-07 20:40:45.000000000 +0100
- @@ -1,6 +1,6 @@
- #! /bin/sh
- # Guess values for system-dependent variables and create Makefiles.
- -# Generated by GNU Autoconf 2.69 for siproxd_orange 0.2.
- +# Generated by GNU Autoconf 2.69 for siproxd_orange 0.2.1.
- #
- # Report bugs to <http://code.x0r.fr/siproxd_orange/issues>.
- #
- @@ -590,8 +590,8 @@
- # Identity of this package.
- PACKAGE_NAME='siproxd_orange'
- PACKAGE_TARNAME='siproxd_orange'
- -PACKAGE_VERSION='0.2'
- -PACKAGE_STRING='siproxd_orange 0.2'
- +PACKAGE_VERSION='0.2.1'
- +PACKAGE_STRING='siproxd_orange 0.2.1'
- PACKAGE_BUGREPORT='http://code.x0r.fr/siproxd_orange/issues'
- PACKAGE_URL='http://code.x0r.fr/siproxd_orange'
- @@ -1335,7 +1335,7 @@
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
- -\`configure' configures siproxd_orange 0.2 to adapt to many kinds of systems.
- +\`configure' configures siproxd_orange 0.2.1 to adapt to many kinds of systems.
- Usage: $0 [OPTION]... [VAR=VALUE]...
- @@ -1405,7 +1405,7 @@
- if test -n "$ac_init_help"; then
- case $ac_init_help in
- - short | recursive ) echo "Configuration of siproxd_orange 0.2:";;
- + short | recursive ) echo "Configuration of siproxd_orange 0.2.1:";;
- esac
- cat <<\_ACEOF
- @@ -1526,7 +1526,7 @@
- test -n "$ac_init_help" && exit $ac_status
- if $ac_init_version; then
- cat <<\_ACEOF
- -siproxd_orange configure 0.2
- +siproxd_orange configure 0.2.1
- generated by GNU Autoconf 2.69
- Copyright (C) 2012 Free Software Foundation, Inc.
- @@ -2124,7 +2124,7 @@
- This file contains any messages produced by compilers while
- running configure, to aid debugging if configure makes a mistake.
- -It was created by siproxd_orange $as_me 0.2, which was
- +It was created by siproxd_orange $as_me 0.2.1, which was
- generated by GNU Autoconf 2.69. Invocation command line was
- $ $0 $@
- @@ -2989,7 +2989,7 @@
- # Define the identity of the package.
- PACKAGE='siproxd_orange'
- - VERSION='0.2'
- + VERSION='0.2.1'
- cat >>confdefs.h <<_ACEOF
- @@ -18020,7 +18020,7 @@
- # report actual input values of CONFIG_FILES etc. instead of their
- # values after options handling.
- ac_log="
- -This file was extended by siproxd_orange $as_me 0.2, which was
- +This file was extended by siproxd_orange $as_me 0.2.1, which was
- generated by GNU Autoconf 2.69. Invocation command line was
- CONFIG_FILES = $CONFIG_FILES
- @@ -18087,7 +18087,7 @@
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
- ac_cs_version="\\
- -siproxd_orange config.status 0.2
- +siproxd_orange config.status 0.2.1
- configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
- diff -ru siproxd_orange-0.2/configure.ac siproxd_orange-0.2.1/configure.ac
- --- siproxd_orange-0.2/configure.ac 2014-11-15 12:10:41.000000000 +0100
- +++ siproxd_orange-0.2.1/configure.ac 2015-01-07 20:39:43.000000000 +0100
- @@ -1,4 +1,4 @@
- -AC_INIT([siproxd_orange], [0.2], [http://code.x0r.fr/siproxd_orange/issues], [siproxd_orange], [http://code.x0r.fr/siproxd_orange])
- +AC_INIT([siproxd_orange], [0.2.1], [http://code.x0r.fr/siproxd_orange/issues], [siproxd_orange], [http://code.x0r.fr/siproxd_orange])
- AC_CONFIG_AUX_DIR([build-aux])
- AC_CONFIG_HEADERS([src/config.h])
- AM_INIT_AUTOMAKE([foreign -Wall -Werror dist-bzip2 subdir-objects])
- diff -ru siproxd_orange-0.2/src/auth.c siproxd_orange-0.2.1/src/auth.c
- --- siproxd_orange-0.2/src/auth.c 2014-11-15 11:47:23.000000000 +0100
- +++ siproxd_orange-0.2.1/src/auth.c 2015-01-07 17:29:03.000000000 +0100
- @@ -394,6 +394,7 @@
- struct sip_params** p_s2r)
- {
- char* postdata;
- + char curl_errbuf[CURL_ERROR_SIZE] = "";
- size_t content_length;
- int ret, result = 0;
- @@ -401,9 +402,9 @@
- struct safe_string response;
- struct sip_params* s2r;
- - const char fake_os_name[] = "Windows";
- - const char fake_os_ver[] = "XP";
- - const char fake_ua_ver[] = "2.5.8";
- + const char fake_os_name[] = "Android";
- + const char fake_os_ver[] = "5.0";
- + const char fake_ua_ver[] = "2.6.0";
- const char fake_lang[] = "fr";
- const char fake_mode[] = "Nominal";
- @@ -453,9 +454,11 @@
- curl_easy_setopt(curl, CURLOPT_USERAGENT, "");
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, auth_step1_write_callback);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
- + curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
- + curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
- if ((ret = curl_easy_perform(curl))) {
- - fprintf(stderr, "auth_step2: %s\n", curl_easy_strerror(ret));
- + fprintf(stderr, "auth_step2: %s\n", curl_errbuf);
- result = 1;
- goto err_2;
- }
- diff -ru siproxd_orange-0.2/src/plugin_orange.c siproxd_orange-0.2.1/src/plugin_orange.c
- --- siproxd_orange-0.2/src/plugin_orange.c 2014-11-15 11:53:07.000000000 +0100
- +++ siproxd_orange-0.2.1/src/plugin_orange.c 2015-01-07 20:39:43.000000000 +0100
- @@ -23,6 +23,7 @@
- #include "config.h"
- +#include <assert.h>
- #include <string.h>
- #include <sys/types.h>
- @@ -54,6 +55,7 @@
- static struct plugin_config {
- char *username;
- char *password;
- + int force_max_expiry_time;
- } plugin_cfg;
- /* SIP parameters storage */
- @@ -61,8 +63,12 @@
- /* Instructions for config parser */
- static cfgopts_t plugin_cfg_opts[] = {
- - { "plugin_orange_username", TYP_STRING, &plugin_cfg.username, {0, NULL} },
- - { "plugin_orange_password", TYP_STRING, &plugin_cfg.password, {0, NULL} },
- + { "plugin_orange_username",
- + TYP_STRING, &plugin_cfg.username, {0, NULL} },
- + { "plugin_orange_password",
- + TYP_STRING, &plugin_cfg.password, {0, NULL} },
- + { "plugin_orange_force_max_expiry_time",
- + TYP_INT4, &plugin_cfg.force_max_expiry_time, {0, NULL} },
- {0, 0, 0}
- };
- @@ -117,7 +123,10 @@
- return STS_FAILURE;
- }
- -
- + if (plugin_cfg.force_max_expiry_time > 3600) {
- + WARN("capping plugin_orange_force_max_expiry_time at 3600 seconds");
- + plugin_cfg.force_max_expiry_time = 3600;
- + }
- /* connect to Orange auth server */
- INFO("logging in");
- @@ -481,17 +490,19 @@
- osip_uri_t *c_uri;
- osip_generic_param_t *p;
- char *str;
- - int i, j;
- + int num_contacts, i, j;
- /* sanitize value */
- value = (value > 3600) ? 3600 : value;
- sprintf(value_str, "%d", value);
- +
- /* iterate over each Contact header in message */
- - for (i = 0; ; i++) {
- + num_contacts = osip_list_size(&ticket->sipmsg->contacts);
- +
- + for (i = 0; i < num_contacts; i++) {
- osip_message_get_contact(ticket->sipmsg, i, &contact);
- - if (contact == NULL)
- - break;
- + assert(contact != NULL);
- osip_contact_init(&ct2);
- osip_uri_clone(osip_contact_get_url(contact), &c_uri);
- @@ -508,10 +519,12 @@
- osip_contact_param_add(ct2, strdup(p->gname), strdup(p->gvalue));
- }
- - osip_list_remove(&ticket->sipmsg->contacts, 0);
- osip_contact_to_str(ct2, &str);
- osip_message_set_contact(ticket->sipmsg, str);
- + }
- + for (j = 0; j < num_contacts; j++) {
- + osip_list_remove(&ticket->sipmsg->contacts, 0);
- }
- }
- @@ -539,6 +552,13 @@
- int i, j;
- osip_contact_t* contact;
- + /* if we are forcing a minimum expiry time, use it here too */
- + if (plugin_cfg.force_max_expiry_time > 0) {
- + DEBUGC(DBCLASS_PLUGIN, "forcing minimum expiry time to %d",
- + plugin_cfg.force_max_expiry_time);
- + min_expires = plugin_cfg.force_max_expiry_time;
- + }
- +
- /* iterate over each Contact header in message */
- for (i = 0; ; i++)
- {
- @@ -571,9 +591,22 @@
- }
- }
- + /* force ridiculously short expiry times to 60 seconds (some PBXes really
- + * don't like such short values otherwise), but don't touch if expires=0
- + * since this means a mapping is being removed */
- + if (min_expires > 0 && min_expires < 60) {
- + DEBUGC(DBCLASS_PLUGIN, "forcing expires=60");
- + min_expires = 60;
- + }
- +
- if (min_expires == -1)
- DEBUGC(DBCLASS_PLUGIN, "no Contact header with expiry info found");
- + else if (min_expires == 0)
- + DEBUGC(DBCLASS_PLUGIN, "found expires=0, not rewriting");
- else {
- + /* filter silly values */
- + min_expires = (min_expires < 0) ? 3600 : min_expires;
- +
- DEBUGC(DBCLASS_PLUGIN, "minimum expiry time is %d s", min_expires);
- plugin_orange_set_contact_expiry(ticket, min_expires);
- }
- diff -ru siproxd_orange-0.2/src/utils.c siproxd_orange-0.2.1/src/utils.c
- --- siproxd_orange-0.2/src/utils.c 2014-11-15 11:47:23.000000000 +0100
- +++ siproxd_orange-0.2.1/src/utils.c 2015-01-07 17:29:03.000000000 +0100
- @@ -48,7 +48,7 @@
- {
- uint16_t result;
- result = (i & 0x00ff) << 8
- - | (i & 0xff00) >> 8
- + | (i & 0xff00) >> 8;
- return result;
- }
- diff -ru siproxd_orange-0.2/src/utils.h siproxd_orange-0.2.1/src/utils.h
- --- siproxd_orange-0.2/src/utils.h 2014-11-15 11:47:23.000000000 +0100
- +++ siproxd_orange-0.2.1/src/utils.h 2015-01-07 17:29:03.000000000 +0100
- @@ -45,7 +45,7 @@
- /* Declare replacement for htole32 and le32toh for older glibcs */
- uint32_t byte_swap_32(uint32_t i);
- /* Declare replacement for htole16 and le16toh for older glibcs */
- -uint16_t byte_swap_16(uint16_t i)
- +uint16_t byte_swap_16(uint16_t i);
- #ifdef WORDS_BIGENDIAN
- #define htole32(x) byte_swap_32(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement