This patch rejects the incoming SCO connection if there isn't a
Handsfree Audio Agent registered.
---
 src/handsfree-audio.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 50aafc1..50bd861 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -126,6 +126,12 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition 
cond,
        if (nsk < 0)
                return TRUE;
 
+       if (agent == NULL) {
+               ofono_error("Reject SCO: Agent not registered");
+               close(nsk);
+               return TRUE;
+       }
+
        bt_ba2str(&saddr.sco_bdaddr, remote);
 
        memset(&saddr, 0, sizeof(saddr));
-- 
1.7.11.7

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to