VoIP/SIP Client and distro
#9
(02-21-2020, 06:10 AM)wibble Wrote: The need to manually change audio profiles was the problem running stock SIP clients back in the Openmoko days too. Are you adjusting mixer settings directly, or using some interface to switch audio profiles? I've been looking for a 'standard' way to do this, but haven't found a consistent one. There was the freesmartphone.org dbus interface, but that seems unused now. Alsa has alsaucm and its API equivalents, while PulseAudio has its own profile thing, but neither seem to have the push/pop capability freesmartphone.org had for returning to whatever profile was active before you changed it.

Sorry, this is going to be a quick post because I'm under the pump getting ready for a trial for work.

Presently, I am doing it the worst possible way. I've hooked bash scripts in Baresip. I'm not entirely sure if this is the best spot to handle events. Plus I could probably write a module for Baresip that allows you to call scripts on certain events taking place. The scripts call 'amixer' to mute/unmute etc.

Here's a dump of the scripts and patches. And, again sorry for the brevity as I'm under the pump. Do as you please with them.

BASH SCRIPT DUMPS


Code:
pinephone:/mnt/mmcblk2p1/home/phablet$ find . -maxdepth 1 -iname \*.sh -print -exec cat {} \;

./fix-audio.sh
#!/bin/bash
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute
amixer -c 0 set 'Line Out' unmute
amixer sset 'Line Out' 100%

./unmute-earpiece.sh
#!/bin/bash
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute
amixer -c 0 set 'Earpiece' unmute
amixer sset 'Earpiece' 100%

./mute-loudspeaker.sh
#!/bin/bash
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' mute
amixer -c 0 set 'DAC' mute
amixer -c 0 set 'Line Out' mute
amixer sset 'Line Out' 0%

./mute-microphone1.sh
#!/bin/bash
amixer -c 0 sset 'AIF1 Data Digital ADC' nocap
amixer -c 0 sset 'Mic1' nocap
amixer -c 0 set 'Mic1' mute
amixer sset 'Mic1' 0%

./start-call.sh
#!/bin/bash
echo "STARTING CALL";
bash mute-loudspeaker.sh; bash unmute-earpiece.sh; bash unmute-microphone1.sh

./unmute-loudspeaker.sh
#!/bin/bash
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute
amixer -c 0 set 'DAC' unmute

amixer -c 0 set 'Line Out' unmute
amixer sset 'Line Out' 100%

./mute-earpiece.sh
#!/bin/bash
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute
amixer -c 0 set 'Earpiece' mute
amixer sset 'Earpiece' 0%

./finish-call.sh
echo "FINISHING CALL"
bash unmute-loudspeaker.sh; bash mute-earpiece.sh; bash mute-microphone1.sh

./unmute-microphone1.sh
#!/bin/bash
amixer -c 0 sset 'AIF1 Data Digital ADC' cap
amixer -c 0 sset 'Mic1' cap


PATCH DUMP


Code:
diff -u baresip-0.6.5/src/ua.c baresip-0.6.5/src/ua.c
--- baresip-0.6.5/src/ua.c
+++ baresip-0.6.5/src/ua.c
@@ -9,6 +9,6 @@
 #include "core.h"
 #include <ctype.h>
+#include <stdlib.h>
 
-
 /** Magic number */
 #define MAGIC 0x0a0a0a0a
@@ -346,5 +346,7 @@
 
        case CALL_EVENT_INCOMING:
+               ua_printf(ua, "CALL_EVENT_INCOMING\n", peeruri);
 
+
                if (contact_block_access(baresip_contacts(),
                                         peeruri)) {
@@ -373,20 +375,26 @@
                break;
 
        case CALL_EVENT_RINGING:
+               ua_printf(ua, "CALL_EVENT_RINGING\n", peeruri);
                ua_event(ua, UA_EVENT_CALL_RINGING, call, peeruri);
                break;
 
        case CALL_EVENT_PROGRESS:
+               ua_printf(ua, "CALL_EVENT_PROGRESS\n", peeruri);
                ua_printf(ua, "Call in-progress: %s\n", peeruri);
                ua_event(ua, UA_EVENT_CALL_PROGRESS, call, peeruri);
                break;
 
        case CALL_EVENT_ESTABLISHED:
+               ua_printf(ua, "CALL_EVENT_ESTABLISHED\n", peeruri);
+               system("/bin/bash /home/phablet/start-call.sh");
                ua_printf(ua, "Call established: %s\n", peeruri);
                ua_event(ua, UA_EVENT_CALL_ESTABLISHED, call, peeruri);
                break;
 
        case CALL_EVENT_CLOSED:
+               ua_printf(ua, "CALL_EVENT_CLOSED\n", peeruri);
+               system("/bin/bash /home/phablet/finish-call.sh");
                ua_event(ua, UA_EVENT_CALL_CLOSED, call, str);
                mem_deref(call);
 
@@ -394,6 +402,7 @@
                break;
 
        case CALL_EVENT_TRANSFER:
+               ua_printf(ua, "CALL_EVENT_TRANSFER\n", peeruri);
                ua_event(ua, UA_EVENT_CALL_TRANSFER, call, str);
                break;
 
@@ -402,6 +411,7 @@
                break;
 
        case CALL_EVENT_MENC:
+               ua_printf(ua, "CALL_EVENT_MENC\n", peeruri);
                ua_event(ua, UA_EVENT_CALL_MENC, call, str);
                break;
        }

(02-21-2020, 06:04 PM)tahayassen Wrote: On my nexus 5 (not pinephone), linphone in the open store in Ubuntu Touch works excellently.

Yes, I looked at that in the OpenStore. Unfortunately, they don't have a 64-bit build/release at the moment. I understand that a 64-bit build is on their TODO list. I recall seeing it mentioned on gitlab.com (https://gitlab.com/ubports-linphone/linp...ple/issues).
  Reply


Messages In This Thread
VoIP/SIP Client and distro - by cmicallef - 02-17-2020, 09:53 PM
RE: VoIP/SIP Client and distro - by p1trson - 02-18-2020, 04:26 AM
RE: VoIP/SIP Client and distro - by p1trson - 02-18-2020, 02:42 PM
RE: VoIP/SIP Client and distro - by cmicallef - 02-18-2020, 04:10 PM
RE: VoIP/SIP Client and distro - by nas - 10-13-2020, 04:53 PM
RE: VoIP/SIP Client and distro - by p1trson - 02-18-2020, 06:00 PM
RE: VoIP/SIP Client and distro - by cmicallef - 02-19-2020, 07:31 PM
RE: VoIP/SIP Client and distro - by wibble - 02-21-2020, 06:10 AM
RE: VoIP/SIP Client and distro - by cmicallef - 02-21-2020, 09:56 PM
RE: VoIP/SIP Client and distro - by lipkowski.be - 10-13-2020, 03:24 AM
RE: VoIP/SIP Client and distro - by tahayassen - 02-21-2020, 06:04 PM
RE: VoIP/SIP Client and distro - by Boern - 08-06-2020, 06:03 AM
RE: VoIP/SIP Client and distro - by p1trson - 11-13-2020, 02:34 PM
RE: VoIP/SIP Client and distro - by p1trson - 01-16-2021, 09:19 AM
RE: VoIP/SIP Client and distro - by nas - 01-16-2021, 12:00 PM
RE: VoIP/SIP Client and distro - by calinb - 01-19-2021, 01:40 AM
RE: VoIP/SIP Client and distro - by p1trson - 01-16-2021, 12:18 PM
RE: VoIP/SIP Client and distro - by p1trson - 02-02-2021, 02:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UPDATED (June 2021): 17-distro multi-boot image for Pinephone (incl. 3GiB variant) megous 182 248,302 03-05-2023, 11:04 AM
Last Post: Eugo
  Poll: What is your favorite distro/interface for the PinePhone? amosbatto 8 11,260 02-01-2022, 07:47 AM
Last Post: amosbatto
  Other Payment options? & I'll buy used PinePhone 3/32 any distro 503d 6 5,665 12-30-2021, 07:22 AM
Last Post: Humusk1
  Poll 2: What is your favorite distro/interface for the PinePhone? amosbatto 3 3,672 12-01-2021, 04:36 PM
Last Post: bcnaz
Question How to install a Whatsapp client on Pinephone w/ Manjaro? danimations 1 7,369 06-23-2021, 09:54 PM
Last Post: ryo
  Poll 4: What is your favorite distro/interface for the PinePhone? amosbatto 7 6,664 02-11-2021, 09:58 AM
Last Post: amosbatto
  Poll 3: What is your favorite distro/interface for the PinePhone? amosbatto 0 1,592 02-01-2021, 07:57 AM
Last Post: amosbatto
  Best distro for my use case andyj 4 4,489 11-18-2020, 05:30 AM
Last Post: andyj

Forum Jump:


Users browsing this thread: 1 Guest(s)