aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmobile
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2021-03-20 11:24:57 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2021-03-20 11:24:57 +0100
commit089a012b06122689b950905d36ce0dfa52c665fe (patch)
tree8413e6efb7ebd3d9381b9ac99d2898010fe39737 /src/libmobile
parent68fbf1ae69e875b95a29b8b32ca21b428f7c430f (diff)
libmobile: Do not send 'proceeding', if call gets answered right after 'setup'
Diffstat (limited to 'src/libmobile')
-rw-r--r--src/libmobile/call.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libmobile/call.c b/src/libmobile/call.c
index 3ea1631..f7db1f8 100644
--- a/src/libmobile/call.c
+++ b/src/libmobile/call.c
@@ -451,7 +451,7 @@ static void indicate_alerting(int callref)
osmo_cc_ll_msg(ep, callref, msg);
}
-static void indicate_answer(int callref, const char *connectid)
+static void indicate_answer(int callref, const char *sdp, const char *connectid)
{
osmo_cc_msg_t *msg;
@@ -460,6 +460,10 @@ static void indicate_answer(int callref, const char *connectid)
if (connectid && connectid[0])
osmo_cc_add_ie_calling(msg, OSMO_CC_TYPE_SUBSCRIBER, OSMO_CC_PLAN_TELEPHONY, OSMO_CC_PRESENT_ALLOWED, OSMO_CC_SCREEN_NETWORK, connectid);
+ /* sdp */
+ if (sdp)
+ osmo_cc_add_ie_sdp(msg, sdp);
+
PDEBUG(DCALL, DEBUG_INFO, "Indicate OSMO-CC answer towards fixed network\n");
osmo_cc_ll_msg(ep, callref, msg);
}
@@ -543,7 +547,7 @@ void call_up_answer(int callref, const char *connect_id)
PDEBUG(DCALL, DEBUG_INFO, "Call has been answered by '%s'\n", connect_id);
if (!connect_on_setup)
- indicate_answer(callref, connect_id);
+ indicate_answer(callref, NULL, connect_id);
set_pattern_process(callref, PATTERN_NONE);
new_state_process(callref, PROCESS_CONNECT);
}
@@ -734,28 +738,24 @@ void ll_msg_cb(osmo_cc_endpoint_t __attribute__((unused)) *ep, uint32_t callref,
if (rc < 0)
number[0] = '\0';
PDEBUG(DCALL, DEBUG_INFO, "Received OSMO-CC call from fixed network '%s' to mobile '%s'\n", caller_id, number);
- indicate_proceeding(callref, sdp);
+ if (!connect_on_setup)
+ indicate_proceeding(callref, sdp);
+ else {
+ PDEBUG(DCALL, DEBUG_DEBUG, "Early connecting after setup\n");
+ indicate_answer(callref, sdp, number);
+ }
PDEBUG(DCALL, DEBUG_INFO, "Outgoing call from '%s' to '%s'\n", caller_id, number);
rc = call_down_setup(callref, caller_id, caller_type, number);
if (rc < 0) {
PDEBUG(DCALL, DEBUG_NOTICE, "Call rejected, cause %d\n", -rc);
- if (connect_on_setup) {
- PDEBUG(DCALL, DEBUG_DEBUG, "Early connecting after setup\n");
- indicate_answer(callref, number);
- } else {
+ if (!connect_on_setup) {
PDEBUG(DCALL, DEBUG_INFO, "Disconnecting OSMO-CC call towards fixed network (cause=%d)\n", -rc);
indicate_disconnect_release(callref, -rc, OSMO_CC_MSG_DISC_IND);
}
disconnect_process(callref, -rc);
break;
}
-
- if (connect_on_setup) {
- PDEBUG(DCALL, DEBUG_DEBUG, "Early connecting after setup\n");
- indicate_answer(callref, number);
- break;
- }
break;
}
case OSMO_CC_MSG_SETUP_ACK_REQ: