common code: Check and ignore events without callref set
This commit is contained in:
parent
f39ee2f15a
commit
62b3712ce5
|
@ -612,6 +612,11 @@ void process_call(int c)
|
||||||
/* Setup is received from transceiver. */
|
/* Setup is received from transceiver. */
|
||||||
int call_in_setup(int callref, const char *callerid, const char *dialing)
|
int call_in_setup(int callref, const char *callerid, const char *dialing)
|
||||||
{
|
{
|
||||||
|
if (!callref) {
|
||||||
|
PDEBUG(DCALL, DEBUG_DEBUG, "Ignoring setup, because callref not set. (not for us)\n");
|
||||||
|
return -CAUSE_INVALCALLREF;
|
||||||
|
}
|
||||||
|
|
||||||
if (callref < 0x4000000) {
|
if (callref < 0x4000000) {
|
||||||
PDEBUG(DCALL, DEBUG_ERROR, "Invalid callref from mobile station, please fix!\n");
|
PDEBUG(DCALL, DEBUG_ERROR, "Invalid callref from mobile station, please fix!\n");
|
||||||
abort();
|
abort();
|
||||||
|
@ -676,6 +681,11 @@ int call_in_setup(int callref, const char *callerid, const char *dialing)
|
||||||
/* Transceiver indicates alerting. */
|
/* Transceiver indicates alerting. */
|
||||||
void call_in_alerting(int callref)
|
void call_in_alerting(int callref)
|
||||||
{
|
{
|
||||||
|
if (!callref) {
|
||||||
|
PDEBUG(DCALL, DEBUG_DEBUG, "Ignoring alerting, because callref not set. (not for us)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PDEBUG(DCALL, DEBUG_INFO, "Call is alerting\n");
|
PDEBUG(DCALL, DEBUG_INFO, "Call is alerting\n");
|
||||||
|
|
||||||
if (use_mncc_sock) {
|
if (use_mncc_sock) {
|
||||||
|
@ -719,6 +729,11 @@ static void _indicate_answer(int callref, const char *connectid)
|
||||||
}
|
}
|
||||||
void call_in_answer(int callref, const char *connectid)
|
void call_in_answer(int callref, const char *connectid)
|
||||||
{
|
{
|
||||||
|
if (!callref) {
|
||||||
|
PDEBUG(DCALL, DEBUG_DEBUG, "Ignoring answer, because callref not set. (not for us)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PDEBUG(DCALL, DEBUG_INFO, "Call has been answered by '%s'\n", connectid);
|
PDEBUG(DCALL, DEBUG_INFO, "Call has been answered by '%s'\n", connectid);
|
||||||
|
|
||||||
if (use_mncc_sock) {
|
if (use_mncc_sock) {
|
||||||
|
@ -741,6 +756,11 @@ void call_in_answer(int callref, const char *connectid)
|
||||||
/* Transceiver indicates release. */
|
/* Transceiver indicates release. */
|
||||||
void call_in_release(int callref, int cause)
|
void call_in_release(int callref, int cause)
|
||||||
{
|
{
|
||||||
|
if (!callref) {
|
||||||
|
PDEBUG(DCALL, DEBUG_DEBUG, "Ignoring release, because callref not set. (not for us)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PDEBUG(DCALL, DEBUG_INFO, "Call has been released with cause=%d\n", cause);
|
PDEBUG(DCALL, DEBUG_INFO, "Call has been released with cause=%d\n", cause);
|
||||||
|
|
||||||
if (use_mncc_sock) {
|
if (use_mncc_sock) {
|
||||||
|
@ -784,6 +804,8 @@ void call_in_release(int callref, int cause)
|
||||||
/* forward audio to MNCC or call instance */
|
/* forward audio to MNCC or call instance */
|
||||||
void call_tx_audio(int callref, int16_t *samples, int count)
|
void call_tx_audio(int callref, int16_t *samples, int count)
|
||||||
{
|
{
|
||||||
|
if (!callref)
|
||||||
|
return;
|
||||||
|
|
||||||
if (use_mncc_sock) {
|
if (use_mncc_sock) {
|
||||||
uint8_t buf[sizeof(struct gsm_data_frame) + count * sizeof(int16_t)];
|
uint8_t buf[sizeof(struct gsm_data_frame) + count * sizeof(int16_t)];
|
||||||
|
|
Loading…
Reference in New Issue