Skip to content
Snippets Groups Projects
  1. May 26, 2015
  2. May 25, 2015
    • Ivan Poddubny's avatar
      Astobj2: Correctly treat hash_fn returning INT_MIN · 23a798fe
      Ivan Poddubny authored
      The code in astobj2_hash.c wrongly assumed that abs(int) is always > 0.
      However, abs(INT_MIN) = INT_MIN and is still negative, as well as
      abs(INT_MIN) % num_buckets, and as a result this led to a crash.
      
      One way to trigger the bug is using host=::80 or 0.0.0.128 in peer
      configuration section in chan_sip or chan_iax.
      
      This patch takes the remainder before applying abs, so that bucket
      number is always in range.
      
      ASTERISK-25100 #close
      Reported by: Mark Petersen
      
      Change-Id: Id6981400ad526f47e10bcf7b847b62bd2785e899
      23a798fe
  3. May 24, 2015
  4. May 23, 2015
    • Ivan Poddubny's avatar
      res_pjsip_transport_websocket: Fix crash on receiving large SIP packets · 70d54ab6
      Ivan Poddubny authored
      Incoming SIP packets larger than PJSIP_MAX_PKT_LEN were themselves
      truncated before passing to pjsip_tpmgr_receive_packet, but the length
      was passed unaltered, thus causing memory corruption and segfault.
      
      ASTERISK-25122 #close
      
      Change-Id: I608a6b6b7f229eacc33a0a7d771d18e27e5b08ab
      70d54ab6
    • Corey Farrell's avatar
      Stasis: Fix unsafe use of stasis_unsubscribe in modules. · 50044fdc
      Corey Farrell authored
      Many uses of stasis_unsubscribe in modules can be reached through unload.
      These have been switched to stasis_unsubscribe_and_join.
      
      Some subscription callbacks do nothing, for these I've created a noop
      callback function in stasis.c.  This is used by some modules that monitor
      MWI topics in order to enable cache, since the callback does not become
      invalid after dlclose it is safe to use stasis_unsubscribe on these, even
      during module unload.
      
      ASTERISK-25121 #close
      
      Change-Id: Ifc2549fbd8eef7d703c222978e8f452e2972189c
      50044fdc
  5. May 22, 2015
    • Corey Farrell's avatar
      Astobj2: Run weakproxy subscription callbacks in reverse order. · 5a1f2a58
      Corey Farrell authored
      Modify ao2_weakproxy_subscribe so each new subscription is added
      to the head of the list.  This ensures that when other objects
      are allocated and use a subscription to the weakproxy for cleanup,
      cleanup will occur in the correct order.
      
      ASTERISK-25120 #close
      
      Change-Id: Ie0476f08ec21330de1b3f5a2dd3d9eb683df3d3d
      5a1f2a58
    • Matt Jordan's avatar
      res/res_pjsip_pubsub: Note that 'dialog' is also a valid event type for RLS · f66c41e6
      Matt Jordan authored
      In addition to specifying lists of 'presence' and 'message-summary',
      users can also create lists of type 'dialog'. These should be treated in
      the same fashion as 'presence'.
      
      Change-Id: I583bb69cd9f88b0b29bf09ddaddeac4e84189f6e
      f66c41e6
    • Matt Jordan's avatar
      res/res_pjsip_exten_state: Fix confusing NOTICE message · ad7192a8
      Matt Jordan authored
      When a SUBSCRIBE request is made to a dialplan hint that doesn't exist,
      the current NOTICE message informing users of this swaps the context and
      extension parameters. This can cause a bit of confusion.
      
      Thanks to CptBurger in #asterisk for helping to point this out.
      
      Change-Id: Ie584d1a58ae217385c87a450ca25b55ca0e36e43
      ad7192a8
    • Mark Michelson's avatar
    • Matt Jordan's avatar
      res/ari: Register Stasis application on WebSocket attempt · 9cffcca5
      Matt Jordan authored
      Prior to this patch, when a WebSocket connection is made, ARI would not
      be informed of the connection until after the WebSocket layer had
      accepted the connection. This created a brief race condition where the
      ARI client would be notified that it was connected, a channel would be
      sent into the Stasis dialplan application, but ARI would not yet have
      registered the Stasis application presented in the HTTP request that
      established the WebSocket.
      
      This patch resolves this issue by doing the following:
       * When a WebSocket attempt is made, a callback is made into the ARI
         application layer, which verifies and registers the apps presented in
         the HTTP request. Because we do not yet have a WebSocket, we cannot
         have an event session for the corresponding applications. Some
         defensive checks were thus added to make the application objects
         tolerant to a NULL event session.
       * When a WebSocket connection is made, the registered application is
         updated with the newly created event session that wraps the WebSocket
         connection.
      
      ASTERISK-24988 #close
      Reported by: Joshua Colp
      
      Change-Id: Ia5dc60dc2b6bee76cd5aff0f69dd53b36e83f636
      9cffcca5
    • Matt Jordan's avatar
    • Joshua Colp's avatar
    • Mark Michelson's avatar
    • George Joseph's avatar
      res_pjsip: Refactor endpt_send_transaction (qualify_timeout) · 29ef6571
      George Joseph authored
      
      This patch refactors the transaction timeout processing to eliminate
      calling the lower level public pjsip functions and reverts to calling
      pjsip_endpt_send_request again.  This is the result of me noticing
      a possible incompatibility with pjproject-2.4 which was causing
      contact status flapping.
      
      The original version of this feature used the lower level calls to
      get access to the tsx structure in order to cancel the transaction
      when our own timer expires. Since we no longer have that access,
      if our own timer expires before the pjsip timer, we call the callbacks
      and just let the pjsip transaction take it's own course.  When the
      transaction ends, it discovers the callbacks have already been run
      and just cleans itself up.
      
      A few messages in pjsip_configuration were also added/cleaned up.
      
      ASTERISK-25105 #close
      
      Change-Id: I0810f3999cf63f3a72607bbecac36af0a957f33e
      Reported-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      29ef6571
    • Joshua Colp's avatar
      res_sorcery_memory_cache: Add support for object_lifetime_maximum. · 81d375ba
      Joshua Colp authored
      This makes the "object_lifetime_maximum" option operational.
      
      On the addition of an object to an empty memory cache a scheduled
      task is created which, when invoked, expires objects from the cache
      which have exceeded their lifetime. If more objects have been added
      the remaining life of the oldest object is used to schedule the
      next invocation of the scheduled task.
      
      If the oldest object is removed from the cache before it can be
      expired automatically the scheduled task is cancelled, if possible,
      and the lifetime of the next oldest is used to schedule the task.
      
      If during these two operations no additional objects exist in the
      cache then no task is scheduled.
      
      An additional unit test has been added which verifies this
      functionality.
      
      ASTERISK-25067
      Reported by: Matt Jordan
      
      Change-Id: I87409674674a508e7717ee20739ca15cec6ba7b6
      81d375ba
    • demon-ru's avatar
      res_pjsip_outbound_registration: Check request URI for line. · 9e2a582d
      demon-ru authored
      When an inbound call is received the To header is checked
      for the "line" option. Some remote servers will place this
      in the request URI instead. This adds an additional check for
      the option in the request URI.
      
      ASTERISK-25072 #close
      Reported by: Dmitriy Serov
      
      Change-Id: Id4e44debbb80baad623b914a88574371575353c8
      9e2a582d
    • Mark Michelson's avatar
      res_sorcery_memory_cache: Add support for maximum_objects. · 071b3d43
      Mark Michelson authored
      This makes the "maximum_objects" option operational.
      
      A heap has been added alongside the hash table in the cache. When
      objects are added to the cache, they are also added to the heap.
      Similarly, when objects are removed from the cache, they are removed
      from the heap.
      
      The heap's use comes into play when an item is to be added to a "full"
      cache. When the cache is full, the oldest item is removed from the
      cache, using the heap to determine the oldest item.
      
      A unit test has been added that verifies that the maximum_objects option
      works as expected and that the oldest object is removed from the cache
      when an object beyond the maximum is added.
      
      ASTERISK-25067 #close
      Reported by Matt Jordan
      
      Change-Id: I490658830e9c4cbf0b3051e4cdc4913cf9f1b73a
      071b3d43
    • Joshua Colp's avatar
      res_sorcery_memory_cache: Add basic module implementation. · f2cc766d
      Joshua Colp authored
      This change adds a basic res_sorcery_memory_cache module which implements
      configuration option parsing, configuration file parsing for threading,
      sorcery interface implementation, and unit tests.
      
      Objects can be added, updated, deleted, and retrieved from the memory
      cache. Automatic expiration and stale handling will be added in the
      future.
      
      Note that unit tests exist within the module itself in case the
      threading done as a result of expiration results in asynchronous
      actions (which it likely will). Providing access and a notification
      mechanism for an external test module would be complicated and
      not worth it.
      
      ASTERISK-25067 #close
      Reported by: Matt Jordan
      
      Change-Id: Id8a6a357ef5a83d466f81eee56a67d13eeb118b9
      f2cc766d
    • Joshua Colp's avatar
  6. May 21, 2015
  7. May 20, 2015
    • Kevin Harwell's avatar
      audiohook.c: Difference in read/write rates caused continuous buffer resets · 7bf88eb6
      Kevin Harwell authored
      Currently, everytime a sample rate change occurs (on read or write) the
      associated factory buffers are reset. If the requested sample rate on a
      read differed from that of a write then the buffers are continually reset
      on every read and write. This has the side effect of emptying the buffer,
      thus there being no data to read and then write to a file in the case of
      call recording.
      
      This patch fixes it so that an audiohook_list's rate always maintains the
      maximum sample rate among hooks and formats. Audiohook sample rates are
      only overwritten by this value when slin native compatibility is turned on.
      Also, the audiohook sample rate can only overwrite the list's sample rate
      when its rate is greater than that of the list or if compatibility is
      turned off. This keeps the rate from constantly switching/resetting.
      
      ASTERISK-24944 #close
      Reported by: Ronald Raikes
      
      Change-Id: Idab4dfef068a7922c09cc631dda27bc920a6c76f
      7bf88eb6
    • Matt Jordan's avatar
    • Matt Jordan's avatar
      res/res_http_websocket: Add a pre-session established callback · 5ce54ed7
      Matt Jordan authored
      This patch updates http_websocket and its corresponding implementation
      with a pre-session established callback. This callback allows for
      WebSocket server consumers to be notified when a WebSocket connection is
      attempted, but before we accept it. Consumers can choose to reject the
      connection, if their application specific logic allows for it.
      
      As a result, this patch pulls out the previously private
      websocket_protocol struct and makes it public, as
      ast_websocket_protocol. In order to preserve backwards compatibility
      with existing modules, the existing APIs were left as-is, and new APIs
      were added for the creation of the ast_websocket_protocol as well as for
      adding a sub-protocol to a WebSocket server.
      
      In particular, the following new API calls were added:
      * ast_websocket_add_protocol2 - add a protocol to the core WebSocket
        server
      * ast_websocket_server_add_protocol2 - add a protocol to a specific
        WebSocket server
      * ast_websocket_sub_protocol_alloc - allocate a sub-protocol object.
        Consumers can populate this with whatever callbacks they wish to
        support, then add it to the core server or a specified server.
      
      ASTERISK-24988
      Reported by: Joshua Colp
      
      Change-Id: Ibe0bbb30c17eec6b578071bdbd197c911b620ab2
      5ce54ed7
    • John Bigelow's avatar
      res/res_resolver_unbound.c: Add missing include of signal.h · ddb7cbef
      John Bigelow authored
      ASTERISK-25110 #close
      Reported by: John Bigelow
      
      Change-Id: I99a9d93f066f265357b647b8e99a75e45da5a39f
      ddb7cbef
    • Rodrigo Ramírez Norambuena's avatar
      cel, cdr: Assigned separator for column name and values. · 9c3c7797
      Rodrigo Ramírez Norambuena authored
      Use a separator string between column names and values for SQL sentences
      instead of evaluating the separator to use each time.
      
      This change adds a space after the comma in constructing SQL sentences.
      Before the SQL was created like "INSERT INTO cdr(calldate,clid,dst"
      without spaces between column name and values.
      
      The files applied this change are cdr/cdr_adaptive_odbc.c, cdr/cdr_pgsql.c,
      cel/cel_odbc.c
      
      ASTERISK-25109 #close
      Reported By: Rodrigo Ramírez Norambuena <decipher.hk@gmail.com>
      
      Change-Id: Ia5a1a161f5e26e1643703b30f8cc9cf0860cc7ea
      9c3c7797
    • Matt Jordan's avatar
      doxygen: Fix doxygen errors · d8698b7f
      Matt Jordan authored
      This patch fixes a number of errors and warning messages in the doxygen
      log. Specifically, it addresses:
      * A number of files incorrectly places a '\brief' tag immediately after
        a '\file' tag. Doing so emits a warning, as '\file' takes an optional
        argument specifying which file the doxygen comment is for. As '\brief'
        is not a file, doxygen was unamused.
      * A grouping of Stasis Topics and Messages in rtp_engine.h was
        incorrectly terminated. We now correctly terminate the grouping, which
        prevents members of rtp_engine.h from showing up in the wrong group.
      * Group indicators which are not part of the Stasis Topics and Messages
        group were removed. Group indicators without an \addtogroup or
        \ingroup have no meaning.
      
      Change-Id: Ia1415ffec6767e27233ae1cae5ed5970de5656d4
      d8698b7f
  8. May 19, 2015
  9. May 18, 2015
  10. May 17, 2015
  11. May 15, 2015
    • George Joseph's avatar
      res_pjsip_config_wizard/config: Fix template processing · 5d939281
      George Joseph authored
      
      The config wizard was always pulling the first occurrence of
      a variable from an ast_variable list but this gets the template
      value from the list instead of any overridden value.  This patch
      creates ast_variable_find_last_in_list() in config.c and updates
      res_pjsip_config_wizard to use it instead of
      ast_variable_find_in_list.  Now the overridden values, where they
      exist, are used instead of template variables.
      
      Updated test_config to test the new API.
      
      ASTERISK-25089 #close
      
      Reported-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      Change-Id: Ifa7ddefc956a463923ee6839dd1ebe021c299de4
      5d939281
Loading