Simply enabling PJSIP to negotiage a video codec (e.g., h264) would leak
video RTP ports if the codec were not negotiated by an incoming call.
* Made add_sdp_streams() associate the handler with the media stream if
the handler handled the media stream. Otherwise, when the
ast_sip_session_media object was destroyed it didn't know how to clean up
the RTP resources.
* Fixed sdp_requires_deferral() associating the handler with the media
stream when deciding if the SDP processing needs to be deferred for T.38.
Like the leaked video RTP ports, the T.38 handler needs to clean up
allocated resources from deciding if SDP processing needs to be deffered.
* Cleaned up some dead code in handle_incoming_sdp() and
sdp_requires_deferral().
ASTERISK-23721 #close
Reported by: cervajs
Review: https://reviewboard.asterisk.org/r/3571/
........
Merged revisions 414749 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The ODBC realtime driver uses ^NN parameter encoding to cope with the
special meaning of the semi-colon. A semi-colon in a field is
interpreted as if the key was supplied twice, something which isn't
otherwise possible with fixed database columns. E.g. allow=alaw;ulaw
is parsed as allow=alaw and allow=ulaw. A literal semi-colon is
rewritten to ^3B when stored in the database.
The module uses a stringfield to efficiently store the encoded
parameters. However, this stringfield wasn't always freed in some
off-nominal cases.
Commit r413241 fixed initialization so the encoding for INSERT and
DELETE queries wouldn't crash. (Only SELECTs and UPDATEs worked
apparently.) But that commit forgot the frees. This change cleans
that up.
Review: https://reviewboard.asterisk.org/r/3555/
........
Merged revisions 414564 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 414565 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 414566 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
User events can now be generated from ARI. Events can be signalled with
arbitrary json variables, and include one or more of channel, bridge, or
endpoint snapshots. An application must be specified which will receive
the event message (other applications can subscribe to it). The message
will also be delivered via AMI provided a channel is attached. Dialplan
generated user event messages are still transmitted via the channel, and
will only be received by a stasis application they are attached to or if
the channel is subscribed to.
This change also introduces the multi object blob mechanism used to send
multiple snapshot types in a single message. The dialplan app UserEvent
was also changed to use multi object blob, and a new stasis message type
created to handle them.
ASTERISK-22697 #close
Review: https://reviewboard.asterisk.org/r/3494/
........
Merged revisions 414405 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes res_corosync such that it works with Asterisk 12. This
restores the functionality that was present in previous versions of
Asterisk, and ensures compatibility with those versions by restoring the
binary message format needed to pass information from/to them.
The following changes were made in the core to support this:
* The event system has been partially restored. All event definition and
event types in this patch were pulled from Asterisk 11. Previously, we had
hoped that this information would live in res_corosync; however, the
approach in this patch seems to be better for a few reasons:
(1) Theoretically, ast_events can be used by any module as a binary
representation of a Stasis message. Given the structure of an ast_event
object, that information has to live in the core to be used universally.
For example, defining the payload of a device state ast_event in
res_corosync could result in an incompatible device state representation
in another module.
(2) Much of this representation already lived in the core, and was not
easily extensible.
(3) The code already existed. :-)
* Stasis message types now have a message formatter that converts their
payload to an ast_event object.
* Stasis message forwarders now handle forwarding to themselves. Previously
this would result in an infinite recursive call. Now, this simply creates a
new forwarding object with no forwards set up (as it is the thing it is
forwarding to). This is advantageous for res_corosync, as returning NULL
would also imply an unrecoverable error. Returning a subscription in this
case allows for easier handling of message types that are published directly
to an aggregate topic that has forwarders.
Review: https://reviewboard.asterisk.org/r/3486/
ASTERISK-22912 #close
ASTERISK-22372 #close
........
Merged revisions 414330 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
While load testing an ARI application, I noticed asterisk was returning HTTP 500
internal server errors on channels/:id/answer. After talking to #asterisk-dev,
the issue appeared to be a lack of media flowing after __ast_answer() was
called. So now, we call ast_raw_answer instead and no longer wait for media.
ASTERISK-23758 #close
Review: https://reviewboard.asterisk.org/r/3549/
........
Merged revisions 414195 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes issues with direct media bridges that occur after a blind
transfer. These issues were caught by the (currently failing)
pjsip/transfers/blind_transfer/caller_direct_media test.
The test currently fails primarily for two reasons:
(1) When Bob and Charlie (the transfer target and the transfer destination)
enter a bridge together, the framehook remains on the transfer target
channel until both channels are in the bridge. As it consumes voice frames,
the initial bridge type is a simple bridge. The framehook is removed when
both channels are in the bridge; however, this does not currently cause the
bridging framework to re-evaluate the bridge. This patch adds a
AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a
framehook is removed so the bridge can re-evaluate itself.
(2) When a channel leaves a native RTP bridge, it may be leaving due to being
hung up. Sending a re-INVITE to a channel that is about to be hung up is
not nice - in fact, there's a good chance we'll send the BYE request before
the channel has had a chance to send back a 200 OK. To be somewhat nicer,
this patch adds a function to channel.h that allows the bridging framework
to query for exactly why a channel is leaving a bridge via the channel's
soft hangup flags. This allows it to only send the re-INVITE if there's a
chance the channel will survive the native bridging experience.
Review: https://reviewboard.asterisk.org/r/3535/
........
Merged revisions 414122 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Embedded carriage return line feed combinations may appear in presence subtypes
and messages since they may be derived from user input in an instant messenger
client. As such, they need to be properly escaped so that XML parsers do not
vomit when the messages are received.
........
Merged revisions 413372 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There was an underlying issue in a realtime backend where database updates
would fail. Since we were not checking for failure, we would end up in a
strange state where the old database entry was still present but Asterisk
thought that it had been updated. Now when an entry fails to update, we
print a warning and delete the old contact from sorcery so there is no
mismatch between foreground and backend state.
Patches:
res_pjsip_registrar.patch by John Hardin (License #6512)
........
Merged revisions 413358 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The realtime API specifies that the store callback is supposed to return the number
of rows affected. res_config_pgsql was instead returning an Oid cast as an int, which
during any nominal execution would be cast to 0. Returning 0 when more than 0 rows were
inserted causes problems to the function's callers.
To give an idea of how strange code can be, this is the necessary code change to fix
a device state issue reported against chan_pjsip in Asterisk 12+. The issue was that
the registrar would attempt to insert contacts into the database. Because of the 0
return from res_config_pgsql, the registrar would think that the contact was not successfully
inserted, even though it actually was. As such, even though the contact was query-able
and it was possible to call the endpoint, Asterisk would "think" the endpoint was unregistered,
meaning it would report the device state as UNAVAILABLE instead of NOT_INUSE.
The necessary fix applies to all versions of Asterisk, so even though the bug reported
only applies to Asterisk 12+, the code correction is being inserted into 1.8+.
Closes issue ASTERISK-23707
Reported by Mark Michelson
........
Merged revisions 413224 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 413225 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 413226 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Per rfc3892, the Referred-By header in a REFER must be copied into the
referenced request (IE. The outgoing INVITE to the transfer target).
* Automatically put the Referred-By header in the outgoing INVITE message
if the SIPREFERREDBYHDR channel variable is defined with a value.
* Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so
chan_pjsip has a better chance to interoperate.
* Fixed refer_blind_callback() and refer_incoming_refer_request() to not
modify the data in the pointer returned by pjsip_msg_find_hdr_by_name().
It seems wrong to modify that data since the calling routine doesn't own
the buffer.
ASTERISK-23501 #close
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/3514/
........
Merged revisions 413210 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The PBX core already takes care of ensuring that repeated state changes
are not communicated to exten state consumers. Because the check in res_pjsip_exten_state
was incomplete, it was causing valid presence state changes not to be sent out. For instance,
if the presence state did not change but the message or subtype did, then no presence-related
NOTIFY request would be sent out.
closes issue ASTERISK-23672
Reported by Mark Michelson
........
Merged revisions 413173 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fixed early exit in sip_msg_send() not destroying the message iterator.
* Made ast_msg_var_iterator_next() and ast_msg_var_iterator_destroy()
tolerant of a NULL iter parameter in case ast_msg_var_iterator_init()
fails.
* Made ast_msg_var_iterator_destroy() clean up any current message data
ref.
* Made struct ast_msg_var_iterator, ast_msg_var_iterator_init(),
ast_msg_var_iterator_next(), ast_msg_var_unref_current(), and
ast_msg_var_iterator_destroy() use iter instead of i.
* Eliminated RAII_VAR usage in res_pjsip_messaging.c:vars_to_headers().
........
Merged revisions 413139 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 413142 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change fixes a bug where if an SDP with media address and sendonly was
received twice the underlying call would go off hold, instead of remaining on hold.
This occured because the code did not properly take into account that the SDP
may contain both a valid media address and the sendonly attribute.
The code now examines the sendonly attribute and media address first, so if the
SDP is received again no change will occur.
ASTERISK-23558 #comment Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/3472/
........
Merged revisions 413119 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
For some odd reason, loading app_mixmonitor was fine, but res_monitor was not.
This patch fixes a set of issues related to func_periodic_hook exporting the
beep functions that gets res_monitor working again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This changes fixes a crash that occurs when stasis determines if it
should send a message out to an application or not. The code
incorrectly assumed that a bridge snapshot would always be present
when in reality for failure cases it may not be.
ASTERISK-23573 #close
........
Merged revisions 412882 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change fixes a problem where permanent contacts being qualified were not
being updated. This was caused by the permanent contacts getting a uuid and not a
known identifier, causing an inability to look them up when updating in the
qualify code. A bug also existed where the new configuration may not be available
immediately when updating qualifies.
(closes issue ASTERISK-23514)
Reported by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/3448/
........
Merged revisions 412551 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Adds a tones URI type to the playback resource. The tone can be specified by
name (from indications.conf) or by a tone pattern. In addition, tonezone can
be specified in the URI (by appending ;tonezone=<zone>). Tones must be
stopped manually in order for a stasis control to move on from playback of
the tone. Tones may be paused, resumed, restarted, and stopped. They may
not be rewound or fast forwarded (tones can't be controlled in a way that
lets you skip around from note to note and pausing and resuming will also
restart the tone from the beginning). Tests are currently in development
for this feature (https://reviewboard.asterisk.org/r/3428/).
(closes issue ASTERISK-23433)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3427/
........
Merged revisions 412535 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Add an option to enable a periodic beep to be played into a call if it
is being recorded. If enabled, it uses the PERIODIC_HOOK() function
internally to play the 'beep' prompt into the call at a specified
interval. This option is provided for both Monitor() and
MixMonitor().
Review: https://reviewboard.asterisk.org/r/3424/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Remove unused RAII_VAR() declarations. The compiler cannot catch these
because the cleanup function "references" the unused variable. Some
actually allocated and released resources that were never used.
* Fixed some whitespace issues in stasis_bridges.c.
........
Merged revisions 412399 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This app is pretty ancient, so it was never converted to use the
option parsing helper code. I'd like to add an option to this app
that takes an argument, and that's a pain to do when not using this
helper, so start by doing this conversion.
Review: https://reviewboard.asterisk.org/r/3429/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
During discussions with Alexandr Dubovikov at Kamailio World, it became
apparent that while the SIP call ID is a useful identifier prior to an Asterisk
channel being created, it is far more preferable to use the channel name (or
some channel based identifier) when the channel is available. Homer is smart
enough to tie the various messages together. This patch opts to use the channel
name when it is available, falling back to the call ID otherwise.
........
Merged revisions 412088 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change makes it so if a transport is configured on an endpoint that is a WebSocket
type the option will be ignored. In practice this is fine because the WebSocket
transport can not create outgoing connections, it can only reuse existing ones. By
ignoring the option the existing PJSIP logic for using the existing connection will
be invoked and stuff will proceed.
(closes issue ASTERISK-23584)
Reported by: Rusty Newton
........
Merged revisions 411927 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The change that fixed the pubsub test event's use of a dangling pointer
also changed when it was processed relative to the pjsip subscription
state change processing. This change corrects the order of events while
holding a reference to the pointer that was previously dangling.
........
Merged revisions 411883 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The Stasis() dialplan application monitors what bridge a channel is in
and so necessarily holds on to a bridge pointer. This change ensures
that it also holds on to a reference for that bridge to prevent the
bridge pointer from becoming a dangling pointer.
........
Merged revisions 411804 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Assert if a channel is destroyed but has the snapshot staging flag set.
In this case the final channel destruction snapshot would never get taken.
* Assert if what we just got out of the stasis cache is not what we were
looking for. This assert would have saved several days searching for a
bug and a lot of my hair.
* Assert if the music on hold message posts could not find the associated
channel. A crash will happen later when manager tries to send the MOH AMI
message. This assert catches the problem when the stasis message is
posted instead of by the thread processing the defective message.
* Always generate a backtrace when an ast_assert() fails.
Review: https://reviewboard.asterisk.org/r/3411/
........
Merged revisions 411701 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Parts of res_hep properly checked for a valid configuration object before
attempting to access the configuration. A check, however, was missed when
a packet is sent. This patch fixes the crash caused by not checking if the
configuration object is valid.
........
Merged revisions 411668 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit contains several changes to sorcery:
1) Application of sorcery configuration based on module name is automatically performed
when sorcery is opened for a module.
2) Sorcery will not attempt to apply the same wizard to an object type more than once.
3) Sorcery gives more exact results when attempting to apply a wizard, whether as the
default or based on configuration.
Sorcery unit tests still pass for me after making these changes.
Review: https://reviewboard.asterisk.org/r/3326
........
Merged revisions 411159 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Use ast_bridge_channel_lock()/ast_bridge_channel_unlock() instead of
ao2_lock()/ao2_unlock() for struct ast_bridge_channel variables.
* Use ast_copy_string() instead of inlining it.
* Remove an already done TODO comment.
* Some whitespace tweaks.
........
Merged revisions 411638 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds the following:
(1) A new module, res_hep, which implements a generic packet capture agent for
the Homer Encapsulation Protocol (HEP) version 3. Note that this code is based
on a patch provided by Alexandr Dubovikov; I basically just wrapped it up,
added configuration via the configuration framework, and threw in a
taskprocessor.
(2) A new module, res_hep_pjsip, which forwards all SIP message traffic that
passes through the res_pjsip stack over to res_hep for encapsulation and
transmission to a HEPv3 capture server.
Much thanks to Alexandr for his Asterisk patch for this code and for a *lot*
of patience waiting for me to port it to 12/trunk. Due to some dithering on
my part, this has taken the better part of a year to port forward (I still
blame CDRs for the delay).
ASTERISK-23557 #close
Review: https://reviewboard.asterisk.org/r/3207/
........
Merged revisions 411534 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes setting nullable integer columns to NULL instead of an empty
string, which fails for PostgreSQL, for example. The current code is supposed
to do so, but the check is broken. The patch also allows the first column in
the list to be a nullable integer.
Also, the check for existence of a mandatory column checked for the first
column in the list instead of the key field lookup column. This patch fixes
that issue as well.
Finally, the compatibility option allow_empty_string_in_nontext, which was
added to previous revisions to allow for some database backends with certain
schemas to function, has been removed.
Review: https://reviewboard.asterisk.org/r/3335
ASTERISK-23459 #close
ASTERISK-23351 #close
(closes issue ASTERISK-23459)
Reported by: zvision
patches:
res_config_odbc.diff uploaded by zvision (License 5755)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fixed bad use of ao2_find() in on_endpoint().
* Replaced use of find_endpoints() with find_an_endpoint() since only the
first found endpoint is ever needed.
* Fixed qualify_contact_cb() to update the contact with the aor
authenticate_qualify setting. Otherwise, permanent contacts in the aor
type sections would have a config line order dependancy.
* Fixed off nominal path contact ref leak in qualify_contact(). The
comment saying the unref is not needed was wrong.
* Fixed off nominal path use of the endpoint parameter if it is NULL in
send_out_of_dialog_request().
* Added missing off nominal path unref of pjsip tdata in
send_out_of_dialog_request().
* Fixed off nominal path failing to call the callback in send_request_cb()
when the request is challenged for authentication.
* Eliminated silly RAII_VAR() use in qualify_contact_cb().
* Updated ast_sip_send_request() doxygen to better reflect reality.
(closes issue ASTERISK-23254)
Reported by: rmudgett
Review: https://reviewboard.asterisk.org/r/3381/
........
Merged revisions 411141 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fix memory leak in ast_unreal_new_channels(). Made it generate the ;2
uniqueid on a stack variable instead of mallocing it.
* Made send error response to ARI and AMI requests instead of just logging
excessive uniqueid length and allowing truncation. action_originate() and
ari_channels_handle_originate_with_id().
* Fixed minor truncating uniqueid hole when generating the ;2 uniqueid
string length. Created public and internal lengths of uniqueid. The
internal length can handle a max public uniqueid plus an appended ;2.
* free() and ast_free() are NULL tolerant so they don't need a NULL test
before calling.
* Made use better struct initialization format instead of the position
dependent initialization format. Also anything not explicitly initialized
in the struct is initialized to zero by the compiler.
* Made ast_channel_internal_set_fake_ids() use the safer
ast_copy_string() instead of strncpy().
Review: https://reviewboard.asterisk.org/r/3371/
........
Merged revisions 410949 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
"identify" is a special type of configuration object in PJSIP because
unlike the other objects, it is not provided by the base res_pjsip module.
Instead, it is provided by the res_pjsip_endpoint_identifier_ip module. If
using the default sorcery wizard (config,criteria=type=identify) then things
work because the module that applies the default wizard is the correct module.
However, if attempting to use sorcery.conf to apply an alternate wizard, it
was not possible. If you attempted to specify the identify object type in the
res_pjsip section, then the object could not be registered since the object
was undocumented for the res_pjsip module. There was no alternate configuration
section defined for it, so you were out of luck if you wanted to override the
default wizard.
With this change, the identify section will properly have a sorcery.conf-based
wizard applied when the identify definition is within the res_pjsip_endpoint_identifier_ip
section.
........
Merged revisions 410933 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change turns the bridge type field into a comma separated list of attributes.
These attributes include: mixing, holding, dtmf_events, and proxy_media. By setting
the various attributes a user can control the type of bridge created with the
behavior they need for their application.
(closes issue ASTERISK-23437)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3359/
........
Merged revisions 410904 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change enables DNS client support within PJSIP. System
nameservers are automatically discovered using res_init or
res_ninit. If this fails then PJSIP will resort to using
gethostbyname for resolution.
By enabling this support we gain SRV support, failover, and
weight support.
(closes issue ASTERISK-23435)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3343/
........
Merged revisions 410795 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.
The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
not to occur (the bridge dies, the channel is removed from the bridge), then we would
never be notified.
The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.
Review: https://reviewboard.asterisk.org/r/3338
........
Merged revisions 410673 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Events are sent to a connected ARI application based on the things that ARI
application cares about. These subscriptions can be set up implicitly - such
as when that ARI application creates a new object - or explicitly, via the
application resource's subscription operations. Debugging *why* something was
being sent to an application - or why something was not being sent to an
application - was a bit tricky, as there was no debug information for the
subscriptions.
This patch adds some debug level 3 statements that show the subscription counts
for applications. (Level 3 was chosen as it matches the verbose level 3
statements elsewhere)
........
Merged revisions 410650 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Realtime backends' update and store callbacks return the number of rows affected,
or -1 if there was a failure. There were a couple of issues:
* The config API was treating 0 as a successful return, and positive values as
a failure. Now the config API treats anything >= 0 as a success.
* res_sorcery_realtime was treating 0 as a successful return from the store
procedure, and any positive values as a failure. Now sorcery treats anything
> 0 as a success. It still considers 0 a "failure" since there is no change
to report to observers.
Review: https://reviewboard.asterisk.org/r/3341
........
Merged revisions 410592 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This fixes an issue where a Stasis application running over ARI and
subscribed to ari/events could miss the ChannelEnteredBridge event
because it did not subscribe to the new bridge fast enough.
To accomplish this, it subscribes the application controlling the
channel to the new bridge before adding it to that bridge which
required the stasis_app_control structure to maintain a reference to
the stasis_app.
(closes issue ASTERISK-23295)
Review: https://reviewboard.asterisk.org/r/3336/
........
Merged revisions 410527 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Made res_musiconhold.c always post the MusicOnHoldStart/MusicOnHoldStop
events when it actually starts/stops the music streams. This allows the
events to always happen when MOH starts/stops. The event posting code was
moved to the MOH alloc/release routines.
* Made channel_do_masquerade() stop any MOH on the original channel before
masquerading so the original channel will get a stop event with correct
information.
* Cleaned up a couple odd codings in moh_files_alloc() and moh_alloc()
dealing with the music state variable.
(issue ASTERISK-23311)
Reported by: Benjamin Keith Ford
Review: https://reviewboard.asterisk.org/r/3306/
........
Merged revisions 410493 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change fixes a bug where the code which changes the transport did not check whether
the message is going out over UDP or not before changing it. For TCP and TLS transports
we don't need to change the transport as the correct one is already chosen.
........
Merged revisions 410471 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Due to how messages are handled within PJSIP it is not until a message is actually
sent that the destination is reliably known. This means that the addresses placed
within the message may not be of the interface the message is being sent out on.
This module determines what interface a message is being sent on and updates the
message to contain the correct address if applicable.
This module was tested by myself in a virtualized environment with multiple interfaces
and also by Kinsey Moore in the following configuration:
Networks:
* 10.24.16.0/21
** hard phone
** default gateway
* 10.24.64.0/21
** softphone with pjsip-based stack
Transport details:
bind address: 0.0.0.0
protocol: UDP
All endpoints were tested with explicitly configured transports and unconfigured transports.
This was tested with inbound and outbound calls, both of which were experiencing detrimental
effects from incorrect IP addresses in SIP messages. These effects were only experienced by the
soft phone on the 10.24.64.0 network since the messages to the hard phone on the 10.24.16.0
network had the correct IP address.
(closes issue ASTERISK-23020)
Reported by: xrobau
Review: https://reviewboard.asterisk.org/r/3102/
........
Merged revisions 410451 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Created the 'pjsip show channel' and 'pjsip show contact' commands.
Refactored out the hated ast_hashtab. Replaced with ao2_container.
Cleaned up function naming. Internal only, no public name changes.
Cleaned up whitespace and brace formatting in cli code.
Changed some NULL checking from "if"s to ast_asserts.
Fixed some register/unregister ordering to reduce deadlock potential.
Fixed ast_sip_location_add_contact where the 'name' buffer was too short.
Fixed some self-assignment issues in res_pjsip_outbound_registration.
(closes issue ASTERISK-23276)
Review: http://reviewboard.asterisk.org/r/3283/
........
Merged revisions 410287 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The one touch recording options have several see-also links between the
various configuration options. These were 'broken' by the snake casing
of those options. This patch corrects the see-also links such that they
reference the correct option names.
........
Merged revisions 410194 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In order to prevent confusion over the allow and disallow
list of codecs being the same an option for registering a
field as an alias is added. The alias field will be read
from the configuration file, but afterwards is not listed
as a known field. With disallow set as an alias, the CLI
command pjsip show endpoint # will list the allow= field,
but not the disallow field.
(closes issue ASTERISK-23092)
Review: https://reviewboard.asterisk.org/r/3193/
........
Merged revisions 410190 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it. Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation. This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first. In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.
Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.
(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/
........
Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
I observed a crash in res_musiconhold on an Asterisk 11 system using realtime
MOH. Investigation of the backtrace showed a corrupt mohclass, implying that
it got destroyed before the code expected it to. I went looking for reference
counting errors that could have caused this crash and this patch this result.
It contains 2 changes.
1) Remove a usless block of code that was impossible to reach. There was even
a comment indicating that it was impossible to reach. The conditional includes
"!ast_test_flag(global_flags, MOH_CACHERTCLASSES)" and it's inside of an if
block with the opposite check "ast_test_flag(global_flags,
MOH_CACHERTCLASSES)". There's no good reason to keep it around.
2) A similar block to #1 contained a reference counting error. It stores
state->class in the local variable mohclass without increasing its reference
count. The reference count on mohclass is decremented at the end of the
function. This block of code probably very rarely runs, which would help
explain why this system was working fine for many months before experiencing a
crash.
Review: https://reviewboard.asterisk.org/r/3282/
........
Merged revisions 410043 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 410044 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 410090 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch creates the AST_SORCERY dialplan function which allows someone to
retrieve any value from a sorcery-based config file. It's similar to
AST_CONFIG.
The creation of the function itself was fairly straightforward but it required
changes to the underlying sorcery infrastructure that rippled into individual
sorcery objects. The changes stemmed from inconsistencies in how sorcery
created ast_variable objectsets from sorcery objects and the inconsistency
in how individual objects used that feature especially when it came to
parameters that can be specified multiple times like contact in aor and match
in identify. You can read more here...
http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html
So, what this patch does, besides actually creating the AST_SORCERY function,
is the following...
* Creates ast_variable_list_append which is a helper to append one ast_variable
list to another.
* Modifies the ast_sorcery_object_field_register functions to accept the
already-defined sorcery_fields_handler callback.
* Modifies ast_sorcery_objectset_create to accept a parameter indicating return
type preference...a single ast_variable with all values concatenated or an
ast_variable list with multiple entries. Also fixed a few bugs.
* Modifies individual sorcery object implementations to use the new function
definition of the ast_sorcery_object_field_register functions.
* Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement
sorcery_fields_handler handlers so they return multiple occurrences as an
ast_variable_list.
* Added a whole bunch of tests to test_sorcery.
(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3254/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Transport TOS values were interpreted as DSCP values without being documented
as such. Endpoint TOS values (tos_audio/tos_video) behaved normally as TOS
values have historically. This patch makes the transport TOS values behave as
TOS values and makes all TOS values readable as string values (e.g. AF11).
In addition, alembic scripts have been updated to use the proper field types
for all TOS/COS values.
(issue ASTERISK-23235)
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3304/
........
Merged revisions 410028 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When acting as a T.38 fax gateway, res_fax_spandsp would at times cause a crash
in libspandsp. This would occur when, during fax tone detection, a ulaw/alaw
frame would be passed to modem_connect_tones_rx. That particular routine
expects the data to be in slin format. This patch looks at the frame type and,
if the data is ulaw/alaw, converts the format to slin before passing it to
modem_connect_tones_rx.
Review: https://reviewboard.asterisk.org/r/3296
(closes issue ASTERISK-20149)
Reported by: Alexandr Gordeev
Tested by: Michal Rybarik
patches:
spandsp_g711decode.diff uploaded by Michal Rybarik (license 6578)
........
Merged revisions 409990 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 409991 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Several fixes for the WebSockets implementation in res/res_http_websocket.c
* Flush the websocket session FILE* as fwrite() may not actually guarantee sending
the data to the network. If we do not flush, it seems that buffering on the SSL
socket for outbound messages causes issues
* Refactored ast_websocket_read to take into account that SSL file descriptors
may be ready to read via fread() but poll() will not actually say so because
the data was already read from the network buffers and is now in the libc buffers
(closes issue ASTERISK-23099)
(closes issue ASTERISK-21930)
Review: https://reviewboard.asterisk.org/r/3248/
........
Merged revisions 409681 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 409697 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
........
r409129 | jrose | 2014-02-27 13:19:02 -0600 (Thu, 27 Feb 2014) | 15 lines
res_rtp_asterisk: Fix checklist creating problems in ICE sessions
Prior to this patch, local candidate lists including SRFLX would fail to start
properly when building ICE candidate check lists. This patch fixes that problem
by making sure that each SRFLX candidate is associated with the proper
base address so that the check list can create matches properly.
This patch was written by jcolp. The issue will be left open to await testing
by the issue participants.
(issue ASTERISK-23213)
Reported by: Andrea Suisani
Review: https://reviewboard.asterisk.org/r/3256/
........
r409130 | jrose | 2014-02-27 13:38:10 -0600 (Thu, 27 Feb 2014) | 8 lines
res_rtp_asterisk: correct build error from r409129
Accidentally placed a declaration below functional code
(issue ASTERISK-23213)
Reported by: Andrea Suisani
Review: https://reviewboard.asterisk.org/r/3256/
........
Merged revisions 409129-409130 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 409131 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The setting 'use_ptime' is supposed to tell Asterisk to honour the ptime
attribute in an offer, preferring it to whatever packetization
preferences have been set internally. Currently, however, something
rather quirky will happen:
(1) The SDP answer will be constructed in create_outgoing_sdp_stream.
This will use the preferences from the endpoint, such that the 200 OK
response will add the packetization preferences from the endpoint, and
not what was offered.
(2) When the 200 response is issued, apply_negotiated_sdp_stream is called.
This will call apply_packetization, which will use the ptime attribute
from the offer internally.
We end up telling the offerer to use the internal ptime attribute, but we end
up using the offered ptime attribute. Hilarity ensues.
This patch modifies the behaviour by calling apply_packetization from
negotiate_incoming_sdp_stream, which is called prior to
create_outgoing_sdp_stream. This causes the format preferences on the
session's media object to be set to the inbound ptime value (if 'use_ptime'
is enabled), such that the construction of the answer gets the right value
immediately.
Review: https://reviewboard.asterisk.org/r/3244/
........
Merged revisions 408999 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
It is currently possible for an ast_sip_session to exist without an
associated channel as is the case when a new invite is coming in or
just after a hangup is issued on a chan_pjsip channel. Part of the
attended transfer code assumed the channel would be non-NULL and used
it as such causing a crash. This bug was exposed thanks to the attended
transfer ARI test in the test suite.
(closes issue ASTERISK-23287)
Reported by: Matt Jordan
........
Merged revisions 408941 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Added the ability for transferring directly to voicemail on digium phones.
Added a new module that checks for the presence of a custom header and/or
diversion header within a sip REFER. If either is found and they specify
a sending to voicemail action then variables are added to the channel
allowing the user access to them in the dialplan. Dialplan can then be
written that branches based upon these values allowing, for instace, for
a single number to be used for dialing and/or accessing voicemail directly.
Also fixed a problem where the PJSIP_HEADER function was allowing non pjsip
channels through (checked to make sure it has the correct channel type before
proceeding).
Review: https://reviewboard.asterisk.org/r/3245/
........
Merged revisions 408880 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fixed off-nominal json ref counting issue with using the following API
calls: ast_json_object_set() and ast_json_array_append().
* Fixed off-nominal error reporting in ast_ari_endpoints_list().
* Fixed some miscellaneous off-nominal json ref counting issues in
report_receive_fax_status() and dial_to_json().
........
Merged revisions 408713 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In order to retrieve an arbitrary sorcery instance from a dialplan function
(or any place else) there needs to be a registry of sorcery instances.
ast_sorcery_init now creates a hashtab as a registry.
ast_sorcery_open now checks the hashtab for an existing sorcery instance
matching the caller's module name. If it finds one, it bumps the
refcount and returns it. If not, it creates a new sorcery instance,
adds it to the hashtab, then returns it.
ast_sorcery_retrieve_by_module_name is a new function that does a hashtab
lookup by module name. It can be called by the future dialplan function.
res_pjsip/config_system needed a small change to share the main res_pjsip
sorcery instance.
tests/test_sorcery was updated to include a test for the registry.
(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3184/
........
Merged revisions 408518 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When 'use_avpf' is set to True, inbound offers must use the AVPF/SAVPF RTP
profile. However, when 'use_avpf' is set to False, Asterisk will accept
both AVP/SAVP or AVPF/SAVPF RTP profiles in inbound offers. The documentation
previously implied that Asterisk would reject AVPF/SAVPF if 'use_avpf' was
set to False and a UA offered said profile in an INVITE request.
........
Merged revisions 408502 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The sorcery astDB wizzard does not handle regex correctly if the pattern
begins with an anchor character.
This patch attempts to convert the anchored regex pattern to a prefix
pattern supported by astDB for performance reasons. If it is not able to
convert the pattern it falls back to getting all astDB members of the
family and doing a normal regex pattern matching on the retrieved records.
Review: https://reviewboard.asterisk.org/r/3161/
........
Merged revisions 408385 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If an AOR has no permanent contacts, then the
permanent_contacts container is never allocated.
This makes the code safe in the face of NULLs.
I also changed the variable that counts contacts
from "num" to "total_contacts" since there are now
two variables that are indicate numbers of things.
........
Merged revisions 407988 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch tweaks the behaviour of POST /channels with channel variables such
that the variables are passed into the pbx.c routines that perform the
origination. This allows the variables to be assigned to the newly created
channels immediately upon their construction, as opposed to be assigned after
the originate has completed.
The upshot of this is that the variables are available on the channels if
they execute in the dialplan, as opposed to only being available once the
channels are answered.
Review: https://reviewboard.asterisk.org/r/3183/
........
Merged revisions 407937 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change allows timing implementation data to be stored directly
on the timer itself thus removing the requirement for many
implementations to do a container lookup for the same information.
This means that API calls into timing implementations can directly
access the information they need instead of having to find it.
Review: https://reviewboard.asterisk.org/r/3175/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Adds identify, transport, and registration support to the PJSIP CLI.
* Creates three additional callbacks, one for an iterator, one for a
comparator, and one for a container. This eliminates the link dependency
from higher level modules to lower level ones.
* Eliminates duplicate sorting in PJSIP CLI commands.
* Cleans up PJSIP CLI output formatting.
* Pushes CLI command registration down to the implementing source file.
* Adds several ast_sip_destroy_sorcery functions to complement existing
ast_sip_sorcery_initialize functions. The destroy functions unregister
PJSIP CLI commands and PJSIP CLI formatters.
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3104/
........
Merged revisions 407568 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If the global section was not specified in pjsip.conf then the configuration
object does not exist in sorcery so when retrieving "debug" option it would
return NULL. Then the NULL result was passed to ast_false utils function
which would return false because it wasn't set to some representation of
false, thus enabling sip debug logging. Made it so if the global config object
does not exist then it will return a default of "no" for sip debugging.
(issue ASTERISK-23038)
Reported by: Rusty Newton
........
Merged revisions 407442 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The code assumed that unregistering the alias would always succeed while in
practice this is not actually true. A common case is the "reload" command itself.
If the cli_aliases.conf configuration file was changed and reload executed the
command would fail to unregister and ultimately point to freed memory.
The reload process now checks whether unregistering succeeded or not and if not
the old CLI alias is retained.
(closes issue ASTERISK-19773)
Reported by: Joel Vandal
(closes issue ASTERISK-22757)
Reported by: Gareth Blades
........
Merged revisions 407205 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 407210 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 407213 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When the PJSIP pubsub framework was created, subscription handlers were required
to state what event they handled along with what body types they knew how to
generate. While this serves well when implementing a base RFC, it has problems
when trying to extend the body to support non-standard or proprietary body
elements. The code also was NOTIFY-specific, meaning that when the time comes
that we start writing code to send out PUBLISH requests with MWI or presence
bodies, we would likely find ourselves duplicating code that had previously been
written.
This changeset introduces the concept of body generators and body supplements. A
body generator is responsible for allocating a native structure for a given body
type, providing the primary body content, converting the native structure to a
string, and deallocating resources. A body supplement takes the primary body
content (the native structure, not a string) generated by the body generator and
adds nonstandard elements to the body. With these elements living in their own
module, it becomes easy to extend our support for body types and to re-use
resources when sending a PUBLISH request.
Body generators and body supplements register themselves with the pubsub core,
similar to how subscription and publish handlers had done. Now, subscription
handlers do not need to know what type of body content they generate, but they
still need to inform the pubsub core about what the default body type for a
given event package is. The pubsub core keeps track of what body generators and
body supplements have been registered. When a SUBSCRIBE arrives, the pubsub core
will check that there is a subscription handler for the event in the SUBSCRIBE,
then it will check that there is a body generator that can provide the content
specified in the Accept header(s).
Because of the nature of body generators and supplements, it means
res_pjsip_exten_state and res_pjsip_mwi have been completely gutted. They no
longer worry about body types, instead calling
ast_sip_pubsub_generate_body_content() when they need to generate a NOTIFY body.
Review: https://reviewboard.asterisk.org/r/3150
........
Merged revisions 407016 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When subscribing to MWI (res_pjsip_mwi) and the sip uri did not contain a name
(ex: sip:<ip address>) then the subscription would fail since it would be unable
to locate an associated aor. This patch makes it so that when a subscribe comes
with no aor name then it will subscribe to all aors on the located endpoint.
(closes issue ASTERISK-23072)
Reported by: Bob M
Review: https://reviewboard.asterisk.org/r/3164/
........
Merged revisions 407014 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In NAT scenarios where a call is placed to a Grandstream phone,
res_pjsip will sometimes send the ACK to a 200 OK to the private
address of the device behind the NAT instead of the address of the NAT
device. This corrects that behavior by rewriting the address in the
Contact header in the incoming 200 OK and the dialog's target address
if necessary (since it has already been rewritten to the incorrect
private address).
(closes issue ASTERISK-23106)
Review: https://reviewboard.asterisk.org/r/3168/
Reported by: Matt Jordan
........
Merged revisions 407000 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
What seems to be happening is if a subscription has been terminated and the
subscription timeout/expires is less than the time it takes for all pending
transactions (currently on the subscription) to end then the subscription
timer will not have been canceled yet and sub will be null. Since the
subscription has already been canceled nothing needs to be done so a null
check in the asterisk code is sufficient in working around this problem.
(closes issue ASTERISK-23129)
Reported by: Dan Jenkins
........
Merged revisions 406847 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
On some systems the values for INFINITY and NAN are not defined thus causing
a build error on those systems. Added definitions for those if they had
not previously been defined.
(closes issue ASTERISK-23056)
Reported by: capouch
Patches:
inf-nan-patch.txt uploaded by capouch (license 6564)
........
Merged revisions 406788 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Currently, attempting to subscribe an application to a device state
that it has already subscribed to will generate a 500 error response.
This will now be treated as a subscription refresh even though ARI
subscriptions don't currently support lifetimes and will respond with
the normal response for a successful subscription (200 OK).
(closes issue ASTERISK-23143)
Reported by: Matt Jordan
........
Merged revisions 406775 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The core may (depending on circumstances) request a single codec on outgoing
calls. Many channel drivers ignore or treat this as a suggestion while still
including configured codecs. The res_pjsip_session logic treated this as
an explicit request, leaving out other configured codecs.
This change makes res_pjsip_session behave like other channel driver and simply
adds the requested codec to the list.
(closes issue ASTERISK-23082)
Reported by: xrobau
Review: https://reviewboard.asterisk.org/r/3140/
........
Merged revisions 406489 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
........
r406294 | mmichelson | 2014-01-23 15:00:24 -0600 (Thu, 23 Jan 2014) | 11 lines
Fix presence body errors found during testing:
* PIDF bodies were reporting an "open" state in many cases where
it should have been reporting "closed"
* XPIDF bodies had XML nodes placed incorrectly within the hierarchy.
* SIP URIs in XPIDF bodies did not go through XML sanitization
* XML sanitization had some errors:
* Right angle bracket was being replaced with "&rt;" instead of ">"
* Double quote, apostrophe, and ampersand were not being escaped.
........
r406295 | mmichelson | 2014-01-23 15:09:35 -0600 (Thu, 23 Jan 2014) | 11 lines
Fix presence body errors found during testing:
* PIDF bodies were reporting an "open" state in many cases where
it should have been reporting "closed"
* XPIDF bodies had XML nodes placed incorrectly within the hierarchy.
* SIP URIs in XPIDF bodies did not go through XML sanitization
* XML sanitization had some errors:
* Right angle bracket was being replaced with "&rt;" instead of ">"
* Double quote, apostrophe, and ampersand were not being escaped.
........
Merged revisions 406294-406295 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Several of the playback error messages for invalid media input in
res_stasis_playback.c had the media name and channel name reversed.
They now correctly identify the channel name and media name.
Reported by: skrusty
........
Merged revisions 406152 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Making the help text for both more explicit regarding the format of mailbox identifiers. i.e. clarifying the format for app_voicemail mailboxes vs mailboxes from external MWI sources through modules such as res_external_mwi.
........
Merged revisions 406133 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The PJSIP header parsing function (pjsip_parse_hdr) can generate more
than one header instance from a single header field. These header
instances exist as a list attached to the returned header and must be
handled appropriately when they are added to a message or else only the
first header instance will be used. This changes the linked list
functions used in outbound proxy code to merge the lists properly.
........
Merged revisions 406020 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This adds back in support for specifying channel variables during an
originate without compromising the ability to specify query parameters
in the JSON body. This was accomplished by generating the body-parsing
code in a separate function instead of being integrated with the URI
query parameter parsing code such that it could be called by paths with
body parameters. This is transparent to the user of the API and
prevents manual duplication of code or data structures.
(closes issue ASTERISK-23051)
Review: https://reviewboard.asterisk.org/r/3122/
Reported by: Matt Jordan
........
Merged revisions 406003 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change adds improvements to support for allow=all in
pjsip.conf so that it functions as intended. Previously,
the allow/disallow socery configuration would set & clear
codecs from the media.codecs and media.prefs list, but if
all was specified the prefs list was not updated. Then a
call would fail when create_outgoing_sdp_stream() created
an SDP with no audio codecs.
A new function ast_codec_pref_append_all() is provided to
add all codecs to the prefs list - only those not already
on the list. This enables the configuration to specify a
codec preference, but still add all codecs, and even then
remove some codecs, as shown in this example:
allow = ulaw, alaw, all, !g729, !g723
Also, the display order of allow in cli output is updated
to match the configuration by using prefs instead of caps
when generating a human readable string.
Finally, a change to create_outgoing_sdp_stream() skips a
codec when it does not have a payload code instead of the
call failing.
(closes issue ASTERISK-23018)
Reported by: xrobau
Review: https://reviewboard.asterisk.org/r/3131/
........
Merged revisions 405875 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405876 65c4cc65-6c06-0410-ace0-fbb531ad65f3