func: static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, size_t datalen) struct skinny_subchannel * sub = ast -> tech_pvt ; struct skinny_line * l = sub -> line ; struct skinny_device * d = l -> device ; struct skinnysession * s = d -> session ; if ( ! s )  switch ( ind )  update_connectedline ( sub , data , datalen ); static void update_connectedline(struct skinny_subchannel *sub, const void *data, size_t datalen) struct ast_channel * c = sub -> owner ; struct skinny_line * l = sub -> line ; struct skinny_device * d = l -> device ; if ( ! c -> caller . id . number . valid || ast_strlen_zero ( c -> caller . id . number . str ) || ! c -> connected . id . number . valid || ast_strlen_zero ( c -> connected . id . number . str ) )  if ( sub -> owner -> _state == AST_STATE_UP )  if ( sub -> calldirection == SKINNY_INCOMING )  transmit_callstate ( d , l -> instance , sub -> callid , SKINNY_RINGIN ); static void transmit_callstate(struct skinny_device *d, int buttonInstance, unsigned callid, int state) struct skinny_req * req ; if ( ! ( req = req_alloc ( sizeof ( struct call_state_message ) , CALL_STATE_MESSAGE ) ) )  static struct skinny_req *req_alloc(size_t size, int response_message) struct skinny_req * req ; if ( ! ( req = ast_calloc ( 1 , skinny_header_size + size + 4 ) ) )  return NULL ; req -> len = htolel ( size + 4 ); req -> e = htolel ( response_message ); return req ; if ( skinnydebug )  ast_verb ( 3 , "Transmitting CALL_STATE_MESSAGE to %s - line %d, callid %d, state %s\n" , d -> name , buttonInstance , callid , callstate2str ( state ) ); static char *callstate2str(int ind) char * tmp ; switch ( ind )  if ( ! ( tmp = ast_threadstorage_get ( & callstate2str_threadbuf , CALLSTATE2STR_BUFSIZE ) ) )  snprintf ( tmp , CALLSTATE2STR_BUFSIZE , "UNKNOWN-%d" , ind ); return tmp ; 