FreeCalypso > hg > themwi-system-sw
view sip-in/call_list.c @ 63:e5aee661e3b2
sip-in: beginning to handle incoming MNCC messages from themwi-mncc
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 18 Sep 2022 15:01:11 -0800 |
parents | 75b7a7b61824 |
children | 709b78a4ebf0 |
line wrap: on
line source
/* * In this module we implement call list management for themwi-sip-in. */ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <syslog.h> #include "call.h" struct call *call_list; struct call * find_call_by_sip_id(sought_id) char *sought_id; { struct call *call; for (call = call_list; call; call = call->next) if (!strcmp(call->sip_call_id, sought_id)) return call; return 0; } struct call * find_call_by_mncc_callref(callref) uint32_t callref; { struct call *call; for (call = call_list; call; call = call->next) if (call->mncc_state && call->mncc_callref == callref) return call; return 0; } allocate_mncc_callref(call) struct call *call; { static uint32_t next_callref; for (;;) { next_callref++; if (!find_call_by_mncc_callref(next_callref)) { call->mncc_callref = next_callref; return(0); } } }