summaryrefslogtreecommitdiff
path: root/src/ua.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-01-09 20:21:22 +0100
committerAlfred E. Heggestad <aeh@db.org>2016-01-09 20:21:22 +0100
commit4d8a30e750cfcbb6de91b1a4ee9c55411a146821 (patch)
treef95112383a8a5f2841ec41e953e5a53c9d09c608 /src/ua.c
parent856d3a5ac00d21d7892d2020a16b33bbd4aa829f (diff)
move playing of ringtones to the menu-module
Diffstat (limited to 'src/ua.c')
-rw-r--r--src/ua.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/ua.c b/src/ua.c
index dc8073b..9fe4f0e 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -28,7 +28,6 @@ struct ua {
struct account *acc; /**< Account Parameters */
struct list regl; /**< List of Register clients */
struct list calls; /**< List of active calls (struct call) */
- struct play *play; /**< Playback of ringtones etc. */
struct pl extensionv[8]; /**< Vector of SIP extensions */
size_t extensionc; /**< Number of SIP extensions */
char *cuser; /**< SIP Contact username */
@@ -245,18 +244,6 @@ bool ua_isregistered(const struct ua *ua)
}
-static const char *translate_errorcode(uint16_t scode)
-{
- switch (scode) {
-
- case 404: return "notfound.wav";
- case 486: return "busy.wav";
- case 487: return NULL; /* ignore */
- default: return "error.wav";
- }
-}
-
-
static struct call *ua_find_call_onhold(const struct ua *ua)
{
struct le *le;
@@ -301,9 +288,6 @@ static void call_event_handler(struct call *call, enum call_event ev,
peeruri = call_peeruri(call);
- /* stop any ringtones */
- ua->play = mem_deref(ua->play);
-
switch (ev) {
case CALL_EVENT_INCOMING:
@@ -329,23 +313,12 @@ static void call_event_handler(struct call *call, enum call_event ev,
case ANSWERMODE_MANUAL:
default:
- if (list_count(&ua->calls) > 1) {
- (void)play_file(&ua->play,
- "callwaiting.wav", 3);
- }
- else {
- /* Alert user */
- (void)play_file(&ua->play, "ring.wav", -1);
- }
-
ua_event(ua, UA_EVENT_CALL_INCOMING, call, peeruri);
break;
}
break;
case CALL_EVENT_RINGING:
- (void)play_file(&ua->play, "ringback.wav", -1);
-
ua_event(ua, UA_EVENT_CALL_RINGING, call, peeruri);
break;
@@ -360,12 +333,6 @@ static void call_event_handler(struct call *call, enum call_event ev,
break;
case CALL_EVENT_CLOSED:
- if (call_scode(call)) {
- const char *tone;
- tone = translate_errorcode(call_scode(call));
- if (tone)
- (void)play_file(&ua->play, tone, 1);
- }
ua_event(ua, UA_EVENT_CALL_CLOSED, call, str);
mem_deref(call);
@@ -530,7 +497,6 @@ static void ua_destructor(void *arg)
list_flush(&ua->calls);
list_flush(&ua->regl);
- mem_deref(ua->play);
mem_deref(ua->cuser);
mem_deref(ua->pub_gruu);
mem_deref(ua->acc);
@@ -831,8 +797,6 @@ void ua_hangup(struct ua *ua, struct call *call,
return;
}
- ua->play = mem_deref(ua->play);
-
(void)call_hangup(call, scode, reason);
mem_deref(call);
@@ -860,8 +824,6 @@ int ua_answer(struct ua *ua, struct call *call)
return ENOENT;
}
- ua->play = mem_deref(ua->play);
-
return call_answer(call, 200);
}