Lines Matching refs:call

123 remote_call_done( RemoteCall  call )
125 call->pref[0] = call->next;
126 call->next = NULL;
127 call->pref = &call->next;
129 if (call->buff && call->buff != call->buff0) {
130 free(call->buff);
131 call->buff = call->buff0;
132 call->buff_size = (int) sizeof(call->buff0);
135 if ( call->channel ) {
136 sys_channel_close( call->channel );
137 call->channel = NULL;
140 call->buff_pos = 0;
141 call->buff_len = 0;
146 remote_call_free( RemoteCall call )
148 if (call) {
149 remote_call_done( call );
150 free(call);
179 p = bufprint(p, end, "gsm call " PHONE_PREFIX "%d\n", from_num );
223 remote_call_set_sms_pdu( RemoteCall call,
230 if (msg2len > call->buff_size) {
231 char* old_buff = call->buff == call->buff0 ? NULL : call->buff;
237 call->buff = new_buff;
238 call->buff_size = msg2len;
241 p = call->buff;
242 end = p + call->buff_size;
249 call->buff_len = p - call->buff;
250 call->buff_pos = 0;
256 remote_call_add( RemoteCall call,
261 call->next = first;
262 call->pref = plist;
265 first->pref = &call->next;
271 RemoteCall call = opaque;
273 S("%s: called for call (%d,%d), events=%02x\n", __FUNCTION__,
274 call->from_port, call->to_port, events);
279 int n = sys_channel_read( call->channel, temp, sizeof(temp) );
282 //S("%s: emulator %d quitted with %d: %s\n", __FUNCTION__, call->to_port, errno, errno_str);
283 remote_call_free( call );
293 S("%s: call (%d,%d) sending %d bytes '", __FUNCTION__,
294 call->from_port, call->to_port, call->buff_len - call->buff_pos );
295 for (nn = call->buff_pos; nn < call->buff_len; nn++) {
296 int c = call->buff[nn];
312 n = sys_channel_write( call->channel,
313 call->buff + call->buff_pos,
314 call->buff_len - call->buff_pos );
318 __FUNCTION__, call->to_port, errno, errno_str);
319 if (call->result_func)
320 call->result_func( call->result_opaque, 0 );
321 remote_call_free( call );
324 call->buff_pos += n;
326 if (call->buff_pos >= call->buff_len) {
328 S("%s: finished sending data to %d\n", __FUNCTION__, call->to_port);
329 if (!call->quitting) {
330 call->quitting = 1;
331 sprintf( call->buff, "quit\n" );
332 call->buff_len = strlen(call->buff);
333 call->buff_pos = 0;
335 call->quitting = 0;
336 if (call->result_func)
337 call->result_func( call->result_opaque, 1 );
339 sys_channel_on( call->channel, SYS_EVENT_READ, remote_call_event, call );
368 RemoteCall call;
379 D("%s: trying to call self\n", __FUNCTION__);
382 call = remote_call_alloc( type, to_port, from_port );
383 if (call == NULL) {
386 remote_call_add( call, &_the_remote_calls );
387 D("%s: adding new call from port %d to port %d\n", __FUNCTION__, from_port, to_port);
388 return call;
398 RemoteCall call = remote_call_generic( REMOTE_CALL_DIAL, number, from );
400 if (call != NULL) {
401 call->result_func = result_func;
402 call->result_opaque = result_opaque;
404 return call ? 0 : -1;
414 /* call this function to send a SMS to a remote emulator */
420 RemoteCall call = remote_call_generic( REMOTE_CALL_SMS, number, from );
422 if (call == NULL)
425 if (call != NULL) {
426 if ( remote_call_set_sms_pdu( call, pdu ) < 0 ) {
427 remote_call_free(call);
431 return call ? 0 : -1;