Commit Graph

649 Commits

Author SHA1 Message Date
Anthony Minessale 8d720d5bcc FS-6940 #resolve #comment %FEATURE use the variable digits_dialed_filter to set regular expressions with () captures and anything matched will be replaced with X's in the CDR 2014-10-23 12:47:27 -05:00
Anthony Minessale 01bf42225c FS-6888 #resolve #comment fix regression from refactoring new feature 2014-10-03 10:17:41 -05:00
Anthony Minessale 789e1481ed FS-6880 #resolve #comment I would think that in real life once the call agreed on a codec it would only offer the negotiated codecs but we can fix this to always filter for good measure. I am not sure what the ramifications are of filtering responses but I think this patch will do so as well. 2014-10-01 13:03:50 -05:00
Anthony Minessale 24084adf77 %FEATURE Add new feature to filter the SDP on bypass_media calls to remove or limit codecs.
VARIABLE: bypass_media_sdp_filter

Can be set globally or per leg on the inbound side of a bypass_media bridge.

VALID FILTERS:

remove(): Removes the specified codec if it exists in the SDP.
only():   Removes all codecs besides the one specified (providing that it exists in the sdp) (will not remove telephone-event))

EXAMPLE 1 (remove everything leaving only g729):

  <action application="set" data="bypass_media_sdp_filter=only(g729)"/>
  <action application="set" data="bypass_media=true"/>
  <action application="bridge" data="sofia/internal/1238@conference.freeswitch.org"/>

EXAMPLE 2 (remove everything leaving only g729 and also remove dtmf):

  <action application="set" data="bypass_media_sdp_filter=only(g729)|remove(telephone-event)"/>
  <action application="set" data="bypass_media=true"/>
  <action application="bridge" data="sofia/internal/1238@conference.freeswitch.org"/>

EXAMPLE 3 (remove alaw and speex):

  <action application="set" data="bypass_media_sdp_filter=remove(pcma)|remove(speex)"/>
  <action application="set" data="bypass_media=true"/>
  <action application="bridge" data="sofia/internal/1238@conference.freeswitch.org"/>
2014-10-01 01:28:10 +05:00
Anthony Minessale c018c28738 FS-6851 #resolve 2014-09-24 20:40:27 +05:00
William King 47760e2d75 Silence a warning in clang-3.5 dealing with implicit conversion from 64bit to 32bit in a function call to switch_ivr_sleep() 2014-08-02 19:41:44 -07:00
Anthony Minessale 388d980b86 FS-6701 #resolve 2014-07-29 22:20:31 +05:00
Brian West ac265ce495 FS-6682: fix arg order on switch_channel_export_variable called from switch_channel_export_variable_printf #resolve 2014-07-24 08:28:38 -05:00
Anthony Minessale 91d405a2c1 call recovery_track on recovering channels once the recovery has completed and fix race condition with repeated recovery 2014-07-16 21:40:23 +05:00
Kathleen King 2d85726ecd Fixed dead code.
While reviewing code I noticed some dead code. It was not possible to
default to the channel variable because the parameter could not be
both full and empty.

If the parameter is not a non zero length string then the code looked
like it was intending to default to the channel variable
'presence_data_cols'. If neither of these are the case it is a noop.

By enabling the dead code, you now have access to set the
'presence_data_cols' in the dialplan or scripts like lua.
2014-07-03 17:03:01 -07:00
Travis Cross 7406be6927 Relay cause of hangup on SRTP failure
We hangup the channel after receiving 10 SRTP packets in a row with a
bad auth tag or that are replayed.  Prior to this commit we were
indicating a normal clearing.  When doing interop and looking first at
packet traces, this made freeswitch's behavior look surprising.  With
this commit we'll indicate more loudly what's happening.
2014-06-28 01:18:50 +00:00
Anthony Minessale 495db48f5a make device state code more accurate 2014-05-31 00:30:59 +05:00
Travis Cross f38ccbfb51 Remove dead assignment, but why...
This assignment isn't doing anything, so it safe to remove it, but
there remains the question of whether there could have been some
actually necessary intention behind this line.
2014-04-30 22:33:24 +00:00
Travis Cross 0f6e364e61 Drop dead assignment 2014-04-30 22:33:24 +00:00
Michael Jerris 6e41898517 this should never happen, but just in case, this will at least calm coverity 2014-04-28 16:30:19 -04:00
Michael Jerris 7e2499355a handle null 'status' passed to 'switch_channel_perform_presence' more gracefully 2014-04-28 16:21:45 -04:00
Michael Jerris a5f680810d only enable passthru_ptime_mismatch when set to a true value, not when it is set to any value 2014-04-28 16:17:56 -04:00
Michael Jerris d9b5bfaa7f only enable passthru_ptime_mismatch when set to a true value, not when it is set to any value 2014-04-28 16:12:10 -04:00
Michael Jerris a044b3b64b remove unused var ocp 2014-04-28 16:06:39 -04:00
Anthony Minessale c51b55a46e FS-6491 --resolve
This seems to be a paradox when running a perl script from a session then executing perl again on the same session from a different thread.
I fixed it by converting any execution of perl in the execute_on_* family of operators to only run background mode which is to store the command in the session stack to be executed only by the session thread instead of on the spot by the outide thread.  changing the execute_on_answer to perl::/path/to/script.pl would also eliminate the crash in code that has not been updated with this patch.

This is just a limitation of embedded perl we have to live with.
2014-04-28 21:19:48 +05:00
Anthony Minessale 804ef7709d change from sqlite hash to newly added one 2014-03-09 00:37:17 +05:00
Anthony Minessale f862c34325 FS-6272 --resolve 2014-02-27 03:24:37 +05:00
Anthony Minessale 5646957c5b FS-5937 2014-02-26 04:06:59 +05:00
Anthony Minessale e47aba1e7e FS-6235 2014-02-23 05:17:07 +05:00
Anthony Minessale ec50c05df6 make hangup or end of bridge trigger unhold action for held legs 2014-02-21 13:26:04 -06:00
Anthony Minessale c945584201 FS-6237 --resolve 2014-02-17 23:48:59 +05:00
Ken Rice 6e7d5d0897 update copyright header for 2014 2014-02-12 12:08:56 -06:00
Anthony Minessale f8844d1398 FS-6020 --resolve 2014-01-07 01:54:31 +05:00
Anthony Minessale 5f239a5bae add channel logical direction 2013-10-31 15:28:33 -05:00
Anthony Minessale b5d53b6341 remove_debug 2013-10-30 17:26:06 -05:00
Anthony Minessale e2e8a57d9d add ring_wait callstate for devstate interface 2013-10-30 14:08:34 -05:00
Anthony Minessale e659814a84 missed a spot 2013-10-23 23:21:31 -05:00
Anthony Minessale a4a8948774 tweak to devstate 2013-10-23 23:09:14 -05:00
Anthony Minessale 916a75e9cf device state tweaks 2013-10-23 20:45:34 -05:00
Anthony Minessale 70ea252505 tweak 2013-10-18 01:32:31 +05:00
Anthony Minessale 4a172402d2 some refactoring and plumbing for 1.4 2013-10-16 02:24:32 +05:00
Anthony Minessale 80e5a7cf0a FS-5778 --resolve use switch_core_event_hook_remove_receive_message() to bind to receive_message and case for new SWITCH_MESSAGE_ANSWER_EVENT, SWITCH_MESSAGE_PROGRESS_EVENT, SWITCH_MESSAGE_RING_EVENT 2013-09-11 22:58:00 +05:00
Anthony Minessale ce4cfc97c4 FS-5772 improve odds a little more but the phone is broken here 2013-09-11 02:55:31 +05:00
Anthony Minessale 38cd508a12 FS-5772 --resolve this is sort of a hack but less painful than reporting bugs to polycom 2013-09-10 23:14:30 +05:00
Seven Du 2490868830 FS-5498 fix typo from commit ab947f5 2013-07-19 12:41:40 +08:00
Anthony Minessale bbdd77ec35 fix race condition on device state destroy 2013-06-28 14:21:04 -05:00
Nathan Neulinger 32adc789f6 make noexpandtab explicit in all vim modelines other than xml files 2013-06-25 11:50:17 -05:00
Anthony Minessale 16bdee13fc add answer_delay variable to sleep N ms when answer is called from the channel thread 2013-06-20 21:29:31 -05:00
Anthony Minessale 2fac3a8e83 refactor some of the video passthru code 2013-06-17 19:52:37 -05:00
Anthony Minessale 2c9ee26fdd dont change device state from hangup to hangup 2013-06-17 10:44:22 -05:00
Seven Du a3dfd0bf62 FS-5498 add ringing and early stats to event 2013-06-12 09:09:21 +08:00
Anthony Minessale de802f2124 FS-5498 fix state change 2013-06-11 11:24:04 -05:00
Anthony Minessale df1bba55ee FS-5498 2013-06-10 19:13:21 -05:00
Anthony Minessale 6731519bef FS-5498 2013-06-10 18:22:08 -05:00
Anthony Minessale 860ed3f9a6 add last callback run stamp to device records 2013-06-06 13:09:13 -05:00
Anthony Minessale 4240526ce3 add some device-state mechinism to FS to allow tracking of device-specific states where they may have more than one call from the same device 2013-06-05 11:20:11 -05:00
Anthony Minessale 9d8af739c8 FS-5480 --resolve 2013-05-28 08:17:44 -05:00
Anthony Minessale f42fffb65f FS-5466 --resolve 2013-05-24 09:14:13 -05:00
Anthony Minessale 6cdb46889c FS-5402 --resolve the problem is ent originate has many channels and many causes to parse so we need to check it against all the causes 2013-05-22 11:01:39 -05:00
Anthony Minessale 2d96d7c165 fix minor cid issue in mod_fifo 2013-04-22 16:31:05 -05:00
Anthony Minessale 8adeab7d5a move callstate changes down to take place after the core states have run 2013-04-15 10:43:32 -05:00
Anthony Minessale 7fd28f58f9 FS-5208 --resolve 2013-04-08 12:09:49 -05:00
Anthony Minessale 18c429f66f refactor and cleanup more cid stuff 2013-04-05 15:29:57 -05:00
Anthony Minessale 83fc8ddf3a endless cid fun 2013-04-05 08:29:16 -05:00
Anthony Minessale a1999ad62a flush on answer for inbound only 2013-04-04 13:46:46 -05:00
Anthony Minessale 69c3c7d8e2 FS-5257 --resolve you seem to be setting sip_secure_media on an inbound leg, this is not correct. This patch should auto-correct that but also beware that the variable has changed to rtp_secure_media after this commit 2013-04-02 20:05:46 -05:00
Anthony Minessale 2207b87769 do some more caller-id cleanup 2013-04-01 23:03:14 -05:00
Anthony Minessale 262aed0ed1 remove debug code 2013-03-29 22:12:54 -05:00
Anthony Minessale aca9257f93 tweaks for caller id in certian uuid_bridge situations 2013-03-28 22:17:28 -05:00
Brian West b8b7176086 remove debug line left in by accident 2013-03-27 22:19:58 -05:00
Anthony Minessale 861c3e3ccc add switch_core_get_variables and allow execute_on funcs to see global vars too 2013-03-27 14:54:01 -05:00
Anthony Minessale 4e812bb263 FS-5169 --resolve 2013-03-13 10:37:44 -05:00
Anthony Minessale 50e7a09eca FS-4709 this is the right way to do this part 2013-02-26 15:32:19 -06:00
Anthony Minessale aa89eab58f FS-4709 --resolve, not adding the change to switch_rtp I want to have that log line there, don't make vanity changes mixed in with code changes 2013-02-26 11:49:17 -06:00
Anthony Minessale 28680c5e58 fix callstate stuff to behave right on outbound calls 2013-02-23 12:55:58 -06:00
Anthony Minessale ee7dd033fd fix race condition in state thread 2013-02-22 17:46:54 -06:00
Anthony Minessale d4f8a79299 try to improve audio stream sync 2012-11-28 23:12:35 -06:00
Anthony Minessale c7c528cd7c FS-4867 --resolve 2012-11-26 13:52:06 -06:00
Anthony Minessale 6f2976298f FS-4836 ok try this 2012-11-15 13:16:50 -06:00
Anthony Minessale 057861867e FS-4836 not quite 2012-11-15 13:14:08 -06:00
Anthony Minessale 73f022873b FS-4836 try this 2012-11-15 12:54:40 -06:00
Anthony Minessale b39a2cbb8b put running_state in the channel event rather than the state so presence events reflect the current state of the channel and not the one that was possibly changed during the last state 2012-11-08 14:13:05 -06:00
Anthony Minessale f1e16ccbfa only track calls once they have been answered 2012-10-24 12:33:13 -05:00
Jeff Lenk a8ee444ab9 FS-4748 --resolve 2012-10-22 09:24:45 -05:00
Anthony Minessale 03d702fabc FS-4676 --resolve 2012-10-09 13:50:11 -05:00
Anthony Minessale 07ed03c458 FS-4625 --resolve 2012-09-20 09:57:58 -05:00
Anthony Minessale 9a193a9cd2 add hold_events variable with start and stop times for each hold 2012-09-12 16:36:17 -05:00
Anthony Minessale c2893801cb add timestamps for on and off hold times to put in xml cdrs 2012-09-07 18:17:57 -05:00
Anthony Minessale 8c6b8edfea FS-4542 --resolve ok if this causes any problems it should lead us back to this commit 2012-08-17 14:07:20 -05:00
Anthony Minessale cc351ca004 revert 2012-08-16 12:09:19 -05:00
Anthony Minessale 42bf44de51 FS-4539 please test this and post new logs if necessary 2012-08-16 11:56:55 -05:00
Anthony Minessale bb69310259 FS-4079 FS-4540 please update to this version 2012-08-15 22:51:41 -05:00
Anthony Minessale 293429f78d add api-expansion to switch.conf.xml and fsctl api_expansion command to control allowing apis to be expanded via variable expansion 2012-07-27 18:53:04 -05:00
Anthony Minessale 696fb9c28b expand vars in hold music variable 2012-07-26 13:17:39 -05:00
Anthony Minessale 293516be59 FS-4370 --resolve 2012-07-10 22:44:11 -05:00
Anthony Minessale f3a49366a1 FS-4331 please test and post a new log if necessary 2012-07-03 08:05:41 -05:00
Anthony Minessale 60bb3595fd FS-4313 --resolve 2012-06-26 11:34:24 -05:00
Anthony Minessale 75aab0ee6c put presence data in state events 2012-06-01 13:21:12 -05:00
Anthony Minessale 8bb55ed4bf abstract out originate_signal_bond to a function to avoid confustion and regressions 2012-05-29 13:10:15 -05:00
Travis Cross 23f8967c32
add enhanced zrtp passthrough (zrtp passthru) mode
ZRTP passthrough mode allows two ZRTP-capable clients to negotiate an
end-to-end security association through FreeSWITCH.  The clients are
therefore able to be certain that the FreeSWITCH instance mediating
the call cannot eavesdrop on their conversation.

Importantly, this capability is maintained across multiple FreeSWITCH
hops.  If widely deployed, this enables a global network architecture
where two people can speak securely with strong cryptographically
protected authentication and confidentiality.

With this commit we implement a zrtp-passthru mode that handles all
the details of the negotiation intelligently.  This mode can be
selected by setting the boolean parameter inbound-zrtp-passthru in the
sofia profile.  This will also force late-negotiation as it is
essential for correctly negotiating an end-to-end ZRTP security
association.

When an incoming call with a zrtp-hash is received and this mode is
enabled, we find the first audio and the first video zrtp-hash in the
SDP and store them as remote values on this channel.  Once a b-leg is
available, we set the local zrtp-hash values on that channel to the
remote zrtp-hash values collected from the a-leg.

Because zrtp-passthru absolutely requires that the channels negotiate
the same codec, we offer to the b-leg only codecs that the a-leg can
speak.  Once the b-leg accepts a codec, we will force that choice onto
the a-leg.

If the b-leg sends us zrtp-hash values in the signaling, we store
those as remote values on the b-leg and copy them to the local values
on the a-leg.

At this point, each leg has the zrtp-hash values from the other, and
we know we can do ZRTP passthrough mode on the call.  We send the
b-leg's zrtp-hash back to the a-leg in the 200 OK.

We then enable UDPTL mode on the rtp streams for both the audio and
the video so that we don't interfere in the ZRTP negotiation.

If the b-leg fails to return a zrtp-hash in the signaling, we set up a
ZRTP security association with the a-leg ourselves, if we are so
equipped.  Likewise, if the a-leg fails to send a zrtp-hash in the
signaling, we attempt to set up a ZRTP security association ourselves
with the b-leg.

The zrtp-passthru mode can also be enabled in the dialplan by setting
the boolean channel variable zrtp_passthru.  If enabled in this
manner, we can't force late-negotiation, so the user would need to be
sure this is configured.

If ZRTP passthrough mode is not enabled in either manner, this change
should have no effect.

Channel variables for each of the various zrtp-hash values are set,
though it is anticipated that there is no good reason to use them, so
they may be removed without warning.  For checking whether zrtp
passthrough mode was successful, we provide the channel variable
zrtp_passthru_active which is set on both legs.

Though not implemented by this commit, the changes here should make it
more straightforward to add correct zrtp-hash values to the signaling
and verify that correct hello hash values are received when FreeSWITCH
is acting as a terminating leg of the ZRTP security association.

A historical note...

This commit replaces the recently-added sdp_zrtp_hash_string method,
commit 2ab1605a88.

This prior method sets a channel variable from the a-leg's zrtp-hash,
then relies on the dialplan to export this channel variable to the
b-leg, where it is put into the SDP.

While it was a great start and wonderful for testing, this approach
has some drawbacks that motivated the present work:

 * There's no good way to pass the zrtp-hash from the b-leg back to
   the a-leg.  In fact, the implementation seems to send the a-leg's
   zrtp-hash back to the originating client in the 200 OK.  This is
   not correct.

 * To support video, we'd need to have a separate dialplan variable,
   and the dialplan author would need to deal with that explicitly.

 * The API is problematic as it requires the dialplan author to
   understand intricate details of how ZRTP works to implement a
   correct dialplan.  Further, by providing too fine-grained control
   (but at the same time, not enough control) it would limit our
   ability to make the behavior smarter once people started relying on
   this.
2012-05-24 20:39:03 +00:00
Anthony Minessale 1cfd145c17 add support for variable expander to recognize 717 vars as specificly globals 2012-05-24 13:07:26 -05:00
Anthony Minessale bbdcd33bde performance tweaks for sip message parsing and event system 2012-05-17 20:10:53 -05:00
Travis Cross 0709cc6f1b make log message relevant even if FS doesn't have ZRTP 2012-05-16 02:50:13 +00:00
Travis Cross 7e193ed382 Revert "disable these options if zrtp isn't enabled"
Brian and I talked about this and concurred on the reversion here.
Part of the point of the ZRTP pass-through mode code is that it allows
two legs to have a ZRTP-enabled call even if FS doesn't have ZRTP.

This reverts commit f0aa4ab390.
2012-05-16 02:41:24 +00:00
Brian West f0aa4ab390 disable these options if zrtp isn't enabled. 2012-05-15 21:05:04 -05:00