Home | History | Annotate | Download | only in telephony

Lines Matching refs:call

89 /** REMOTE CALL OBJECTS
114 remote_call_done( RemoteCall call )
116 call->pref[0] = call->next;
117 call->next = NULL;
118 call->pref = &call->next;
120 if (call->buff && call->buff != call->buff0) {
121 free(call->buff);
122 call->buff = call->buff0;
123 call->buff_size = (int) sizeof(call->buff0);
126 if ( call->channel ) {
127 sys_channel_close( call->channel );
128 call->channel = NULL;
131 call->buff_pos = 0;
132 call->buff_len = 0;
137 remote_call_free( RemoteCall call )
139 if (call) {
140 remote_call_done( call );
141 free(call);
170 p = bufprint(p, end, "gsm call %d\n", from_num );
214 remote_call_set_sms_pdu( RemoteCall call,
221 if (msg2len > call->buff_size) {
222 char* old_buff = call->buff == call->buff0 ? NULL : call->buff;
228 call->buff = new_buff;
229 call->buff_size = msg2len;
232 p = call->buff;
233 end = p + call->buff_size;
240 call->buff_len = p - call->buff;
241 call->buff_pos = 0;
247 remote_call_add( RemoteCall call,
252 call->next = first;
253 call->pref = plist;
256 first->pref = &call->next;
262 RemoteCall call = opaque;
264 S("%s: called for call (%d,%d), events=%02x\n", __FUNCTION__,
265 call->from_port, call->to_port, events);
270 int n = sys_channel_read( call->channel, temp, sizeof(temp) );
273 //S("%s: emulator %d quitted with %d: %s\n", __FUNCTION__, call->to_port, errno, errno_str);
274 remote_call_free( call );
284 S("%s: call (%d,%d) sending %d bytes '", __FUNCTION__,
285 call->from_port, call->to_port, call->buff_len - call->buff_pos );
286 for (nn = call->buff_pos; nn < call->buff_len; nn++) {
287 int c = call->buff[nn];
303 n = sys_channel_write( call->channel,
304 call->buff + call->buff_pos,
305 call->buff_len - call->buff_pos );
309 __FUNCTION__, call->to_port, errno, errno_str);
310 if (call->result_func)
311 call->result_func( call->result_opaque, 0 );
312 remote_call_free( call );
315 call->buff_pos += n;
317 if (call->buff_pos >= call->buff_len) {
319 S("%s: finished sending data to %d\n", __FUNCTION__, call->to_port);
320 if (!call->quitting) {
321 call->quitting = 1;
322 sprintf( call->buff, "quit\n" );
323 call->buff_len = strlen(call->buff);
324 call->buff_pos = 0;
326 call->quitting = 0;
327 if (call->result_func)
328 call->result_func( call->result_opaque, 1 );
330 sys_channel_on( call->channel, SYS_EVENT_READ, remote_call_event, call );
359 RemoteCall call;
370 D("%s: trying to call self\n", __FUNCTION__);
373 call = remote_call_alloc( type, to_port, from_port );
374 if (call == NULL) {
377 remote_call_add( call, &_the_remote_calls );
378 D("%s: adding new call from port %d to port %d\n", __FUNCTION__, from_port, to_port);
379 return call;
389 RemoteCall call = remote_call_generic( REMOTE_CALL_DIAL, number, from );
391 if (call != NULL) {
392 call->result_func = result_func;
393 call->result_opaque = result_opaque;
395 return call ? 0 : -1;
405 /* call this function to send a SMS to a remote emulator */
411 RemoteCall call = remote_call_generic( REMOTE_CALL_SMS, number, from );
413 if (call == NULL)
416 if (call != NULL) {
417 if ( remote_call_set_sms_pdu( call, pdu ) < 0 ) {
418 remote_call_free(call);
422 return call ? 0 : -1;