Merge branch 'master' into netborder
This commit is contained in:
commit
e1e8417fde
|
@ -942,11 +942,13 @@ Global
|
|||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.Build.0 = Debug|x64
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.ActiveCfg = Release|x64
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.Build.0 = Release|x64
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.All|Win32.ActiveCfg = Release|x64
|
||||
|
@ -1442,11 +1444,13 @@ Global
|
|||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.Build.0 = Debug|x64
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.Build.0 = Release|Win32
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.ActiveCfg = Release|x64
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.Build.0 = Release|x64
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.All|Win32.ActiveCfg = Release|x64
|
||||
|
@ -1458,11 +1462,13 @@ Global
|
|||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.Build.0 = Debug|x64
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.Build.0 = Release|Win32
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.ActiveCfg = Release|x64
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.Build.0 = Release|x64
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|Win32.ActiveCfg = Release|x64
|
||||
|
@ -1510,11 +1516,13 @@ Global
|
|||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.Build.0 = Debug|x64
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|x64
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.Build.0 = Release|x64
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|Win32.ActiveCfg = Release|x64
|
||||
|
@ -1670,11 +1678,13 @@ Global
|
|||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.Build.0 = Debug|x64
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.Build.0 = Release|Win32
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.ActiveCfg = Release|x64
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.Build.0 = Release|x64
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|Win32.ActiveCfg = Release|x64
|
||||
|
@ -1938,11 +1948,13 @@ Global
|
|||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|x64.Build.0 = Debug|x64
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Win32.Build.0 = Release|Win32
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|x64.ActiveCfg = Release|x64
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|x64.Build.0 = Release|x64
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|Win32.ActiveCfg = Release|x64
|
||||
|
|
|
@ -374,7 +374,7 @@ src/include/switch_version.h: src/include/switch_version.h.in .version $(libfree
|
|||
touch .version ; \
|
||||
else \
|
||||
if [ -d .git ] ; then \
|
||||
version=`git log --format="%h %ci" -1 HEAD | head -1 | sed -e 's|:|-|g' || echo hacked` ; \
|
||||
version=`git log --pretty=format:"%h %ci" -1 HEAD | head -1 | sed -e 's|:|-|g' || echo hacked` ; \
|
||||
if [ "x$$version" = "xhacked" ] ; then \
|
||||
version="hacked-`date -u +%Y%m%dT%H%M%SZ`" ; \
|
||||
else \
|
||||
|
|
|
@ -19,6 +19,7 @@ freeswitch (1.0.7)
|
|||
build: add mod_osp Makefile to configure generated Makefiles (r:dc06a039/FS-122)
|
||||
build: Remove mod_spidermonkey from windows 2008 x64 builds - does not work (r:280e894d)
|
||||
build: fix warnings on windows x64 builds src and mods projects - only libsofia included on the libs side (r:45ecbc2f)
|
||||
build: Patch debian init.d script to set ulimit values (r:0eb33e57/FS-2844)
|
||||
codec2: working prototype, still for testing only (r:04ca0751)
|
||||
config: move limit.conf to db.conf
|
||||
config: Update VM phrase macros to voice option then action on main, config menus
|
||||
|
@ -30,6 +31,7 @@ freeswitch (1.0.7)
|
|||
config: Add att_xfer example to default dialplan (r:20ec962a)
|
||||
config: default example to resolve some issues with SCA in cases where host and ip are mixed causing the phone to be confused. (r:0279261b)
|
||||
config: Fix phrase files, still missing a sound file (r:6741f350/FS-2742)
|
||||
config: Disallow global-intercept and group-intercept can intercept an outbound call in default dialplan (r:890871ba/FS-2777)
|
||||
core: Add RTCP support (FSRTP-14)
|
||||
core: handle some errors on missing db handle conditions
|
||||
core: add ... and shutdown as a fail-safe when no modules are loaded
|
||||
|
@ -110,6 +112,28 @@ freeswitch (1.0.7)
|
|||
core: add bitrate patch from moc with some extra stuff for late neg mode (r:633f193d)
|
||||
core: refactor fmtp parser as a core func (r:56f8c11f)
|
||||
core: add switch_ivr_dmachine async digit parser to core (r:7f3319dc)
|
||||
core: make parens optional on functions as vars ${foo(bar)} is now the same as ${foo bar} (r:fdba0e07)
|
||||
core: fix default ptime for iLBC and make new configurable global map in switch.conf.xml (r:e3c427ad)
|
||||
core: only pause recording media bugs in fifo (r:c1d41dd9)
|
||||
core: Allow IPv6 in proxy mode (r:4e5911c2/FS-2776)
|
||||
core: "Silent recovery" (r:93c2ed94)
|
||||
core: fix switch_find_local_ip to properly handle force_local_ip_v4 and _v6 (r:f42c9036/FS-2778)
|
||||
core: fix att_xfer/3-way scenario (r:0559cc50)
|
||||
core: dmachine - timeout instantly when you have exact match and are equal to max digits (r:81a9f8ef)
|
||||
core: Core ODBC support for transactions with MSSQL (r:d2ca8d40/FS-2050)
|
||||
core: Show the UUID of the session in the log when sending RFC2833 DTMF packet and when receiving a RTP DTMF (r:9241a35e)
|
||||
core: add record_post_process_exec_app and record_post_process_exec_api both can have <app|cmd>:<args> (r:07adca56)
|
||||
core: add -ncwait for Unix based implememtations to make the backgrounder wait to make sure the process starts before detaching (r:23d5fc19)
|
||||
core: fire DTMF event when converting dtmf to inband with start_dtmf_generate (r:dcdd3811)
|
||||
core: fail calls with uninitialized frame (r:7dafe4e2)
|
||||
core: allow switch_process_import to specify a prefix (r:e0c37c1f)
|
||||
core: add additional info when fail (r:4bbd9a4c/FS-2825)
|
||||
core: avoid hypothetical problem with flushing queue with delayed events (r:49b6237e)
|
||||
core: add send_silence_when_idle and dmachine honoring to park loop (r:3be3cd76)
|
||||
core: ivr_enterprise_originate: Fix export of variable from the originator channel to the called channels (r:025c82e7)
|
||||
core: Better handling of progress and answering to prevent sip profile from locking up at higher volumes (r:04e57577/FS-2801)
|
||||
core: ACL for IPv6 address and swigall to boot (r:db91f0e8/FS-2842)
|
||||
core: add intercept_unanswered_only var akin to intercept_unbridged_only (r:68f18efe)
|
||||
lang: Improve French phrase files (FSCONFIG-23)
|
||||
libapr: Fix issue where after a bridge with a member, uuid of Agent is set to single quote character ' (r:3fee704d/FS-2738)
|
||||
libdingaling: fix race on shutdown causing crash (FSMOD-47)
|
||||
|
@ -126,6 +150,7 @@ freeswitch (1.0.7)
|
|||
libesl: use uint32_t instead of long for timeout as in the rest of the lib, 0 means forever. Also added esl_send_recv_timed() (r:49d6c803)
|
||||
libesl: Fix SEGV when using serialize function without any arguments (r:910729b5/ESL-44)
|
||||
libesl: fix leak-on-error in esl_connect_timeout() (r:4263d60e)
|
||||
libesl: Call close on connection handle if the connection fails (r:413dcc4c/ESL-50)
|
||||
libfreetdm: implemented freetdm config nodes and ss7 initial configuration
|
||||
libfreetdm: fix codec for CAS signaling (r:b76e7f18)
|
||||
libfreetdm: freetdm: ss7- added support for incoming group blocks, started adding support for ansi (r:c219a73c)
|
||||
|
@ -137,13 +162,16 @@ freeswitch (1.0.7)
|
|||
libsofiasip: Fix random crashes (r:c15ee980/SFSIP-219)
|
||||
libsofiasip: Fix T.38 bug in sofia_glue (r:2843f1ad/MODSOFIA-94)
|
||||
libsofiasip: VS2010 sofia posix problem (r:46dd24c2/SFSIP-220)
|
||||
libsofiasip: set minimum initital sip t1 timer to 1000ms to work around race condition on retry timer firing before all the things that are supposed to be handled by the timer are set. The base resolution on this timer is 500ms, so doubling up makes sure we always hit the initial retry timer on the next run, where everything should be set. The side effect was, 1/2 the time on a request that did not get immediate response, the timer would be fired and cleared, but the action (sending retry) was never done, and a new timer was not set, causing the request to just sit zombied and never retry. A better solution would be to find and correct the race condition so the timer is never set to early and we never hit this condition. (r:20c2740c)
|
||||
libspandsp: Fixed a typo in spandsp's msvc/inttypes.h Updated sig_tone processing in spandsp to the latest, to allow moy to proceed with his signaling work.
|
||||
libspandsp: removed a saturate16 from spandsp that was causing problems fixed a typo in the MSVC inttypes.h file for spandsp
|
||||
libspandsp: Changes to the signaling tone detector to detect concurrent 2400Hz + 2600Hz tones. This passes voice immunity and other key tests, but it bounces a bit when transitions like 2400 -> 2400+2600 -> 2600 occur. Transitions between tone off and tone on are clean. (r:bc13e944)
|
||||
libspandsp: Fix Windows build after libspandsp update (r:d70cc852/FSBUILD-293)
|
||||
libspandsp: Fix for T.30 processing of operator interrupts, to improve compatibility with some machines, which seem to send them when no operator is around. (r:84ee0ae6)
|
||||
libspandsp: spandsp t38 fax receiving error in win XP - regression from f029f7ef (r:761cec8f/FS-2766)
|
||||
mod_avmd: Initial check in - Advanced Voicemail Detect (r:10c6a30a) (by Eric Des Courtis)
|
||||
mod_avmd: Add to windows build (r:df4bd935)
|
||||
mod_avmd: Fix mem leak (r:cd951384/FS-2839)
|
||||
mod_callcenter: Initial commit of the mod_callcenter application. This module is in it early state of developpement. You can see documentation on the wiki at : <a href="http://wiki.freeswitch.org/wiki/Mod_callcenter">http://wiki.freeswitch.org/wiki/Mod_callcenter</a> For support/comments, please use <a href="http://jira.freeswitch.org/">http://jira.freeswitch.org/</a> and select the MOD CALLCENTER module. (r:ba09b96d)
|
||||
mod_callcenter: Add ability to unload/reload/load a queue setting (You still need to reloadxml before). Note that joining a queue will check for it in the config and load it on the fly... I've used the same system as in mod_voicemail. Not sure if we should allow this, but just comment it out of the config before unload and it wont be available anymore (r:3eafca60)
|
||||
mod_callcenter: Try to fix the ring-all, also add cli auto complete done in previous commit (r:1666783c)
|
||||
|
@ -159,6 +187,9 @@ freeswitch (1.0.7)
|
|||
mod_callcenter: Added max-wait-time and max-wait-time-with-no-agent param to a queue. (r:3482f95e)
|
||||
mod_callcenter: Make sure we fail to load if config is not present (r:e1fb79a1)
|
||||
mod_callcenter: Fix invalid update of agent field (r:426a448f/FS-2738)
|
||||
mod_callcenter: Allow to get queue info via api (r:70d592ae)
|
||||
mod_callcenter: Fix bad return type so it compile on archlinux, thx bougyman (r:3a475986)
|
||||
mod_callcenter: Make callcenter_config agent get return the value of the item requested. Also added queue param max-wait-time-with-no-agent-time-reached: If the max-wai-time-with-no-agent is already reached for the queue, then new caller can wait for x ammount of second before it kicked out of the queue rather than get rejected automaticly. (r:81a03869)
|
||||
mod_cidlookup: null xml is bad (r:095815f8)
|
||||
mod_cid_lookup: honor skipcitystate when using whitepages (r:a66654de/FSMOD-53)
|
||||
mod_commands: make break uuid_break and add cascade flag
|
||||
|
@ -173,6 +204,7 @@ freeswitch (1.0.7)
|
|||
mod_commands: Allow cond API to return empty false value (r:c8a897b9)
|
||||
mod_commands: ***BEHAVIOUR CHANGE*** reloadacl, load <module>, reload <module> will now explicitly call reloadxml (r:42c9df72)
|
||||
mod_commands: add nat_map usage (r:7577b8aa)
|
||||
mod_commands: add escaping empty strings to sql_escape (r:7bd0a5a6/FS-2833)
|
||||
mod_conference: Fix reporting of volume up/down (MODAPP-419)
|
||||
mod_conference: add last talking time per member to conference xml list
|
||||
mod_conference: add terminate-on-silence conference param
|
||||
|
@ -180,30 +212,41 @@ freeswitch (1.0.7)
|
|||
mod_conference: add conference_member_id variable to all sessions with the member id used by their conference participation (For drk__) (r:49c9bfdb)
|
||||
mod_conference: fix relate nohear (r:f029ce07/MODAPP-428)
|
||||
mod_conference: Fix floor change events not always firing (r:8f1767d3/MODAPP-424)
|
||||
mod_conference: refactor conference to use switch_ivr_dmachine for the digit parsing controls are now bound to each member separately based on conference_controls channel var, then the caller-controls param in the profile or a default to "default" (r:ac19f73c)
|
||||
mod_conference: Fix crash on dtmf action (r:4d5389bd/FS-2781)
|
||||
mod_curl: use method=post when post requested (r:c6a4ddd0/FSMOD-69)
|
||||
mod_db: fix stack corruption (MODAPP-407)
|
||||
mod_dialplan_xml: Add in the INFO log the caller id number when processing a request (Currenly only show the caller name) (r:e1df5e13)
|
||||
mod_dingaling: make mod_dingaling compat with google's new free phonecalls thing (r:ba0a2a32)
|
||||
mod_dingaling: make dingaling work with google voice inbound too (r:4ee68141)
|
||||
mod_dingaling: Fix crash when testing the new gv-dingaling with around 24 concurrent calls (r:73e1ec5e/FSCORE-667)
|
||||
mod_dingaling: Fix NULL pointer (r:e3eff816/FS-1103)
|
||||
mod_directory: Add variable directory_search_order to allow to search by first name by default is set to "first_name" (r:163ca31f)
|
||||
mod_db: fix stack corruption (MODAPP-407)
|
||||
mod_distributor: Add mod_distributor to VS2010 - not built by default (r:bac79ba1)
|
||||
mod_dptools: add eavesdrop_enable_dtmf chan var (r:596c0012)
|
||||
mod_dptools: Make park app not send 183 session progress (r:76932995/FSCORE-567)
|
||||
mod_dptools: add block_dtmf and unblock_dtmf apps (r:d9eb0197)
|
||||
mod_dptools: refactor export code and add new bridge_export app which is like export but exports across when one channel bridges another (r:4aa9a838)
|
||||
mod_dptools: add bind_digit_action application (r:9537197b)
|
||||
mod_dptools: emit event when user presses DTMFs (r:37298f56)
|
||||
mod_erlang_event: Make XML fetch reply ACKs distinguishable, update freeswitch.erl (r:9d44ed04)
|
||||
mod_erlang_event: Add 3 new commands; session_event, session_noevents, session_nixevent (r:698fa045)
|
||||
mod_erlang_event: generate long node names the same as erlang does (r:9ad509c2)
|
||||
mod_erlang_event: Improve some logging to include UUIDs (r:c0d51b83)
|
||||
mod_erlang_event: Support for reading erlang cookie from a file (r:094ffe37)
|
||||
mod_erlang_event: Rewrite XML fetch conditional wait to be more sane (Reported by James Aimonetti) (r:6941c6eb/FS-2775)
|
||||
mod_event_socket: fix up other users of switch_event_xmlize() to use SWITCH_EVENT_NONE (r:d6eb7562)
|
||||
mod_event_socket: Fix small mem leaks (r:e4f90584/MODEVENT-68)
|
||||
mod_event_socket: Add "-ERR" to api cmd response when failure occurs (r:58759052/FS-2827)
|
||||
mod_fifo: allow multiple dtmf to exit fifo, set fifo_caller_exit_key to specify which (MODAPP-420)
|
||||
mod_fifo: cancel outbound call if customer hangs up (r:cadb4d94)
|
||||
mod_fifo: add taking_calls param to fifo member add and config file (r:821488bf)
|
||||
mod_fifo: add nomedia flag (r:2d30a8c2)
|
||||
mod_fifo: Fix inconsistency between the fifo queue and the channels (num callers in queue can become "-1") (r:07487114/FS-1659)
|
||||
mod_fifo: fix issue leaving stale records in fifo_bridge table (r:b36d015f)
|
||||
mod_fifo: fix fifo race in use count dec (r:402e383b)
|
||||
mod_fifo: add outbound_ring_timeout param to mod_fifo (r:3885eea7)
|
||||
mod_fifo: add default_lag to fifo (r:dd4fb5be)
|
||||
mod_freetdm: Fix for TON and NPI not passed through to channel variables on incoming calls
|
||||
mod_freetdm: add pvt data to freetdm channels fix fxs features (r:9d456900)
|
||||
mod_freetdm: export and import boost custom data (r:edb2d582)
|
||||
|
@ -234,7 +277,10 @@ freeswitch (1.0.7)
|
|||
mod_freetdm: OPENZAP-107 - Patched by Jeff Lenk (r:aa075136/OPENZAP-107)
|
||||
mod_freetdm: allocate channels in their own memory page when debugging (r:fcd8df0a)
|
||||
mod_freetdm: lock the channel when placing call (r:705dd237)
|
||||
mod_freetdm: created cmake files for freetdm (r:fc55997b)
|
||||
mod_freetdm: ss7 - added support to control mtp2, mtp3, and isup timers via freetdm.conf.xml (r:4455d581)
|
||||
mod_gsmopen: copy from branch
|
||||
mod_gsmopen: fix FS-2793, compilation stops (r:355c0dbb/FS-2793)
|
||||
mod_hash: free all hashtables on shutdown (r:e76d7d92)
|
||||
mod_hash: remove unneeded initializer (r:10d468a6)
|
||||
mod_hash: begin working on remote support (r:c5ad49da)
|
||||
|
@ -258,6 +304,8 @@ freeswitch (1.0.7)
|
|||
mod_java: fix eventConsumer issue and add flush() method (r:7fd3aff6)
|
||||
mod_java: Allow user defined java methods to be called at startup and shutdown of JVM (r:1339e218/MODLANG-117)
|
||||
mod_json_cdr: Fix segfault in mod_json_cdr.c (r:f347698a/MODEVENT-66)
|
||||
mod_khomp: Added mod_khomp Endpoint. (r:5fea197b)
|
||||
mod_khomp: Removed alternative contexts / extensions - New struct for matchs - On calls originated from an FXS branch, the Endpoint searches for a valid extension (digits sent) after the DTMF '#' or after the timeout (option fxs-digit-timeout). That search is done in the context defined in section <fxs-options>, or if no context configured, the search is done in context defined in context-fxs. - Added "dialplan" configuration: Name of the dialplan module in use (default XML) - Group context enabled. If set, the search for a valid extension is done only in that context. - Updated documentation (r:1ef3fc9a)
|
||||
mod_lcr: Expand variables (MODAPP-418)
|
||||
mod_lcr: add enable_sip_redir parameter (r:70bf7a0a/MODAPP-427)
|
||||
mod_lcr: don't validate profiles with ${} vars since they are dynamic and we can't guess what the proper value should be (r:af33afaa)
|
||||
|
@ -268,12 +316,16 @@ freeswitch (1.0.7)
|
|||
mod_loopback: add loopback_bowout_on_execute var to make 1 legged loopback calls bow out of the picture
|
||||
mod_loopback: only execute app once in app mode (r:64f58f2d)
|
||||
mod_loopback: fix bug in mod_loopback where bowout=false (r:e9ab5368)
|
||||
mod_loopback: pass indication when in app mode on mod_loopback (r:c423e209)
|
||||
mod_loopback: fix voicemail failure (r:1a1881e8/FS-2795)
|
||||
mod_loopback: pass ring_ready like we do with pre_answer (r:9d087d45)
|
||||
mod_lua: Add switch_core_sqldb functionality from inside Lua script (r:26f2e095/FS-1384)
|
||||
mod_lua: Made 2nd arg to freeswitch.Dbh:query (cb func) optional (r:87db11af)
|
||||
mod_lua: Added SAF_ROUTING_EXEC flag to lua app, so it can be run inline (r:7d5ca1c0)
|
||||
mod_managed: Added wrapper for switch_event_bind for .net (r:a5f07a80/MODLANG-165)
|
||||
mod_managed: add additional support (r:5be58aac)
|
||||
mod_mp4v: MP4V-ES passthru for washibechi on IRC
|
||||
mod_mp4: New module. Supports playback of MP4 files. Depends on libmp4v2 <http://code.google.com/p/mp4v2/> (originally compiled against v1.6.1)
|
||||
mod_nibblebill: free allocated mem at shutdown; free properly if using custom_sql
|
||||
mod_nibblebill: Add SAF_SUPPORT_NOMEDIA to nibblebill
|
||||
mod_nibblebill: fix compile issues in latest HEAD (r:b073e82b/FSMOD-51)
|
||||
|
@ -291,7 +343,17 @@ freeswitch (1.0.7)
|
|||
mod_sangoma_codec: added load/noload options for the supported codecs
|
||||
mod_sangoma_codec: rename load/noload to register/noregister
|
||||
mod_sangoma_codec: silence suppression (r:73d9d56f)
|
||||
mod_say_es: fix grammar when saying dates and time (r:6bed19b2/MODAPP-429)
|
||||
mod_sangoma_codec: do not return 0 len frames and return silence instead when there is no transcoding output update stats only when we really receive a frame (r:dc4d19e9)
|
||||
mod_sangoma_codec: flush sockets on first use (r:bbba1148)
|
||||
mod_sangoma_codec: use native L16 for the source codec (r:d2e25519)
|
||||
mod_sangoma_codec: default to G729 only and remove L16 since it did not make any sense (r:1d5aa062)
|
||||
mod_sangoma_codec: add iLBC 13.3k and 15.2k (r:68abb39e)
|
||||
mod_sangoma_codec: add G723.1 (r:3e33540a)
|
||||
mod_sangoma_codec: register AMR (r:31cc2502)
|
||||
mod_sangoma_codec: add G722 (r:ca8c2336)
|
||||
mod_sangoma_codec: add siren7 32kbps (r:fcaf2677)
|
||||
mod_sangoma_codec: add SIREN7 24kbps (r:3acc5fdb)
|
||||
mod_say_es: fix grammar when saying dates and time (r:6bed19b2/MODAPP-429)
|
||||
mod_say_ja: initial commit, still needs sound files (r:b2423158/FS-2755)
|
||||
mod_say_ru: Fix saying time with +1 hour of current time (r:68d74c31/MODAPP-444)
|
||||
mod_say_zh: Number reading should now be OK for the whole range of integers for Cantonese and Mandarin
|
||||
|
@ -320,6 +382,7 @@ freeswitch (1.0.7)
|
|||
mod_skypopen: now answer a call only when directed to do it (before was trying to answer any incoming call). Lot of changes to a messy part, so maybe some problem will come out... (r:45c6c4d3)
|
||||
mod_skypopen: ignore early media sent by channels to be bridged before our channel is answered (r:ef14b78a)
|
||||
mod_sndfile: Add support for .alaw and .ulaw to mod_sndfile (r:facf09b8/MODFORM-41)
|
||||
mod_sndfile: return break in mod_sndfile when seek returns failure (r:564dc7e4)
|
||||
mod_sofia: Send SIP MESSAGE to unregistered users by prefixing sip: to user@domain
|
||||
mod_sofia: fix callee being updated with callee information
|
||||
mod_sofia: set appearance-index in update statement for SLA
|
||||
|
@ -391,6 +454,24 @@ freeswitch (1.0.7)
|
|||
mod_sofia: fix parsing of sofia tracelevel param, moved param from profile params to global_settings as its global, and it only worked on reparse before anyways. Please correct any documentation on this issue on the wiki (r:82c4c4cc/FS-523)
|
||||
mod_sofia: fix nat acl count check to check against the number of nat acls (r:e11550e7/FS-502)
|
||||
mod_sofia: add sofia_glue_find_parameter_value function to get a specific value from a url params string (r:c701d41c)
|
||||
mod_sofia: Sofia SIP Stack Lockup (r:8f13eb89/FS-2762)
|
||||
mod_sofia: ix memory leak caused by regression from FS-2747 (r:6c4cb07b/FS-2747)
|
||||
mod_sofia: Set SDP proper connection type of "c=" field to IP6 or IP4 when IPv6 called IPv4 (r:14361c09/FS-620)
|
||||
mod_sofia: FS wrongly assumes NAT on Cisco 7941G (r:42f534fa/FS-2773)
|
||||
mod_sofia: sofia_reg.c doesn't pass profile name into query, also, typo with all-reg-options-ping (r:6772c795/FS-2787)
|
||||
mod_sofia: adjust sql stmts in presence to allow even non-registered entities to be tracked (r:4e0399d0)
|
||||
mod_sofia: dont update display to ring when call is hungup in pidf presence (r:36851a90)
|
||||
mod_sofia: 1) Add force-publish-expires to set custom presence update expires delta (-1 means endless) 2) Check how many users are registered when receiving a PUBLISH AND Multiple Registrations is enabled: if there is more than just 1 AND you are sending a offline message: skip publishing it to everyone to prevent clients from thinking themselves has gone offline. (r:fd1736b3)
|
||||
mod_sofia: profile param ignore-183nosdp, chanvar sip_ignore_183nosdp FS-1978 (r:59d3b84d/FS-1978)
|
||||
mod_sofia: fix race in codec failure condition, then fix bug in sdp parsing (likely a regression from recent codec changes) to never have the problem in the first place so you are double-protected (r:19325c43)
|
||||
mod_sofia: fix mem leak (r:1970ec1d/FS-2810)
|
||||
mod_sofia: parse static route in sip uri in notify by event (r:35676e7e)
|
||||
mod_sofia: add support for NDLB-force-rport=safe param that does force-rport behavior only on endpoints we know are safe to do so on. This is a dirty hack to try to work with certain endpoints behind sonicwall which does not use the same port when it does nat, when the devices do not support rport, while not breaking devices that acutally use different ports that force-rport will break (r:fc4d290c)
|
||||
mod_sofia: add separate reg timeout from retry sec (r:e5b891ee)
|
||||
mod_sofia: fix display of timeout (r:2043d5a)
|
||||
mod_sofia: fix missing name and potential segfault in gateway status (r:40ac860a)
|
||||
mod_sofia: Add missing RTP info for early SDP in bypass media (r:10119e9e/FS-2824)
|
||||
mod_sofia: add manual_rtp_bugs to profile and chan var and 3 new RTP bugs SEND_LINEAR_TIMESTAMPS|START_SEQ_AT_ZERO|NEVER_SEND_MARKER (r:b278dd23)
|
||||
mod_spandsp: initial checkin of mod_fax/mod_voipcodecs merge into mod_spandsp (r:fa9a59a8)
|
||||
mod_spandsp: rework of new mod_spandsp to have functions broken up into different c files (r:65400642)
|
||||
mod_spandsp: improve duplicate digit detection and add 'min_dup_digit_spacing_ms' channel variable for use with the dtmf detector (r:eab4f246/FSMOD-45)
|
||||
|
@ -420,6 +501,7 @@ freeswitch (1.0.7)
|
|||
mod_voicemail: fix vm_inject to a group and change syntax for sending to a whole domain to domain= for clarity sake (r:f30a1cc6)
|
||||
mod_voicemail: add quotes to vm_cc command generated internally to escape spaces in the caller id name (r:5f012813)
|
||||
mod_voicemail: Play caller id of callee prior to playing a vmail (r:e7b97907/FS-2719)
|
||||
mod_voicemail: FS-1776 Add support for per user operator exten override param vm-operator-extension (r:df5b3498/FS-1776)
|
||||
mod_xml_cdr: add force_process_cdr var to process b leg cdr on a case by case basis when b leg cdr is disabled (XML-17)
|
||||
mod_xml_cdr: add leg param to query string (XML-24)
|
||||
mod_xml_cdr: fix locked sessions (XML-26)
|
||||
|
@ -428,6 +510,7 @@ freeswitch (1.0.7)
|
|||
scripts: added honeypot.pl and blacklist.pl which add extra SIP security options (r:b6a81ba7)
|
||||
sofia-sip: fix null derefernce segfault in soa (r:f356c5e6)
|
||||
sofia-sip: extend timeout for session expires on short timeouts to be 90% of timeout instead of 1/3 to handle devices that do not refresh in time such as polycom (r:a7f48928/SFSIP-212)
|
||||
tools: Add fs_encode tool (r:89b17601)
|
||||
|
||||
freeswitch (1.0.6)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Mon Dec 28 14:55:57 EST 2009
|
||||
Thu 18 Nov 2010 20:56:38 EST
|
||||
|
|
|
@ -78,6 +78,22 @@ APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data);
|
|||
*/
|
||||
APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data);
|
||||
|
||||
/**
|
||||
* pop/get an object from the queue, blocking if the queue is already empty
|
||||
*
|
||||
* @param queue the queue
|
||||
* @param data the data
|
||||
* @param timeout The amount of time in microseconds to wait. This is
|
||||
* a maximum, not a minimum. If the condition is signaled, we
|
||||
* will wake up before this time, otherwise the error APR_TIMEUP
|
||||
* is returned.
|
||||
* @returns APR_TIMEUP the request timed out
|
||||
* @returns APR_EINTR the blocking was interrupted (try again)
|
||||
* @returns APR_EOF if the queue has been terminated
|
||||
* @returns APR_SUCCESS on a successfull pop
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_queue_pop_timeout(apr_queue_t *queue, void **data, apr_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* push/add a object to the queue, returning immediatly if the queue is full
|
||||
*
|
||||
|
|
|
@ -313,6 +313,71 @@ APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data)
|
|||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the next item from the queue. If there are no
|
||||
* items available, it will block until one becomes available, or
|
||||
* until timeout is elapsed. Once retrieved, the item is placed into
|
||||
* the address specified by'data'.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_queue_pop_timeout(apr_queue_t *queue, void **data, apr_interval_time_t timeout)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
if (queue->terminated) {
|
||||
return APR_EOF; /* no more elements ever again */
|
||||
}
|
||||
|
||||
rv = apr_thread_mutex_lock(queue->one_big_mutex);
|
||||
if (rv != APR_SUCCESS) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* Keep waiting until we wake up and find that the queue is not empty. */
|
||||
if (apr_queue_empty(queue)) {
|
||||
if (!queue->terminated) {
|
||||
queue->empty_waiters++;
|
||||
rv = apr_thread_cond_timedwait(queue->not_empty, queue->one_big_mutex, timeout);
|
||||
queue->empty_waiters--;
|
||||
/* In the event of a timemout, APR_TIMEUP will be returned */
|
||||
if (rv != APR_SUCCESS) {
|
||||
apr_thread_mutex_unlock(queue->one_big_mutex);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
/* If we wake up and it's still empty, then we were interrupted */
|
||||
if (apr_queue_empty(queue)) {
|
||||
Q_DBG("queue empty (intr)", queue);
|
||||
rv = apr_thread_mutex_unlock(queue->one_big_mutex);
|
||||
if (rv != APR_SUCCESS) {
|
||||
return rv;
|
||||
}
|
||||
if (queue->terminated) {
|
||||
return APR_EOF; /* no more elements ever again */
|
||||
}
|
||||
else {
|
||||
return APR_EINTR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*data = queue->data[queue->out];
|
||||
queue->nelts--;
|
||||
|
||||
queue->out = (queue->out + 1) % queue->bounds;
|
||||
if (queue->full_waiters) {
|
||||
Q_DBG("signal !full", queue);
|
||||
rv = apr_thread_cond_signal(queue->not_full);
|
||||
if (rv != APR_SUCCESS) {
|
||||
apr_thread_mutex_unlock(queue->one_big_mutex);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
rv = apr_thread_mutex_unlock(queue->one_big_mutex);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the next item from the queue. If there are no
|
||||
* items available, return APR_EAGAIN. Once retrieved,
|
||||
|
|
|
@ -24,7 +24,12 @@ AC_PROG_MAKE_SET
|
|||
AM_PROG_CC_C_O
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# NOTE: pkg-config is used to detect libisdn
|
||||
m4_ifdef([PKG_PROG_PKG_CONFIG],
|
||||
[PKG_PROG_PKG_CONFIG],
|
||||
[AC_MSG_WARN([pkg-config missing (required for libisdn detection)])]
|
||||
)
|
||||
|
||||
AX_COMPILER_VENDOR
|
||||
|
||||
|
@ -305,41 +310,44 @@ AC_ARG_WITH([libisdn],
|
|||
if test "${with_libisdn}" != "no"
|
||||
then
|
||||
AC_MSG_RESULT([${as_nl}<<>> ftmod_isdn (libisdn stack)])
|
||||
PKG_CHECK_MODULES([libisdn],
|
||||
[libisdn >= 0.0.1],
|
||||
[AC_MSG_CHECKING([libisdn version])
|
||||
LIBISDN_VERSION="`${PKG_CONFIG} --modversion libisdn`"
|
||||
if test -z "${LIBISDN_VERSION}"; then
|
||||
AC_MSG_ERROR([Failed to retrieve libisdn version])
|
||||
fi
|
||||
AC_MSG_RESULT([${LIBISDN_VERSION}])
|
||||
m4_ifdef([PKG_CHECK_MODULES],
|
||||
[PKG_CHECK_MODULES([libisdn],
|
||||
[libisdn >= 0.0.1],
|
||||
[AC_MSG_CHECKING([libisdn version])
|
||||
LIBISDN_VERSION="`${PKG_CONFIG} --modversion libisdn`"
|
||||
if test -z "${LIBISDN_VERSION}"; then
|
||||
AC_MSG_ERROR([Failed to retrieve libisdn version])
|
||||
fi
|
||||
AC_MSG_RESULT([${LIBISDN_VERSION}])
|
||||
|
||||
# check features
|
||||
AC_MSG_CHECKING([for new experimental API])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <libisdn/version.h>
|
||||
#if !LIBISDN_FEATURE(API2)
|
||||
#error "libisdn API v2 not available"
|
||||
#endif
|
||||
],
|
||||
[;]
|
||||
)],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])]
|
||||
# check features
|
||||
AC_MSG_CHECKING([for new experimental API])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <libisdn/version.h>
|
||||
#if !LIBISDN_FEATURE(API2)
|
||||
#error "libisdn API v2 not available"
|
||||
#endif
|
||||
],
|
||||
[;]
|
||||
)],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])]
|
||||
)
|
||||
|
||||
HAVE_LIBISDN="yes"
|
||||
AC_DEFINE([HAVE_LIBISDN], [1], [libisdn support])
|
||||
AC_SUBST([LIBISDN_CFLAGS], [${libisdn_CFLAGS}])
|
||||
AC_SUBST([LIBISDN_CPPFLAGS],[${libisdn_CPPFLAGS}])
|
||||
AC_SUBST([LIBISDN_LDFLAGS], [${libisdn_LDFLAGS}])
|
||||
AC_SUBST([LIBISDN_LIBS], [${libisdn_LIBS}])
|
||||
AC_SUBST([LIBISDN_VERSION])
|
||||
],
|
||||
[AC_MSG_ERROR([Need libisdn-0.0.1 or higher])]
|
||||
)
|
||||
|
||||
HAVE_LIBISDN="yes"
|
||||
AC_DEFINE([HAVE_LIBISDN], [1], [libisdn support])
|
||||
AC_SUBST([LIBISDN_CFLAGS], [${libisdn_CFLAGS}])
|
||||
AC_SUBST([LIBISDN_CPPFLAGS],[${libisdn_CPPFLAGS}])
|
||||
AC_SUBST([LIBISDN_LDFLAGS], [${libisdn_LDFLAGS}])
|
||||
AC_SUBST([LIBISDN_LIBS], [${libisdn_LIBS}])
|
||||
AC_SUBST([LIBISDN_VERSION])
|
||||
],
|
||||
[AC_MSG_ERROR([Need libisdn-0.0.1 or higher])]
|
||||
AX_LIB_PCAP],
|
||||
[AC_MSG_WARN([pkg-config missing (required for libisdn detection)])]
|
||||
)
|
||||
AX_LIB_PCAP
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_LIBISDN], [test "${HAVE_LIBISDN}" = "yes"])
|
||||
|
||||
|
|
|
@ -1690,6 +1690,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxo_signal)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case FTDM_SIGEVENT_RELEASED: { /* twiddle */ } break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
@ -1744,6 +1745,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case FTDM_SIGEVENT_RELEASED: { /* twiddle */ } break;
|
||||
case FTDM_SIGEVENT_STOP:
|
||||
{
|
||||
private_t *tech_pvt = NULL;
|
||||
|
@ -1966,6 +1968,8 @@ static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
|
|||
status = ftdm_channel_from_event(sigmsg, &session);
|
||||
}
|
||||
break;
|
||||
|
||||
case FTDM_SIGEVENT_RELEASED: { /* twiddle */ } break;
|
||||
|
||||
/* on DNIS received from the R2 forward side, return status == FTDM_BREAK to stop requesting DNIS */
|
||||
case FTDM_SIGEVENT_COLLECTED_DIGIT:
|
||||
|
@ -2071,6 +2075,9 @@ static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
|
|||
return ftdm_channel_from_event(sigmsg, &session);
|
||||
}
|
||||
break;
|
||||
|
||||
case FTDM_SIGEVENT_RELEASED: { /* twiddle */ } break;
|
||||
|
||||
case FTDM_SIGEVENT_STOP:
|
||||
case FTDM_SIGEVENT_RESTART:
|
||||
{
|
||||
|
|
|
@ -2349,6 +2349,8 @@ static void close_dtmf_debug(ftdm_channel_t *ftdmchan)
|
|||
static ftdm_status_t ftdm_channel_clear_vars(ftdm_channel_t *ftdmchan);
|
||||
FT_DECLARE(ftdm_status_t) ftdm_channel_done(ftdm_channel_t *ftdmchan)
|
||||
{
|
||||
ftdm_sigmsg_t sigmsg;
|
||||
|
||||
ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "Null channel can't be done!\n");
|
||||
|
||||
ftdm_mutex_lock(ftdmchan->mutex);
|
||||
|
@ -2387,6 +2389,13 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_done(ftdm_channel_t *ftdmchan)
|
|||
|
||||
ftdm_log(FTDM_LOG_DEBUG, "channel done %u:%u\n", ftdmchan->span_id, ftdmchan->chan_id);
|
||||
|
||||
memset(&sigmsg, 0, sizeof(sigmsg));
|
||||
sigmsg.span_id = ftdmchan->span_id;
|
||||
sigmsg.chan_id = ftdmchan->chan_id;
|
||||
sigmsg.channel = ftdmchan;
|
||||
sigmsg.event_id = FTDM_SIGEVENT_RELEASED;
|
||||
ftdm_span_send_signal(ftdmchan->span, &sigmsg);
|
||||
|
||||
ftdm_mutex_unlock(ftdmchan->mutex);
|
||||
|
||||
return FTDM_SUCCESS;
|
||||
|
|
|
@ -417,7 +417,7 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_destroy(ftdm_interrupt_t **ininterrupt)
|
|||
FT_DECLARE(ftdm_status_t) ftdm_interrupt_multiple_wait(ftdm_interrupt_t *interrupts[], ftdm_size_t size, int ms)
|
||||
{
|
||||
int numdevices = 0;
|
||||
unsigned i;
|
||||
unsigned i = 0;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
DWORD res = 0;
|
||||
|
@ -496,6 +496,8 @@ pollagain:
|
|||
}
|
||||
}
|
||||
#else
|
||||
/* for MacOS compilation, unused vars */
|
||||
numdevices = i;
|
||||
#endif
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ typedef enum {
|
|||
struct ftdm_analog_data {
|
||||
uint32_t flags;
|
||||
uint32_t max_dialstr;
|
||||
uint32_t wait_dialtone_timeout;
|
||||
uint32_t digit_timeout;
|
||||
char hotline[FTDM_MAX_HOTLINE_STR];
|
||||
};
|
||||
|
|
|
@ -49,13 +49,16 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj);
|
|||
*/
|
||||
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxo_outgoing_call)
|
||||
{
|
||||
ftdm_analog_data_t *analog_data = ftdmchan->span->signal_data;
|
||||
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) && !ftdm_test_flag(ftdmchan, FTDM_CHANNEL_INTHREAD)) {
|
||||
ftdm_channel_clear_needed_tones(ftdmchan);
|
||||
ftdm_channel_clear_detected_tones(ftdmchan);
|
||||
|
||||
ftdm_channel_command(ftdmchan, FTDM_COMMAND_OFFHOOK, NULL);
|
||||
ftdm_channel_command(ftdmchan, FTDM_COMMAND_ENABLE_PROGRESS_DETECT, NULL);
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_DIAL] = 1;
|
||||
if (analog_data->wait_dialtone_timeout) {
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_DIAL] = 1;
|
||||
}
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DIALING);
|
||||
ftdm_thread_create_detached(ftdm_analog_channel_run, ftdmchan);
|
||||
return FTDM_SUCCESS;
|
||||
|
@ -157,6 +160,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
|
|||
const char *tonemap = "us";
|
||||
const char *hotline = "";
|
||||
uint32_t digit_timeout = 10;
|
||||
uint32_t wait_dialtone_timeout = 30000;
|
||||
uint32_t max_dialstr = MAX_DTMF;
|
||||
const char *var, *val;
|
||||
int *intval;
|
||||
|
@ -191,6 +195,15 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
|
|||
break;
|
||||
}
|
||||
digit_timeout = *intval;
|
||||
} else if (!strcasecmp(var, "wait_dialtone_timeout")) {
|
||||
if (!(intval = va_arg(ap, int *))) {
|
||||
break;
|
||||
}
|
||||
wait_dialtone_timeout = *intval;
|
||||
if (wait_dialtone_timeout < 0) {
|
||||
wait_dialtone_timeout = 0;
|
||||
}
|
||||
ftdm_log_chan(span->channels[i], FTDM_LOG_DEBUG, "Wait dial tone ms = %d\n", wait_dialtone_timeout);
|
||||
} else if (!strcasecmp(var, "enable_callerid")) {
|
||||
if (!(val = va_arg(ap, char *))) {
|
||||
break;
|
||||
|
@ -221,7 +234,6 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (digit_timeout < 2000 || digit_timeout > 10000) {
|
||||
digit_timeout = 2000;
|
||||
}
|
||||
|
@ -241,6 +253,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
|
|||
span->stop = ftdm_analog_stop;
|
||||
analog_data->flags = flags;
|
||||
analog_data->digit_timeout = digit_timeout;
|
||||
analog_data->wait_dialtone_timeout = wait_dialtone_timeout;
|
||||
analog_data->max_dialstr = max_dialstr;
|
||||
span->signal_cb = sig_cb;
|
||||
strncpy(analog_data->hotline, hotline, sizeof(analog_data->hotline));
|
||||
|
@ -325,6 +338,27 @@ static void send_caller_id(ftdm_channel_t *ftdmchan)
|
|||
ftdm_channel_send_fsk_data(ftdmchan, &fsk_data, -14);
|
||||
}
|
||||
|
||||
static void analog_dial(ftdm_channel_t *ftdmchan, uint32_t *state_counter, uint32_t *dial_timeout)
|
||||
{
|
||||
if (ftdm_strlen_zero(ftdmchan->caller_data.dnis.digits)) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "No Digits to send!\n");
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
if (ftdm_channel_command(ftdmchan, FTDM_COMMAND_SEND_DTMF, ftdmchan->caller_data.dnis.digits) != FTDM_SUCCESS) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Send Digits Failed [%s]\n", ftdmchan->last_error);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
*state_counter = 0;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_RING] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_BUSY] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_FAIL1] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_FAIL2] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_FAIL3] = 1;
|
||||
*dial_timeout = ((ftdmchan->dtmf_on + ftdmchan->dtmf_off) * strlen(ftdmchan->caller_data.dnis.digits)) + 2000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Main thread function for analog channel (outgoing call)
|
||||
* \param me Current thread
|
||||
|
@ -342,7 +376,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
|||
ftdm_size_t dtmf_offset = 0;
|
||||
ftdm_analog_data_t *analog_data = ftdmchan->span->signal_data;
|
||||
ftdm_channel_t *closed_chan;
|
||||
uint32_t state_counter = 0, elapsed = 0, collecting = 0, interval = 0, last_digit = 0, indicate = 0, dial_timeout = 30000;
|
||||
uint32_t state_counter = 0, elapsed = 0, collecting = 0, interval = 0, last_digit = 0, indicate = 0, dial_timeout = analog_data->wait_dialtone_timeout;
|
||||
ftdm_sigmsg_t sig;
|
||||
ftdm_status_t status;
|
||||
|
||||
|
@ -383,7 +417,11 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
|||
sig.span_id = ftdmchan->span_id;
|
||||
sig.channel = ftdmchan;
|
||||
|
||||
assert(interval != 0);
|
||||
ftdm_assert(interval != 0, NULL);
|
||||
|
||||
if (!dial_timeout) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Not waiting for dial tone to dial number %s\n", ftdmchan->caller_data.dnis.digits);
|
||||
}
|
||||
|
||||
while (ftdm_running() && ftdm_test_flag(ftdmchan, FTDM_CHANNEL_INTHREAD)) {
|
||||
ftdm_wait_flag_t flags = FTDM_READ;
|
||||
|
@ -412,7 +450,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
|||
} else {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_GENRING:
|
||||
|
@ -730,28 +768,15 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
|||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "Failure indication detected!\n");
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else if (ftdmchan->detected_tones[FTDM_TONEMAP_DIAL]) {
|
||||
if (ftdm_strlen_zero(ftdmchan->caller_data.dnis.digits)) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "No Digits to send!\n");
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
if (ftdm_channel_command(ftdmchan, FTDM_COMMAND_SEND_DTMF, ftdmchan->caller_data.dnis.digits) != FTDM_SUCCESS) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Send Digits Failed [%s]\n", ftdmchan->last_error);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
state_counter = 0;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_RING] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_BUSY] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_FAIL1] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_FAIL2] = 1;
|
||||
ftdmchan->needed_tones[FTDM_TONEMAP_FAIL3] = 1;
|
||||
dial_timeout = ((ftdmchan->dtmf_on + ftdmchan->dtmf_off) * strlen(ftdmchan->caller_data.dnis.digits)) + 2000;
|
||||
}
|
||||
}
|
||||
analog_dial(ftdmchan, &state_counter, &dial_timeout);
|
||||
} else if (ftdmchan->detected_tones[FTDM_TONEMAP_RING]) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_UP);
|
||||
}
|
||||
|
||||
ftdm_channel_clear_detected_tones(ftdmchan);
|
||||
} else if (!dial_timeout) {
|
||||
/* we were requested not to wait for dial tone, we can dial immediately */
|
||||
analog_dial(ftdmchan, &state_counter, &dial_timeout);
|
||||
}
|
||||
|
||||
if ((ftdmchan->dtmf_buffer && ftdm_buffer_inuse(ftdmchan->dtmf_buffer)) || (ftdmchan->fsk_buffer && ftdm_buffer_inuse(ftdmchan->fsk_buffer))) {
|
||||
|
|
|
@ -594,9 +594,10 @@ static void ftdm_isdn_call_event(struct Q931_Call *call, struct Q931_CallEvent *
|
|||
return;
|
||||
}
|
||||
|
||||
if (ftdmchan->state != FTDM_CHANNEL_STATE_DOWN) {
|
||||
if (ftdm_channel_get_state(ftdmchan) != FTDM_CHANNEL_STATE_DOWN) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Channel %d:%d not in DOWN state, cleaning up\n",
|
||||
ftdmchan->span_id, ftdmchan->chan_id);
|
||||
ftdm_channel_get_span_id(ftdmchan),
|
||||
ftdm_channel_get_id(ftdmchan));
|
||||
|
||||
/*
|
||||
* Send hangup signal to mod_openzap
|
||||
|
@ -606,7 +607,7 @@ static void ftdm_isdn_call_event(struct Q931_Call *call, struct Q931_CallEvent *
|
|||
}
|
||||
|
||||
sig.event_id = FTDM_SIGEVENT_STOP;
|
||||
isdn_data->sig_cb(&sig);
|
||||
ftdm_span_send_signal(ftdm_channel_get_span(ftdmchan), &sig);
|
||||
|
||||
/* Release zap channel */
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DOWN);
|
||||
|
@ -640,7 +641,9 @@ static void ftdm_isdn_call_event(struct Q931_Call *call, struct Q931_CallEvent *
|
|||
return;
|
||||
}
|
||||
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Call setup failed on channel %d:%d\n", ftdmchan->span_id, ftdmchan->chan_id);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Call setup failed on channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(ftdmchan),
|
||||
ftdm_channel_get_id(ftdmchan));
|
||||
|
||||
/*
|
||||
* Send signal to mod_openzap
|
||||
|
@ -648,7 +651,7 @@ static void ftdm_isdn_call_event(struct Q931_Call *call, struct Q931_CallEvent *
|
|||
sig.channel->caller_data.hangup_cause = FTDM_CAUSE_NETWORK_OUT_OF_ORDER;
|
||||
|
||||
sig.event_id = FTDM_SIGEVENT_STOP;
|
||||
isdn_data->sig_cb(&sig);
|
||||
ftdm_span_send_signal(ftdm_channel_get_span(ftdmchan), &sig);
|
||||
|
||||
/* Release zap channel */
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DOWN);
|
||||
|
@ -908,7 +911,7 @@ static L3INT ftdm_isdn_931_34(void *pvt, struct Q931_Call *call, Q931mes_Generic
|
|||
sig.channel->caller_data.hangup_cause = (cause) ? cause->Value : FTDM_CAUSE_NORMAL_UNSPECIFIED;
|
||||
|
||||
sig.event_id = FTDM_SIGEVENT_STOP;
|
||||
status = isdn_data->sig_cb(&sig);
|
||||
status = ftdm_span_send_signal(span, &sig);
|
||||
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Received %s in state %s, requested hangup for channel %d:%d\n", what,
|
||||
ftdm_channel_get_state_str(ftdmchan),
|
||||
|
@ -1297,6 +1300,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
{
|
||||
Q931mes_Generic *gen = (Q931mes_Generic *) ftdmchan->caller_data.raw_data;
|
||||
ftdm_isdn_data_t *isdn_data = ftdmchan->span->signal_data;
|
||||
ftdm_span_t *span = ftdm_channel_get_span(ftdmchan);
|
||||
ftdm_sigmsg_t sig;
|
||||
ftdm_status_t status;
|
||||
|
||||
|
@ -1328,7 +1332,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
{
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
sig.event_id = FTDM_SIGEVENT_PROGRESS;
|
||||
if ((status = isdn_data->sig_cb(&sig) != FTDM_SUCCESS)) {
|
||||
if ((status = ftdm_span_send_signal(ftdm_channel_get_span(ftdmchan), &sig) != FTDM_SUCCESS)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_HANGUP);
|
||||
}
|
||||
} else {
|
||||
|
@ -1376,7 +1380,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
{
|
||||
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
sig.event_id = FTDM_SIGEVENT_START;
|
||||
if ((status = isdn_data->sig_cb(&sig) != FTDM_SUCCESS)) {
|
||||
if ((status = ftdm_span_send_signal(span, &sig) != FTDM_SUCCESS)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_HANGUP);
|
||||
}
|
||||
}
|
||||
|
@ -1386,7 +1390,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
{
|
||||
ftdmchan->caller_data.hangup_cause = FTDM_CAUSE_NORMAL_UNSPECIFIED;
|
||||
sig.event_id = FTDM_SIGEVENT_RESTART;
|
||||
status = isdn_data->sig_cb(&sig);
|
||||
status = ftdm_span_send_signal(span, &sig);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DOWN);
|
||||
}
|
||||
break;
|
||||
|
@ -1394,7 +1398,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
{
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
sig.event_id = FTDM_SIGEVENT_PROGRESS_MEDIA;
|
||||
if ((status = isdn_data->sig_cb(&sig) != FTDM_SUCCESS)) {
|
||||
if ((status = ftdm_span_send_signal(span, &sig) != FTDM_SUCCESS)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_HANGUP);
|
||||
}
|
||||
} else {
|
||||
|
@ -1414,7 +1418,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
{
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
sig.event_id = FTDM_SIGEVENT_UP;
|
||||
if ((status = isdn_data->sig_cb(&sig) != FTDM_SUCCESS)) {
|
||||
if ((status = ftdm_span_send_signal(span, &sig) != FTDM_SUCCESS)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_HANGUP);
|
||||
}
|
||||
} else {
|
||||
|
@ -1635,7 +1639,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||
ftdm_log(FTDM_LOG_DEBUG, "Terminating: Direction %s\n", ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND) ? "Outbound" : "Inbound");
|
||||
|
||||
sig.event_id = FTDM_SIGEVENT_STOP;
|
||||
status = isdn_data->sig_cb(&sig);
|
||||
status = ftdm_span_send_signal(span, &sig);
|
||||
|
||||
gen->MesType = Q931mes_RELEASE;
|
||||
gen->CRVFlag = ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND) ? 0 : 1;
|
||||
|
@ -1672,7 +1676,6 @@ static __inline__ void check_state(ftdm_span_t *span)
|
|||
|
||||
static __inline__ ftdm_status_t process_event(ftdm_span_t *span, ftdm_event_t *event)
|
||||
{
|
||||
ftdm_isdn_data_t *isdn_data = span->signal_data;
|
||||
ftdm_alarm_flag_t alarmbits;
|
||||
ftdm_sigmsg_t sig;
|
||||
|
||||
|
@ -1696,7 +1699,7 @@ static __inline__ ftdm_status_t process_event(ftdm_span_t *span, ftdm_event_t *e
|
|||
}
|
||||
ftdm_set_flag(event->channel, FTDM_CHANNEL_SUSPENDED);
|
||||
ftdm_channel_get_alarms(event->channel, &alarmbits);
|
||||
isdn_data->sig_cb(&sig);
|
||||
ftdm_span_send_signal(span, &sig);
|
||||
|
||||
ftdm_log(FTDM_LOG_WARNING, "channel %d:%d (%d:%d) has alarms [%s]\n",
|
||||
ftdm_channel_get_span_id(event->channel),
|
||||
|
@ -1711,7 +1714,7 @@ static __inline__ ftdm_status_t process_event(ftdm_span_t *span, ftdm_event_t *e
|
|||
sig.event_id = FTDM_OOB_ALARM_CLEAR;
|
||||
ftdm_clear_flag(event->channel, FTDM_CHANNEL_SUSPENDED);
|
||||
ftdm_channel_get_alarms(event->channel, &alarmbits);
|
||||
isdn_data->sig_cb(&sig);
|
||||
ftdm_span_send_signal(span, &sig);
|
||||
}
|
||||
break;
|
||||
#ifdef __BROKEN_BY_FREETDM_CONVERSION__
|
||||
|
@ -2056,8 +2059,7 @@ static void *ftdm_isdn_run(ftdm_thread_t *me, void *obj)
|
|||
}
|
||||
|
||||
done:
|
||||
// ftdm_channel_close(&isdn_data->dchans[0]);
|
||||
// ftdm_channel_close(&isdn_data->dchans[1]);
|
||||
ftdm_channel_close(&isdn_data->dchan);
|
||||
ftdm_clear_flag(isdn_data, FTDM_ISDN_RUNNING);
|
||||
|
||||
#ifdef WIN32
|
||||
|
@ -2744,8 +2746,7 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(isdn_configure_span)
|
|||
}
|
||||
}
|
||||
|
||||
isdn_data->sig_cb = sig_cb;
|
||||
isdn_data->dchan = dchan;
|
||||
isdn_data->dchan = dchan;
|
||||
isdn_data->digit_timeout = digit_timeout;
|
||||
|
||||
Q921_InitTrunk(&isdn_data->q921,
|
||||
|
@ -2787,6 +2788,7 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(isdn_configure_span)
|
|||
span->state_map = &isdn_state_map;
|
||||
span->signal_data = isdn_data;
|
||||
span->signal_type = FTDM_SIGTYPE_ISDN;
|
||||
span->signal_cb = sig_cb;
|
||||
span->start = ftdm_isdn_start;
|
||||
span->stop = ftdm_isdn_stop;
|
||||
span->outgoing_call = isdn_outgoing_call;
|
||||
|
|
|
@ -63,9 +63,6 @@ struct ftdm_isdn_data {
|
|||
Q921Data_t q921;
|
||||
Q931_TrunkInfo_t q931;
|
||||
ftdm_channel_t *dchan;
|
||||
ftdm_channel_t *dchans[2];
|
||||
struct ftdm_sigmsg sigmsg;
|
||||
fio_signal_cb_t sig_cb;
|
||||
uint32_t flags;
|
||||
int32_t mode;
|
||||
int32_t digit_timeout;
|
||||
|
|
|
@ -503,15 +503,9 @@ static __inline__ void state_advance(ftdm_channel_t *chan)
|
|||
ftdm_status_t status;
|
||||
ftdm_sigmsg_t sig;
|
||||
|
||||
ftdm_log(FTDM_LOG_DEBUG, "%d:%d STATE [%s]\n",
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- %d:%d STATE [%s]\n",
|
||||
ftdm_channel_get_span_id(chan), ftdm_channel_get_id(chan), ftdm_channel_get_state_str(chan));
|
||||
|
||||
#if 0
|
||||
if (!ftdm_test_flag(chan, FTDM_CHANNEL_OUTBOUND) && !call) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "NO CALL!!!!\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(&sig, 0, sizeof(sig));
|
||||
sig.chan_id = ftdm_channel_get_id(chan);
|
||||
sig.span_id = ftdm_channel_get_span_id(chan);
|
||||
|
@ -522,6 +516,22 @@ static __inline__ void state_advance(ftdm_channel_t *chan)
|
|||
{
|
||||
chan->call_data = NULL;
|
||||
ftdm_channel_done(chan);
|
||||
|
||||
/*
|
||||
* Close channel completely, BRI PTMP will thank us
|
||||
*/
|
||||
if (ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_channel_t *chtmp = chan;
|
||||
if (ftdm_channel_close(&chtmp) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "-- Failed to close channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Closed channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -548,6 +558,10 @@ static __inline__ void state_advance(ftdm_channel_t *chan)
|
|||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_HANGUP);
|
||||
}
|
||||
} else if (call) {
|
||||
/* make sure channel is open in this state (outbound handled in on_proceeding()) */
|
||||
if (!ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_channel_open_chan(chan);
|
||||
}
|
||||
pri_proceeding(isdn_data->spri.pri, call, ftdm_channel_get_id(chan), 1);
|
||||
} else {
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_RESTART);
|
||||
|
@ -557,6 +571,10 @@ static __inline__ void state_advance(ftdm_channel_t *chan)
|
|||
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
{
|
||||
/*
|
||||
* This needs more auditing for BRI PTMP:
|
||||
* does pri_acknowledge() steal the call from other devices?
|
||||
*/
|
||||
if (!ftdm_test_flag(chan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
if (call) {
|
||||
pri_acknowledge(isdn_data->spri.pri, call, ftdm_channel_get_id(chan), 0);
|
||||
|
@ -588,6 +606,10 @@ static __inline__ void state_advance(ftdm_channel_t *chan)
|
|||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_HANGUP);
|
||||
}
|
||||
} else if (call) {
|
||||
/* make sure channel is open in this state (outbound handled in on_answer()) */
|
||||
if (!ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_channel_open_chan(chan);
|
||||
}
|
||||
pri_answer(isdn_data->spri.pri, call, 0, 1);
|
||||
} else {
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_RESTART);
|
||||
|
@ -795,34 +817,113 @@ static int on_answer(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
|
|||
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->answer.channel);
|
||||
|
||||
if (chan) {
|
||||
if (!ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Call answered, opening B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
if (ftdm_channel_open_chan(chan) != FTDM_SUCCESS) {
|
||||
ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan);
|
||||
|
||||
ftdm_log(FTDM_LOG_ERROR, "-- Error opening channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
caller_data->hangup_cause = FTDM_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Answer on channel %d:%d\n", ftdm_span_get_id(span), pevent->answer.channel);
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_UP);
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Answer on channel %d:%d but it's not in the span?\n",
|
||||
ftdm_span_get_id(span), pevent->answer.channel);
|
||||
}
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Handler for libpri proceed event
|
||||
* \brief Handler for libpri proceeding event
|
||||
* \param spri Pri wrapper structure (libpri, span, dchan)
|
||||
* \param event_type Event type (unused)
|
||||
* \param pevent Event
|
||||
* \return 0
|
||||
*/
|
||||
static int on_proceed(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event *pevent)
|
||||
static int on_proceeding(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event *pevent)
|
||||
{
|
||||
ftdm_span_t *span = spri->span;
|
||||
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->answer.channel);
|
||||
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->proceeding.channel);
|
||||
|
||||
if (chan) {
|
||||
/* Open channel if inband information is available */
|
||||
if ((pevent->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) && !ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- In-band information available, opening B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
if (ftdm_channel_open_chan(chan) != FTDM_SUCCESS) {
|
||||
ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan);
|
||||
|
||||
ftdm_log(FTDM_LOG_ERROR, "-- Error opening channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
caller_data->hangup_cause = FTDM_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Proceeding on channel %d:%d\n", ftdm_span_get_id(span), pevent->proceeding.channel);
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA);
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Proceeding on channel %d:%d but it's not in the span?\n",
|
||||
ftdm_span_get_id(span), pevent->proceeding.channel);
|
||||
}
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Handler for libpri progress event
|
||||
* \param spri Pri wrapper structure (libpri, span, dchan)
|
||||
* \param event_type Event type (unused)
|
||||
* \param pevent Event
|
||||
* \return 0
|
||||
* \note also uses pri_event->proceeding
|
||||
*/
|
||||
static int on_progress(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event *pevent)
|
||||
{
|
||||
ftdm_span_t *span = spri->span;
|
||||
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->proceeding.channel);
|
||||
|
||||
if (chan) {
|
||||
/* Open channel if inband information is available */
|
||||
if ((pevent->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) && !ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- In-band information available, opening B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
if (ftdm_channel_open_chan(chan) != FTDM_SUCCESS) {
|
||||
ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan);
|
||||
|
||||
ftdm_log(FTDM_LOG_ERROR, "-- Error opening channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
caller_data->hangup_cause = FTDM_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Progress on channel %d:%d\n", ftdm_span_get_id(span), pevent->proceeding.channel);
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA);
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Progress on channel %d:%d but it's not in the span?\n",
|
||||
ftdm_span_get_id(span), pevent->proceeding.channel);
|
||||
}
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -840,17 +941,37 @@ static int on_ringing(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_eve
|
|||
|
||||
if (chan) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Ringing on channel %d:%d\n", ftdm_span_get_id(span), pevent->ringing.channel);
|
||||
|
||||
/* we may get on_ringing even when we're already in FTDM_CHANNEL_STATE_PROGRESS_MEDIA */
|
||||
if (ftdm_channel_get_state(chan) == FTDM_CHANNEL_STATE_PROGRESS_MEDIA) {
|
||||
/* dont try to move to STATE_PROGRESS to avoid annoying veto warning */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Open channel if inband information is available */
|
||||
if ((pevent->ringing.progressmask & PRI_PROG_INBAND_AVAILABLE) && !ftdm_test_flag(chan, FTDM_CHANNEL_OPEN)) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- In-band information available, opening B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
if (ftdm_channel_open_chan(chan) != FTDM_SUCCESS) {
|
||||
ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan);
|
||||
|
||||
ftdm_log(FTDM_LOG_ERROR, "-- Error opening channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
caller_data->hangup_cause = FTDM_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_PROGRESS);
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Ringing on channel %d:%d but it's not in the span?\n",
|
||||
ftdm_span_get_id(span), pevent->ringing.channel);
|
||||
}
|
||||
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -868,16 +989,42 @@ static int on_ring(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event
|
|||
ftdm_caller_data_t *caller_data = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (!chan || ftdm_channel_get_state(chan) != FTDM_CHANNEL_STATE_DOWN || ftdm_test_flag(chan, FTDM_CHANNEL_INUSE)) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "--Duplicate Ring on channel %d:%d (ignored)\n", ftdm_span_get_id(span), pevent->ring.channel);
|
||||
if (!chan) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "-- Unable to get channel %d:%d\n", ftdm_span_get_id(span), pevent->ring.channel);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (ftdm_channel_open_chan(chan) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "--Failure opening channel %d:%d (ignored)\n", ftdm_span_get_id(span), pevent->ring.channel);
|
||||
if (ftdm_channel_get_state(chan) != FTDM_CHANNEL_STATE_DOWN || ftdm_test_flag(chan, FTDM_CHANNEL_INUSE)) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "-- Duplicate Ring on channel %d:%d (ignored)\n", ftdm_span_get_id(span), pevent->ring.channel);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ((pevent->ring.progressmask & PRI_PROG_INBAND_AVAILABLE)) {
|
||||
/* Open channel if inband information is available */
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- In-band information available, opening B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
if (!ftdm_test_flag(chan, FTDM_CHANNEL_OPEN) && ftdm_channel_open_chan(chan) != FTDM_SUCCESS) {
|
||||
// ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan);
|
||||
|
||||
ftdm_log(FTDM_LOG_WARNING, "-- Error opening channel %d:%d (ignored)\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
// caller_data->hangup_cause = FTDM_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
// ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
// goto done;
|
||||
}
|
||||
} else {
|
||||
/* Reserve channel, don't open it yet */
|
||||
if (ftdm_channel_use(chan) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "-- Error reserving channel %d:%d (ignored)\n",
|
||||
ftdm_span_get_id(span), pevent->ring.channel);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
ftdm_log(FTDM_LOG_NOTICE, "-- Ring on channel %d:%d (from %s to %s)\n", ftdm_span_get_id(span), pevent->ring.channel,
|
||||
pevent->ring.callingnum, pevent->ring.callednum);
|
||||
|
||||
|
@ -901,7 +1048,7 @@ static int on_ring(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event
|
|||
}
|
||||
|
||||
// scary to trust this pointer, you'd think they would give you a copy of the call data so you own it......
|
||||
/* hurr, this valid as along as nobody releases the call */
|
||||
/* hurr, this is valid as along as nobody releases the call */
|
||||
chan->call_data = pevent->ring.call;
|
||||
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_RING);
|
||||
|
@ -1300,7 +1447,7 @@ static int on_dchan_down(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_
|
|||
*/
|
||||
static int on_anything(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event *pevent)
|
||||
{
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Caught Event span %d %u (%s)\n", ftdm_span_get_id(spri->span), event_type, lpwrap_pri_event_str(event_type));
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Caught Event span %d %u (%s)\n", ftdm_span_get_id(spri->span), event_type, lpwrap_pri_event_str(event_type));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1313,7 +1460,7 @@ static int on_anything(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_ev
|
|||
*/
|
||||
static int on_io_fail(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event *pevent)
|
||||
{
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Caught Event span %d %u (%s)\n", ftdm_span_get_id(spri->span), event_type, lpwrap_pri_event_str(event_type));
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- Caught Event span %d %u (%s)\n", ftdm_span_get_id(spri->span), event_type, lpwrap_pri_event_str(event_type));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1401,8 +1548,8 @@ static void *ftdm_libpri_run(ftdm_thread_t *me, void *obj)
|
|||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_ANY, on_anything);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_RING, on_ring);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_RINGING, on_ringing);
|
||||
//LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_SETUP_ACK, on_proceed);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_PROCEEDING, on_proceed);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_PROCEEDING, on_proceeding);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_PROGRESS, on_progress);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_ANSWER, on_answer);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_DCHAN_UP, on_dchan_up);
|
||||
LPWRAP_MAP_PRI_EVENT(isdn_data->spri, LPWRAP_PRI_EVENT_DCHAN_DOWN, on_dchan_down);
|
||||
|
|
|
@ -333,8 +333,8 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start
|
|||
ftdm_log(FTDM_LOG_ERROR, "Failed to enable RBS/CAS events in device %d:%d fd:%d\n", chan->span_id, chan->chan_id, sockfd);
|
||||
continue;
|
||||
}
|
||||
/* probably done by the driver but lets write defensive code this time */
|
||||
sangoma_flush_bufs(chan->sockfd, &tdm_api);
|
||||
sangoma_flush_event_bufs(chan->sockfd, &tdm_api);
|
||||
#else
|
||||
/*
|
||||
* With wanpipe 3.4.4.2 I get failure even though the events are enabled, /var/log/messages said:
|
||||
|
@ -514,9 +514,6 @@ static FIO_OPEN_FUNCTION(wanpipe_open)
|
|||
|
||||
memset(&tdm_api,0,sizeof(tdm_api));
|
||||
sangoma_tdm_flush_bufs(ftdmchan->sockfd, &tdm_api);
|
||||
#ifdef LIBSANGOMA_VERSION
|
||||
sangoma_flush_event_bufs(ftdmchan->sockfd, &tdm_api);
|
||||
#endif
|
||||
|
||||
if (ftdmchan->type == FTDM_CHAN_TYPE_DQ921 || ftdmchan->type == FTDM_CHAN_TYPE_DQ931) {
|
||||
ftdmchan->native_codec = ftdmchan->effective_codec = FTDM_CODEC_NONE;
|
||||
|
|
|
@ -889,13 +889,18 @@ static FIO_WAIT_FUNCTION(zt_wait)
|
|||
inflags |= POLLPRI;
|
||||
}
|
||||
|
||||
|
||||
pollagain:
|
||||
memset(&pfds[0], 0, sizeof(pfds[0]));
|
||||
pfds[0].fd = ftdmchan->sockfd;
|
||||
pfds[0].events = inflags;
|
||||
result = poll(pfds, 1, to);
|
||||
*flags = 0;
|
||||
|
||||
if (result < 0 && errno == EINTR) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "DAHDI wait got interrupted, trying again\n");
|
||||
goto pollagain;
|
||||
}
|
||||
|
||||
if (pfds[0].revents & POLLERR) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "DAHDI device got POLLERR\n");
|
||||
result = -1;
|
||||
|
|
|
@ -287,6 +287,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
FTDM_SIGEVENT_START, /*!< Incoming call (ie: incoming SETUP msg or Ring) */
|
||||
FTDM_SIGEVENT_STOP, /*!< Hangup */
|
||||
FTDM_SIGEVENT_RELEASED, /*!< Channel is completely released and available */
|
||||
FTDM_SIGEVENT_UP, /*!< Outgoing call has been answered */
|
||||
FTDM_SIGEVENT_FLASH, /*< Flash event (typically on-hook/off-hook for analog devices) */
|
||||
FTDM_SIGEVENT_PROGRESS, /*!< Outgoing call is making progress */
|
||||
|
|
|
@ -235,7 +235,7 @@ void _PR_InitMW(void)
|
|||
* We use NT 4's InterlockedCompareExchange() to operate
|
||||
* on PRMWStatus variables.
|
||||
*/
|
||||
PR_ASSERT(sizeof(PVOID) == sizeof(PRMWStatus));
|
||||
//PR_ASSERT(sizeof(PVOID) == sizeof(PRMWStatus));
|
||||
TimerInit();
|
||||
#endif
|
||||
mw_lock = PR_NewLock();
|
||||
|
|
|
@ -44,11 +44,62 @@
|
|||
|
||||
#if defined(XP_WIN) || defined(XP_OS2) || defined(WINCE)
|
||||
|
||||
#if defined(_WIN64)
|
||||
|
||||
#if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
|
||||
#define IS_LITTLE_ENDIAN 1
|
||||
#undef IS_BIG_ENDIAN
|
||||
|
||||
#define JS_BYTES_PER_BYTE 1Ll
|
||||
#define JS_BYTES_PER_SHORT 2L
|
||||
#define JS_BYTES_PER_INT 4L
|
||||
#define JS_BYTES_PER_INT64 8L
|
||||
#define JS_BYTES_PER_LONG 4L
|
||||
#define JS_BYTES_PER_FLOAT 4L
|
||||
#define JS_BYTES_PER_DOUBLE 8L
|
||||
#define JS_BYTES_PER_WORD 8L
|
||||
#define JS_BYTES_PER_DWORD 8L
|
||||
|
||||
#define JS_BITS_PER_BYTE 8L
|
||||
#define JS_BITS_PER_SHORT 16L
|
||||
#define JS_BITS_PER_INT 32L
|
||||
#define JS_BITS_PER_INT64 64L
|
||||
#define JS_BITS_PER_LONG 32L
|
||||
#define JS_BITS_PER_FLOAT 32L
|
||||
#define JS_BITS_PER_DOUBLE 64L
|
||||
#define JS_BITS_PER_WORD 64L
|
||||
|
||||
#define JS_BITS_PER_BYTE_LOG2 3L
|
||||
#define JS_BITS_PER_SHORT_LOG2 4L
|
||||
#define JS_BITS_PER_INT_LOG2 5L
|
||||
#define JS_BITS_PER_INT64_LOG2 6L
|
||||
#define JS_BITS_PER_LONG_LOG2 5L
|
||||
#define JS_BITS_PER_FLOAT_LOG2 5L
|
||||
#define JS_BITS_PER_DOUBLE_LOG2 6L
|
||||
#define JS_BITS_PER_WORD_LOG2 6L
|
||||
|
||||
#define JS_ALIGN_OF_SHORT 2L
|
||||
#define JS_ALIGN_OF_INT 4L
|
||||
#define JS_ALIGN_OF_LONG 4L
|
||||
#define JS_ALIGN_OF_INT64 8L
|
||||
#define JS_ALIGN_OF_FLOAT 4L
|
||||
#define JS_ALIGN_OF_DOUBLE 8L
|
||||
#define JS_ALIGN_OF_POINTER 8L
|
||||
#define JS_ALIGN_OF_WORD 8L
|
||||
|
||||
#define JS_BYTES_PER_WORD_LOG2 3L
|
||||
#define JS_BYTES_PER_DWORD_LOG2 3L
|
||||
#define PR_WORDS_PER_DWORD_LOG2 0L
|
||||
#else /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
|
||||
#error "CPU type is unknown"
|
||||
#endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
|
||||
|
||||
#elif defined(_WIN32) || defined(XP_OS2) || defined(WINCE)
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
#define HAVE_VA_LIST_AS_ARRAY
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(XP_OS2) || defined(WINCE)
|
||||
#define IS_LITTLE_ENDIAN 1
|
||||
#undef IS_BIG_ENDIAN
|
||||
|
||||
|
@ -95,6 +146,7 @@
|
|||
#endif /* _WIN32 || XP_OS2 || WINCE*/
|
||||
|
||||
#if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */
|
||||
|
||||
#define IS_LITTLE_ENDIAN 1
|
||||
#undef IS_BIG_ENDIAN
|
||||
|
||||
|
@ -138,6 +190,7 @@
|
|||
#define JS_BYTES_PER_WORD_LOG2 2L
|
||||
#define JS_BYTES_PER_DWORD_LOG2 3L
|
||||
#define PR_WORDS_PER_DWORD_LOG2 1L
|
||||
|
||||
#endif /* defined(_WINDOWS) && !defined(_WIN32) */
|
||||
|
||||
#elif defined(XP_UNIX) || defined(XP_BEOS)
|
||||
|
|
|
@ -77,35 +77,25 @@
|
|||
**
|
||||
***********************************************************************/
|
||||
#ifdef WIN32
|
||||
|
||||
/* These also work for __MWERKS__ */
|
||||
#define JS_EXTERN_API(__type) extern __declspec(dllexport) __type
|
||||
#define JS_EXPORT_API(__type) __declspec(dllexport) __type
|
||||
#define JS_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
||||
#define JS_EXPORT_DATA(__type) __declspec(dllexport) __type
|
||||
# define JS_EXTERN_API(__type) extern __declspec(dllexport) __type
|
||||
# define JS_EXPORT_API(__type) __declspec(dllexport) __type
|
||||
# define JS_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
||||
# define JS_EXPORT_DATA(__type) __declspec(dllexport) __type
|
||||
|
||||
#define JS_DLL_CALLBACK
|
||||
#define JS_STATIC_DLL_CALLBACK(__x) static __x
|
||||
# define JS_DLL_CALLBACK
|
||||
# define JS_STATIC_DLL_CALLBACK(__x) static __x
|
||||
|
||||
#elif defined(WIN16)
|
||||
#elif defined(XP_OS2) && defined(__declspec)
|
||||
|
||||
#ifdef _WINDLL
|
||||
#define JS_EXTERN_API(__type) extern __type _cdecl _export _loadds
|
||||
#define JS_EXPORT_API(__type) __type _cdecl _export _loadds
|
||||
#define JS_EXTERN_DATA(__type) extern __type _export
|
||||
#define JS_EXPORT_DATA(__type) __type _export
|
||||
# define JS_EXTERN_API(__type) extern __declspec(dllexport) __type
|
||||
# define JS_EXPORT_API(__type) __declspec(dllexport) __type
|
||||
# define JS_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
||||
# define JS_EXPORT_DATA(__type) __declspec(dllexport) __type
|
||||
|
||||
#define JS_DLL_CALLBACK __cdecl __loadds
|
||||
#define JS_STATIC_DLL_CALLBACK(__x) static __x CALLBACK
|
||||
|
||||
#else /* this must be .EXE */
|
||||
#define JS_EXTERN_API(__type) extern __type _cdecl _export
|
||||
#define JS_EXPORT_API(__type) __type _cdecl _export
|
||||
#define JS_EXTERN_DATA(__type) extern __type _export
|
||||
#define JS_EXPORT_DATA(__type) __type _export
|
||||
|
||||
#define JS_DLL_CALLBACK __cdecl __loadds
|
||||
#define JS_STATIC_DLL_CALLBACK(__x) __x JS_DLL_CALLBACK
|
||||
#endif /* _WINDLL */
|
||||
# define JS_DLL_CALLBACK
|
||||
# define JS_STATIC_DLL_CALLBACK(__x) static __x
|
||||
|
||||
#else /* Unix */
|
||||
|
||||
|
@ -126,44 +116,57 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# if defined(__MWERKS__) || defined(__GNUC__)
|
||||
# define JS_IMPORT_API(__x) __x
|
||||
# else
|
||||
# define JS_IMPORT_API(__x) __declspec(dllimport) __x
|
||||
# endif
|
||||
# if defined(__MWERKS__) || defined(__GNUC__)
|
||||
# define JS_IMPORT_API(__x) __x
|
||||
# else
|
||||
# define JS_IMPORT_API(__x) __declspec(dllimport) __x
|
||||
# endif
|
||||
#elif defined(XP_OS2) && defined(__declspec)
|
||||
# define JS_IMPORT_API(__x) __declspec(dllimport) __x
|
||||
#else
|
||||
# define JS_IMPORT_API(__x) JS_EXPORT_API (__x)
|
||||
# define JS_IMPORT_API(__x) JS_EXPORT_API (__x)
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(__MWERKS__)
|
||||
# define JS_IMPORT_DATA(__x) __declspec(dllimport) __x
|
||||
# define JS_IMPORT_DATA(__x) __declspec(dllimport) __x
|
||||
#elif defined(XP_OS2) && defined(__declspec)
|
||||
# define JS_IMPORT_DATA(__x) __declspec(dllimport) __x
|
||||
#else
|
||||
# define JS_IMPORT_DATA(__x) JS_EXPORT_DATA (__x)
|
||||
# define JS_IMPORT_DATA(__x) JS_EXPORT_DATA (__x)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The linkage of JS API functions differs depending on whether the file is
|
||||
* used within the JS library or not. Any source file within the JS
|
||||
* used within the JS library or not. Any source file within the JS
|
||||
* interpreter should define EXPORT_JS_API whereas any client of the library
|
||||
* should not.
|
||||
* should not. STATIC_JS_API is used to build JS as a static library.
|
||||
*/
|
||||
#ifdef EXPORT_JS_API
|
||||
#define JS_PUBLIC_API(t) JS_EXPORT_API(t)
|
||||
#define JS_PUBLIC_DATA(t) JS_EXPORT_DATA(t)
|
||||
#if defined(STATIC_JS_API)
|
||||
|
||||
# define JS_PUBLIC_API(t) t
|
||||
# define JS_PUBLIC_DATA(t) t
|
||||
|
||||
#elif defined(EXPORT_JS_API)
|
||||
|
||||
# define JS_PUBLIC_API(t) JS_EXPORT_API(t)
|
||||
# define JS_PUBLIC_DATA(t) JS_EXPORT_DATA(t)
|
||||
|
||||
#else
|
||||
#define JS_PUBLIC_API(t) JS_IMPORT_API(t)
|
||||
#define JS_PUBLIC_DATA(t) JS_IMPORT_DATA(t)
|
||||
|
||||
# define JS_PUBLIC_API(t) JS_IMPORT_API(t)
|
||||
# define JS_PUBLIC_DATA(t) JS_IMPORT_DATA(t)
|
||||
|
||||
#endif
|
||||
|
||||
#define JS_FRIEND_API(t) JS_PUBLIC_API(t)
|
||||
#define JS_FRIEND_DATA(t) JS_PUBLIC_DATA(t)
|
||||
|
||||
#ifdef _WIN32
|
||||
# define JS_INLINE __inline
|
||||
#if defined(_MSC_VER)
|
||||
# define JS_INLINE __forceinline
|
||||
#elif defined(__GNUC__)
|
||||
# define JS_INLINE
|
||||
#else
|
||||
# define JS_INLINE
|
||||
# define JS_INLINE
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -174,7 +177,14 @@
|
|||
** behave syntactically more like functions when called.
|
||||
***********************************************************************/
|
||||
#define JS_BEGIN_MACRO do {
|
||||
#define JS_END_MACRO } while (0)
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
# define JS_END_MACRO \
|
||||
} __pragma(warning(push)) __pragma(warning(disable:4127)) \
|
||||
while (0) __pragma(warning(pop))
|
||||
#else
|
||||
# define JS_END_MACRO } while (0)
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
** MACROS: JS_BEGIN_EXTERN_C
|
||||
|
@ -183,11 +193,15 @@
|
|||
** Macro shorthands for conditional C++ extern block delimiters.
|
||||
***********************************************************************/
|
||||
#ifdef __cplusplus
|
||||
#define JS_BEGIN_EXTERN_C extern "C" {
|
||||
#define JS_END_EXTERN_C }
|
||||
|
||||
# define JS_BEGIN_EXTERN_C extern "C" {
|
||||
# define JS_END_EXTERN_C }
|
||||
|
||||
#else
|
||||
#define JS_BEGIN_EXTERN_C
|
||||
#define JS_END_EXTERN_C
|
||||
|
||||
# define JS_BEGIN_EXTERN_C
|
||||
# define JS_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -226,12 +240,12 @@
|
|||
#define JS_MAX(x,y) ((x)>(y)?(x):(y))
|
||||
|
||||
#if (defined(XP_WIN) && !defined(CROSS_COMPILE)) || defined (WINCE)
|
||||
# include "jscpucfg.h" /* Use standard Mac or Windows configuration */
|
||||
# include "jscpucfg.h" /* Use standard Mac or Windows configuration */
|
||||
#elif defined(XP_UNIX) || defined(XP_BEOS) || defined(XP_OS2) || defined(CROSS_COMPILE)
|
||||
# include "jsautocfg.h" /* Use auto-detected configuration */
|
||||
# include "jsautocfg.h" /* Use auto-detected configuration */
|
||||
# include "jsosdep.h" /* ...and platform-specific flags */
|
||||
#else
|
||||
# error "Must define one of XP_BEOS, XP_OS2, XP_WIN or XP_UNIX"
|
||||
# error "Must define one of XP_BEOS, XP_OS2, XP_WIN or XP_UNIX"
|
||||
#endif
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
@ -247,7 +261,7 @@ JS_BEGIN_EXTERN_C
|
|||
typedef unsigned char JSUint8;
|
||||
typedef signed char JSInt8;
|
||||
#else
|
||||
#error No suitable type for JSInt8/JSUint8
|
||||
# error No suitable type for JSInt8/JSUint8
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
@ -260,7 +274,7 @@ typedef signed char JSInt8;
|
|||
typedef unsigned short JSUint16;
|
||||
typedef short JSInt16;
|
||||
#else
|
||||
#error No suitable type for JSInt16/JSUint16
|
||||
# error No suitable type for JSInt16/JSUint16
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
@ -272,15 +286,15 @@ typedef short JSInt16;
|
|||
#if JS_BYTES_PER_INT == 4
|
||||
typedef unsigned int JSUint32;
|
||||
typedef int JSInt32;
|
||||
#define JS_INT32(x) x
|
||||
#define JS_UINT32(x) x ## U
|
||||
# define JS_INT32(x) x
|
||||
# define JS_UINT32(x) x ## U
|
||||
#elif JS_BYTES_PER_LONG == 4
|
||||
typedef unsigned long JSUint32;
|
||||
typedef long JSInt32;
|
||||
#define JS_INT32(x) x ## L
|
||||
#define JS_UINT32(x) x ## UL
|
||||
# define JS_INT32(x) x ## L
|
||||
# define JS_UINT32(x) x ## UL
|
||||
#else
|
||||
#error No suitable type for JSInt32/JSUint32
|
||||
# error No suitable type for JSInt32/JSUint32
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
@ -294,28 +308,32 @@ typedef long JSInt32;
|
|||
** the JSLL_ macros (see jslong.h).
|
||||
************************************************************************/
|
||||
#ifdef JS_HAVE_LONG_LONG
|
||||
#if JS_BYTES_PER_LONG == 8
|
||||
|
||||
# if JS_BYTES_PER_LONG == 8
|
||||
typedef long JSInt64;
|
||||
typedef unsigned long JSUint64;
|
||||
#elif defined(WIN16)
|
||||
# elif defined(WIN16)
|
||||
typedef __int64 JSInt64;
|
||||
typedef unsigned __int64 JSUint64;
|
||||
#elif defined(WIN32) && !defined(__GNUC__)
|
||||
# elif defined(WIN32) && !defined(__GNUC__)
|
||||
typedef __int64 JSInt64;
|
||||
typedef unsigned __int64 JSUint64;
|
||||
#else
|
||||
# else
|
||||
typedef long long JSInt64;
|
||||
typedef unsigned long long JSUint64;
|
||||
#endif /* JS_BYTES_PER_LONG == 8 */
|
||||
# endif /* JS_BYTES_PER_LONG == 8 */
|
||||
|
||||
#else /* !JS_HAVE_LONG_LONG */
|
||||
|
||||
typedef struct {
|
||||
#ifdef IS_LITTLE_ENDIAN
|
||||
# ifdef IS_LITTLE_ENDIAN
|
||||
JSUint32 lo, hi;
|
||||
#else
|
||||
# else
|
||||
JSUint32 hi, lo;
|
||||
#endif
|
||||
} JSInt64;
|
||||
typedef JSInt64 JSUint64;
|
||||
|
||||
#endif /* !JS_HAVE_LONG_LONG */
|
||||
|
||||
/************************************************************************
|
||||
|
@ -331,7 +349,7 @@ typedef JSInt64 JSUint64;
|
|||
typedef int JSIntn;
|
||||
typedef unsigned int JSUintn;
|
||||
#else
|
||||
#error 'sizeof(int)' not sufficient for platform use
|
||||
# error 'sizeof(int)' not sufficient for platform use
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
@ -362,7 +380,11 @@ typedef ptrdiff_t JSPtrdiff;
|
|||
** A type for pointer difference. Variables of this type are suitable
|
||||
** for storing a pointer or pointer sutraction.
|
||||
************************************************************************/
|
||||
#if JS_BYTES_PER_WORD == 8 && JS_BYTES_PER_LONG != 8
|
||||
typedef JSUint64 JSUptrdiff;
|
||||
#else
|
||||
typedef unsigned long JSUptrdiff;
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
** TYPES: JSBool
|
||||
|
@ -380,15 +402,20 @@ typedef JSIntn JSBool;
|
|||
** TYPES: JSPackedBool
|
||||
** DESCRIPTION:
|
||||
** Use JSPackedBool within structs where bitfields are not desireable
|
||||
** but minimum and consistant overhead matters.
|
||||
** but minimum and consistent overhead matters.
|
||||
************************************************************************/
|
||||
typedef JSUint8 JSPackedBool;
|
||||
|
||||
/*
|
||||
** A JSWord is an integer that is the same size as a void*
|
||||
*/
|
||||
#if JS_BYTES_PER_WORD == 8 && JS_BYTES_PER_LONG != 8
|
||||
typedef JSInt64 JSWord;
|
||||
typedef JSUint64 JSUword;
|
||||
#else
|
||||
typedef long JSWord;
|
||||
typedef unsigned long JSUword;
|
||||
#endif
|
||||
|
||||
#include "jsotypes.h"
|
||||
|
||||
|
@ -409,13 +436,37 @@ typedef unsigned long JSUword;
|
|||
**
|
||||
***********************************************************************/
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
#define JS_LIKELY(x) (__builtin_expect((x), 1))
|
||||
#define JS_UNLIKELY(x) (__builtin_expect((x), 0))
|
||||
|
||||
# define JS_LIKELY(x) (__builtin_expect((x), 1))
|
||||
# define JS_UNLIKELY(x) (__builtin_expect((x), 0))
|
||||
|
||||
#else
|
||||
#define JS_LIKELY(x) (x)
|
||||
#define JS_UNLIKELY(x) (x)
|
||||
|
||||
# define JS_LIKELY(x) (x)
|
||||
# define JS_UNLIKELY(x) (x)
|
||||
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
** MACROS: JS_ARRAY_LENGTH
|
||||
** JS_ARRAY_END
|
||||
** DESCRIPTION:
|
||||
** Macros to get the number of elements and the pointer to one past the
|
||||
** last element of a C array. Use them like this:
|
||||
**
|
||||
** jschar buf[10], *s;
|
||||
** JSString *str;
|
||||
** ...
|
||||
** for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;
|
||||
** ...
|
||||
** str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));
|
||||
** ...
|
||||
**
|
||||
***********************************************************************/
|
||||
|
||||
#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])
|
||||
#define JS_ARRAY_END(array) ((array) + JS_ARRAY_LENGTH(array))
|
||||
|
||||
JS_END_EXTERN_C
|
||||
|
||||
#endif /* jstypes_h___ */
|
||||
|
|
|
@ -47,6 +47,7 @@ struct stfu_instance {
|
|||
struct stfu_queue *in_queue;
|
||||
struct stfu_queue *out_queue;
|
||||
struct stfu_frame *last_frame;
|
||||
uint32_t cur_ts;
|
||||
uint32_t last_wr_ts;
|
||||
uint32_t last_rd_ts;
|
||||
uint32_t interval;
|
||||
|
@ -267,27 +268,26 @@ static int stfu_n_find_frame(stfu_queue_t *queue, uint32_t ts, stfu_frame_t **r_
|
|||
stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i)
|
||||
{
|
||||
uint32_t index;
|
||||
uint32_t should_have = 0;
|
||||
stfu_frame_t *rframe = NULL;
|
||||
|
||||
|
||||
if (((i->out_queue->wr_len == i->out_queue->array_len) || !i->out_queue->array_len)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (i->last_wr_ts) {
|
||||
should_have = i->last_wr_ts + i->interval;
|
||||
} else {
|
||||
should_have = i->out_queue->array[0].ts;
|
||||
}
|
||||
if (i->cur_ts == 0) {
|
||||
i->cur_ts = i->out_queue->array[0].ts;
|
||||
} else {
|
||||
i->cur_ts += i->interval;
|
||||
}
|
||||
|
||||
|
||||
if (stfu_n_find_frame(i->out_queue, should_have, &rframe, &index) || stfu_n_find_frame(i->in_queue, should_have, &rframe, &index)) {
|
||||
if (stfu_n_find_frame(i->out_queue, i->cur_ts, &rframe, &index) || stfu_n_find_frame(i->in_queue, i->cur_ts, &rframe, &index)) {
|
||||
i->last_frame = rframe;
|
||||
i->out_queue->wr_len++;
|
||||
i->last_wr_ts = rframe->ts;
|
||||
rframe->was_read = 1;
|
||||
i->miss_count = 0;
|
||||
} else {
|
||||
i->last_wr_ts = should_have;
|
||||
i->last_wr_ts = i->cur_ts;
|
||||
rframe = &i->out_queue->int_frame;
|
||||
|
||||
if (i->last_frame && i->last_frame != rframe) {
|
||||
|
@ -296,12 +296,11 @@ stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i)
|
|||
memcpy(rframe->data, i->last_frame->data, rframe->dlen);
|
||||
}
|
||||
|
||||
rframe->ts = should_have;
|
||||
rframe->ts = i->cur_ts;
|
||||
|
||||
if (++i->miss_count > i->max_plc) {
|
||||
i->interval = 0;
|
||||
i->out_queue->wr_len = i->out_queue->array_size;
|
||||
i->last_wr_ts = 0;
|
||||
i->cur_ts = 0;
|
||||
rframe = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <apr_time.h>
|
||||
#include <apr_queue.h>
|
||||
#include "apt_consumer_task.h"
|
||||
#include "apt_log.h"
|
||||
|
|
|
@ -17,13 +17,17 @@ my @netblocks = split(/\n/, get("http://www.infiltrated.net/voipabuse/netblocks.
|
|||
|
||||
print "<list name=\"voip-abuse-addresses\" default=\"deny\">\n";
|
||||
foreach $addr (@addresses) {
|
||||
print " <node type=\"allow\" cidr=\"$addr/32\"/>\n";
|
||||
$addr =~ s/\s//g; # strip whitespace
|
||||
next unless $addr =~ m/\d+\.\d+\.\d+\.\d+/; # imperfect but useful IP addr check
|
||||
print " <node type=\"allow\" cidr=\"$addr/32\"/>\n";
|
||||
}
|
||||
print "</list>\n";
|
||||
|
||||
|
||||
print "<list name=\"voip-abuse-netblocks\" default=\"deny\">\n";
|
||||
foreach $netb (@netblocks) {
|
||||
print " <node type=\"allow\" cidr=\"$netb\"/>\n";
|
||||
$netb =~ s/\s//g; # strip whitespace
|
||||
next unless $netb =~ m/\d+\.\d+\.\d+\.\d+/; # imperfect but useful IP addr check
|
||||
print " <node type=\"allow\" cidr=\"$netb\"/>\n";
|
||||
}
|
||||
print "</list>\n";
|
||||
|
|
|
@ -592,6 +592,22 @@ SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t ** queue, uns
|
|||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_queue_pop(switch_queue_t *queue, void **data);
|
||||
|
||||
/**
|
||||
* pop/get an object from the queue, blocking if the queue is already empty
|
||||
*
|
||||
* @param queue the queue
|
||||
* @param data the data
|
||||
* @param timeout The amount of time in microseconds to wait. This is
|
||||
* a maximum, not a minimum. If the condition is signaled, we
|
||||
* will wake up before this time, otherwise the error APR_TIMEUP
|
||||
* is returned.
|
||||
* @returns APR_TIMEUP the request timed out
|
||||
* @returns APR_EINTR the blocking was interrupted (try again)
|
||||
* @returns APR_EOF if the queue has been terminated
|
||||
* @returns APR_SUCCESS on a successfull pop
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_queue_pop_timeout(switch_queue_t *queue, void **data, switch_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* push/add a object to the queue, blocking if the queue is already full
|
||||
*
|
||||
|
|
|
@ -1387,7 +1387,6 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
|
|||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
callback_t routes = { 0 };
|
||||
lcr_route cur_route = { 0 };
|
||||
char *lcr_profile = NULL;
|
||||
switch_memory_pool_t *pool = NULL;
|
||||
switch_event_t *event = NULL;
|
||||
const char *intrastate = NULL;
|
||||
|
@ -1403,11 +1402,6 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
|
|||
}
|
||||
routes.pool = pool;
|
||||
|
||||
if (!(routes.profile = locate_profile(lcr_profile))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unknown profile: %s\n", lcr_profile);
|
||||
goto end;
|
||||
}
|
||||
|
||||
intrastate = switch_channel_get_variable(channel, "intrastate");
|
||||
intralata = switch_channel_get_variable(channel, "intralata");
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intrastate channel var is [%s]\n", intrastate);
|
||||
|
@ -1427,7 +1421,12 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
|
|||
caller_profile = switch_channel_get_caller_profile(channel);
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "LCR Lookup on %s using profile %s\n", caller_profile->destination_number, lcr_profile);
|
||||
if (!(routes.profile = locate_profile(caller_profile->context))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unknown profile: %s\n", caller_profile->context);
|
||||
goto end;
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "LCR Lookup on %s using profile %s\n", caller_profile->destination_number, caller_profile->context);
|
||||
routes.lookup_number = caller_profile->destination_number;
|
||||
routes.cid = (char *) caller_profile->caller_id_number;
|
||||
if (lcr_do_lookup(&routes) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -1465,7 +1464,7 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
|
|||
switch_caller_extension_add_application(session, extension, app, argc);
|
||||
}
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "LCR lookup failed for %s using profile %s\n", caller_profile->destination_number, lcr_profile);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "LCR lookup failed for %s using profile %s\n", caller_profile->destination_number, caller_profile->context);
|
||||
}
|
||||
|
||||
end:
|
||||
|
|
|
@ -63,10 +63,6 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
|
|
@ -40,7 +40,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load);
|
|||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sangoma_codec_shutdown);
|
||||
SWITCH_MODULE_DEFINITION(mod_sangoma_codec, mod_sangoma_codec_load, mod_sangoma_codec_shutdown, NULL);
|
||||
|
||||
#define IANA_LINEAR 10
|
||||
#define SANGOMA_SESS_HASH_KEY_FORMAT "sngtc%lu"
|
||||
|
||||
/* it seemed we need higher PTIME than the calling parties, so we assume nobody will use higher ptime than 40 */
|
||||
|
@ -83,26 +82,26 @@ typedef struct vocallo_codec_s {
|
|||
int autoinit; /* initialize on start loop or manually */
|
||||
} vocallo_codec_t;
|
||||
|
||||
#define ILBC_133_PAYLOAD 97
|
||||
#define ILBC_152_PAYLOAD 98
|
||||
vocallo_codec_t g_codec_map[] =
|
||||
{
|
||||
/* auto-init codecs */
|
||||
{ SNGTC_CODEC_PCMU, 0, "PCMU", "Sangoma PCMU", 40, 64000, 10000, 80, 160, 80, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_PCMA, 8, "PCMA", "Sangoma PCMA", 40, 64000, 10000, 80, 160, 80, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_L16_1, 10, "L16", "Sangoma L16", 40, 120000, 10000, 80, 160, 160, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_L16_2, 10, "L16", "Sangoma L16 2", 40, 320000, 10000, 80, 320, 320, 16000, 16000, 0 },
|
||||
{ SNGTC_CODEC_G729AB, 18, "G729", "Sangoma G729", 40, 8000, 10000, 80, 160, 10, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_G726_32, 122, "G726-32", "Sangoma G.726 32k", 40, 32000, 10000, 80, 160, 40, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_G722, 9, "G722", "Sangoma G722", 20, 64000, 10000, 80, 160, 80, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_PCMU, IANA_PCMU_A_8000_1, "PCMU", "Sangoma PCMU", 40, 64000, 10000, 80, 160, 80, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_PCMA, IANA_PCMA_A_8000_1, "PCMA", "Sangoma PCMA", 40, 64000, 10000, 80, 160, 80, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_L16_1, IANA_L16_A_8000_1, "L16", "Sangoma L16", 40, 120000, 10000, 80, 160, 160, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_L16_2, IANA_L16_A_16000_1, "L16", "Sangoma L16 2", 40, 320000, 10000, 160, 320, 320, 16000, 16000, 0 },
|
||||
{ SNGTC_CODEC_G729AB, IANA_G729_AB_8000_1, "G729", "Sangoma G729", 40, 8000, 10000, 80, 160, 10, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_G726_32, IANA_G726_32_8000_1, "G726-32", "Sangoma G.726 32k", 40, 32000, 10000, 80, 160, 40, 8000, 8000, 1 },
|
||||
{ SNGTC_CODEC_G722, IANA_G722_A_8000_1, "G722", "Sangoma G722", 20, 64000, 10000, 80, 160, 80, 8000, 8000, 1 },
|
||||
|
||||
/* manually initialized */
|
||||
{ SNGTC_CODEC_GSM_FR, 3, "GSM", "Sangoma GSM", 20, 13200, 20000, 160, 320, 33, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_G723_1_63, 4, "G723", "Sangoma G723", 90, 6300, 30000, 240, 480, 24, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_AMR_1220, 96, "AMR", "Sangoma AMR", 20, 12200, 20000, 160, 320, 0, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_ILBC_133, ILBC_133_PAYLOAD, "iLBC", "Sangoma iLBC", -1, -1, -1, -1, -1, -1, -1, -1, 0 },
|
||||
{ SNGTC_CODEC_ILBC_152, ILBC_152_PAYLOAD, "iLBC", "Sangoma iLBC", -1, -1, -1, -1, -1, -1, -1, -1, 0 },
|
||||
{ -1, -1, NULL, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 0 },
|
||||
{ SNGTC_CODEC_GSM_FR, IANA_GSM_A_8000_1, "GSM", "Sangoma GSM", 20, 13200, 20000, 160, 320, 33, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_G723_1_63, IANA_G723_A_8000_1, "G723", "Sangoma G723", 90, 6300, 30000, 240, 480, 24, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_AMR_1220, IANA_AMR_WB_16000_1, "AMR", "Sangoma AMR", 20, 12200, 20000, 160, 320, 0, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_SIREN7_24, IANA_SIREN7, "G7221", "Sangoma G722.1", 20, 24000, 20000, 320, 640, 60, 16000, 16000, 0 },
|
||||
{ SNGTC_CODEC_SIREN7_32, IANA_SIREN7, "G7221", "Sangoma G722.1", 20, 32000, 20000, 320, 640, 80, 16000, 16000, 0 },
|
||||
{ SNGTC_CODEC_ILBC_133, IANA_ILBC_133_8000_1, "iLBC", "Sangoma iLBC", 30, 13300, 30000, 240, 480, 50, 8000, 8000, 0 },
|
||||
{ SNGTC_CODEC_ILBC_152, IANA_ILBC_152_8000_1, "iLBC", "Sangoma iLBC", 20, 15200, 20000, 160, 320, 38, 8000, 8000, 0 },
|
||||
{ -1, -1, NULL, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 0 },
|
||||
};
|
||||
|
||||
/* RFC3389 RTP Payload for Comfort Noise */
|
||||
|
@ -181,11 +180,14 @@ static int codec_id_to_iana(int codec_id)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static vocallo_codec_t *get_codec_from_iana(int iana)
|
||||
static vocallo_codec_t *get_codec_from_iana(int iana, int bitrate)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; g_codec_map[i].codec_id != -1; i++) {
|
||||
if (iana == g_codec_map[i].iana) {
|
||||
if (iana == g_codec_map[i].iana && !bitrate) {
|
||||
return &g_codec_map[i];
|
||||
}
|
||||
if (iana == g_codec_map[i].iana && bitrate == g_codec_map[i].bps) {
|
||||
return &g_codec_map[i];
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +321,7 @@ static switch_status_t switch_sangoma_init(switch_codec_t *codec, switch_codec_f
|
|||
sess->pool = codec->memory_pool;
|
||||
sess->impl = codec->implementation;
|
||||
|
||||
vcodec = get_codec_from_iana(codec->implementation->ianacode);
|
||||
vcodec = get_codec_from_iana(codec->implementation->ianacode, codec->implementation->bits_per_second);
|
||||
|
||||
switch_mutex_lock(g_sessions_lock);
|
||||
|
||||
|
@ -386,6 +388,12 @@ static switch_status_t switch_sangoma_init_ilbc(switch_codec_t *codec, switch_co
|
|||
return switch_sangoma_init(codec, flags, codec_settings);
|
||||
}
|
||||
|
||||
static switch_status_t switch_sangoma_init_siren7(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
int bit_rate = codec->implementation->bits_per_second;
|
||||
codec->fmtp_out = switch_core_sprintf(codec->memory_pool, "bitrate=%d", bit_rate);
|
||||
return switch_sangoma_init(codec, flags, codec_settings);
|
||||
}
|
||||
|
||||
static void flush_rtp(switch_rtp_t *rtp)
|
||||
{
|
||||
|
@ -435,6 +443,7 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
|
|||
switch_time_t func_start_time = 0, func_end_time = 0;
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
int linear_payload = codec->implementation->actual_samples_per_second == 8000 ? IANA_L16_A_8000_1 : IANA_L16_A_16000_1;
|
||||
struct sangoma_transcoding_session *sess = codec->private_info;
|
||||
|
||||
if (sess->encoder.debug_timing) {
|
||||
|
@ -473,7 +482,7 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
|
|||
linear_frame.source = __FUNCTION__;
|
||||
linear_frame.data = decoded_byteswapped_data;
|
||||
linear_frame.datalen = decoded_data_len;
|
||||
linear_frame.payload = IANA_LINEAR;
|
||||
linear_frame.payload = linear_payload;
|
||||
|
||||
/* copy and byte-swap */
|
||||
for (i = 0; i < decoded_data_len/2; i++) {
|
||||
|
@ -531,9 +540,9 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
|
|||
if (sess->encoder.request.b.codec_id == SNGTC_CODEC_ILBC_152 || sess->encoder.request.b.codec_id == SNGTC_CODEC_ILBC_133) {
|
||||
/* since we moved to SOAP based communications, the mapping between vocallo IANA and our IANA does not work,
|
||||
* some codecs checks cannot be completely done, like iLBC */
|
||||
if (encoded_frame.payload != ILBC_152_PAYLOAD && encoded_frame.payload != ILBC_133_PAYLOAD) {
|
||||
if (encoded_frame.payload != IANA_ILBC_152_8000_1 && encoded_frame.payload != IANA_ILBC_133_8000_1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read unexpected payload %d in Sangoma encoder RTP session, expecting either %d or %d\n",
|
||||
encoded_frame.payload, ILBC_152_PAYLOAD, ILBC_133_PAYLOAD);
|
||||
encoded_frame.payload, IANA_ILBC_152_8000_1, IANA_ILBC_133_8000_1);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -633,6 +642,7 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses
|
|||
uint16_t *rtp_data_linear;
|
||||
int res = 0;
|
||||
int i = 0;
|
||||
int linear_payload = codec->implementation->actual_samples_per_second == 8000 ? IANA_L16_A_8000_1 : IANA_L16_A_16000_1;
|
||||
struct sangoma_transcoding_session *sess = codec->private_info;
|
||||
|
||||
if (sess->decoder.debug_timing) {
|
||||
|
@ -722,9 +732,9 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses
|
|||
continue;
|
||||
}
|
||||
|
||||
if (linear_frame.payload != IANA_LINEAR) {
|
||||
if (linear_frame.payload != linear_payload) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read unexpected payload %d in Sangoma decoder RTP session, expecting %d\n",
|
||||
linear_frame.payload, IANA_LINEAR);
|
||||
linear_frame.payload, linear_payload);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1156,7 +1166,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
|||
switch_api_interface_t *api_interface = NULL;
|
||||
int i = 0, c = 0;
|
||||
int ilbc_done = 0;
|
||||
int siren_done = 0;
|
||||
vocallo_codec_t *ilbc_codec = NULL;
|
||||
vocallo_codec_t *siren_codec = NULL;
|
||||
int detected = 0, activated = 0;
|
||||
|
||||
/* make sure we have valid configuration */
|
||||
|
@ -1214,17 +1226,18 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
|||
continue;
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Registering implementations for codec %s\n", g_codec_map[c].iana_name);
|
||||
|
||||
/* let know the library which iana to use */
|
||||
sngtc_set_iana_code_based_on_codec_id(g_codec_map[c].codec_id, g_codec_map[c].iana);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mapped codec %d to IANA %d\n", g_codec_map[c].codec_id, g_codec_map[c].iana);
|
||||
|
||||
/* special check for iLBC to add a single codec interface for both ILBC bitrate versions */
|
||||
if ((g_codec_map[c].codec_id == SNGTC_CODEC_ILBC_152 || g_codec_map[c].codec_id == SNGTC_CODEC_ILBC_133) && ilbc_done) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* special check for siren to add a single codec interface for all siren bitrate versions */
|
||||
if ((g_codec_map[c].codec_id == SNGTC_CODEC_SIREN7_24 || g_codec_map[c].codec_id == SNGTC_CODEC_SIREN7_32) && siren_done) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Registering implementations for codec %s\n", g_codec_map[c].iana_name);
|
||||
|
||||
/* SWITCH_ADD_CODEC allocates a codec interface structure from the pool the core gave us and adds it to the internal interface
|
||||
* list the core keeps, gets a codec id and set the given codec name to it.
|
||||
* At this point there is an empty shell codec interface registered, but not yet implementations */
|
||||
|
@ -1322,7 +1335,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
|||
50, /* number of bytes per frame compressed */
|
||||
1, /* number of channels represented */
|
||||
1, /* number of frames per network packet (I dont think this is used at all) */
|
||||
switch_sangoma_init, /* function to initialize a codec session using this implementation */
|
||||
switch_sangoma_init_ilbc, /* function to initialize a codec session using this implementation */
|
||||
switch_sangoma_encode, /* function to encode slinear data into encoded data */
|
||||
switch_sangoma_decode, /* function to decode encoded data into slinear data */
|
||||
switch_sangoma_destroy); /* deinitalize a codec handle using this implementation */
|
||||
|
@ -1353,6 +1366,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
case SNGTC_CODEC_AMR_1220:
|
||||
switch_core_codec_add_implementation(pool, codec_interface, /* the codec interface we allocated and we want to register with the core */
|
||||
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
|
||||
|
@ -1374,6 +1388,51 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
|||
switch_sangoma_destroy); /* deinitalize a codec handle using this implementation */
|
||||
break;
|
||||
|
||||
case SNGTC_CODEC_SIREN7_24:
|
||||
case SNGTC_CODEC_SIREN7_32:
|
||||
|
||||
siren_codec = get_codec_from_id(SNGTC_CODEC_SIREN7_24);
|
||||
switch_core_codec_add_implementation(pool, codec_interface, /* the codec interface we allocated and we want to register with the core */
|
||||
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
|
||||
siren_codec->iana, /* the IANA code number, ie http://www.iana.org/assignments/rtp-parameters */
|
||||
siren_codec->iana_name, /* the IANA code name */
|
||||
"bitrate=24000", /* default fmtp to send (can be overridden by the init function), fmtp is used in SDP for format specific parameters */
|
||||
siren_codec->sampling_rate, /* samples transferred per second */
|
||||
siren_codec->actual_sampling_rate, /* actual samples transferred per second */
|
||||
siren_codec->bps, /* bits transferred per second */
|
||||
siren_codec->mpf, /* microseconds per frame */
|
||||
siren_codec->spf, /* samples per frame */
|
||||
siren_codec->bpfd, /* number of bytes per frame decompressed */
|
||||
siren_codec->bpfc, /* number of bytes per frame compressed */
|
||||
1, /* number of channels represented */
|
||||
siren_codec->spf, /* number of frames per network packet (I dont think this is used at all) */
|
||||
switch_sangoma_init_siren7, /* function to initialize a codec session using this implementation */
|
||||
switch_sangoma_encode, /* function to encode slinear data into encoded data */
|
||||
switch_sangoma_decode, /* function to decode encoded data into slinear data */
|
||||
switch_sangoma_destroy); /* deinitalize a codec handle using this implementation */
|
||||
|
||||
siren_codec = get_codec_from_id(SNGTC_CODEC_SIREN7_32);
|
||||
switch_core_codec_add_implementation(pool, codec_interface, /* the codec interface we allocated and we want to register with the core */
|
||||
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
|
||||
siren_codec->iana, /* the IANA code number, ie http://www.iana.org/assignments/rtp-parameters */
|
||||
siren_codec->iana_name, /* the IANA code name */
|
||||
"bitrate=32000", /* default fmtp to send (can be overridden by the init function), fmtp is used in SDP for format specific parameters */
|
||||
siren_codec->sampling_rate, /* samples transferred per second */
|
||||
siren_codec->actual_sampling_rate, /* actual samples transferred per second */
|
||||
siren_codec->bps, /* bits transferred per second */
|
||||
siren_codec->mpf, /* microseconds per frame */
|
||||
siren_codec->spf, /* samples per frame */
|
||||
siren_codec->bpfd, /* number of bytes per frame decompressed */
|
||||
siren_codec->bpfc, /* number of bytes per frame compressed */
|
||||
1, /* number of channels represented */
|
||||
siren_codec->spf, /* number of frames per network packet (I dont think this is used at all) */
|
||||
switch_sangoma_init_siren7, /* function to initialize a codec session using this implementation */
|
||||
switch_sangoma_encode, /* function to encode slinear data into encoded data */
|
||||
switch_sangoma_decode, /* function to decode encoded data into slinear data */
|
||||
switch_sangoma_destroy); /* deinitalize a codec handle using this implementation */
|
||||
siren_done = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -666,21 +666,32 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (((tmp = switch_channel_get_variable(channel, "effective_callee_id_name")) ||
|
||||
(tmp = switch_channel_get_variable(channel, "sip_callee_id_name")) ||
|
||||
(tmp = switch_channel_get_variable(channel, "callee_id_name"))) && !zstr(tmp)) {
|
||||
(tmp = switch_channel_get_variable(channel, "sip_callee_id_name"))) && !zstr(tmp)) {
|
||||
name = (char *) tmp;
|
||||
}
|
||||
|
||||
if (((tmp = switch_channel_get_variable(channel, "effective_callee_id_number")) ||
|
||||
(tmp = switch_channel_get_variable(channel, "sip_callee_id_number")) ||
|
||||
(tmp = switch_channel_get_variable(channel, "callee_id_number"))) && !zstr(tmp)) {
|
||||
(tmp = switch_channel_get_variable(channel, "sip_callee_id_number"))) && !zstr(tmp)) {
|
||||
number = tmp;
|
||||
}
|
||||
|
||||
if (zstr(name))
|
||||
if (zstr(number)) {
|
||||
if ((tmp = switch_channel_get_variable(channel, "callee_id_number")) && !zstr(tmp)) {
|
||||
number = (char *) tmp;
|
||||
}
|
||||
}
|
||||
|
||||
if (zstr(name)) {
|
||||
if ((tmp = switch_channel_get_variable(channel, "callee_id_name")) && !zstr(tmp)) {
|
||||
name = (char *) tmp;
|
||||
}
|
||||
}
|
||||
|
||||
if (zstr(name)) {
|
||||
name = (char *) number;
|
||||
}
|
||||
|
||||
if (zstr(name) && zstr(number)) {
|
||||
goto end;
|
||||
|
@ -1230,43 +1241,43 @@ static void sofia_perform_profile_start_failure(sofia_profile_t *profile, char *
|
|||
void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
sofia_profile_t *profile = (sofia_profile_t *) obj;
|
||||
uint32_t ireg_loops = 0;
|
||||
uint32_t gateway_loops = 0;
|
||||
int loops = 0;
|
||||
uint32_t qsize;
|
||||
void *pop = NULL;
|
||||
int loop_count = 0;
|
||||
switch_size_t sql_len = 1024 * 32;
|
||||
char *tmp, *sqlbuf = NULL;
|
||||
char *sql = NULL;
|
||||
uint32_t ireg_loops = IREG_SECONDS; /* Number of loop iterations done when we haven't checked for registrations */
|
||||
uint32_t gateway_loops = GATEWAY_SECONDS; /* Number of loop iterations done when we haven't checked for gateways */
|
||||
void *pop = NULL; /* queue_pop placeholder */
|
||||
switch_size_t sql_len = 1024 * 32; /* length of sqlbuf */
|
||||
char *tmp, *sqlbuf = NULL; /* Buffer for SQL statements */
|
||||
char *sql = NULL; /* Current SQL statement */
|
||||
switch_time_t last_commit; /* Last time we committed stuff to the DB */
|
||||
switch_time_t last_check; /* Last time we did the second-resolution loop that checks various stuff */
|
||||
switch_size_t len = 0; /* Current length of sqlbuf */
|
||||
uint32_t statements = 0; /* Number of statements in the current sql buffer */
|
||||
|
||||
last_commit = last_check = switch_micro_time_now();
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) {
|
||||
sqlbuf = (char *) malloc(sql_len);
|
||||
}
|
||||
|
||||
ireg_loops = IREG_SECONDS;
|
||||
gateway_loops = GATEWAY_SECONDS;
|
||||
|
||||
sofia_set_pflag_locked(profile, PFLAG_WORKER_RUNNING);
|
||||
|
||||
switch_queue_create(&profile->sql_queue, SOFIA_QUEUE_SIZE, profile->pool);
|
||||
|
||||
qsize = switch_queue_size(profile->sql_queue);
|
||||
|
||||
while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || qsize) {
|
||||
/* While we're running, or there is a pending sql statment that we haven't appended to sqlbuf yet, because of a lack of buffer space */
|
||||
while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || sql) {
|
||||
if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) {
|
||||
if (qsize > 0 && (qsize >= 1024 || ++loop_count >= (int)profile->trans_timeout)) {
|
||||
switch_size_t newlen;
|
||||
uint32_t iterations = 0;
|
||||
switch_size_t len = 0;
|
||||
|
||||
switch_mutex_lock(profile->ireg_mutex);
|
||||
/* Do we have enough statements or is the timeout expired */
|
||||
while (sql || (sofia_test_pflag(profile, PFLAG_RUNNING) && mod_sofia_globals.running == 1 &&
|
||||
switch_micro_time_now() - last_check < 1000000 &&
|
||||
(statements == 0 || (statements <= 1024 && (switch_micro_time_now() - last_commit)/1000 < profile->trans_timeout)))) {
|
||||
|
||||
while (sql || (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop)) {
|
||||
switch_interval_time_t sleepy_time = !statements ? 1000000 : switch_micro_time_now() - last_commit - profile->trans_timeout*1000;
|
||||
|
||||
if (sql || (switch_queue_pop_timeout(profile->sql_queue, &pop, sleepy_time) == SWITCH_STATUS_SUCCESS && pop)) {
|
||||
switch_size_t newlen;
|
||||
|
||||
if (!sql) sql = (char *) pop;
|
||||
|
||||
newlen = strlen(sql) + 2;
|
||||
iterations++;
|
||||
newlen = strlen(sql) + 2 /* strlen(";\n") */ ;
|
||||
|
||||
if (len + newlen + 10 > sql_len) {
|
||||
switch_size_t new_mlen = len + newlen + 10 + 10240;
|
||||
|
@ -1280,7 +1291,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
|||
}
|
||||
sqlbuf = tmp;
|
||||
} else {
|
||||
goto skip;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1288,31 +1299,32 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
|||
len += newlen;
|
||||
free(sql);
|
||||
sql = NULL;
|
||||
|
||||
statements++;
|
||||
}
|
||||
|
||||
skip:
|
||||
|
||||
}
|
||||
|
||||
/* Execute here */
|
||||
last_commit = switch_micro_time_now();
|
||||
|
||||
if (len) {
|
||||
//printf("TRANS:\n%s\n", sqlbuf);
|
||||
switch_mutex_lock(profile->ireg_mutex);
|
||||
sofia_glue_actually_execute_sql_trans(profile, sqlbuf, NULL);
|
||||
//sofia_glue_actually_execute_sql(profile, "commit;\n", NULL);
|
||||
switch_mutex_unlock(profile->ireg_mutex);
|
||||
loop_count = 0;
|
||||
statements = 0;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (qsize) {
|
||||
//switch_mutex_lock(profile->ireg_mutex);
|
||||
while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
|
||||
sofia_glue_actually_execute_sql(profile, (char *) pop, profile->ireg_mutex);
|
||||
free(pop);
|
||||
}
|
||||
//switch_mutex_unlock(profile->ireg_mutex);
|
||||
if (switch_queue_pop_timeout(profile->sql_queue, &pop, 1000000) == SWITCH_STATUS_SUCCESS && pop) {
|
||||
sofia_glue_actually_execute_sql(profile, (char *) pop, profile->ireg_mutex);
|
||||
free(pop);
|
||||
}
|
||||
}
|
||||
|
||||
if (++loops >= 1000) {
|
||||
|
||||
|
||||
|
||||
if (switch_micro_time_now() - last_check >= 1000000) {
|
||||
if (profile->watchdog_enabled) {
|
||||
uint32_t event_diff = 0, step_diff = 0, event_fail = 0, step_fail = 0;
|
||||
|
||||
|
@ -1339,7 +1351,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
|||
if (event_fail || step_fail) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile %s: SIP STACK FAILURE DETECTED!\n"
|
||||
"GOODBYE CRUEL WORLD, I'M LEAVING YOU TODAY....GOODBYE, GOODBYE, GOOD BYE\n", profile->name);
|
||||
switch_yield(2000);
|
||||
switch_yield(2000000);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
@ -1354,12 +1366,11 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
|||
sofia_reg_check_gateway(profile, switch_epoch_time_now(NULL));
|
||||
gateway_loops = 0;
|
||||
}
|
||||
|
||||
sofia_sub_check_gateway(profile, time(NULL));
|
||||
loops = 0;
|
||||
|
||||
last_check = switch_micro_time_now();
|
||||
}
|
||||
|
||||
switch_cond_next();
|
||||
qsize = switch_queue_size(profile->sql_queue);
|
||||
}
|
||||
|
||||
switch_mutex_lock(profile->ireg_mutex);
|
||||
|
@ -5947,7 +5958,12 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||
|
||||
/* Barf if we didn't get our private */
|
||||
assert(switch_core_session_get_private(session));
|
||||
|
||||
|
||||
if (!strncasecmp(sip->sip_content_type->c_type, "message", 7) && !strcasecmp(sip->sip_content_type->c_subtype, "update_display")) {
|
||||
sofia_update_callee_id(session, profile, sip, SWITCH_TRUE);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (sip && sip->sip_content_type && sip->sip_content_type->c_type && sip->sip_content_type->c_subtype &&
|
||||
sip->sip_payload && sip->sip_payload->pl_data) {
|
||||
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) {
|
||||
|
@ -6000,8 +6016,6 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||
} else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf")) {
|
||||
int tmp = atoi(sip->sip_payload->pl_data);
|
||||
dtmf.digit = switch_rfc2833_to_char(tmp);
|
||||
} else if (!strncasecmp(sip->sip_content_type->c_type, "message", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "update_display")) {
|
||||
sofia_update_callee_id(session, profile, sip, SWITCH_TRUE);
|
||||
} else {
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
|
|||
|
||||
static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen,
|
||||
switch_port_t port,
|
||||
int cur_ptime, const char *append_audio, const char *sr, int use_cng, int cng_type, switch_event_t *map)
|
||||
int cur_ptime, const char *append_audio, const char *sr, int use_cng, int cng_type, switch_event_t *map, int verbose_sdp)
|
||||
{
|
||||
int i = 0;
|
||||
int rate;
|
||||
|
@ -298,7 +298,7 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen,
|
|||
}
|
||||
}
|
||||
|
||||
if (tech_pvt->ianacodes[i] > 95) {
|
||||
if (tech_pvt->ianacodes[i] > 95 || verbose_sdp) {
|
||||
switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d %s/%d\n", tech_pvt->ianacodes[i], imp->iananame, rate);
|
||||
}
|
||||
|
||||
|
@ -373,6 +373,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
|
|||
const char *fmtp_out_var = switch_channel_get_variable(tech_pvt->channel, "sip_force_audio_fmtp");
|
||||
switch_event_t *map = NULL, *ptmap = NULL;
|
||||
const char *b_sdp = NULL;
|
||||
int verbose_sdp = 0;
|
||||
|
||||
sofia_glue_check_dtmf_type(tech_pvt);
|
||||
|
||||
|
@ -396,6 +397,10 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
|
|||
fmtp_out = fmtp_out_var;
|
||||
}
|
||||
|
||||
if ((val = switch_channel_get_variable(tech_pvt->channel, "verbose_sdp")) && switch_true(val)) {
|
||||
verbose_sdp = 1;
|
||||
}
|
||||
|
||||
if (sofia_test_pflag(tech_pvt->profile, PFLAG_SUPPRESS_CNG) ||
|
||||
((val = switch_channel_get_variable(tech_pvt->channel, "supress_cng")) && switch_true(val)) ||
|
||||
((val = switch_channel_get_variable(tech_pvt->channel, "suppress_cng")) && switch_true(val))) {
|
||||
|
@ -533,7 +538,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
|
|||
}
|
||||
|
||||
if (!switch_true(switch_channel_get_variable(tech_pvt->channel, "sdp_m_per_ptime"))) {
|
||||
generate_m(tech_pvt, buf, sizeof(buf), port, 0, append_audio, sr, use_cng, cng_type, map);
|
||||
generate_m(tech_pvt, buf, sizeof(buf), port, 0, append_audio, sr, use_cng, cng_type, map, verbose_sdp);
|
||||
} else {
|
||||
|
||||
for (i = 0; i < tech_pvt->num_codecs; i++) {
|
||||
|
@ -547,7 +552,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
|
|||
|
||||
if (cur_ptime != this_ptime) {
|
||||
cur_ptime = this_ptime;
|
||||
generate_m(tech_pvt, buf, sizeof(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map);
|
||||
generate_m(tech_pvt, buf, sizeof(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map, verbose_sdp);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1115,7 +1115,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
|
||||
if (auth_res != AUTH_OK && !stale) {
|
||||
if (profile->debug) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s for [%s@%s]\n", forbidden ? "forbidden" : "challenge", to_user, to_host);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s for [%s@%s] from ip '%s'\n",
|
||||
forbidden ? "forbidden" : "challenge", to_user, to_host, network_ip);
|
||||
}
|
||||
if (auth_res == AUTH_FORBIDDEN) {
|
||||
nua_respond(nh, SIP_403_FORBIDDEN, NUTAG_WITH_THIS(nua), TAG_END());
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1"
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
<Tool
|
||||
|
@ -111,7 +111,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1"
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
<Tool
|
||||
|
@ -178,7 +178,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1"
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
<Tool
|
||||
|
@ -244,7 +244,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1"
|
||||
PreprocessorDefinitions="SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
<Tool
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
|
@ -91,7 +91,7 @@
|
|||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
|
@ -107,7 +107,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
|
@ -125,7 +125,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>SM_EXPORTS;JS_HAS_FILE_OBJECT=1;XP_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
|
|
|
@ -986,6 +986,12 @@ SWITCH_DECLARE(switch_status_t) switch_queue_pop(switch_queue_t *queue, void **d
|
|||
return apr_queue_pop(queue, data);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_queue_pop_timeout(switch_queue_t *queue, void **data, switch_interval_time_t timeout)
|
||||
{
|
||||
return apr_queue_pop_timeout(queue, data, timeout);
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_queue_push(switch_queue_t *queue, void *data)
|
||||
{
|
||||
apr_status_t s;
|
||||
|
|
|
@ -1971,7 +1971,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
|
|||
SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *channel, switch_event_t *event)
|
||||
{
|
||||
switch_event_header_t *hi;
|
||||
int x, global_verbose_events = 0;
|
||||
int global_verbose_events = -1;
|
||||
|
||||
switch_mutex_lock(channel->profile_mutex);
|
||||
|
||||
|
@ -2004,7 +2004,6 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *ch
|
|||
event->event_id == SWITCH_EVENT_MEDIA_BUG_STOP ||
|
||||
event->event_id == SWITCH_EVENT_CUSTOM) {
|
||||
|
||||
x = 0;
|
||||
/* Index Variables */
|
||||
if (channel->variables) {
|
||||
for (hi = channel->variables->headers; hi; hi = hi->next) {
|
||||
|
@ -2013,8 +2012,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *ch
|
|||
|
||||
vvar = (char *) hi->name;
|
||||
vval = (char *) hi->value;
|
||||
x++;
|
||||
|
||||
|
||||
switch_assert(vvar && vval);
|
||||
switch_snprintf(buf, sizeof(buf), "variable_%s", vvar);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, buf, vval);
|
||||
|
|
|
@ -672,14 +672,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_decode(switch_codec_t *codec,
|
|||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
||||
{
|
||||
switch_mutex_t *mutex;
|
||||
switch_memory_pool_t *pool;
|
||||
switch_mutex_t *mutex = codec->mutex;
|
||||
switch_memory_pool_t *pool = codec->memory_pool;
|
||||
int free_pool = 0;
|
||||
|
||||
switch_assert(codec != NULL);
|
||||
|
||||
if (!switch_core_codec_ready(codec)) {
|
||||
if (mutex) switch_mutex_lock(mutex);
|
||||
|
||||
if (switch_core_codec_ready(codec)) {
|
||||
switch_clear_flag(codec, SWITCH_CODEC_FLAG_READY);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Codec is not initialized!\n");
|
||||
if (mutex) switch_mutex_unlock(mutex);
|
||||
return SWITCH_STATUS_NOT_INITALIZED;
|
||||
}
|
||||
|
||||
|
@ -687,23 +692,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
|||
free_pool = 1;
|
||||
}
|
||||
|
||||
pool = codec->memory_pool;
|
||||
mutex = codec->mutex;
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_lock(mutex);
|
||||
switch_clear_flag(codec, SWITCH_CODEC_FLAG_READY);
|
||||
switch_mutex_unlock(mutex);
|
||||
switch_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
codec->implementation->destroy(codec);
|
||||
|
||||
UNPROTECT_INTERFACE(codec->codec_interface);
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_unlock(mutex);
|
||||
}
|
||||
if (mutex) switch_mutex_unlock(mutex);
|
||||
|
||||
if (free_pool) {
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
|
|
|
@ -548,7 +548,7 @@ static void *SWITCH_THREAD_FUNC pool_thread(switch_thread_t *thread, void *obj)
|
|||
goto done;
|
||||
}
|
||||
} else {
|
||||
switch_yield(100000);
|
||||
switch_yield(1000000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -898,7 +898,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_db_thread(switch_thread_t *threa
|
|||
wake_thread(0);
|
||||
sec = 0;
|
||||
}
|
||||
switch_yield(1000);
|
||||
switch_yield(1000000);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -914,21 +914,23 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
|||
if (switch_channel_has_dtmf(channel)) {
|
||||
switch_dtmf_t dtmf = { 0 };
|
||||
|
||||
if (!args->input_callback && !args->buf && !args->dmachine) {
|
||||
if (args && !args->input_callback && !args->buf && !args->dmachine) {
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
break;
|
||||
}
|
||||
|
||||
switch_channel_dequeue_dtmf(channel, &dtmf);
|
||||
|
||||
if (args->dmachine) {
|
||||
char ds[2] = {dtmf.digit, '\0'};
|
||||
if ((status = switch_ivr_dmachine_feed(args->dmachine, ds, NULL)) != SWITCH_STATUS_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} else if (args && args->input_callback) {
|
||||
if ((status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen)) != SWITCH_STATUS_SUCCESS) {
|
||||
break;
|
||||
if (args) {
|
||||
if (args->dmachine) {
|
||||
char ds[2] = {dtmf.digit, '\0'};
|
||||
if ((status = switch_ivr_dmachine_feed(args->dmachine, ds, NULL)) != SWITCH_STATUS_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} else if (args->input_callback) {
|
||||
if ((status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen)) != SWITCH_STATUS_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1546,6 +1546,13 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
|
|||
}
|
||||
}
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "intercept_unanswered_only")) && switch_true(var)) {
|
||||
if ((switch_channel_test_flag(rchannel, CF_ANSWERED))) {
|
||||
switch_core_session_rwunlock(rsession);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch_channel_pre_answer(channel);
|
||||
|
||||
if (!zstr(buuid)) {
|
||||
|
|
|
@ -1293,7 +1293,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autolo
|
|||
if (path && zstr(path)) {
|
||||
path = SWITCH_GLOBAL_dirs.mod_dir;
|
||||
}
|
||||
if (switch_loadable_module_load_module_ex((char *) path, (char *) val, SWITCH_FALSE, global, &err) == SWITCH_STATUS_FALSE) {
|
||||
if (switch_loadable_module_load_module_ex((char *) path, (char *) val, SWITCH_FALSE, global, &err) == SWITCH_STATUS_GENERR) {
|
||||
if (critical && switch_true(critical)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failed to load critical module '%s', abort()\n", val);
|
||||
abort();
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
handle SIGPIPE pass noprint nostop
|
||||
handle SIGTTIN pass noprint nostop
|
||||
|
||||
# FreeSWITCH Custom GDB commands
|
||||
define list_sessions
|
||||
dont-repeat
|
||||
|
|
|
@ -597,6 +597,51 @@
|
|||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>MODLOCATION</RefTargetDir>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\mod\languages\mod_spidermonkey\mod_spidermonkey.2010.vcxproj">
|
||||
<Name>mod_spidermonkey</Name>
|
||||
<Project>{1ad3f51e-bbb6-4090-ba39-9dfab1ef1f5f}</Project>
|
||||
<Private>True</Private>
|
||||
<DoNotHarvest>
|
||||
</DoNotHarvest>
|
||||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>MODLOCATION</RefTargetDir>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\mod\languages\mod_spidermonkey\mod_spidermonkey_core_db.2010.vcxproj">
|
||||
<Name>mod_spidermonkey_core_db</Name>
|
||||
<Project>{acfff684-4d19-4d48-af12-88ea1d778bdf}</Project>
|
||||
<Private>True</Private>
|
||||
<DoNotHarvest>
|
||||
</DoNotHarvest>
|
||||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>MODLOCATION</RefTargetDir>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\mod\languages\mod_spidermonkey\mod_spidermonkey_odbc.2010.vcxproj">
|
||||
<Name>mod_spidermonkey_odbc</Name>
|
||||
<Project>{0a6b5ea5-6e9b-4a51-931f-ed25aa87b4df}</Project>
|
||||
<Private>True</Private>
|
||||
<DoNotHarvest>
|
||||
</DoNotHarvest>
|
||||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>MODLOCATION</RefTargetDir>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\mod\languages\mod_spidermonkey\mod_spidermonkey_socket.2010.vcxproj">
|
||||
<Name>mod_spidermonkey_socket</Name>
|
||||
<Project>{028c7278-05d7-4e18-82fe-be231b844f41}</Project>
|
||||
<Private>True</Private>
|
||||
<DoNotHarvest>
|
||||
</DoNotHarvest>
|
||||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>MODLOCATION</RefTargetDir>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\mod\languages\mod_spidermonkey\mod_spidermonkey_teletone.2010.vcxproj">
|
||||
<Name>mod_spidermonkey_teletone</Name>
|
||||
<Project>{8f992c49-6c51-412f-b2a3-34eab708eb65}</Project>
|
||||
<Private>True</Private>
|
||||
<DoNotHarvest>
|
||||
</DoNotHarvest>
|
||||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||
<RefTargetDir>MODLOCATION</RefTargetDir>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\mod\loggers\mod_console\mod_console.2010.vcxproj">
|
||||
<Name>mod_console</Name>
|
||||
<Project>{1c453396-d912-4213-89fd-9b489162b7b5}</Project>
|
||||
|
|
Loading…
Reference in New Issue