FreeCalypso > hg > themwi-system-sw
comparison sip-out/call.h @ 154:e54b0a9e322f
beginning of themwi-sip-out
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Tue, 11 Oct 2022 23:04:01 -0800 |
| parents | sip-in/call.h@e499e8db8b82 |
| children | bfa9f0c0f0ac |
comparison
equal
deleted
inserted
replaced
| 153:99fd4ae573ae | 154:e54b0a9e322f |
|---|---|
| 1 /* | |
| 2 * In this header file we define two key structures for call state | |
| 3 * in themwi-sip-out: struct call exists for each call just like in | |
| 4 * themwi-sip-in, and struct mncc_conn exists for every connection | |
| 5 * to our outcall socket. | |
| 6 */ | |
| 7 | |
| 8 struct mncc_conn { | |
| 9 int fd; | |
| 10 struct mncc_conn *next; | |
| 11 }; | |
| 12 | |
| 13 #define MAX_SIP_CALL_ID 30 | |
| 14 #define MAX_SIP_FROM_HEADER (MAX_SIP_USER_PART + 5 + 17 + 5 + 8) | |
| 15 #define MAX_SIP_TO_URI (MAX_SIP_USER_PART + MAX_SIP_DEST_DOMAIN + 5) | |
| 16 #define MAX_SIP_TO_TAG 63 | |
| 17 | |
| 18 struct call { | |
| 19 /* global call list */ | |
| 20 struct call *next; | |
| 21 char sip_call_id[MAX_SIP_CALL_ID+1]; | |
| 22 int sip_call_exists; | |
| 23 /* MNCC call origin */ | |
| 24 struct mncc_conn *mncc; | |
| 25 uint32_t mncc_callref; | |
| 26 /* call routing info */ | |
| 27 char from_user[MAX_SIP_USER_PART+1]; | |
| 28 char from_header[MAX_SIP_FROM_HEADER+1]; | |
| 29 char to_uri[MAX_SIP_TO_URI+1]; | |
| 30 char to_tag[MAX_SIP_TO_TAG+1]; | |
| 31 struct sockaddr_in udp_sin; | |
| 32 /* PSTN side RTP info */ | |
| 33 struct sockaddr_in pstn_rtp_local; | |
| 34 struct sockaddr_in pstn_rtp_remote; | |
| 35 int use_pcma; | |
| 36 /* GSM side RTP info */ | |
| 37 struct sockaddr_storage gsm_rtp_osmo; | |
| 38 struct sockaddr_storage gsm_rtp_tmgw; | |
| 39 uint32_t gsm_payload_type; | |
| 40 uint32_t gsm_payload_msg_type; | |
| 41 /* state machines */ | |
| 42 uint32_t overall_state; | |
| 43 uint32_t mncc_state; | |
| 44 uint32_t sip_state; | |
| 45 uint32_t mgw_state; | |
| 46 uint32_t mgw_ep_id; | |
| 47 uint32_t mgw_xact; | |
| 48 uint32_t mgw_xact_id; | |
| 49 unsigned sip_tx_count; | |
| 50 time_t sip_clear_time; | |
| 51 int dtmf_digit; | |
| 52 int dtmf_pending_stop; | |
| 53 }; | |
| 54 | |
| 55 #define OVERALL_STATE_GSM_RTP 1 | |
| 56 #define OVERALL_STATE_CRCX 2 | |
| 57 #define OVERALL_STATE_SIP_OUT 3 | |
| 58 #define OVERALL_STATE_RINGING 4 | |
| 59 #define OVERALL_STATE_CONNECTED 5 | |
| 60 #define OVERALL_STATE_TEARDOWN 6 | |
| 61 #define OVERALL_STATE_SIP_FINISH 7 | |
| 62 #define OVERALL_STATE_GC 8 | |
| 63 | |
| 64 #define MNCC_STATE_MO_PROC 1 | |
| 65 #define MNCC_STATE_GOT_RTP 2 | |
| 66 #define MNCC_STATE_ALERTING 3 | |
| 67 #define MNCC_STATE_CONNECTED 4 | |
| 68 #define MNCC_STATE_DISCONNECT 5 | |
| 69 #define MNCC_STATE_RELEASE 6 | |
| 70 | |
| 71 #define SIP_STATE_INV_SENT 1 | |
| 72 #define SIP_STATE_100_RCVD 2 | |
| 73 #define SIP_STATE_CONNECTED 3 | |
| 74 #define SIP_STATE_CANCEL_SENT 4 | |
| 75 #define SIP_STATE_BYE_SENT 5 | |
| 76 #define SIP_STATE_ACCEPT_100 6 | |
| 77 #define SIP_STATE_ACCEPT_200 7 | |
| 78 #define SIP_STATE_ENDED 8 | |
| 79 | |
| 80 #define MGW_STATE_NO_EXIST 0 | |
| 81 #define MGW_STATE_ALLOCATED 1 | |
| 82 #define MGW_STATE_IBT_CONN 2 | |
| 83 #define MGW_STATE_COMPLETE 3 | |
| 84 #define MGW_STATE_HELD 4 | |
| 85 #define MGW_STATE_MDCX_IBT 5 | |
| 86 #define MGW_STATE_MDCX_CONN 6 | |
| 87 #define MGW_STATE_MDCX_HOLD 7 | |
| 88 #define MGW_STATE_MDCX_RETR 8 | |
| 89 #define MGW_STATE_DTMF_OP 9 | |
| 90 #define MGW_STATE_DELETING 10 |
