bgapi_exec() public static method

public static bgapi_exec ( String cmd, String args ) : void
cmd String
args String
return void
 public static void SendDTMF(string dtmf)
 {
     char[] chars = dtmf.ToCharArray();
     foreach (char c in chars)
     {
         Utils.bgapi_exec("pa", "dtmf " + c);
     }
 }
Esempio n. 2
0
 public void SetOurAudioLevel(int level)
 {
     if (level > 4 || level < -4)
     {
         return;
     }
     our_audio_level = level;
     Utils.bgapi_exec("uuid_audio", leg_b_uuid + " start write level " + level);
 }
Esempio n. 3
0
 public void SetOtherPartyAudioLevel(int level)
 {
     if (level > 4 || level < -4)
     {
         return;
     }
     other_audio_level = level;
     Utils.bgapi_exec("uuid_audio", leg_b_uuid + " start read level " + level);
 }
 public static void set_mute(bool muted)
 {
     if (muted)
     {
         Utils.bgapi_exec("pa", "flags off mouth");
     }
     else
     {
         Utils.bgapi_exec("pa", "flags on mouth");
     }
 }
 public static void PlayDTMF(char dtmf, string uuid, bool no_close = false)
 {
     if (uuid == null)
     {
         Utils.bgapi_exec("pa", "play tone_stream://d=150;v=-5;" + dtmf + (no_close ? " -1 no_close" : ""));
     }
     else
     {
         PlayInUUID(uuid, "tone_stream://d=150;v=-5;" + dtmf);
     }
 }
Esempio n. 6
0
 public void Transfer(String number)
 {
     if (String.IsNullOrEmpty(number) || call_ended)
     {
         return;
     }
     if (is_conference_call)
     {
         MessageBox.Show("Cannot transfer the conference");
         return;
     }
     if (String.IsNullOrEmpty(note))
     {
         note = "Call transferred to: " + number;
     }
     Utils.bgapi_exec("uuid_deflect", leg_b_uuid + " " + number);
 }
Esempio n. 7
0
        private void RecordCall()
        {
            String full_path = broker.recordings_folder.Replace('/', '\\');

            if (!full_path.Contains(":\\"))
            {
                full_path = Path.Combine(Directory.GetCurrentDirectory(), full_path);                //freeswitch is not happy with relative paths when using quotes
            }
            full_path = Path.Combine(full_path, "rec_" + other_party_number + "_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"));
            int    num            = 1;
            String orig_full_path = full_path;

            while (File.Exists(full_path + ".wav"))
            {
                full_path = orig_full_path + "." + num++;
            }

            full_path         = full_path.Replace('\\', '/');     //seems freeswitch will selectively escape what it cant otherwise
            am_recording_file = full_path + ".wav";
            Utils.bgapi_exec("uuid_setvar", leg_b_uuid + " record_stereo true");
            Utils.bgapi_exec("uuid_record", leg_b_uuid + " start '" + am_recording_file + "'");
        }
 public static void Call(string dest)
 {
     Utils.bgapi_exec("pa", "call " + dest);
 }
Esempio n. 9
0
 private void ConferenceAdd()
 {
     Conference.instance.join_conference();
     Utils.bgapi_exec("uuid_transfer", leg_b_uuid + " fsc_conference xml default");
 }
Esempio n. 10
0
 private void StopRecordCall()
 {
     Utils.bgapi_exec("uuid_record", leg_b_uuid + " stop '" + am_recording_file + "'");
     am_recording_file = null;
 }
Esempio n. 11
0
 private static void SetRingDev(int guid)
 {
     Utils.bgapi_exec("pa", "ringdev #" + guid_to_id(guid));
 }
Esempio n. 12
0
 private static void SetInAndOutDev(int indev_guid, int outdev_guid)
 {
     Utils.bgapi_exec("pa", "switchstream #" + guid_to_id(indev_guid) + " #" + guid_to_id(outdev_guid));
 }
Esempio n. 13
0
 private static void SetOutDev(int guid)
 {
     Utils.bgapi_exec("pa", "outdev #" + guid_to_id(guid));
 }
Esempio n. 14
0
 public static void ClearRingDev()
 {
     Utils.bgapi_exec("pa", "ringdev #" + -1);
 }
Esempio n. 15
0
 public void reload_config()
 {
     Utils.bgapi_exec("reload", "mod_conference");
 }
Esempio n. 16
0
 public static void PrepareStream(AudioDevice indev, AudioDevice outdev)
 {
     Utils.bgapi_exec("pa", "preparestream #" + guid_to_id(indev.guid) + " #" + guid_to_id(outdev.guid));
 }
Esempio n. 17
0
 public void Drop()
 {
     Utils.bgapi_exec("uuid_kill", uuid + " NORMAL_CLEARING");
 }
Esempio n. 18
0
 public static void CloseStreams()
 {
     Utils.bgapi_exec("pa", "closestreams");
 }
Esempio n. 19
0
 public static void Hangup(int call_id)
 {
     Utils.bgapi_exec("pa", "hangup " + call_id);
 }
Esempio n. 20
0
 internal static void Answer(int call_id)
 {
     Utils.bgapi_exec("pa", "answer " + call_id);
 }
Esempio n. 21
0
 public static void PlayInUUID(string uuid, string to_play)
 {
     Utils.bgapi_exec("uuid_displace", uuid + " start " + to_play + " 0 mux");
 }
Esempio n. 22
0
 public static void HoldAll()
 {
     Utils.bgapi_exec("pa", "switch none");
 }
Esempio n. 23
0
 public static void SwitchTo(int call_id)
 {
     Utils.bgapi_exec("pa", "switch " + call_id);
 }
Esempio n. 24
0
 public void Split()
 {
     Utils.bgapi_exec("uuid_transfer", uuid + " auto_answer xml public");
 }
Esempio n. 25
0
 private static void SetInDev(int guid)
 {
     Utils.bgapi_exec("pa", "indev #" + guid_to_id(guid));
 }
Esempio n. 26
0
 public static void ConferenceAction(String action)
 {
     Utils.bgapi_exec("conference", "fsc_conference " + action);
 }
 public void reload_config()
 {
     Utils.bgapi_exec("reload", "mod_event_socket");
 }