conf included

This commit is contained in:
boyska 2022-02-19 17:01:13 +01:00
parent 88ab4af511
commit 8afe654faf
6 changed files with 2592 additions and 0 deletions

View file

@ -0,0 +1,476 @@
[general]
; The general section of this config
; is not currently used, but reserved
; for future use.
;
; --- Default Information ---
; The default_user and default_bridge sections are applied
; automatically to all ConfBridge instances invoked without
; a user, or bridge argument. No menu is applied by default.
;
; Note that while properties of the default_user or default_bridge
; profile can be overridden, if removed, they will be automatically
; added and made available to the dialplan upon module load.
;
; --- ConfBridge User Profile Options ---
[default_user]
type=user
;admin=yes ; Sets if the user is an admin or not. Off by default.
;send_events=no ; If events are enabled for this bridge and this option is
; set, users will receive events like join, leave, talking,
; etc. via text messages. For users accessing the bridge
; via chan_pjsip, this means in-dialog MESSAGE messages.
; This is most useful for WebRTC participants where the
; browser application can use the messages to alter the user
; interface.
;echo_events=yes ; If events are enabled for this user and this option is set,
; the user will receive events they trigger, talking, mute, etc.
; If not set, they will not receive their own events.
;marked=yes ; Sets if this is a marked user or not. Off by default.
;startmuted=yes; Sets if all users should start out muted. Off by default
;music_on_hold_when_empty=yes ; Sets whether MOH should be played when only
; one person is in the conference or when the
; the user is waiting on a marked user to enter
; the conference. Off by default.
;music_on_hold_class=default ; The MOH class to use for this user.
quiet=no ; When enabled enter/leave prompts and user intros are not played.
; There are some prompts, such as the prompt to enter a PIN number,
; that must be played regardless of what this option is set to.
; Off by default
;announce_user_count=yes ; Sets if the number of users should be announced to the
; caller. Off by default.
;announce_user_count_all=yes ; Sets if the number of users should be announced to
; all the other users in the conference when someone joins.
; This option can be either set to 'yes' or a number.
; When set to a number, the announcement will only occur
; once the user count is above the specified number.
;announce_only_user=yes ; Sets if the only user announcement should be played
; when a channel enters a empty conference. On by default.
;wait_marked=yes ; Sets if the user must wait for a marked user to enter before
; joining the conference. Off by default.
;end_marked=yes ; This option will kick every user with this option set in their
; user profile after the last Marked user exists the conference.
;dsp_drop_silence=yes ; This option drops what Asterisk detects as silence from
; entering into the bridge. Enabling this option will drastically
; improve performance and help remove the buildup of background
; noise from the conference. Highly recommended for large conferences
; due to its performance enhancements.
;dsp_talking_threshold=128 ; Average magnitude threshold to determine talking.
;
; The minimum average magnitude per sample in a frame for the
; DSP to consider talking/noise present. A value below this
; level is considered silence. This value affects several
; operations and should not be changed unless the impact on
; call quality is fully understood.
;
; What this value affects internally:
;
; 1. Audio is only mixed out of a user's incoming audio
; stream if talking is detected. If this value is set too
; high the user will hear himself talking.
;
; 2. When talk detection AMI events are enabled, this value
; determines when talking has begun which results in an
; AMI event to fire. If this value is set too low AMI
; events may be falsely triggered by variants in room
; noise.
;
; 3. The 'drop_silence' option depends on this value to
; determine when the user's audio should be mixed into the
; bridge after periods of silence. If this value is too
; high the user's speech will get discarded as they will
; be considered silent.
;
; Valid values are 1 through 2^15.
; By default this value is 160.
;dsp_silence_threshold=2000 ; The number of milliseconds of silence necessary to declare
; talking stopped.
;
; The time in milliseconds of sound falling below the
; 'dsp_talking_threshold' option when a user is considered to
; stop talking. This value affects several operations and
; should not be changed unless the impact on call quality is
; fully understood.
;
; What this value affects internally:
;
; 1. When talk detection AMI events are enabled, this value
; determines when the user has stopped talking after a
; period of talking. If this value is set too low AMI
; events indicating the user has stopped talking may get
; falsely sent out when the user briefly pauses during mid
; sentence.
;
; 2. The 'drop_silence' option depends on this value to
; determine when the user's audio should begin to be
; dropped from the conference bridge after the user stops
; talking. If this value is set too low the user's audio
; stream may sound choppy to the other participants. This
; is caused by the user transitioning constantly from
; silence to talking during mid sentence.
;
; The best way to approach this option is to set it slightly
; above the maximum amount of milliseconds of silence a user
; may generate during natural speech.
;
; Valid values are 1 through 2^31.
; By default this value is 2500ms.
;talk_detection_events=yes ; This option sets whether or not notifications of when a user
; begins and ends talking should be sent out as events over AMI.
; By default this option is off.
;denoise=yes ; Sets whether or not a denoise filter should be applied
; to the audio before mixing or not. Off by default. Requires
; func_speex to be built and installed. Do not confuse this option
; with drop_silence. Denoise is useful if there is a lot of background
; noise for a user as it attempts to remove the noise while preserving
; the speech. This option does NOT remove silence from being mixed into
; the conference and does come at the cost of a slight performance hit.
;jitterbuffer=yes ; Enabling this option places a jitterbuffer on the user's audio stream
; before audio mixing is performed. This is highly recommended but will
; add a slight delay to the audio. This option is using the JITTERBUFFER
; dialplan function's default adaptive jitterbuffer. For a more fine tuned
; jitterbuffer, disable this option and use the JITTERBUFFER dialplan function
; on the user before entering the ConfBridge application.
;pin=1234 ; Sets if this user must enter a PIN number before entering
; the conference. The PIN will be prompted for.
;announce_join_leave=yes ; When enabled, this option will prompt the user for a
; name when entering the conference. After the name is
; recorded, it will be played as the user enters and exists
; the conference. This option is off by default.
;announce_join_leave_review=yes ; When enabled, implies announce_join_leave, but the user
; will be prompted to review their recording before
; entering the conference. During this phase, the recording
; may be listened to, re-recorded, or accepted as is. This
; option is off by default.
;dtmf_passthrough=yes ; Sets whether or not DTMF should pass through the conference.
; This option is off by default.
;announcement=</path/to/file> ; Play a sound file to the user when they join the conference.
;timeout=3600 ; When set non-zero, this specifies the number of seconds that the participant
; may stay in the conference before being automatically ejected. When the user
; is ejected from the conference, the user's channel will have the CONFBRIDGE_RESULT
; variable set to "TIMEOUT". A value of 0 indicates that there is no timeout.
; Default: 0
;text_messaging=yes ; When set to yes text messages will be sent to this user. Text messages
; may occur as a result of events or can be received from other participants.
; When set to no text messages will not be sent to this user.
; --- ConfBridge Bridge Profile Options ---
[default_bridge]
type=bridge
;max_members=50 ; This option limits the number of participants for a single
; conference to a specific number. By default conferences
; have no participant limit. After the limit is reached, the
; conference will be locked until someone leaves. Note however
; that an Admin user will always be alowed to join the conference
; regardless if this limit is reached or not.
record_conference=no ; Records the conference call starting when the first user
;record_conference=yes ; Records the conference call starting when the first user
; enters the room, and ending when the last user exits the room.
; The default recorded filename is
; 'confbridge-<name of conference bridge>-<start time>.wav
; and the default format is 8khz slinear. This file will be
; located in the configured monitoring directory in asterisk.conf.
;record_file=</path/to/file> ; When record_conference is set to yes, the specific name of the
; record file can be set using this option. Note that since multiple
; conferences may use the same bridge profile, this may cause issues
; depending on the configuration. It is recommended to only use this
; option dynamically with the CONFBRIDGE() dialplan function. This
; allows the record name to be specified and a unique name to be chosen.
; By default, the record_file is stored in Asterisk's spool/monitor directory
; with a unique filename starting with the 'confbridge' prefix.
;record_file_append=yes ; Append record file when starting/stopping on same conference recording.
;record_file_timestamp=yes ; Append the start time to the record file name.
;record_options= ; Pass additional options to MixMonitor.
;record_command=</path/to/command> ; Command to execute when recording finishes.
;internal_sample_rate=auto ; Sets the internal native sample rate the
; conference is mixed at. This is set to automatically
; adjust the sample rate to the best quality by default.
; Other values can be anything from 8000-192000. If a
; sample rate is set that Asterisk does not support, the
; closest sample rate Asterisk does support to the one requested
; will be used.
;maximum_sample_rate=none ; Sets the maximum sample rate the conference
; is mixed at. This is set to no maximum by default.
; Values can be anything from 8000-192000.
;mixing_interval=40 ; Sets the internal mixing interval in milliseconds for the bridge. This
; number reflects how tight or loose the mixing will be for the conference.
; In order to improve performance a larger mixing interval such as 40ms may
; be chosen. Using a larger mixing interval comes at the cost of introducing
; larger amounts of delay into the bridge. Valid values here are 10, 20, 40,
; or 80. By default 20ms is used.
;video_mode = follow_talker; Sets how confbridge handles video distribution to the conference participants.
; Note that participants wanting to view and be the source of a video feed
; _MUST_ be sharing the same video codec. Also, using video in conjunction with
; with the jitterbuffer currently results in the audio being slightly out of sync
; with the video. This is a result of the jitterbuffer only working on the audio
; stream. It is recommended to disable the jitterbuffer when video is used.
;
; --- MODES ---
; none: No video sources are set by default in the conference. It is still
; possible for a user to be set as a video source via AMI or DTMF action
; at any time.
;
; follow_talker: The video feed will follow whoever is talking and providing video.
;
; last_marked: The last marked user to join the conference with video capabilities
; will be the single source of video distributed to all participants.
; If multiple marked users are capable of video, the last one to join
; is always the source, when that user leaves it goes to the one who
; joined before them.
;
; first_marked: The first marked user to join the conference with video capabilities
; is the single source of video distribution among all participants. If
; that user leaves, the marked user to join after them becomes the source.
;
; sfu: Selective Forwarding Unit - Sets multi-stream operation
; for a multi-party video conference.
language=it
;language=en ; Set the language used for announcements to the conference.
; Default is en (English).
;regcontext=conferences ; The name of the context into which to register conference names as extensions.
;video_update_discard=2000 ; Amount of time (in milliseconds) to discard video update requests after sending a video
; update request. Default is 2000. A video update request is a request for a full video
; intra-frame. Clients can request this if they require a full frame in order to decode
; the video stream. Since a full frame can be large limiting how often they occur can
; reduce bandwidth usage at the cost of increasing how long it may take a newly joined
; channel to receive the video stream.
;remb_send_interval=1000 ; Interval (in milliseconds) at which a combined REMB frame will be sent to sources of video.
; A REMB frame contains receiver estimated maximum bitrate information. By creating a combined
; frame and sending it to the sources of video the sender can be influenced on what bitrate
; they choose allowing a better experience for the receivers. This defaults to 0, or disabled.
;remb_behavior=average ; How the combined REMB report for an SFU video bridge is constructed. If set to "average" then
; the estimated maximum bitrate of each receiver is used to construct an average bitrate. If
; set to "lowest" the lowest maximum bitrate is forwarded to the sender. If set to "highest"
; the highest maximum bitrate is forwarded to the sender. If set to "average_all" a single average
; is generated from every receiver and the same value is sent to every sender. If set to
; "lowest_all" the lowest maximum bitrate of all receivers is sent to every sender. If set to
; "highest_all" the highest maximum bitrate of all receivers is sent to every sender.
; When set to "force", the value set in remb_estimated_bitrate is sent to every sender.
; This defaults to "average".
;remb_estimated_bitrate=0 ; When remb_behavior is set to 'force', this options sets the estimated bitrate
; (in bits per second) sent to each participant in REMB reports.
;enable_events=no ; If enabled, recipients who joined the bridge via a channel driver
; that supports Enhanced Messaging (currently only chan_pjsip) will
; receive in-dialog messages containing a JSON body describing the
; event. The Content-Type header will be
; "text/x-ast-confbridge-event".
; This feature must also be enabled in user profiles.
; All sounds in the conference are customizable using the bridge profile options below.
; Simply state the option followed by the filename or full path of the filename after
; the option. Example: sound_had_joined=conf-hasjoin This will play the conf-hasjoin
; sound file found in the sounds directory when announcing someone's name is joining the
; conference.
;sound_join ; The sound played to everyone when someone enters the conference.
;sound_leave ; The sound played to everyone when someone leaves the conference.
;sound_has_joined ; The sound played before announcing someone's name has
; joined the conference. This is used for user intros.
; Example "_____ has joined the conference"
;sound_has_left ; The sound played when announcing someone's name has
; left the conference. This is used for user intros.
; Example "_____ has left the conference"
;sound_kicked ; The sound played to a user who has been kicked from the conference.
;sound_muted ; The sound played when the mute option is toggled on using DTMF menu.
;sound_unmuted ; The sound played when the mute option is toggled off using DTMF menu.
;sound_only_person ; The sound played when the user is the only person in the conference.
;sound_only_one ; The sound played to a user when there is only one other
; person is in the conference.
;sound_there_are ; The sound played when announcing how many users there
; are in a conference.
;sound_other_in_party; ; This file is used in conjunction with 'sound_there_are"
; when announcing how many users there are in the conference.
; The sounds are stringed together like this.
; "sound_there_are" <number of participants> "sound_other_in_party"
;sound_place_into_conference ; The sound played when someone is placed into the conference
; after waiting for a marked user. This sound is now deprecated
; since it was only ever used improperly and correcting that bug
; made it completely unused.
;sound_wait_for_leader ; The sound played when a user is placed into a conference that
; can not start until a marked user enters.
;sound_leader_has_left ; The sound played when the last marked user leaves the conference.
;sound_get_pin ; The sound played when prompting for a conference pin number.
;sound_invalid_pin ; The sound played when an invalid pin is entered too many times.
;sound_locked ; The sound played to a user trying to join a locked conference.
;sound_locked_now ; The sound played to an admin after toggling the conference to locked mode.
;sound_unlocked_now; The sound played to an admin after toggling the conference to unlocked mode.
;sound_error_menu ; The sound played when an invalid menu option is entered.
;sound_begin ; The sound played to the conference when the first marked user enters the conference.
;sound_binaural_on ; The sound played when binaural audio is turned on
;sound_binaural_off ; The sound played when binaural audio is turned off
; --- ConfBridge Menu Options ---
; The ConfBridge application also has the ability to
; apply custom DTMF menus to each channel using the
; application. Like the User and Bridge profiles
; a menu is passed in to ConfBridge as an argument in
; the dialplan.
;
; Below is a list of menu actions that can be assigned
; to a DTMF sequence.
;
; To have the first DTMF digit in a sequence be the '#' character, you need to
; escape it. If it is not escaped then normal config file processing will
; think it is a directive like #include. For example:
; \#1=toggle_mute ; Pressing #1 will toggle the mute setting.
;
; A single DTMF sequence can have multiple actions associated with it. This is
; accomplished by stringing the actions together and using a ',' as the delimiter.
; Example: Both listening and talking volume is reset when '5' is pressed.
; 5=reset_talking_volume, reset_listening_volume
;
; playback(<name of audio file>&<name of audio file>)
; Playback will play back an audio file to a channel
; and then immediately return to the conference.
; This file can not be interupted by DTMF.
; Mutliple files can be chained together using the
; '&' character.
; playback_and_continue(<name of playback prompt>&<name of playback prompt>)
; playback_and_continue will
; play back a prompt while continuing to
; collect the dtmf sequence. This is useful
; when using a menu prompt that describes all
; the menu options. Note however that any DTMF
; during this action will terminate the prompts
; playback. Prompt files can be chained together
; using the '&' character as a delimiter.
; toggle_mute ; Toggle turning on and off mute. Mute will make the user silent
; to everyone else, but the user will still be able to listen in.
; toggle_binaural ; Toggle on or off binaural audio processing.
; no_op ; This action does nothing (No Operation). Its only real purpose exists for
; being able to reserve a sequence in the config as a menu exit sequence.
; decrease_listening_volume ; Decreases the channel's listening volume.
; increase_listening_volume ; Increases the channel's listening volume.
; reset_listening_volume ; Reset channel's listening volume to default level.
; decrease_talking_volume ; Decreases the channel's talking volume.
; increase_talking_volume ; Icreases the channel's talking volume.
; reset_talking_volume ; Reset channel's talking volume to default level.
;
; dialplan_exec(context,exten,priority) ; The dialplan_exec action allows a user
; to escape from the conference and execute
; commands in the dialplan. Once the dialplan
; exits the user will be put back into the
; conference. The possibilities are endless!
; leave_conference ; This action allows a user to exit the conference and continue
; execution in the dialplan.
;
; admin_kick_last ; This action allows an Admin to kick the last participant from the
; conference. This action will only work for admins which allows
; a single menu to be used for both users and admins.
;
; admin_toggle_conference_lock ; This action allows an Admin to toggle locking and
; unlocking the conference. Non admins can not use
; this action even if it is in their menu.
; set_as_single_video_src ; This action allows any user to set themselves as the
; single video source distributed to all participants.
; This will make the video feed stick to them regardless
; of what the video_mode is set to.
; release_as_single_video_src ; This action allows a user to release themselves as
; the video source. If video_mode is not set to "none"
; this action will result in the conference returning to
; whatever video mode the bridge profile is using.
;
; Note that this action will have no effect if the user
; is not currently the video source. Also, the user is
; not guaranteed by using this action that they will not
; become the video source again. The bridge will return
; to whatever operation the video_mode option is set to
; upon release of the video src.
; admin_toggle_mute_participants ; This action allows an administrator to toggle the mute
; state for all non-admins within a conference.
; Subsequent non-admins joining a muted conference will
; start muted. All admin users are unaffected by this
; option. Note that all users, regardless of their admin
; status, are notified that the conference is muted when
; the state is toggled.
; participant_count ; This action plays back the number of participants currently
; in a conference
[sample_user_menu]
type=menu
*=playback_and_continue(conf-usermenu)
*1=toggle_mute
1=toggle_mute
*4=decrease_listening_volume
4=decrease_listening_volume
*6=increase_listening_volume
6=increase_listening_volume
*7=decrease_talking_volume
7=decrease_talking_volume
*8=leave_conference
8=leave_conference
*9=increase_talking_volume
9=increase_talking_volume
[sample_admin_menu]
type=menu
*=playback_and_continue(conf-adminmenu)
*1=toggle_mute
1=toggle_mute
*2=admin_toggle_conference_lock ; only applied to admin users
2=admin_toggle_conference_lock ; only applied to admin users
*3=admin_kick_last ; only applied to admin users
3=admin_kick_last ; only applied to admin users
*4=decrease_listening_volume
4=decrease_listening_volume
*6=increase_listening_volume
6=increase_listening_volume
*7=decrease_talking_volume
7=decrease_talking_volume
*8=no_op
8=no_op
*9=increase_talking_volume
9=increase_talking_volume
; Questa stanza e' quella di "in onda"
[mixer]
type=bridge
max_members=3
record_conference=no
; Queste sono le stanze private di ogni telefono della regia
[regia]
type=bridge
record_conference=no
[esterno]
type=user
[mixer]
type=user
music_on_hold_when_empty=no
[regia]
type=user
music_on_hold_when_empty=yes
marked=yes
quiet=yes

View file

@ -0,0 +1,370 @@
SIP = "PJSIP/"
CONSOLE = "Console/dsp" -- Console interface for demo
--CONSOLE = "DAHDI/1"
--CONSOLE = "Phone/phone0"
IAXINFO = "guest" -- IAXtel username/password
--IAXINFO = "myuser:mypass"
TRUNK = "DAHDI/G2"
TRUNKMSD = 1
-- TRUNK = "IAX2/user:pass@provider"
--
-- Extensions are expected to be defined in a global table named 'extensions'.
-- The 'extensions' table should have a group of tables in it, each
-- representing a context. Extensions are defined in each context. See below
-- for examples.
--
-- Extension names may be numbers, letters, or combinations thereof. If
-- an extension name is prefixed by a '_' character, it is interpreted as
-- a pattern rather than a literal. In patterns, some characters have
-- special meanings:
--
-- X - any digit from 0-9
-- Z - any digit from 1-9
-- N - any digit from 2-9
-- [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
-- . - wildcard, matches anything remaining (e.g. _9011. matches
-- anything starting with 9011 excluding 9011 itself)
-- ! - wildcard, causes the matching process to complete as soon as
-- it can unambiguously determine that no other matches are possible
--
-- For example the extension _NXXXXXX would match normal 7 digit
-- dialings, while _1NXXNXXXXXX would represent an area code plus phone
-- number preceded by a one.
--
-- If your extension has special characters in it such as '.' and '!' you must
-- explicitly make it a string in the tabale definition:
--
-- ["_special."] = function;
-- ["_special!"] = function;
--
-- There are no priorities. All extensions to asterisk appear to have a single
-- priority as if they consist of a single priority.
--
-- Each context is defined as a table in the extensions table. The
-- context names should be strings.
--
-- One context may be included in another context using the 'includes'
-- extension. This extension should be set to a table containing a list
-- of context names. Do not put references to tables in the includes
-- table.
--
-- include = {"a", "b", "c"};
--
-- Channel variables can be accessed thorugh the global 'channel' table.
--
-- v = channel.var_name
-- v = channel["var_name"]
-- v.value
-- v:get()
--
-- channel.var_name = "value"
-- channel["var_name"] = "value"
-- v:set("value")
--
-- channel.func_name(1,2,3):set("value")
-- value = channel.func_name(1,2,3):get()
--
-- channel["func_name(1,2,3)"]:set("value")
-- channel["func_name(1,2,3)"] = "value"
-- value = channel["func_name(1,2,3)"]:get()
--
-- Note the use of the ':' operator to access the get() and set()
-- methods.
--
-- Also notice the absence of the following constructs from the examples above:
-- channel.func_name(1,2,3) = "value" -- this will NOT work
-- value = channel.func_name(1,2,3) -- this will NOT work as expected
--
--
-- Dialplan applications can be accessed through the global 'app' table.
--
-- app.Dial("DAHDI/1")
-- app.dial("DAHDI/1")
-- app["dial"]("DAHDI/1")
--
-- More examples can be found below.
--
-- An autoservice is automatically run while lua code is executing. The
-- autoservice can be stopped and restarted using the autoservice_stop() and
-- autoservice_start() functions. The autservice should be running before
-- starting long running operations. The autoservice will automatically be
-- stopped before executing applications and dialplan functions and will be
-- restarted afterwards. The autoservice_status() function can be used to
-- check the current status of the autoservice and will return true if an
-- autoservice is currently running.
--
-- Note about naming conflicts:
-- Lua allows you to refer to table entries using the '.' notation,
-- I.E. app.goto(something), only if the entry doesn't conflict with an Lua
-- reserved word. In the 'goto' example, with Lua 5.1 or earlier, 'goto' is
-- not a reserved word so you'd be calling the Asterisk dialplan application
-- 'goto'. Lua 5.2 however, introduced the 'goto' control statement which
-- makes 'goto' a reserved word. This casues the interpreter to fail parsing
-- the file and pbx_lua.so will fail to load. The same applies to any use of
-- Lua tables including extensions, channels and any tables you create.
--
-- There are two ways around this: Since Lua is case-sensitive, you can use
-- capitalized names, I.E. app.Goto(something) to refer to the Asterisk apps,
-- functions, etc. Or you can use the full syntax, I.E. app["goto"](something).
-- Both syntaxes are backwards compatible with earlier Lua versions. To make
-- your Lua dialplans easier to maintain and to reduce the chance of future
-- conflicts you may want to use the app["goto"](something) syntax for all
-- table accesses.
--
function outgoing_local(c, e)
app.dial("DAHDI/1/" .. e, "", "")
end
function demo_instruct()
app.background("demo-instruct")
app.waitexten()
end
function demo_congrats()
app.background("demo-congrats")
demo_instruct()
end
-- Answer the chanel and play the demo sound files
function demo_start(context, exten)
app.wait(1)
app.answer()
channel.TIMEOUT("digit"):set(5)
channel.TIMEOUT("response"):set(10)
-- app.set("TIMEOUT(digit)=5")
-- app.set("TIMEOUT(response)=10")
demo_congrats(context, exten)
end
function demo_hangup()
app.playback("demo-thanks")
app.hangup()
end
extensions = {
demo = {
s = demo_start;
["2"] = function()
app.background("demo-moreinfo")
demo_instruct()
end;
["3"] = function ()
channel.LANGUAGE():set("fr") -- set the language to french
demo_congrats()
end;
["1000"] = function()
-- See the naming conflict note above.
app['goto']("default", "s", 1)
end;
["1234"] = function()
app.playback("transfer", "skip")
-- do a dial here
end;
["1235"] = function()
app.voicemail("1234", "u")
end;
["1236"] = function()
app.dial("Console/dsp")
app.voicemail(1234, "b")
end;
["#"] = demo_hangup;
t = demo_hangup;
i = function()
app.playback("invalid")
demo_instruct()
end;
["500"] = function()
app.playback("demo-abouttotry")
app.dial("IAX2/guest@misery.digium.com/s@default")
app.playback("demo-nogo")
demo_instruct()
end;
["600"] = function()
app.playback("demo-echotest")
app.echo()
app.playback("demo-echodone")
demo_instruct()
end;
["8500"] = function()
app.voicemailmain()
demo_instruct()
end;
};
tointerni = {};
debug = {};
testing = {};
-- ci sono 4 classi di utenti fondamentali:
-- - mixer (aka il tel invisibile)
-- - regia (2 tel, il mixer non conta come regia)
-- - interni (altri interni)
-- - ext (esterno)
["from-mixer"] = {};
["from-interni"] = { include = {"tointerni", "debug"}; };
["from-regia"] = { include= {"from-interni", "testing"}; };
["from-ext"] = {};
-- nessun utente "parte" da private, lo si puo' usare solo quando si fanno megahack
["private"] = {};
default = {
-- by default, do the demo
include = {"demo"};
};
public = {
-- ATTENTION: If your Asterisk is connected to the internet and you do
-- not have allowguest=no in sip.conf, everybody out there may use your
-- public context without authentication. In that case you want to
-- double check which services you offer to the world.
--
include = {"demo"};
};
["local"] = {
["_NXXXXXX"] = outgoing_local;
};
}
-- XXX: rimettici il 402, l'ho tolto per fare delle prove; e poi rimettilo come from-regia, non come from-ext
INTERNI = {401,403,404,405,406};
EXT = {020202, 402};
-- gli interni si possono chiamare fra loro
for _, num in ipairs(INTERNI) do
extensions["from-interni"][num] = function()
app.set("__DYNAMIC_FEATURES=mandainondaChiamante")
app.dial(SIP .. num)
end
end
--[[ for _, num in ipairs(EXT) do
extensions["from-interni"][x] = function()
app.set("__DYNAMIC_FEATURES=mandainonda")
app.dial(SIP .. num)
end
end ]]--
-- con il prefisso 0, gli interni possono chiamare qualsiasi cosa
extensions["from-regia"]["_0."] = function(c, ext)
app.noop(ext)
trunks = { "fastweb/", "vodafone/" };
if ext:sub(1,1) == "0" then
num = ext:sub(2) -- butta via lo 0 iniziale
-- XXX: in realta' questo dovra' passare per i trunk, rimuovere prima o poi
trunks = { "" };
else
num = ext:sub(3) -- butta via l'*1 o *2
trunks = { trunks[tonumber(ext:sub(2,2))] };
end
to_dial = ""
for i, trunk in ipairs(trunks) do
if i > 1 then
to_dial = to_dial .. "&"
end
to_dial = to_dial .. SIP .. trunk .. num
end
-- qui NON ci va il doppio underscore: solo chi chiama puo' usare questa feature
app.set("DYNAMIC_FEATURES=mandainondaChiamante")
app.dial(to_dial)
end
extensions["from-regia"]["_1[12]."] = extensions["from-regia"]["_0."]
-- gli esterni possono chiamare, e squilla in tutti i telefoni
extensions["from-ext"]["_."] = function()
to_dial = ""
for _, num in ipairs(INTERNI) do
if #to_dial > 0 then
to_dial = to_dial .. "&"
end
to_dial = to_dial .. SIP .. num
end
app.set("__DYNAMIC_FEATURES=mandainondaRicevente")
app.dial(to_dial)
end
extensions["debug"][9000] = function ()
app.answer()
-- TODO: fagli spiegare cosa sta leggendo
for num, func in pairs(extensions["debug"]) do
app.saydigits(num)
-- TODO: fagli dire cosa fa
app.wait(2)
end
app.hangup()
end
extensions["debug"][9440] = function()
app.answer()
for i = 1,20 do
app.playtones("440/4000")
app.wait(4)
end
app.hangup()
end
extensions["debug"][9880] = function()
app.answer()
for i = 1,20 do
app.playtones("880/4000")
app.wait(4)
end
app.hangup()
end
extensions["private"][9438] = function()
app.answer()
for i = 1,20 do
app.playtones("438/4000")
app.wait(4)
end
app.hangup()
end
-- questa e' la stanza in cui 401 incontra i suoi interlocutori
extensions["private"][9401] = function()
app.answer()
app.confbridge("401", "regia", "regia")
app.hangup()
end
-- questa e' la stanza in cui 401 sente la musica a loop mentre aspetta
extensions["private"][94011] = function()
app.answer()
app.musiconhold("default")
app.hangup()
end
extensions["from-regia"][94011] = function()
app.answer()
app.musiconhold("default")
app.hangup()
end
-- se inizia con 99, vuol dire che fa dial del numero di debug tramite Local/
extensions["debug"][99440] = function()
app.set("__DYNAMIC_FEATURES=mandainonda")
app.dial("Local/9440@from-regia/n")
end
extensions["testing"][9009] = function()
app.agi("agi:async")
end
hints = {
demo = { };
default = { };
}

View file

@ -0,0 +1,127 @@
;
; Sample Call Features (transfer, monitor/mixmonitor, etc) configuration
;
; Note: From Asterisk 12 - All parking lot configuration is now done in res_parking.conf
[general]
;transferdigittimeout => 3 ; Number of seconds to wait between digits when transferring a call
; (default is 3 seconds)
;xfersound = beep ; to indicate an attended transfer is complete
;xferfailsound = beeperr ; to indicate a failed transfer
;pickupexten = *8 ; Configure the pickup extension. (default is *8)
;pickupsound = beep ; to indicate a successful pickup (default: no sound)
;pickupfailsound = beeperr ; to indicate that the pickup failed (default: no sound)
;featuredigittimeout = 1000 ; Max time (ms) between digits for
; feature activation (default is 1000 ms)
;recordingfailsound = beeperr ; indicates that a one-touch monitor or one-touch mixmonitor feature failed
; to be applied to the call. (default: no sound)
;atxfernoanswertimeout = 15 ; Timeout for answer on attended transfer default is 15 seconds.
;atxferdropcall = no ; If someone does an attended transfer, then hangs up before the transfer
; target answers, then by default, the system will try to call back the
; person that did the transfer. If this is set to "yes", the ringing
; transfer target is immediately transferred to the transferee.
;atxferloopdelay = 10 ; Number of seconds to sleep between retries (if atxferdropcall = no)
;atxfercallbackretries = 2 ; Number of times to attempt to send the call back to the transferer.
; By default, this is 2.
;transferdialattempts = 3 ; Number of times that a transferer may attempt to dial an extension before
; being kicked back to the original call.
;transferretrysound = beep ; Sound to play when a transferer fails to dial a valid extension.
;transferinvalidsound = beeperr ; Sound to play when a transferer fails to dial a valid extension and is out of retries.
;atxferabort = *1 ; cancel the attended transfer
;atxfercomplete = *2 ; complete the attended transfer, dropping out of the call
;atxferthreeway = *3 ; complete the attended transfer, but stay in the call. This will turn the call into a multi-party bridge
;atxferswap = *4 ; swap to the other party. Once an attended transfer has begun, this options may be used multiple times
; Note that the DTMF features listed below only work when two channels have answered and are bridged together.
; They can not be used while the remote party is ringing or in progress. If you require this feature you can use
; chan_local in combination with Answer to accomplish it.
[featuremap]
;blindxfer => #1 ; Blind transfer (default is #) -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
;disconnect => *0 ; Disconnect (default is *) -- Make sure to set the H and/or h option in the Dial() or Queue() app call!
;automon => *1 ; One Touch Record a.k.a. Touch Monitor -- Make sure to set the W and/or w option in the Dial() or Queue() app call!
;atxfer => *2 ; Attended transfer -- Make sure to set the T and/or t option in the Dial() or Queue() app call!
;parkcall => #72 ; Park call (one step parking) -- Make sure to set the K and/or k option in the Dial() app call!
;automixmon => *3 ; One Touch Record a.k.a. Touch MixMonitor -- Make sure to set the X and/or x option in the Dial() or Queue() app call!
[applicationmap]
; Note that the DYNAMIC_FEATURES channel variable must be set to use the features
; defined here. The value of DYNAMIC_FEATURES should be the names of the features
; to allow the channel to use separated by '#'. For example:
;
; Set(__DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
;
; (Note: The two leading underscores allow these feature settings to be set
; on the outbound channels, as well. Otherwise, only the original channel
; will have access to these features.)
;
; The syntax for declaring a dynamic feature is any of the following:
;
;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>[,<AppArguments>[,MOH_Class]]
;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>[,"<AppArguments>"[,MOH_Class]]
;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>([<AppArguments>])[,MOH_Class]
;
; FeatureName -> This is the name of the feature used when setting the
; DYNAMIC_FEATURES variable to enable usage of this feature.
; DTMF_sequence -> This is the key sequence used to activate this feature.
; ActivateOn -> This is the channel of the call that the application will be executed
; on. Valid values are "self" and "peer". "self" means run the
; application on the same channel that activated the feature. "peer"
; means run the application on the opposite channel from the one that
; has activated the feature.
; ActivatedBy -> ActivatedBy is no longer honored. The feature is activated by which
; channel DYNAMIC_FEATURES includes the feature is on. Use a pre-dial
; handler to set different values for DYNAMIC_FEATURES on the channels.
; Historic values are: "caller", "callee", and "both".
; Application -> This is the application to execute.
; AppArguments -> These are the arguments to be passed into the application. If you need
; commas in your arguments, you should use either the second or third
; syntax, above.
; MOH_Class -> This is the music on hold class to play while the idle
; channel waits for the feature to complete. If left blank,
; no music will be played.
;
;
; IMPORTANT NOTE: The applicationmap is not intended to be used for all Asterisk
; applications. When applications are used in extensions.conf, they are executed
; by the PBX core. In this case, these applications are executed outside of the
; PBX core, so it does *not* make sense to use any application which has any
; concept of dialplan flow. Examples of this would be things like Goto,
; Background, WaitExten, and many more. The exceptions to this are Gosub and
; Macro routines which must complete for the call to continue.
;
; Enabling these features means that the PBX needs to stay in the media flow and
; media will not be re-directed if DTMF is sent in the media stream.
;
; Example Usage:
;
;testfeature => #9,peer,Playback,tt-monkeys ;Allow both the caller and callee to play
; ;tt-monkeys to the opposite channel
; mandainonda => #9,self,AGI(agi:async),tt-monkeys
mandainondaChiamante => #9,self,AGI(agi:async,mandainondaChiamante),
mandainondaRicevente => #9,self,AGI(agi:async,mandainondaRicevente),
; mandainonda => *5,self,Playback(hello-world),default
; Set arbitrary channel variables, based upon CALLERID number (Note that the application
; argument contains commas)
;retrieveinfo => #8,peer,Set(ARRAY(CDR(mark),CDR(name))=${ODBC_FOO(${CALLERID(num)})})
;
;pauseMonitor => #1,self/callee,Pausemonitor ;Allow the callee to pause monitoring
; ;on their channel
;unpauseMonitor => #3,self/callee,UnPauseMonitor ;Allow the callee to unpause monitoring
; ;on their channel
; Dynamic Feature Groups:
; Dynamic feature groups are groupings of features defined in [applicationmap]
; that can have their own custom key mappings. To give a channel access to a dynamic
; feature group, add the group name to the value of the DYNAMIC_FEATURES variable.
;
; example:
; [myGroupName] ; defines the group named myGroupName
; testfeature => #9 ; associates testfeature with the group and the keycode '#9'.
; pauseMonitor => ; associates pauseMonitor with the group and uses the keycode specified
; ; in the [applicationmap].

View file

@ -0,0 +1,77 @@
;
; Asterisk configuration file
;
; Module Loader configuration file
;
[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; If you want, load the GTK console right away.
; Don't load the KDE console since
; it's not as sophisticated right now.
;
noload => chan_sip.so
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
;
; Intercom application is obsoleted by
; chan_oss. Don't load it.
;
noload => app_intercom.so
;
; The 'modem' channel driver and its subdrivers are
; obsolete, don't load them.
;
noload => chan_modem.so
noload => chan_modem_aopen.so
noload => chan_modem_bestdata.so
noload => chan_modem_i4l.so
;
; Comment this out (after installing CAPI middleware and hardware
; drivers) if you have CAPI-able hardware and wish to use it in
; Asterisk.
;
noload => chan_capi.so
;
load => res_musiconhold.so
;
; Do not load load local channel drivers (using the system speaker) by default,
; they are not used in most installations and might block the sound hardware
;
noload => chan_alsa.so
noload => chan_console.so
noload => chan_oss.so
;
; Disable CDR logging to SQLite by default since it writes unconditionally to
; cdr.db without a way to rotate it.
;
noload => cdr_sqlite.so
;
; These conflict with app_directory.so and each other.
noload => app_directory_odbc.so
;
; Enable these if you want to configure Asterisk in a database
;
noload => res_config_odbc.so
noload => res_config_pgsql.so
noload => res_config_ldap.so
noload => chan_mgcp.so
;
; Module names listed in "global" section will have symbols globally
; exported to modules loaded after them.
;
[global]

File diff suppressed because it is too large Load diff