Stay listening

  1. 13 years ago

    Dear Nicolas,

    We were wondering if there is a feature to remain listening to one extension? So you don't need to press listen button again each time the target extensions terminate a call. Please let us know, thank you. :lol:

    Warmest regards,
    Dan

  2. admin

    5 Oct 2011 Administrator

    Try setting in fop2.cfg

    persistent_spy=1

    I think that feature was added in version 2.21

    Best regards,

  3. 12 years ago

    Hi, i have an issue, that when i uncomment "persistent_spy=1" and save the configuration in fop2.cfg i don't get what i want, i mean when the chan spy session finishes a call, it hangs up ! :cry:
    I tried "service fop2 reload" and "service fop2 restart" but it doesn't work :? , what could i do to fix that ?
    then i have in /usr/local/fop2/ two files : "fop2.cfg" and "fop2.cfg~" which one should i modify ?
    Best regards.

  4. admin

    23 Mar 2012 Administrator

    persisten_spy=1 should work fine, the file to modify is fop2.cfg. You must restart or reload fop2 after the change with the command

    service fop2 reload

    You also might want to modify the spy_options to be only "q"

  5. Hi again, i tried what you said, i reloaded te config, i did restart fop2, and i did even reboot the server, but it still not working.
    thats he content of my fop2.cfg file :
    ######################################################################################

    [general]
    ; AMI definitions
    manager_host=localhost
    manager_port=5038
    manager_user=admin
    manager_secret=amp111
    ;event_mask=agent,call,command,system,user,dialplan

    ; Daemon definitios
    ;listen_port = 4445
    ;restrict_host = http://www.asternic.org
    ;web_dir = /var/www/html/operator/fop2

    ; Global Config
    poll_interval = 86400
    poll_voicemail = 1
    monitor_ipaddress = 1

    ; Force blind transfer on asterisk 1.6
    blind_transfer = 1

    ; Force supervised transfer on asterisk 1.4
    ; requires the atxfer manager backport patch
    supervised_transfer = 1

    ; Force delimiter for asterisk applications
    ; force_parameter_delimiter = ","

    ; When adding or removing members to a queue, fop2 will default to
    ; AddQueueMember/RemoveQueueMember commands. If you set use_agentlogin
    ; to 1, together with the QueueChannel in a button definition set to
    ; an Agent number it will use AgentCallbackLogin and Agentlogoff instead.
    ;
    ; use_agentlogin = 0

    ; Master Password that overrides any individual one
    ;master_key = 5678

    ; Options to send to chan_spy when doing a Listen action
    ; This global setting is overriden by the individual button
    ; spyoptions directive if set (in the button config).
    ; Asterisk 1.6.1 or higher has the option "d" that lets you
    ; switch spying modes using the keypad:
    ;4 = spy mode
    ;5 = whisper mode
    ;6 = barge mode
    spy_options="q"

    ; Options to send to chan_spy when doing a Whisper action
    ; In Asterisk 1.6.1 or higher you can use B to enable barge (speak
    ; to both channels on a call).
    whisper_options = "w"

    ; When you spy to an ongoing call, your spy session will end as
    ; soon as the conversation you are listening to finishes. If you
    ; rather keep the chan spy session open after the call end, uncomment
    ; the following line.
    persistent_spy=1

    ; Filename to use when start monitoring, you can use ${UNIQUEID},
    ; ${ORIG_EXTENSION}, ${DEST_EXTENSION}
    ; and date formats %Y %m %d to construct the filename.
    ;
    ; Settings for modifying the recording filename
    ; Available variables are:
    ; ${UNIQUEID} = Unique Id of the call
    ; ${TIMESTAMP} = Unix Timestamp when the recording was initiated
    ; ${CLIDNUM} = Callerid or Dialed number for the active call
    ; ${CLIDNAME} = Callerid name for the active call
    ; ${DEST_EXTENSION} = Target extenstion being monitored
    ; ${ORIG_EXTENSION} = Extension/User that started the recording (not
    ; the other leg)
    ; ${MBOX} = Mailbox of the extension/user that startend the
    ; recording
    ;
    ; Date variables:
    ; %Y 4 digits year
    ; %y 2 digits year
    ; %m 2 digits month
    ; %d 2 digits day
    ; %h 2 digits hour
    ; %i 2 digits minute
    ; %s 2 digits seconds

    ; For elastix Monitoring Tab:
    ; monitor_filename=g${DEST_EXTENSION}-${UNIQUEID}

    ; For fop2 recording interface
    monitor_filename=/var/spool/asterisk/monitor/${ORIG_EXTENSION}_${DEST_EXTENSION}_%h%i%s_${UNIQUEID}
    monitor_format=wav
    monitor_mix=true

    ; To enable the recording interface you must uncomment the following
    ; line, but also you might need to modify the script a little bit
    ; depending on the sox version you have installed.
    ;
    monitor_exec=/usr/local/fop2/recording_fop2.pl

    ; You could specify your own script to be executed when the recording
    ; is finished. It will receive 3 parameters, the complete
    ; path and filename of the IN leg, the OUT leg and the final
    ; recording NAME. You should run soxmix in your script to join
    ; the recordings into one file.
    ;
    monitor_exec=/var/lib/asterisk/bin/postrecording-script.sh

    ; FOP2 can fire notifications/popups when an extension or queue
    ; member receives a call. The default behaviour is to show a
    ; notification on state RINGING (notify_on_ringing=1).
    ;
    ; To customize notifications, you must uncomment the custom_popup
    ; function in checkdir.php you can replace that notification with
    ; a custom popup function to integrate with other web applications.
    ;
    ; For call centers you might need to perform a popup not on the
    ; RINGING state but when the call is CONNECTED to an agent. If you
    ; set in the queue configuration in queues.conf the option
    ; eventwhencalled=yes and then set here notify_on_connect=1,
    ; fop2 will send notifications on queue connected calls
    ; during AGENTCONNECT events. This will only work for inbound calls
    ; from a queue.
    ;
    notify_on_ringing = 1
    notify_on_connect = 1

    ; Call pickup uses the pickupmark variable by default. In multi tenant
    ; systems this might lead to problems as you might end un picking up
    ; some other tenant call. In that case you might want to try to
    ; pickup the call by its context uncomenting the following line:
    ;
    ; no_pickupmark=1

    ; Path to your voicemail directory
    ; For voicemail to work the fop2 server must run on the same server
    ; as asterisk, or your voicemail directory must be network mounted
    voicemail_path=/var/spool/asterisk/voicemail

    ; By default IM chats are not logged/saved. If you uncomment
    ; the following parameter, all chats will be stored on the chatlog
    ; table inside the fop2settings.db sqlite database.
    ;
    ; save_chat_log=1

    ; Khomp GSM interface to send SMS messages
    ; If there is a card plugged, fop2 will auto discover it
    ; and use the first one available. If you want to change it
    ; to a fixed one, uncomemnt the folowing line and change the name
    ; to your liking
    ;
    ; khomp_gsm=Khomp/b0

    ; --- SAMPLE GROUPS ---
    ; group=queues:QUEUE/100,QUEUE/101
    ; group=deptA:SIP/100,SIP/101,SIP/102
    ; --- END SAMPLE ---

    ; --- SAMPLE USER LIST ---
    ; format: user= EXTENSION : SECRET : PERMISSIONS : GROUPS
    ; You can enumerate several permissions and groups separated by comma
    ; available permissions: 'all', 'dial', 'hangup', 'meetme', 'pickup',
    ; 'record', 'spy', 'transfer', 'whisper',
    ; 'queuemanager', 'queueagent', 'phonebook',
    ; 'chat', 'preferences', 'hangupself',
    ; 'recordself', 'voicemailadmin'
    ;
    ; user=620:1234:all:queues
    ; user=621:1234:dial,transfer,pickup:deptA
    ; user=622:1234:all
    ; user=623:1234:meetme,pickup
    ; buttonfile=buttons.cfg
    ; ------ END SAMPLE ------

    ; This line is NOT commented, it executes
    ; the autoconfig configuration for FreePBX
    #exec autoconfig-users-freepbx.sh
    ########################################################################

    Please let me know if i have to change someting on my fop2.conf or somewhere else.
    Warmest regards,
    Lakehal.

  6. admin

    23 Mar 2012 Administrator

    You never told me what fop2 version are you running:

    /usr/local/fop2/fop2_server -v

  7. Oh sorry for the delay i made to reply, i'm currently using the fop2_server version 2.23

  8. admin

    26 Mar 2012 Administrator

    I think that persistent_spy was added on 2.21 or so, so the feature should be there. And it is working, at least in the last fop2 version , just tried:

    persisten_spy=1
    spy_options="q"

    Started monitoring a channel, then that channel terminated the call, I heard dead air, call again from that same device and started monitoring as soon as that new channel was up.

    So, it is working fine. If asterisk decides to drop a chan_spy session because of lack of rtp, perhaps because you are using the "b" option, is now up to your asterisk version/configuration, not fop2.

    Best regards,

  9. Actually, i'm using Asterisk 1.6.2.10.

  10. admin

    26 Mar 2012 Administrator

    You will have to check your asterisk full log. This is not a fop2 issue, fop2 with persistent_spy will not send a hangup request when the monitored channel ends the call. From there on, is up to asterisk, not fop2 , what to do with the monitoring. You could have an rtp timeout that disconnected the call when there is no audio, for example. I cannot guess what you have in your asterisk configurations, and it is out of the scope of fop2 itself. Check the full log and see the lines related to the spying channel being destroyed.

or Sign Up to reply!