static void on_call_state (pjsua_call_id call_id, pjsip_event *e) { ics_t *data; pjsua_call_info ci; PJ_UNUSED_ARG(e); pjsua_call_get_info(call_id, &ci); //Handle hold call problem #if 0 if ( (strcmp(ci.state_text.ptr,"CALLING") == 0) && (current_call != PJSUA_INVALID_ID) ) _ics_core_hold_call(data); #endif current_call = call_id; if (strcmp(ci.state_text.ptr,"DISCONNCTD") == 0){ find_call(); } data = (ics_t *)pjsua_acc_get_user_data(ci.acc_id); opool_item_t *p_item = opool_get(&data->opool); build_call_state_event((ics_event_t *)p_item->data, call_id, ci.state_text.ptr); ics_event_t *event = (ics_event_t *)p_item->data; process_event(event); }
int add_direct_and_function(int *args, char *arg, int c) { int value; if ((value = (find_call(arg))) == -1) my_exit("Syntax error", -1); args[c++] = 0; args[c++] = (value * -1); return (c); }
int recv_packet(unsigned char *buf, int size, unsigned char *port) { unsigned char *bptr; int count, i; unsigned char *call; /* printf("Got packet size %d\n", size);*/ /* * Decode the AX.25 Packet */ /* Find packet, skip over flag */ bptr = buf+1; /* Now at destination address */ /* print_call(bptr); printf("<-");*/ bptr += AXALEN; /* Now at source address */ /* print_call(bptr);*/ if (bptr[6] & E_BIT) { /* printf("\n");*/ return -1; /* No digis, we're not interested */ } /* printf(" ");*/ bptr += AXALEN; /* Now at digipeaters */ count = 0; while( count < AX25_MAX_DIGIS && ( (bptr - buf) < size)) { /* print_call(bptr); printf(", ");*/ if (bptr[6] & REPEATED) { /* This one has been repeated, move to next one */ bptr += AXALEN; count++; continue; } /* Check to see if callsign is one of ours */ for (i = 0; i < port_count; i++) { /* printf("compare "); print_call(bptr); printf(" "); print_call(portcall[i]); printf("\n");*/ if ( (bcmp(bptr, portcall[i], AXALEN-1) == 0) && ((bptr[6] & 0x1e) == portcall[i][6])) { /* Copy new address over and turn on repeated bit*/ call = find_call(port); if (call == NULL) return -1; bcopy(call, bptr, AXALEN-1); bptr[6] = (bptr[6] & ~0x1e) | call[6]; bptr[6] |= REPEATED; return i; } } /* for */ return -1; } return -1; }