Skip to content
Snippets Groups Projects
  1. Oct 10, 2016
    • Ludovic Gasc (GMLudo)'s avatar
      res_calendar: Add support for fetching calendars when reloading · 9f62feca
      Ludovic Gasc (GMLudo) authored
      We use a lot res_calendar, we are very happy with that, especially
      because you use libical, the almost alone opensource library that
      supports really ical format with all types of recurrency.
      
      Nevertheless, some features are missed for our business use cases.
      
      This first patch adds a new option in calendar.conf:
      fetch_again_at_reload. Be my guest for a better name.
      
      If it's true, when you'll launch "module reload res_calendar.so",
      Asterisk will download again the calendar.
      
      The business use case is that we have a WebUI with a scheduler planner,
      we know when the calendars are modified.
      
      For now, we need to define 1 minute of timeout to have a chance that
      our user doesn't wait too long between the modification and the real
      test.  But it generates a lot of useless HTTP traffic.
      
      
      ASTERISK-26422 #close
      
      Change-Id: I384b02ebfa42b142bbbd5b7221458c7f4dee7077
      9f62feca
  2. Sep 27, 2016
  3. Sep 25, 2016
    • George Joseph's avatar
      build_tools: Add ability to download variants to download_externals · 43901e94
      George Joseph authored
      Some external packages have multiple variants that apply to different
      builds of asterisk.  The DPMA for instance has a "bundled" variant that
      needs to be downloaded if asterisk was configured with
      --with-pjproject-bundled.
      
      There are 2 ways to specify variants:
      
      If you need the user to make the decision about which variant to
      download, simply create multiple menuselect "member" entries like so...
      
      <member name="res_digium_phone" displayname="..snipped..">
        <support_level>external</support_level>
        <depend>xmlstarlet</depend>
        <depend>bash</depend>
        <defaultenabled>no</defaultenabled>
      </member>
      
      <member name="res_digium_phone-bundled" displayname="..snipped..">
        <support_level>external</support_level>
        <depend>xmlstarlet</depend>
        <depend>bash</depend>
        <defaultenabled>no</defaultenabled>
      </member>
      
      Note that the second entry has "-<variant>" appended to the name.
      You can then use the existing menuselect facilities to restrict which
      members to enable or disable.  Youy probably don't want the user to
      enable multiple at the same time.
      
      If you want to hide the details of the variants, the better way to
      do it is to create 1 member with "variant" elements.
      
      <member name="res_digium_phone" displayname="..snipped..">
        <support_level>external</support_level>
        <depend>xmlstarlet</depend>
        <depend>bash</depend>
        <defaultenabled>no</defaultenabled>
        <member_data>
          <downloader>
            <variants>
              <variant tag="bundled"
                condition='[[ "$PJPROJECT_BUNDLED" = "yes" ]]'/>
            </variants>
          </downloader>
        </member_data>
      </member>
      
      The condition must be a bash expression suitable for use with an "if"
      statement.  Any environment variable can be used plus those available
      in makeopts.
      
      In this case, if asterisk was configured with --with-pjproject-bundled
      the bundled variant will be automatically downloaded.  Otherwise the
      normal version will be downloaded.
      
      Change-Id: I4de23e06d4492b0a65e105c8369966547d0faa3e
      43901e94
  4. Sep 23, 2016
    • zuul's avatar
    • zuul's avatar
      91513c5e
    • Alexander Traud's avatar
      chan_sip: Resolve externhost not to IPv6; instead go for IPv4. · 5dd99465
      Alexander Traud authored
      For the channel driver chan_sip, you specify externhost=example.com in sip.conf
      when your Asterisk is behind a NAT and your IP address is assigned dynamically.
      Or stated differently: You do not have a static IP address to use "externaddr"
      directly. This NAT support is quite handy but just about IPv4. Previously,
      Asterisk resolved "externhost" to any IP version. When the first DNS answer
      resolved to an IPv6, Asterisk sent an IPv6 in SIP/SDP for origin (o=) and
      connection (c=). This happened in outgoing SIP-REGISTER and while answering
      SIP-INVITE. If the remote peer is IPv4-only, it might not handle o=/c= with an
      IPv6. This change makes sure, no IPv6 is resolved anymore for "externhost".
      
      ASTERISK-18232 #close
      Reported by: Jacek Kowalski
      Tested by: Alexander Traud
      patches:
       changes.patch submitted by Alessandro Crespi
      
      Change-Id: If68eedbeff65bd1c1d8a9ed921c02ba464b32dac
      5dd99465
    • George Joseph's avatar
      chan_sip: Address runaway when realtime peers subscribe to mailboxes · d4259710
      George Joseph authored
      Users upgrading from asterisk 13.5 to a later version and who use
      realtime with peers that have mailboxes were experiencing runaway
      situations that manifested as a continuous stream of taskprocessor
      congestion errors, memory leaks and an unresponsive chan_sip.
      
      A related issue was that setting rtcachefriends=no NEVER worked in
      asterisk 13 (since the move to stasis).  In 13.5 and earlier, when a
      peer tried to register, all of the stasis threads would block and
      chan_sip would again become unresponsive.  After 13.5, the runaway
      would happen.
      
      There were a number of causes...
      * mwi_event_cb was (indirectly) calling build_peer even though calls to
        mwi_event_cb are often caused by build_peer.
      * In an effort to prevent chan_sip from being unloaded while messages
        were still in flight, destroy_mailboxes was calling
        stasis_unsubscribe_and_join but in some cases waited forever for the
        final message.
      * add_peer_mailboxes wasn't properly marking the existing mailboxes
        on a peer as "keep" so build_peer would always delete them all.
      * add_peer_mwi_subs was unsubscribing existing mailbox subscriptions
        then just creating them again.
      
      All of this was causing a flood of subscribes and unsubscribes on
      multiple threads all for the same peer and mailbox.
      
      Fixes...
      * add_peer_mailboxes now marks mailboxes correctly and build_peer only
        deletes the ones that really are no longer needed by the peer.
      * add_peer_mwi_subs now only adds subscriptions marked as "new" instead
        of unsubscribing and resubscribing everything.  It also adds the peer
        object's address to the mailbox instead of its name to the subscription
        userdata so mwi_event_cb doesn't have to call build_peer.
      
      With these changes, with rtcachefriends=yes (the most common setting),
      there are no leaks, locks, loops or crashes at shutdown.
      
      rtcachefriends=no still causes leaks but at least it doesn't lock, loop
      or crash.  Since making rtcachefriends=no work wasnt in scope for this
      issue, further work will have to be deferred to a separate patch.
      
      Side fixes...
       * The ast_lock_track structure had a member named "thread" which gdb
         doesn't like since it conflicts with it's "thread" command.  That
         member was renamed to "thread_id".
      
      ASTERISK-25468 #close
      
      Change-Id: I07519ef7f092629e1e844f855abd279d6475cdd0
      d4259710
  5. Sep 22, 2016
  6. Sep 21, 2016
  7. Sep 20, 2016
    • Corey Farrell's avatar
      logger: Simplify ast_callid handling code. · 923edf25
      Corey Farrell authored
      Routines responsible for managing ast_callid's are overly complicated.
      This is left-over code from when ast_callid was an AO2 object.  Now that
      it is an integer the code can be reduced.
      
      ast_callid handler code no longer prints it's own error message upon failure
      to allocate threadstorage as ast_calloc would have already printed a
      message.  Debug messages that were printed when TEST_FRAMEWORK was
      enabled have been also been removed.
      
      Change-Id: I65a768a78dc6cf3cfa071e97f33ce3dce280258e
      923edf25
    • Corey Farrell's avatar
      core: Fix LOW_MEMORY missing symbol ast_pbx_uuid_get. · 5cb905a2
      Corey Farrell authored
      Move the function outside the conditional block that excludes
      LOW_MEMORY.
      
      ASTERISK-26273 #close
      
      Change-Id: Ic290fa128222c410c3531107e30efacabc8493b4
      5cb905a2
    • zuul's avatar
    • Corey Farrell's avatar
      logger: Always enable verbose for console channel. · 00f1d05d
      Corey Farrell authored
      Previous versions of Asterisk did not require verbose to be specified in
      logger.conf for the console channel, if it was requested by command line
      or asterisk.conf it just worked.  This change causes Asterisk to always
      enable verbose in the console channel level mask.  Verbose is displayed
      on consoles if requested by command line, option_verbose or 'core set
      verbose'.
      
      This also delays initialization of the logger until after threadstorage
      is initialized.  Initializing too early can cause messages to be printed
      multiple times to the console (stdout).
      
      ASTERISK-26391 #close
      
      Change-Id: I52187d67c2fcb3efd5561bf04b3e5e23e5ee8a04
      00f1d05d
    • Corey Farrell's avatar
      logger: Fix default console settings. · 74f562a8
      Corey Farrell authored
      When logger.conf is missing or invalid we should be printing notices,
      warnings and errors to the console.  The logmask was incorrectly
      calculated.
      
      Change-Id: Ibaa9465a8682854bc1a5e9ba07079bea1bfb6bb3
      74f562a8
    • zuul's avatar
      ea8105cf
    • zuul's avatar
  8. Sep 19, 2016
  9. Sep 16, 2016
    • Richard Mudgett's avatar
      res_config_odbc.c: Fix buffer size limitation creating invalid SQL. · 2820b133
      Richard Mudgett authored
      Creating ODBC SQL queries resulted in queries too large to fit into the
      supplied buffer.  The resulting truncated buffer contained an invalid SQL
      query.
      
      * Made SQL query generation code use a thread storage buffer that can
      increase in size as needed.
      
      * Fixed bad multi-line warning messages.
      
      ASTERISK-26263 #close
      Reported by: Jeppe Ryskov Larsen
      
      Change-Id: I23f3cdd43c2dac80bed3ded4dd77d18cb17f21ae
      2820b133
  10. Sep 15, 2016
    • Joshua Colp's avatar
      rtp: Only accept the first payload for a format in SDP. · 0376af95
      Joshua Colp authored
      When receiving an SDP offer with multiple payloads for
      the same format we would generate an answer with the first
      payload, but during the payload crossover operation
      (to set the payloads for receiving) we would remove all
      payloads but the last. This would result in incoming
      traffic being matched against the wrong format and outgoing
      traffic being sent using the wrong payload.
      
      This change makes it so that once a format has a payload
      number put into the mapping all subsequent ones are ignored.
      This ensures there is only ever one payload in the mapping
      and that it is the payload placed into the answer SDP.
      
      ASTERISK-26365 #close
      
      Change-Id: I1e8150860a3518cab36d00b1fab50f9352b64e60
      0376af95
Loading