Commit Graph

167 Commits

Author SHA1 Message Date
Kevin Harwell c602b086ed res_pjsip_messaging: send message to a default outbound endpoint
In some cases messages need to be sent to a direct URI (sip:<ip address>). This
patch adds in that support by using a default outbound endpoint.  When sending
messages, if no endpoint can be found then the default one is used.

To facilitate this a new default_outbound_endpoint option was added to the
globals section for pjsip.conf.

Review: https://reviewboard.asterisk.org/r/2944/
........

Merged revisions 403680 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-11 20:24:50 +00:00
Mark Michelson b18ed67d16 Switch PJSIP auth to use a vector.
Since Asterisk has a vector API now, places where arrays are manually
resized don't really make sense any more. Since the auth work in PJSIP
was freshly-written, it was easy to reform it to use a vector.

Review: https://reviewboard.asterisk.org/r/3044



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-09 16:10:05 +00:00
Richard Mudgett 3357c494cb sorcery, bucket: Change observer remove calls to take const callbacks struct.
* Make ast_sorcery_observer_remove() accept a const callbacks struct.

* Make ast_sorcery_observer_remove() tolerant of the sorcery parameter
being NULL.  Now it can be called within a module unload routine if the
sorcery initialization fails.

* Fix ast_sorcery_observer_add() to fail if the container link fails.
........

Merged revisions 403324 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03 17:35:54 +00:00
Joshua Colp a64cd7c6bb res_pjsip_session: Add configurable behavior for redirects.
The action taken when a redirect occurs is now configurable on a
per-endpoint basis. The redirect can either be treated as a redirect
to a local extension, to a URI that is dialed through the Asterisk
core, or to a URI that is dialed within PJSIP itself.

(closes issue ASTERISK-21710)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/2963/
........

Merged revisions 403207 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-28 00:38:36 +00:00
Joshua Colp 9d3b590ad8 res_pjsip: Fix crash when reloading certain configurations.
Certain options available that specify a SIP URI perform validation
on the provided URI using the PJSIP URI parser. This operation
requires that the thread executing it be registered with the PJLIB
library. During reloads this was done on a thread which was NOT
registered with it.

This fixes the problem by creating a task which reloads the
configuration on a PJSIP thread.

(closes issue ASTERISK-22923)
Reported by: Anthony Messina
........

Merged revisions 403179 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-27 16:12:56 +00:00
Joshua Colp fd33969240 res_pjsip: Update handling of some options to work with new option names.
Some options (such as call_group and pickup_group) share the same configuration
handler and decide what logic to use based on the name of the option. These
handlers were not updated to check for the new option names and were treating
the options as invalid.

This change simply updates the handlers with the proper names of the options.

(closes issue ASTERISK-22922)
Reported by: Anthony Messina
........

Merged revisions 403173 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-27 15:31:43 +00:00
Kevin Harwell 05cbf8df9b res_pjsip: AMI commands and events.
Created the following AMI commands and corresponding events for res_pjsip:

PJSIPShowEndpoints - Provides a listing of all pjsip endpoints and a few
                     select attributes on each.
  Events:
    EndpointList - for each endpoint a few attributes.
    EndpointlistComplete - after all endpoints have been listed.

PJSIPShowEndpoint - Provides a detail list of attributes for a specified
                    endpoint.
  Events:
    EndpointDetail - attributes on an endpoint.
    AorDetail - raised for each AOR on an endpoint.
    AuthDetail - raised for each associated inbound and outbound auth
    TransportDetail - transport attributes.
    IdentifyDetail - attributes for the identify object associated with
                     the endpoint.
    EndpointDetailComplete - last event raised after all detail events.

PJSIPShowRegistrationsInbound - Provides a detail listing of all inbound
                                registrations.
  Events:
    InboundRegistrationDetail - inbound registration attributes for each
                                registration.
    InboundRegistrationDetailComplete - raised after all detail records have
                                been listed.

PJSIPShowRegistrationsOutbound  - Provides a detail listing of all outbound
                                  registrations.
  Events:
    OutboundRegistrationDetail - outbound registration attributes for each
                                 registration.
    OutboundRegistrationDetailComplete - raised after all detail records
                                 have been listed.

PJSIPShowSubscriptionsInbound - A detail listing of all inbound subscriptions
                                and their attributes.
  Events:
    SubscriptionDetail - on each subscription detailed attributes
    SubscriptionDetailComplete - raised after all detail records have
                                 been listed.

PJSIPShowSubscriptionsOutbound - A detail listing of all outboundbound
                                subscriptions and their attributes.
  Events:
    SubscriptionDetail - on each subscription detailed attributes
    SubscriptionDetailComplete - raised after all detail records have
                                 been listed.

(issue ASTERISK-22609)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2959/
........

Merged revisions 403131 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-23 17:26:57 +00:00
Kevin Harwell 76a2b855e1 res_pjsip: convert configuration settings names to snake case some more
Updated the alembic script for pjsip.  Also, the dtls config parsing stuff was
expecting strings with no underscores, so removed the underscores from the
option name before passing it to the parser.
........

Merged revisions 403082 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-22 22:37:30 +00:00
Kevin Harwell 1c45a32ee8 res_pjsip: convert configuration settings names to snake case
Renamed, where appropriate, the configuration options for chan/res_pjsip to use
snake case (compound words separated by an underscore).  For example, faxdetect
will become fax_detect, recordofffeature will become record_off_feature, etc...

Review: https://reviewboard.asterisk.org/r/3002/
........

Merged revisions 403022 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-22 17:27:55 +00:00
Joshua Colp cbbcf1808c Fix an assertion in res_pjsip when specifying an invalid outbound proxy.
This change fixes two issues when setting an outbound proxy:

1. The outbound proxy URI was not parsed and validated during configuration.
2. If an outgoing dialog was created and the outbound proxy could not be set an assertion would
occur because the usage count on the dialog was not decremented.

The documentation has also been updated to specify that a full URI must be specified for
the outbound proxy.

(closes issue ASTERISK-22672)
Reported by: Antti Yrjola
........

Merged revisions 400824 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-10 12:26:20 +00:00
Mark Michelson ee21eee7e0 Cache string values of formats on ast_format_cap() to save processing.
Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

Review: https://reviewboard.asterisk.org/r/2879
........

Merged revisions 400356 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:58:16 +00:00
Mark Michelson 391f0003c4 Change the "external_media_address" PJSIP endpoint option to "media_address".
The endpoint option does not apply to communication with external entities. Rather,
the option is applied to all communications with the endpoint. The external_media_address
transport configuration option may override the endpoint option if it turns out that
we are going to be communicating with an external entity.

Two things of note:
1) I have not updated the XML documentation. This is being taken care of by Rusty as part
of his work on issue ASTERISK-22405
2) This commit is likely to cause testsuite failures since there are tests that use the
external_media_address endpoint option, and they will need to be changed over. Well, I'm
planning to get that updated ASAP after this commit.

(closes issue ASTERISK-22528)
reported by Rusty Newton
........

Merged revisions 399283 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17 23:10:49 +00:00
Richard Mudgett 83bf017db9 Fix incorrect usages of ast_realloc().
There are several locations in the code base where this is done:
buf = ast_realloc(buf, new_size);

This is going to leak the original buf contents if the realloc fails.

Review: https://reviewboard.asterisk.org/r/2832/
........

Merged revisions 398757 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 398758 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398759 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-10 18:05:47 +00:00
Matthew Jordan de44880645 Add rtpengine configuration parameter
The rtpengine configuration parameter was documented in the XML documentation,
but it was not actually registered with the sorcery object. This adds the
parameter with a default of "asterisk", such that res_rtp_asterisk is chosen as
the default RTP implementation.

(closes issue ASTERISK-22380)
Reported by: Rusty Newton
Tested by: Rusty Newton
........

Merged revisions 397621 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-25 01:15:28 +00:00
Matthew Jordan e31bd332b8 Update config framework/sorcery with types/options without documentation
There are times when a configuration option should not have documentation.

1. Some options are registered with a particular object merely as a warning to
   users. These options aren't even really 'deprecated' - which has its own
   separate API call - they are actually provided by a different configuration
   file. The options are merely registered so that the user gets a warning that
   a different configuration file provides the item.

2. Some object types - most notably some used by modules that use sorcery - are
   completely internal and should never be shown to the user.

3. Sorcery itself has several 'hidden' fields that should never be shown to a
   user.

This patch updates the configuration framework and sorcery with additional API
calls that allow a module to register types as internal and options as not
requiring documentation. This bypasses the XML documentation checking.

This patch also re-enables the strict XML documentation checking in trunk, as
well as updates some documentation that was missing.

Review: https://reviewboard.asterisk.org/r/2785/

(closes issue ASTERISK-22359)
Reported by: Matt Jordan

(closes issue ASTERISK-22112)
Reported by: Rusty Newton



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 15:21:40 +00:00
Mark Michelson 5caa938be2 Localize and rename ACL configuration.
This is more-or-less a reversion of previous ACL behavior so that
it is more self-contained. ACL sections are now only parsed if res_pjsip_acl.so
is loaded. Moreover, the configuration section is now "type=acl" instead of
"type=security".

The original reason for having ACLs configured in a "type=security" section
was to lump ACLs and other security-related items into the same section. The
problem is that ACLs really should be in their own sections and there are
no other security-related options implemented anyways.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-20 21:01:59 +00:00
Mark Michelson 735b30ad71 The large GULP->PJSIP renaming effort.
The general gist is to have a clear boundary between old SIP stuff
and new SIP stuff by having the word "SIP" for old stuff and "PJSIP"
for new stuff. Here's a brief rundown of the changes:

* The word "Gulp" in dialstrings, functions, and CLI commands is now
  "PJSIP"
* chan_gulp.c is now chan_pjsip.c
* Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*"
* All files that were "res_sip*" are now "res_pjsip*"
* The "res_sip" directory is now "res_pjsip"
* Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*"
* The configuration file is now "pjsip.conf" instead of "res_sip.conf"
* The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP"
* CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as
the starting word instead of "sip"



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-30 18:14:50 +00:00