Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Enumerations | Functions | Variables
chan_skinny.c File Reference

Implementation of the Skinny protocol. More...

#include "asterisk.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <fcntl.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <signal.h>
#include <ctype.h>
#include "asterisk/lock.h"
#include "asterisk/channel.h"
#include "asterisk/config.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/sched.h"
#include "asterisk/io.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/netsock2.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/cli.h"
#include "asterisk/manager.h"
#include "asterisk/say.h"
#include "asterisk/astdb.h"
#include "asterisk/causes.h"
#include "asterisk/pickup.h"
#include "asterisk/app.h"
#include "asterisk/mwi.h"
#include "asterisk/musiconhold.h"
#include "asterisk/utils.h"
#include "asterisk/dsp.h"
#include "asterisk/stringfields.h"
#include "asterisk/abstract_jb.h"
#include "asterisk/threadstorage.h"
#include "asterisk/devicestate.h"
#include "asterisk/indications.h"
#include "asterisk/linkedlists.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/bridge.h"
#include "asterisk/parking.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/format_cache.h"
#include <byteswap.h>
Include dependency graph for chan_skinny.c:

Go to the source code of this file.

Data Structures

struct  activate_call_plane_message
 
struct  alarm_message
 
struct  bksp_req_message
 
struct  button_definition
 
struct  button_definition_template
 
struct  button_template_res_message
 
struct  call_info_message
 
struct  call_info_message_variable
 
struct  call_state_message
 
struct  capabilities_res_message
 
struct  clear_display_message
 
struct  clear_prinotify_message
 
struct  clear_prompt_message
 
struct  close_receive_channel_message
 
struct  definetimedate_message
 
struct  devices
 
struct  dialed_number_message
 
struct  display_notify_message
 
struct  display_prinotify_message
 
struct  display_prinotify_message_variable
 
struct  display_prompt_status_message
 
struct  display_prompt_status_message_variable
 
struct  displaytext_message
 
struct  enbloc_call_message
 
struct  forward_stat_message
 
struct  keypad_button_message
 
struct  line_stat_res_message
 
struct  line_state_req_message
 
struct  lines
 
struct  media_qualifier
 
struct  offhook_message
 
struct  onhook_message
 
struct  open_receive_channel_ack_message_ip4
 
struct  open_receive_channel_ack_message_ip6
 
struct  open_receive_channel_message
 
struct  register_ack_message
 
struct  register_message
 
struct  register_rej_message
 
struct  reset_message
 
struct  select_soft_keys_message
 
struct  server_identifier
 
struct  server_res_message
 
struct  serviceurl_stat_message
 
struct  serviceurl_statreq_message
 
struct  sessions
 
struct  set_lamp_message
 
struct  set_microphone_message
 
struct  set_ringer_message
 
struct  set_speaker_message
 
struct  skinny_addon
 
struct  skinny_container
 
union  skinny_data
 
struct  skinny_device
 
struct  skinny_device_options
 
struct  skinny_line
 
struct  skinny_line_options
 
struct  skinny_req
 
struct  skinny_serviceurl
 
struct  skinny_speeddial
 
struct  skinny_subchannel
 
struct  skinny_subline
 
struct  skinnysession
 
struct  soft_key_definitions
 
struct  soft_key_event_message
 
struct  soft_key_set_definition
 
struct  soft_key_set_res_message
 
struct  soft_key_template_definition
 
struct  soft_key_template_res_message
 
struct  speed_dial_stat_req_message
 
struct  speed_dial_stat_res_message
 
struct  start_media_transmission_message_ip4
 
struct  start_media_transmission_message_ip6
 
struct  start_tone_message
 
struct  station_capabilities
 
struct  stimulus_message
 
struct  stop_media_transmission_message
 
struct  stop_tone_message
 
struct  version_res_message
 

Macros

#define ACTIVATE_CALL_PLANE_MESSAGE   0x0116
 
#define ALARM_MESSAGE   0x0020
 
#define BKSP_REQ_MESSAGE   0x0119
 
#define BT_AUTOANSWER   STIMULUS_AUTOANSWER
 
#define BT_CALLPARK   STIMULUS_CALLPARK
 
#define BT_CALLPICKUP   STIMULUS_CALLPICKUP
 
#define BT_CONFERENCE   STIMULUS_CONFERENCE
 
#define BT_CUST_LINE   0xB1 /* line or speeddial with hint only */
 
#define BT_CUST_LINESPEEDDIAL   0xB0 /* line or speeddial with/without hint */
 
#define BT_DISPLAY   STIMULUS_DISPLAY
 
#define BT_DND   STIMULUS_DND
 
#define BT_FORWARDALL   STIMULUS_FORWARDALL
 
#define BT_FORWARDBUSY   STIMULUS_FORWARDBUSY
 
#define BT_FORWARDNOANSWER   STIMULUS_FORWARDNOANSWER
 
#define BT_HOLD   STIMULUS_HOLD
 
#define BT_LINE   STIMULUS_LINE
 
#define BT_NONE   0x00
 
#define BT_REDIAL   STIMULUS_REDIAL
 
#define BT_SERVICEURL   STIMULUS_SERVICEURL
 
#define BT_SPEEDDIAL   STIMULUS_SPEEDDIAL
 
#define BT_TRANSFER   STIMULUS_TRANSFER
 
#define BT_VOICEMAIL   STIMULUS_VOICEMAIL
 
#define BUTTON_TEMPLATE_REQ_MESSAGE   0x000E
 
#define BUTTON_TEMPLATE_RES_MESSAGE   0x0097
 
#define CALL_INFO_MESSAGE   0x008F
 
#define CALL_INFO_MESSAGE_VARIABLE   0x014A
 
#define CALL_STATE_MESSAGE   0x0111
 
#define CALLSTATE2STR_BUFSIZE   15
 
#define CAPABILITIES_REQ_MESSAGE   0x009B
 
#define CAPABILITIES_RES_MESSAGE   0x0010
 
#define CDEV   ((struct skinny_device *)item)
 
#define CDEV_OPTS   ((struct skinny_device_options *)item)
 
#define CLEAR_DISPLAY_MESSAGE   0x009A
 
#define CLEAR_NOTIFY_MESSAGE   0x0115
 
#define CLEAR_PRINOTIFY_MESSAGE   0x0121
 
#define CLEAR_PROMPT_MESSAGE   0x0113
 
#define CLINE   ((struct skinny_line *)item)
 
#define CLINE_OPTS   ((struct skinny_line_options *)item)
 
#define CLOSE_RECEIVE_CHANNEL_MESSAGE   0x0106
 
#define CONTROL2STR_BUFSIZE   100
 
#define DEBUG_AUDIO   (1 << 4)
 
#define DEBUG_GENERAL   (1 << 1)
 
#define DEBUG_HINT   (1 << 8)
 
#define DEBUG_KEEPALIVE   (1 << 9)
 
#define DEBUG_LOCK   (1 << 5)
 
#define DEBUG_PACKET   (1 << 3)
 
#define DEBUG_SUB   (1 << 2)
 
#define DEBUG_TEMPLATE   (1 << 6)
 
#define DEBUG_THREAD   (1 << 7)
 
#define DEFAULT_AUTH_LIMIT   50
 
#define DEFAULT_AUTH_TIMEOUT   30
 
#define DEFAULT_SKINNY_BACKLOG   2
 
#define DEFAULT_SKINNY_PORT   2000
 
#define DEFINETIMEDATE_MESSAGE   0x0094
 
#define DEVICE2STR_BUFSIZE   15
 
#define DIALED_NUMBER_MESSAGE   0x011D
 
#define DIALTYPE_CFWD   1<<1
 
#define DIALTYPE_NORMAL   1<<0
 
#define DIALTYPE_XFER   1<<2
 
#define DISPLAY_NOTIFY_MESSAGE   0x0114
 
#define DISPLAY_PRINOTIFY_MESSAGE   0x0120
 
#define DISPLAY_PRINOTIFY_MESSAGE_VARIABLE   0x0144
 
#define DISPLAY_PROMPT_STATUS_MESSAGE   0x0112
 
#define DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE   0x0145
 
#define DISPLAYTEXT_MESSAGE   0x0099
 
#define ENBLOC_CALL_MESSAGE   0x0004
 
#define FORWARD_STAT_MESSAGE   0x0090
 
#define HEADSET_STATUS_MESSAGE   0x002B
 
#define htolel(x)   bswap_32(x)
 
#define htoles(x)   bswap_16(x)
 
#define IP_PORT_MESSAGE   0x0002
 
#define KEEP_ALIVE_ACK_MESSAGE   0x0100
 
#define KEEP_ALIVE_MESSAGE   0x0000
 
#define KEYDEF_CONNECTED   1
 
#define KEYDEF_CONNWITHCONF   7
 
#define KEYDEF_CONNWITHTRANS   5
 
#define KEYDEF_DADFD   6 /* Digits After Dialing First Digit */
 
#define KEYDEF_OFFHOOK   4
 
#define KEYDEF_OFFHOOKWITHFEAT   9
 
#define KEYDEF_ONHOLD   2
 
#define KEYDEF_ONHOOK   0
 
#define KEYDEF_RINGIN   3
 
#define KEYDEF_RINGOUT   8
 
#define KEYDEF_RINGOUTWITHTRANS   13
 
#define KEYDEF_SLACONNECTEDNOTACTIVE   12
 
#define KEYDEF_SLAHOLD   11
 
#define KEYDEF_UNKNOWN   10
 
#define KEYMASK_ALL   0xFFFFFFFF
 
#define KEYMASK_ANSWER   (1 << 11)
 
#define KEYMASK_BKSPC   (1 << 8)
 
#define KEYMASK_CFWDALL   (1 << 5)
 
#define KEYMASK_CFWDBUSY   (1 << 6)
 
#define KEYMASK_CFWDNOANSWER   (1 << 7)
 
#define KEYMASK_CONFRN   (1 << 13)
 
#define KEYMASK_DND   (1 << 29)
 
#define KEYMASK_ENDCALL   (1 << 9)
 
#define KEYMASK_FORCEDIAL   (1 << 21)
 
#define KEYMASK_GPICKUP   (1 << 18)
 
#define KEYMASK_HOLD   (1 << 3)
 
#define KEYMASK_IDIVERT   (1 << 20)
 
#define KEYMASK_INFO   (1 << 12)
 
#define KEYMASK_JOIN   (1 << 15)
 
#define KEYMASK_MEETME   (1 << 16)
 
#define KEYMASK_NEWCALL   (1 << 2)
 
#define KEYMASK_NONE   (1 << 0)
 
#define KEYMASK_PARK   (1 << 14)
 
#define KEYMASK_PICKUP   (1 << 17)
 
#define KEYMASK_REDIAL   (1 << 1)
 
#define KEYMASK_RESUME   (1 << 10)
 
#define KEYMASK_TRNSFER   (1 << 4)
 
#define KEYPAD_BUTTON_MESSAGE   0x0003
 
#define letohl(x)   bswap_32(x)
 
#define letohs(x)   bswap_16(x)
 
#define LINE_STAT_RES_MESSAGE   0x0092
 
#define LINE_STATE_REQ_MESSAGE   0x000B
 
#define MAX_SERVICEURL   256
 
#define MAXCALLINFOSTR   256
 
#define MAXDISPLAYNOTIFYSTR   32
 
#define MESSAGE2STR_BUFSIZE   35
 
#define OCTAL_ANSWER   "\200\013" /* Answer */
 
#define OCTAL_BARGE   "\200\103" /* Barge */
 
#define OCTAL_BARGEEXIST   "\200\105" /* Another Barge exists */
 
#define OCTAL_BARGEFAIL   "\200\104" /* Failed to setup Barge */
 
#define OCTAL_BKSPC   "\200\010" /* << */
 
#define OCTAL_BUSY   "\200\031" /* Busy */
 
#define OCTAL_CALLBACK   "\200\101" /* CallBack */
 
#define OCTAL_CALLDURTIMEOUT   "\200\131" /* Max Call Duration Timeout */
 
#define OCTAL_CALLPARK   "\200\035" /* Call Park */
 
#define OCTAL_CALLPROCEED   "\200\036" /* Call Proceed */
 
#define OCTAL_CALLWAITING   "\200\033" /* Call Waiting */
 
#define OCTAL_CALLXFER   "\200\034" /* Call Transfer */
 
#define OCTAL_CANTCOMPCNF   "\200\046" /* Can Not Complete Conference */
 
#define OCTAL_CANTCOMPLXFER   "\200\122" /* Can Not Complete Transfer */
 
#define OCTAL_CANTJOINCALLS   "\200\123" /* Can Not Join Calls */
 
#define OCTAL_CBARGE   "\200\121" /* cBarge */
 
#define OCTAL_CFWDALL   "\200\005" /* CFwdALL */
 
#define OCTAL_CFWDBUSY   "\200\006" /* CFwdBusy */
 
#define OCTAL_CFWDNOAN   "\200\007" /* CFwdNoAnswer */
 
#define OCTAL_CM1   "\200\167" /* CallManager 1 */
 
#define OCTAL_CM2   "\200\170" /* CallManager 2 */
 
#define OCTAL_CM3   "\200\171" /* CallManager 3 */
 
#define OCTAL_CM4   "\200\172" /* CallManager 4 */
 
#define OCTAL_CM5   "\200\173" /* CallManager 5 */
 
#define OCTAL_CONFERENCE   "\200\064" /* Conference */
 
#define OCTAL_CONFLIST   "\200\117" /* ConfList */
 
#define OCTAL_CONFRN   "\200\015" /* Confrn */
 
#define OCTAL_CONNECTED   "\200\030" /* Connected */
 
#define OCTAL_CUROPTS   "\200\023" /* Your current options */
 
#define OCTAL_DIRTRFR   "\200\115" /* DirTrfr */
 
#define OCTAL_DIVALL   "\200\100" /* DivAll */
 
#define OCTAL_DND   "\200\077" /* DND */
 
#define OCTAL_DNS1   "\200\160" /* DNS Server 1 */
 
#define OCTAL_DNS2   "\200\161" /* DNS Server 2 */
 
#define OCTAL_DNS3   "\200\162" /* DNS Server 3 */
 
#define OCTAL_DNS4   "\200\163" /* DNS Server 4 */
 
#define OCTAL_DNS5   "\200\164" /* DNS Server 5 */
 
#define OCTAL_DOMAIN   "\200\147" /* Domain Name */
 
#define OCTAL_ENDCALL   "\200\011" /* EndCall */
 
#define OCTAL_ENTRNUM   "\200\040" /* Enter number */
 
#define OCTAL_ERRDB   "\200\060" /* Error Database */
 
#define OCTAL_ERRDBCFG   "\200\057" /* Error DBConfig */
 
#define OCTAL_ERRMISMATCH   "\200\063" /* Error Mismatch */
 
#define OCTAL_ERRNOLIC   "\200\056" /* Error No License */
 
#define OCTAL_ERRPASSLMT   "\200\061" /* Error Pass Limit */
 
#define OCTAL_ERRUNK   "\200\062" /* Error Unknown */
 
#define OCTAL_EXTXFERRESTRICT   "\200\141" /* External Transfer Restricted */
 
#define OCTAL_FROM   "\200\027" /* From */
 
#define OCTAL_FWDEDTO   "\200\045" /* Forwarded to */
 
#define OCTAL_GPICKUP   "\200\022" /* GPickUp */
 
#define OCTAL_HAVEVMAIL   "\200\044" /* You Have VoiceMail */
 
#define OCTAL_HITRAFFIC   "\200\112" /* High Traffic Try Again Later */
 
#define OCTAL_HOLD   "\200\003" /* Hold */
 
#define OCTAL_HOLDDURTIMEOUT   "\200\132" /* Max Hold Duration Timeout */
 
#define OCTAL_HOST   "\200\146" /* Host Name */
 
#define OCTAL_IDIVERT   "\200\120" /* iDivert */
 
#define OCTAL_IMMDIV   "\200\073" /* ImmDiv */
 
#define OCTAL_INCOMPATDEV   "\200\106" /* Incompatible device type */
 
#define OCTAL_INCONFALREADY   "\200\052" /* In Conference Already */
 
#define OCTAL_INFO   "\200\014" /* Info */
 
#define OCTAL_INSUFBANDW   "\200\067" /* Not Enough Bandwidth */
 
#define OCTAL_INTRCPT   "\200\074" /* Intrcpt */
 
#define OCTAL_INUSEREMOTE   "\200\037" /* In Use Remote */
 
#define OCTAL_INVALCONFPART   "\200\051" /* Invalid Conference Participant */
 
#define OCTAL_IPADD   "\200\150" /* IP Address */
 
#define OCTAL_JOIN   "\200\017" /* Join */
 
#define OCTAL_KEYNOTACTIVE   "\200\055" /* Key Is Not Active */
 
#define OCTAL_LINEINUSE   "\200\032" /* Line In Use */
 
#define OCTAL_MACADD   "\200\145" /* Mac Address */
 
#define OCTAL_MAXPARTEXCEED   "\200\054" /* Exceed Maximum Parties */
 
#define OCTAL_MCID   "\200\114" /* MCID */
 
#define OCTAL_MCIDSUCCESS   "\200\124" /* Mcid Successful */
 
#define OCTAL_MEETME   "\200\020" /* MeetMe */
 
#define OCTAL_NETCNGREROUT   "\200\102" /* Network congestion,rerouting */
 
#define OCTAL_NEWCALL   "\200\002" /* New Call */
 
#define OCTAL_NOCONFBRDG   "\200\047" /* No Conference Bridge */
 
#define OCTAL_NOPARTINFO   "\200\053" /* No Participant Info */
 
#define OCTAL_NOPRIMARYCTL   "\200\050" /* Can Not Hold Primary Control */
 
#define OCTAL_NUMNOTCFG   "\200\125" /* Number Not Configured */
 
#define OCTAL_OFFHOOK   "\200\024" /* Off Hook */
 
#define OCTAL_ONHOOK   "\200\025" /* On Hook */
 
#define OCTAL_OPICKUP   "\200\133" /* OPickUp */
 
#define OCTAL_PARK   "\200\016" /* Park */
 
#define OCTAL_PARKAT   "\200\041" /* Call park At */
 
#define OCTAL_PARKNO   "\200\065" /* Park Number */
 
#define OCTAL_PARKNONUM   "\200\107" /* No Park Number Available */
 
#define OCTAL_PARKREVERSION   "\200\110" /* CallPark Reversion */
 
#define OCTAL_PICKUP   "\200\021" /* PickUp */
 
#define OCTAL_PRIMONLY   "\200\042" /* Primary Only */
 
#define OCTAL_PRIVATE   "\200\066" /* Private */
 
#define OCTAL_QRT   "\200\113" /* QRT */
 
#define OCTAL_REDIAL   "\200\001" /* Redial */
 
#define OCTAL_RESUME   "\200\012" /* Resume */
 
#define OCTAL_RINGOUT   "\200\026" /* Ring out */
 
#define OCTAL_RMLSTC   "\200\071" /* RmLstC */
 
#define OCTAL_ROUTER1   "\200\153" /* Default Router 1 */
 
#define OCTAL_ROUTER2   "\200\154" /* Default Router 2 */
 
#define OCTAL_ROUTER3   "\200\155" /* Default Router 3 */
 
#define OCTAL_ROUTER4   "\200\156" /* Default Router 4 */
 
#define OCTAL_ROUTER5   "\200\157" /* Default Router 5 */
 
#define OCTAL_SECERROR   "\200\126" /* Security Error */
 
#define OCTAL_SELECT   "\200\116" /* Select */
 
#define OCTAL_SETWTCH   "\200\075" /* SetWtch */
 
#define OCTAL_SRVNOTACTIVE   "\200\111" /* Service is not Active */
 
#define OCTAL_SUBMASK   "\200\151" /* Subnet Mask */
 
#define OCTAL_TFTP1   "\200\152" /* TFTP Server 1 */
 
#define OCTAL_TMPFAIL   "\200\043" /* Temp Fail */
 
#define OCTAL_TRANSFER   "\200\004" /* Transfer */
 
#define OCTAL_TRNSFVM   "\200\076" /* TrnsfVM */
 
#define OCTAL_UNKNUM   "\200\070" /* Unknown Number */
 
#define OCTAL_URLDIRS   "\200\175" /* Directories URL */
 
#define OCTAL_URLINFO   "\200\174" /* Information URL */
 
#define OCTAL_URLMSGS   "\200\176" /* Messages URL */
 
#define OCTAL_URLSRVS   "\200\177" /* Services URL */
 
#define OCTAL_VIDBANDWNA   "\200\127" /* Video Bandwidth Unavailable */
 
#define OCTAL_VIDMODE   "\200\130" /* VidMode */
 
#define OCTAL_VLANADID   "\200\166" /* Admin. VLAN Id */
 
#define OCTAL_VLANOPID   "\200\165" /* Operational VLAN Id */
 
#define OCTAL_VOICEMAIL   "\200\072" /* Voicemail */
 
#define OFFHOOK_MESSAGE   0x0006
 
#define ONHOOK_MESSAGE   0x0007
 
#define OPEN_RECEIVE_CHANNEL_ACK_MESSAGE   0x0022
 
#define OPEN_RECEIVE_CHANNEL_MESSAGE   0x0105
 
#define PACKET_TIMEOUT   10000
 
#define REGISTER_ACK_MESSAGE   0x0081
 
#define REGISTER_AVAILABLE_LINES_MESSAGE   0x002D
 
#define REGISTER_MESSAGE   0x0001
 
#define REGISTER_REJ_MESSAGE   0x009D
 
#define RESET_MESSAGE   0x009F
 
#define SELECT_SOFT_KEYS_MESSAGE   0x0110
 
#define SERVER_REQUEST_MESSAGE   0x0012
 
#define SERVER_RES_MESSAGE   0x009E
 
#define SERVICEURL_STAT_MESSAGE   0x012F
 
#define SERVICEURL_STATREQ_MESSAGE   0x0033
 
#define SET_LAMP_MESSAGE   0x0086
 
#define SET_MICROPHONE_MESSAGE   0x0089
 
#define SET_RINGER_MESSAGE   0x0085
 
#define SET_SPEAKER_MESSAGE   0x0088
 
#define SKINNY_ALERT   0x24
 
#define SKINNY_BARGIN   0x43
 
#define SKINNY_BEEPBONK   0x33
 
#define SKINNY_BUSY   6
 
#define SKINNY_BUSYTONE   0x23
 
#define SKINNY_CALLREMOTEMULTILINE   13
 
#define SKINNY_CALLWAIT   9
 
#define SKINNY_CALLWAITTONE   0x2D
 
#define SKINNY_CFWD_ALL   (1 << 0)
 
#define SKINNY_CFWD_BUSY   (1 << 1)
 
#define SKINNY_CFWD_NOANSWER   (1 << 2)
 
#define SKINNY_CONGESTION   7
 
#define SKINNY_CONNECTED   5
 
#define SKINNY_CX_CONF   3
 
#define SKINNY_CX_CONFERENCE   3
 
#define SKINNY_CX_INACTIVE   4
 
#define SKINNY_CX_MUTE   4
 
#define SKINNY_CX_RECVONLY   1
 
#define SKINNY_CX_SENDONLY   0
 
#define SKINNY_CX_SENDRECV   2
 
#define SKINNY_DEBUG(type, verb_level, text, ...)
 
#define SKINNY_DEVICE_12   4
 
#define SKINNY_DEVICE_12SP   3
 
#define SKINNY_DEVICE_12SPPLUS   2
 
#define SKINNY_DEVICE_30SPPLUS   1
 
#define SKINNY_DEVICE_30VIP   5
 
#define SKINNY_DEVICE_7902   30008
 
#define SKINNY_DEVICE_7905   20000
 
#define SKINNY_DEVICE_7906   369
 
#define SKINNY_DEVICE_7910   6
 
#define SKINNY_DEVICE_7911   307
 
#define SKINNY_DEVICE_7912   30007
 
#define SKINNY_DEVICE_7914   124 /* Expansion module */
 
#define SKINNY_DEVICE_7920   30002
 
#define SKINNY_DEVICE_7921   365
 
#define SKINNY_DEVICE_7931   348
 
#define SKINNY_DEVICE_7935   9
 
#define SKINNY_DEVICE_7936   30019
 
#define SKINNY_DEVICE_7937   431
 
#define SKINNY_DEVICE_7940   8
 
#define SKINNY_DEVICE_7941   115
 
#define SKINNY_DEVICE_7941GE   309
 
#define SKINNY_DEVICE_7942   434
 
#define SKINNY_DEVICE_7945   435
 
#define SKINNY_DEVICE_7960   7
 
#define SKINNY_DEVICE_7961   30018
 
#define SKINNY_DEVICE_7961GE   308
 
#define SKINNY_DEVICE_7962   404 /* Not found */
 
#define SKINNY_DEVICE_7965   436
 
#define SKINNY_DEVICE_7970   30006
 
#define SKINNY_DEVICE_7971   119
 
#define SKINNY_DEVICE_7975   437
 
#define SKINNY_DEVICE_7985   302
 
#define SKINNY_DEVICE_ATA186   12 /* Cisco ATA-186 */
 
#define SKINNY_DEVICE_CIPC   30016 /* Cisco IP Communicator */
 
#define SKINNY_DEVICE_NONE   0
 
#define SKINNY_DEVICE_OPTIONS
 
#define SKINNY_DEVICE_SCCPGATEWAY_AN   30027 /* Analog gateway */
 
#define SKINNY_DEVICE_SCCPGATEWAY_BRI   30028 /* BRI gateway */
 
#define SKINNY_DEVICE_UNKNOWN   -1
 
#define SKINNY_DEVICECONTAINER   1
 
#define SKINNY_DIALTONE   0x21
 
#define SKINNY_HOLD   8
 
#define SKINNY_INCOMING   1
 
#define SKINNY_INVALID   14
 
#define SKINNY_LAMP_BLINK   5
 
#define SKINNY_LAMP_FLASH   4
 
#define SKINNY_LAMP_OFF   1
 
#define SKINNY_LAMP_ON   2
 
#define SKINNY_LAMP_WINK   3
 
#define SKINNY_LINE_OPTIONS
 
#define SKINNY_LINECONTAINER   2
 
#define SKINNY_MAX_CAPABILITIES   18
 
#define SKINNY_MAX_PACKET   2000
 
#define SKINNY_MICOFF   2
 
#define SKINNY_MICON   1
 
#define SKINNY_NOTONE   0x7F
 
#define SKINNY_OFFHOOK   1
 
#define SKINNY_ONHOOK   2
 
#define SKINNY_OUTGOING   2
 
#define SKINNY_PARK   11
 
#define SKINNY_PROGRESS   12
 
#define SKINNY_REORDER   0x25
 
#define SKINNY_RING_FEATURE   4
 
#define SKINNY_RING_INSIDE   2
 
#define SKINNY_RING_OFF   1
 
#define SKINNY_RING_OUTSIDE   3
 
#define SKINNY_RINGIN   4
 
#define SKINNY_RINGOUT   3
 
#define SKINNY_SDCONTAINER   4
 
#define SKINNY_SILENCE   0x00 /* Note sure this is part of the protocol, remove? */
 
#define SKINNY_SPEAKEROFF   2
 
#define SKINNY_SPEAKERON   1
 
#define SKINNY_SUBLINECONTAINER   3
 
#define SKINNY_TRANSFER   10
 
#define SKINNY_ZIP   0x32
 
#define SKINNY_ZIPZIP   0x31
 
#define SOFT_KEY_EVENT_MESSAGE   0x0026
 
#define SOFT_KEY_SET_REQ_MESSAGE   0x0025
 
#define SOFT_KEY_SET_RES_MESSAGE   0x0109
 
#define SOFT_KEY_TEMPLATE_REQ_MESSAGE   0x0028
 
#define SOFT_KEY_TEMPLATE_RES_MESSAGE   0x0108
 
#define SOFTKEY_ANSWER   0x0B
 
#define SOFTKEY_BKSPC   0x08
 
#define SOFTKEY_CFWDALL   0x05
 
#define SOFTKEY_CFWDBUSY   0x06
 
#define SOFTKEY_CFWDNOANSWER   0x07
 
#define SOFTKEY_CONFRN   0x0D
 
#define SOFTKEY_DND   0x13
 
#define SOFTKEY_ENDCALL   0x09
 
#define SOFTKEY_FORCEDIAL   0x15
 
#define SOFTKEY_GPICKUP   0x12
 
#define SOFTKEY_HOLD   0x03
 
#define SOFTKEY_IDIVERT   0x14
 
#define SOFTKEY_INFO   0x0C
 
#define SOFTKEY_JOIN   0x0F
 
#define SOFTKEY_MEETME   0x10
 
#define SOFTKEY_NEWCALL   0x02
 
#define SOFTKEY_NONE   0x00
 
#define SOFTKEY_PARK   0x0E
 
#define SOFTKEY_PICKUP   0x11
 
#define SOFTKEY_REDIAL   0x01
 
#define SOFTKEY_RESUME   0x0A
 
#define SOFTKEY_TRNSFER   0x04
 
#define SPEED_DIAL_STAT_REQ_MESSAGE   0x000A
 
#define SPEED_DIAL_STAT_RES_MESSAGE   0x0091
 
#define START_MEDIA_TRANSMISSION_MESSAGE   0x008A
 
#define START_TONE_MESSAGE   0x0082
 
#define STIMULUS_AUTOANSWER   0x11
 
#define STIMULUS_CALLPARK   0x7E
 
#define STIMULUS_CALLPICKUP   0x7F
 
#define STIMULUS_CONFERENCE   0x7D
 
#define STIMULUS_DISPLAY   0x08
 
#define STIMULUS_DND   0x3F
 
#define STIMULUS_FORWARDALL   0x05
 
#define STIMULUS_FORWARDBUSY   0x06
 
#define STIMULUS_FORWARDNOANSWER   0x07
 
#define STIMULUS_HOLD   0x03
 
#define STIMULUS_LINE   0x09
 
#define STIMULUS_MESSAGE   0x0005
 
#define STIMULUS_NONE   0xFF
 
#define STIMULUS_REDIAL   0x01
 
#define STIMULUS_SERVICEURL   0x14
 
#define STIMULUS_SPEEDDIAL   0x02
 
#define STIMULUS_TRANSFER   0x04
 
#define STIMULUS_VOICEMAIL   0x0F
 
#define STOP_MEDIA_TRANSMISSION_MESSAGE   0x008B
 
#define STOP_TONE_MESSAGE   0x0083
 
#define SUBSTATE2STR_BUFSIZE   15
 
#define SUBSTATE_BUSY   6
 
#define SUBSTATE_CALLWAIT   9
 
#define SUBSTATE_CONGESTION   7
 
#define SUBSTATE_CONNECTED   5
 
#define SUBSTATE_DIALING   101
 
#define SUBSTATE_HOLD   8
 
#define SUBSTATE_OFFHOOK   1
 
#define SUBSTATE_ONHOOK   2
 
#define SUBSTATE_PROGRESS   12
 
#define SUBSTATE_RINGIN   4
 
#define SUBSTATE_RINGOUT   3
 
#define SUBSTATE_UNSET   0
 
#define TIME_DATE_REQ_MESSAGE   0x000D
 
#define TYPE_DEF_DEVICE   2
 
#define TYPE_DEF_LINE   4
 
#define TYPE_DEVICE   8
 
#define TYPE_GENERAL   1
 
#define TYPE_LINE   16
 
#define UNREGISTER_MESSAGE   0x0027
 
#define VERSION_REQ_MESSAGE   0x000F
 
#define VERSION_RES_MESSAGE   0x0098
 

Enumerations

enum  skinny_codecs {
  SKINNY_CODEC_ALAW = 2, SKINNY_CODEC_ULAW = 4, SKINNY_CODEC_G722 = 6, SKINNY_CODEC_G723_1 = 9,
  SKINNY_CODEC_G729A = 12, SKINNY_CODEC_G726_32 = 82, SKINNY_CODEC_H261 = 100, SKINNY_CODEC_H263 = 101
}
 

Functions

static void __init_callstate2str_threadbuf (void)
 
static void __init_control2str_threadbuf (void)
 
static void __init_device2str_threadbuf (void)
 
static void __init_message2str_threadbuf (void)
 
static void __init_substate2str_threadbuf (void)
 
static void __reg_module (void)
 
static void __unreg_module (void)
 
static char * _skinny_message_clear (int type, int fd, struct mansession *s, const struct message *m, int argc, const char *const *argv)
 
static char * _skinny_message_set (int type, int fd, struct mansession *s, const struct message *m, int argc, const char *const *argv)
 
static char * _skinny_show_device (int type, int fd, struct mansession *s, const struct message *m, int argc, const char *const *argv)
 
static char * _skinny_show_devices (int fd, int *total, struct mansession *s, const struct message *m, int argc, const char *const *argv)
 
static char * _skinny_show_line (int type, int fd, struct mansession *s, const struct message *m, int argc, const char *const *argv)
 
static char * _skinny_show_lines (int fd, int *total, struct mansession *s, const struct message *m, int argc, const char *const *argv)
 
static void _transmit_displayprinotify (struct skinny_device *d, const char *text, const char *extratext, int timeout, int priority)
 
static void _transmit_displayprinotifyvar (struct skinny_device *d, const char *text, const char *extratext, int timeout, int priority)
 
static void * accept_thread (void *ignore)
 
static void activatesub (struct skinny_subchannel *sub, int state)
 
static struct ast_variableadd_var (const char *buf, struct ast_variable *list)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static char * callstate2str (int ind)
 
static void cleanup_stale_contexts (char *new, char *old)
 
static int codec_ast2skinny (const struct ast_format *astcodec)
 
static struct ast_formatcodec_skinny2ast (enum skinny_codecs skinnycodec)
 
static char * complete_skinny_debug (const char *line, const char *word, int pos, int state)
 
static char * complete_skinny_devices (const char *word, int state)
 
static char * complete_skinny_reset (const char *line, const char *word, int pos, int state)
 
static char * complete_skinny_show_device (const char *line, const char *word, int pos, int state)
 
static char * complete_skinny_show_line (const char *line, const char *word, int pos, int state)
 
static struct skinny_deviceconfig_device (const char *dname, struct ast_variable *v)
 
static struct skinny_lineconfig_line (const char *lname, struct ast_variable *v)
 
static int config_load (void)
 
static void config_parse_variables (int type, void *item, struct ast_variable *vptr)
 
static char * control2str (int ind)
 
static void delete_devices (void)
 
static void destroy_rtp (struct skinny_subchannel *sub)
 
static void destroy_session (struct skinnysession *s)
 
static char * device2str (int type)
 
static void dialandactivatesub (struct skinny_subchannel *sub, char exten[AST_MAX_EXTENSION])
 
static void dumpsub (struct skinny_subchannel *sub, int forcehangup)
 
static void end_session (struct skinnysession *s)
 
static struct skinny_linefind_line_by_instance (struct skinny_device *d, int instance)
 
static struct skinny_linefind_line_by_name (const char *dest)
 
static struct skinny_speeddialfind_speeddial_by_instance (struct skinny_device *d, int instance, int isHint)
 
static struct skinny_subchannelfind_subchannel_by_instance_reference (struct skinny_device *d, int instance, int reference)
 
static struct skinny_subchannelfind_subchannel_by_reference (struct skinny_device *d, int reference)
 
static struct skinny_sublinefind_subline_by_callid (struct skinny_device *d, int callid)
 
static struct skinny_sublinefind_subline_by_name (const char *dest)
 
static void * get_button_template (struct skinnysession *s, struct button_definition_template *btn)
 
static int get_devicestate (struct skinny_line *l)
 
static int handle_button_template_req_message (struct skinny_req *req, struct skinnysession *s)
 
static void handle_callforward_button (struct skinny_line *l, struct skinny_subchannel *sub, int cfwdtype)
 
static int handle_capabilities_res_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_enbloc_call_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_hold_button (struct skinny_subchannel *sub)
 
static int handle_ip_port_message (struct skinny_req *req, struct skinnysession *s)
 
static void handle_keepalive_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_keypad_button_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_offhook_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_onhook_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_open_receive_channel_ack_message (struct skinny_req *req, struct skinnysession *s)
 
static char * handle_skinny_message_clear (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 Handle clearing messages to devices. More...
 
static char * handle_skinny_message_set (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 Handle sending messages to devices. More...
 
static char * handle_skinny_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static char * handle_skinny_reset (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static char * handle_skinny_set_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static char * handle_skinny_show_device (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 Show device information. More...
 
static char * handle_skinny_show_devices (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static char * handle_skinny_show_line (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 List line information. More...
 
static char * handle_skinny_show_lines (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static char * handle_skinny_show_settings (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 List global settings for the Skinny subsystem. More...
 
static int handle_soft_key_event_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_stimulus_message (struct skinny_req *req, struct skinnysession *s)
 
static int handle_transfer_button (struct skinny_subchannel *sub)
 
static int keyset_translatebitmask (int keyset, int intmask)
 
static int load_module (void)
 Load the module. More...
 
static int manager_skinny_show_device (struct mansession *s, const struct message *m)
 
static int manager_skinny_show_devices (struct mansession *s, const struct message *m)
 Show SKINNY devices in the manager API. More...
 
static int manager_skinny_show_line (struct mansession *s, const struct message *m)
 
static int manager_skinny_show_lines (struct mansession *s, const struct message *m)
 Show Skinny lines in the manager API. More...
 
static void mwi_event_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg)
 
static void push_callinfo (struct skinny_subline *subline, struct skinny_subchannel *sub)
 
static void register_exten (struct skinny_line *l)
 
static int reload (void)
 
static struct skinny_reqreq_alloc (size_t size, int response_message)
 
static void send_callinfo (struct skinny_subchannel *sub)
 
static void send_displayprinotify (struct skinny_device *d, const char *text, const char *extratext, int timeout, int priority)
 
static void send_displaypromptstatus (struct skinny_device *d, const char *text, const char *extratext, int t, int instance, int callid)
 
static int set_callforwards (struct skinny_line *l, const char *cfwd, int cfwdtype)
 
static void setsubstate (struct skinny_subchannel *sub, int state)
 
static int skinny_answer (struct ast_channel *ast)
 
static int skinny_autoanswer_cb (const void *data)
 
static int skinny_call (struct ast_channel *ast, const char *dest, int timeout)
 
static int skinny_cfwd_cb (const void *data)
 
static char * skinny_debugs (void)
 
static struct skinny_deviceskinny_device_alloc (const char *dname)
 
static struct skinny_deviceskinny_device_destroy (struct skinny_device *d)
 
static int skinny_devicestate (const char *data)
 
static void skinny_dialer (struct skinny_subchannel *sub, int timedout)
 
static int skinny_dialer_cb (const void *data)
 
static int skinny_extensionstate_cb (const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
 
static int skinny_fixup (struct ast_channel *oldchan, struct ast_channel *newchan)
 
static enum ast_rtp_glue_result skinny_get_rtp_peer (struct ast_channel *c, struct ast_rtp_instance **instance)
 
static enum ast_rtp_glue_result skinny_get_vrtp_peer (struct ast_channel *c, struct ast_rtp_instance **instance)
 
static int skinny_hangup (struct ast_channel *ast)
 
static int skinny_indicate (struct ast_channel *ast, int ind, const void *data, size_t datalen)
 
static struct skinny_lineskinny_line_alloc (void)
 
static struct skinny_lineskinny_line_destroy (struct skinny_line *l)
 
static void skinny_locksub (struct skinny_subchannel *sub)
 
static struct ast_channelskinny_new (struct skinny_line *l, struct skinny_subline *subline, int state, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, int direction)
 
static void * skinny_newcall (void *data)
 
static int skinny_noauth_cb (const void *data)
 
static int skinny_nokeepalive_cb (const void *data)
 
static struct ast_frameskinny_read (struct ast_channel *ast)
 
static int skinny_register (struct skinny_req *req, struct skinnysession *s)
 
static int skinny_reload (void)
 
static struct ast_channelskinny_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *dest, int *cause)
 
static struct ast_frameskinny_rtp_read (struct skinny_subchannel *sub)
 
static int skinny_sched_add (int when, ast_sched_cb callback, struct skinny_subchannel *sub)
 
static int skinny_sched_del (int sched_id, struct skinny_subchannel *sub)
 
static int skinny_senddigit_begin (struct ast_channel *ast, char digit)
 
static int skinny_senddigit_end (struct ast_channel *ast, char digit, unsigned int duration)
 
static void * skinny_session (void *data)
 
static void skinny_session_cleanup (void *data)
 
static void skinny_set_owner (struct skinny_subchannel *sub, struct ast_channel *chan)
 
static int skinny_set_rtp_peer (struct ast_channel *c, struct ast_rtp_instance *rtp, struct ast_rtp_instance *vrtp, struct ast_rtp_instance *trtp, const struct ast_format_cap *codecs, int nat_active)
 
static void skinny_transfer_attended (struct skinny_subchannel *sub)
 
static void skinny_transfer_blind (struct skinny_subchannel *sub)
 
static void skinny_unlocksub (struct skinny_subchannel *sub)
 
static int skinny_write (struct ast_channel *ast, struct ast_frame *frame)
 
static void start_rtp (struct skinny_subchannel *sub)
 
static char * substate2str (int ind)
 
static void transmit_activatecallplane (struct skinny_device *d, struct skinny_line *l)
 
static void transmit_backspace (struct skinny_device *d, int instance, unsigned callid)
 
static void transmit_callinfo (struct skinny_device *d, int instance, int callid, char *fromname, char *fromnum, char *toname, char *tonum, int calldirection, char *origtonum, char *origtoname)
 
static void transmit_callinfo_variable (struct skinny_device *d, int instance, int callreference, char *fromname, char *fromnum, char *toname, char *tonum, int calldirection, char *origtonum, char *origtoname)
 
static void transmit_callstate (struct skinny_device *d, int buttonInstance, unsigned callid, int state)
 
static void transmit_capabilitiesreq (struct skinny_device *d)
 
static void transmit_cfwdstate (struct skinny_device *d, struct skinny_line *l)
 
static void transmit_clear_display_message (struct skinny_device *d, int instance, int reference)
 
static void transmit_clearprinotify (struct skinny_device *d, int priority)
 
static void transmit_clearpromptmessage (struct skinny_device *d, int instance, int callid)
 
static void transmit_closereceivechannel (struct skinny_device *d, struct skinny_subchannel *sub)
 
static void transmit_connect (struct skinny_device *d, struct skinny_subchannel *sub)
 
static void transmit_definetimedate (struct skinny_device *d)
 
static void transmit_dialednumber (struct skinny_device *d, const char *text, int instance, int callid)
 
static void transmit_displaynotify (struct skinny_device *d, const char *text, int t)
 
static void transmit_displaypromptstatus (struct skinny_device *d, const char *text, const char *extratext, int t, int instance, int callid)
 
static void transmit_displaypromptstatusvar (struct skinny_device *d, const char *text, const char *extratext, int t, int instance, int callid)
 
static void transmit_keepaliveack (struct skinnysession *s)
 
static void transmit_lamp_indication (struct skinny_device *d, int stimulus, int instance, int indication)
 
static void transmit_linestatres (struct skinny_device *d, int instance)
 
static void transmit_microphone_mode (struct skinny_device *d, int mode)
 
static void transmit_registerack (struct skinny_device *d)
 
static void transmit_registerrej (struct skinnysession *s)
 
static void transmit_reset (struct skinny_device *d, int fullrestart)
 
static void transmit_response (struct skinny_device *d, struct skinny_req *req)
 
static int transmit_response_bysession (struct skinnysession *s, struct skinny_req *req)
 
static void transmit_ringer_mode (struct skinny_device *d, int mode)
 
static void transmit_selectsoftkeys (struct skinny_device *d, int instance, int callid, int softkey, int mask)
 
static void transmit_serverres (struct skinny_device *d)
 
static void transmit_serviceurlstat (struct skinny_device *d, int instance)
 
static void transmit_softkeysetres (struct skinny_device *d)
 
static void transmit_softkeytemplateres (struct skinny_device *d)
 
static void transmit_speaker_mode (struct skinny_device *d, int mode)
 
static void transmit_speeddialstatres (struct skinny_device *d, struct skinny_speeddial *sd)
 
static void transmit_start_tone (struct skinny_device *d, int tone, int instance, int reference)
 
static void transmit_startmediatransmission (struct skinny_device *d, struct skinny_subchannel *sub, struct sockaddr_in dest, struct ast_format *format, unsigned int framing)
 
static void transmit_stop_tone (struct skinny_device *d, int instance, int reference)
 
static void transmit_stopmediatransmission (struct skinny_device *d, struct skinny_subchannel *sub)
 
static void transmit_versionres (struct skinny_device *d)
 
static int unload_module (void)
 
static void unregister_exten (struct skinny_line *l)
 
static void update_connectedline (struct skinny_subchannel *sub, const void *data, size_t datalen)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Skinny Client Control Protocol (Skinny)" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DRIVER, }
 
static struct in_addr __ourip
 
static pthread_t accept_t
 
static struct ast_hostent ahp
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static int auth_limit = DEFAULT_AUTH_LIMIT
 
static int auth_timeout = DEFAULT_AUTH_TIMEOUT
 
static struct sockaddr_in bindaddr
 
static int callnums = 1
 
static struct ast_threadstorage callstate2str_threadbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_callstate2str_threadbuf , .custom_init = NULL , }
 
static struct ast_cli_entry cli_skinny []
 
static const char config [] = "skinny.conf"
 
static struct ast_threadstorage control2str_threadbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_control2str_threadbuf , .custom_init = NULL , }
 
static char date_format [6] = "D-M-Y"
 
char dbgcli_buf [256]
 
static struct ast_format_capdefault_cap
 
static struct skinny_device_optionsdefault_device = &default_device_struct
 
static struct skinny_device_options default_device_struct
 
static struct ast_jb_conf default_jbconf
 
static struct skinny_line_optionsdefault_line = &default_line_struct
 
static struct skinny_line_options default_line_struct
 
static struct ast_threadstorage device2str_threadbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_device2str_threadbuf , .custom_init = NULL , }
 
static struct devices devices = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , }
 
static int firstdigittimeout = 16000
 
static int gendigittimeout = 8000
 
static struct ast_jb_conf global_jbconf
 
static struct hostent * hp
 
static char immed_dialchar
 
static int keep_alive = 120
 
static struct lines lines = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , }
 
static int matchdigittimeout = 3000
 
static struct ast_threadstorage message2str_threadbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_message2str_threadbuf , .custom_init = NULL , }
 
static ast_mutex_t netlock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} }
 
static int not_used
 
static char ourhost [256]
 
static int ourport
 
struct {
   unsigned int   cos
 
   unsigned int   cos_audio
 
   unsigned int   cos_video
 
   unsigned int   tos
 
   unsigned int   tos_audio
 
   unsigned int   tos_video
 
qos = { 0, 0, 0, 0, 0, 0 }
 
static char regcontext [AST_MAX_CONTEXT]
 
static struct ast_sched_contextsched = NULL
 
static struct sessions sessions = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , }
 
static int skinny_header_size = 12
 
static struct ast_rtp_glue skinny_rtp_glue
 
static struct ast_channel_tech skinny_tech
 
static int skinnydebug = 0
 
static int skinnyreload = 0
 
static int skinnysock = -1
 
static const uint8_t soft_key_default_connected []
 
static const uint8_t soft_key_default_connwithconf []
 
static const uint8_t soft_key_default_connwithtrans []
 
static const uint8_t soft_key_default_dadfd []
 
static const struct soft_key_definitions soft_key_default_definitions []
 
static const uint8_t soft_key_default_offhook []
 
static const uint8_t soft_key_default_offhookwithfeat []
 
static const uint8_t soft_key_default_onhold []
 
static const uint8_t soft_key_default_onhook []
 
static const uint8_t soft_key_default_ringin []
 
static const uint8_t soft_key_default_ringout []
 
static const uint8_t soft_key_default_ringoutwithtransfer []
 
static const uint8_t soft_key_default_SLAconnectednotactive []
 
static const uint8_t soft_key_default_SLAhold []
 
static const uint8_t soft_key_default_unknown []
 
static struct soft_key_template_definition soft_key_template_default []
 
static struct ast_threadstorage substate2str_threadbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_substate2str_threadbuf , .custom_init = NULL , }
 
static const char tdesc [] = "Skinny Client Control Protocol (Skinny)"
 
static int unauth_sessions = 0
 
static char used_context [AST_MAX_EXTENSION]
 
static char version_id [16] = "P002F202"
 
static char vmexten [AST_MAX_EXTENSION]
 

Detailed Description

Implementation of the Skinny protocol.

Author
Jeremy McNamara & Florian Overkamp & North Antara

Definition in file chan_skinny.c.

Macro Definition Documentation

◆ ACTIVATE_CALL_PLANE_MESSAGE

#define ACTIVATE_CALL_PLANE_MESSAGE   0x0116

Definition at line 1092 of file chan_skinny.c.

Referenced by transmit_activatecallplane().

◆ ALARM_MESSAGE

#define ALARM_MESSAGE   0x0020

Definition at line 368 of file chan_skinny.c.

Referenced by handle_message().

◆ BKSP_REQ_MESSAGE

#define BKSP_REQ_MESSAGE   0x0119

Definition at line 688 of file chan_skinny.c.

Referenced by transmit_backspace().

◆ BT_AUTOANSWER

#define BT_AUTOANSWER   STIMULUS_AUTOANSWER

Definition at line 602 of file chan_skinny.c.

◆ BT_CALLPARK

#define BT_CALLPARK   STIMULUS_CALLPARK

Definition at line 606 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_CALLPICKUP

#define BT_CALLPICKUP   STIMULUS_CALLPICKUP

Definition at line 607 of file chan_skinny.c.

◆ BT_CONFERENCE

#define BT_CONFERENCE   STIMULUS_CONFERENCE

Definition at line 605 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_CUST_LINE

#define BT_CUST_LINE   0xB1 /* line or speeddial with hint only */

Definition at line 614 of file chan_skinny.c.

Referenced by get_button_template(), and handle_button_template_req_message().

◆ BT_CUST_LINESPEEDDIAL

#define BT_CUST_LINESPEEDDIAL   0xB0 /* line or speeddial with/without hint */

Definition at line 613 of file chan_skinny.c.

Referenced by get_button_template(), and handle_button_template_req_message().

◆ BT_DISPLAY

#define BT_DISPLAY   STIMULUS_DISPLAY

Definition at line 599 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_DND

#define BT_DND   STIMULUS_DND

Definition at line 604 of file chan_skinny.c.

◆ BT_FORWARDALL

#define BT_FORWARDALL   STIMULUS_FORWARDALL

Definition at line 596 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_FORWARDBUSY

#define BT_FORWARDBUSY   STIMULUS_FORWARDBUSY

Definition at line 597 of file chan_skinny.c.

◆ BT_FORWARDNOANSWER

#define BT_FORWARDNOANSWER   STIMULUS_FORWARDNOANSWER

Definition at line 598 of file chan_skinny.c.

◆ BT_HOLD

#define BT_HOLD   STIMULUS_HOLD

Definition at line 594 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_LINE

#define BT_LINE   STIMULUS_LINE

Definition at line 600 of file chan_skinny.c.

Referenced by get_button_template(), and handle_button_template_req_message().

◆ BT_NONE

#define BT_NONE   0x00

Definition at line 608 of file chan_skinny.c.

Referenced by get_button_template(), and handle_button_template_req_message().

◆ BT_REDIAL

#define BT_REDIAL   STIMULUS_REDIAL

Definition at line 592 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_SERVICEURL

#define BT_SERVICEURL   STIMULUS_SERVICEURL

Definition at line 603 of file chan_skinny.c.

Referenced by handle_button_template_req_message().

◆ BT_SPEEDDIAL

#define BT_SPEEDDIAL   STIMULUS_SPEEDDIAL

Definition at line 593 of file chan_skinny.c.

Referenced by get_button_template(), and handle_button_template_req_message().

◆ BT_TRANSFER

#define BT_TRANSFER   STIMULUS_TRANSFER

Definition at line 595 of file chan_skinny.c.

Referenced by get_button_template().

◆ BT_VOICEMAIL

#define BT_VOICEMAIL   STIMULUS_VOICEMAIL

Definition at line 601 of file chan_skinny.c.

Referenced by get_button_template().

◆ BUTTON_TEMPLATE_REQ_MESSAGE

#define BUTTON_TEMPLATE_REQ_MESSAGE   0x000E

Definition at line 364 of file chan_skinny.c.

Referenced by handle_message().

◆ BUTTON_TEMPLATE_RES_MESSAGE

#define BUTTON_TEMPLATE_RES_MESSAGE   0x0097

Definition at line 561 of file chan_skinny.c.

Referenced by handle_button_template_req_message().

◆ CALL_INFO_MESSAGE

#define CALL_INFO_MESSAGE   0x008F

Definition at line 499 of file chan_skinny.c.

Referenced by transmit_callinfo().

◆ CALL_INFO_MESSAGE_VARIABLE

#define CALL_INFO_MESSAGE_VARIABLE   0x014A

Definition at line 1127 of file chan_skinny.c.

Referenced by transmit_callinfo_variable().

◆ CALL_STATE_MESSAGE

#define CALL_STATE_MESSAGE   0x0111

Definition at line 1063 of file chan_skinny.c.

Referenced by transmit_callstate().

◆ CALLSTATE2STR_BUFSIZE

#define CALLSTATE2STR_BUFSIZE   15

Definition at line 279 of file chan_skinny.c.

Referenced by callstate2str().

◆ CAPABILITIES_REQ_MESSAGE

#define CAPABILITIES_REQ_MESSAGE   0x009B

Definition at line 639 of file chan_skinny.c.

Referenced by transmit_capabilitiesreq().

◆ CAPABILITIES_RES_MESSAGE

#define CAPABILITIES_RES_MESSAGE   0x0010

Definition at line 336 of file chan_skinny.c.

Referenced by handle_message().

◆ CDEV

#define CDEV   ((struct skinny_device *)item)

Definition at line 7768 of file chan_skinny.c.

Referenced by config_parse_variables().

◆ CDEV_OPTS

#define CDEV_OPTS   ((struct skinny_device_options *)item)

Definition at line 7767 of file chan_skinny.c.

Referenced by config_parse_variables().

◆ CLEAR_DISPLAY_MESSAGE

#define CLEAR_DISPLAY_MESSAGE   0x009A

Definition at line 634 of file chan_skinny.c.

Referenced by transmit_clear_display_message().

◆ CLEAR_NOTIFY_MESSAGE

#define CLEAR_NOTIFY_MESSAGE   0x0115

Definition at line 633 of file chan_skinny.c.

◆ CLEAR_PRINOTIFY_MESSAGE

#define CLEAR_PRINOTIFY_MESSAGE   0x0121

Definition at line 1122 of file chan_skinny.c.

Referenced by transmit_clearprinotify().

◆ CLEAR_PROMPT_MESSAGE

#define CLEAR_PROMPT_MESSAGE   0x0113

Definition at line 1080 of file chan_skinny.c.

Referenced by transmit_clearpromptmessage().

◆ CLINE

#define CLINE   ((struct skinny_line *)item)

Definition at line 7766 of file chan_skinny.c.

Referenced by config_parse_variables().

◆ CLINE_OPTS

#define CLINE_OPTS   ((struct skinny_line_options *)item)

Definition at line 7765 of file chan_skinny.c.

Referenced by config_parse_variables().

◆ CLOSE_RECEIVE_CHANNEL_MESSAGE

#define CLOSE_RECEIVE_CHANNEL_MESSAGE   0x0106

Definition at line 675 of file chan_skinny.c.

Referenced by transmit_closereceivechannel().

◆ CONTROL2STR_BUFSIZE

#define CONTROL2STR_BUFSIZE   100

Definition at line 273 of file chan_skinny.c.

Referenced by control2str().

◆ DEBUG_AUDIO

#define DEBUG_AUDIO   (1 << 4)

◆ DEBUG_GENERAL

#define DEBUG_GENERAL   (1 << 1)

Definition at line 148 of file chan_skinny.c.

Referenced by handle_skinny_set_debug(), and skinny_debugs().

◆ DEBUG_HINT

#define DEBUG_HINT   (1 << 8)

Definition at line 155 of file chan_skinny.c.

Referenced by handle_skinny_set_debug(), skinny_debugs(), and skinny_extensionstate_cb().

◆ DEBUG_KEEPALIVE

#define DEBUG_KEEPALIVE   (1 << 9)

Definition at line 156 of file chan_skinny.c.

Referenced by handle_keepalive_message(), handle_skinny_set_debug(), and skinny_debugs().

◆ DEBUG_LOCK

#define DEBUG_LOCK   (1 << 5)

Definition at line 152 of file chan_skinny.c.

Referenced by handle_skinny_set_debug(), and skinny_debugs().

◆ DEBUG_PACKET

#define DEBUG_PACKET   (1 << 3)

◆ DEBUG_SUB

#define DEBUG_SUB   (1 << 2)

◆ DEBUG_TEMPLATE

#define DEBUG_TEMPLATE   (1 << 6)

◆ DEBUG_THREAD

#define DEBUG_THREAD   (1 << 7)

Definition at line 154 of file chan_skinny.c.

Referenced by accept_thread(), handle_skinny_set_debug(), and skinny_debugs().

◆ DEFAULT_AUTH_LIMIT

#define DEFAULT_AUTH_LIMIT   50

Definition at line 190 of file chan_skinny.c.

Referenced by config_parse_variables().

◆ DEFAULT_AUTH_TIMEOUT

#define DEFAULT_AUTH_TIMEOUT   30

Definition at line 189 of file chan_skinny.c.

Referenced by config_parse_variables().

◆ DEFAULT_SKINNY_BACKLOG

#define DEFAULT_SKINNY_BACKLOG   2

Definition at line 187 of file chan_skinny.c.

Referenced by config_load().

◆ DEFAULT_SKINNY_PORT

#define DEFAULT_SKINNY_PORT   2000

Definition at line 186 of file chan_skinny.c.

Referenced by config_device(), and config_load().

◆ DEFINETIMEDATE_MESSAGE

#define DEFINETIMEDATE_MESSAGE   0x0094

Definition at line 548 of file chan_skinny.c.

Referenced by transmit_definetimedate().

◆ DEVICE2STR_BUFSIZE

#define DEVICE2STR_BUFSIZE   15

Definition at line 270 of file chan_skinny.c.

Referenced by device2str().

◆ DIALED_NUMBER_MESSAGE

#define DIALED_NUMBER_MESSAGE   0x011D

Definition at line 1097 of file chan_skinny.c.

Referenced by transmit_dialednumber().

◆ DIALTYPE_CFWD

#define DIALTYPE_CFWD   1<<1

Definition at line 1385 of file chan_skinny.c.

Referenced by dialandactivatesub(), and handle_callforward_button().

◆ DIALTYPE_NORMAL

#define DIALTYPE_NORMAL   1<<0

Definition at line 1384 of file chan_skinny.c.

Referenced by dialandactivatesub(), handle_transfer_button(), and skinny_new().

◆ DIALTYPE_XFER

#define DIALTYPE_XFER   1<<2

Definition at line 1386 of file chan_skinny.c.

Referenced by dialandactivatesub(), and handle_transfer_button().

◆ DISPLAY_NOTIFY_MESSAGE

#define DISPLAY_NOTIFY_MESSAGE   0x0114

Definition at line 1086 of file chan_skinny.c.

Referenced by transmit_displaynotify().

◆ DISPLAY_PRINOTIFY_MESSAGE

#define DISPLAY_PRINOTIFY_MESSAGE   0x0120

Definition at line 1115 of file chan_skinny.c.

Referenced by _transmit_displayprinotify().

◆ DISPLAY_PRINOTIFY_MESSAGE_VARIABLE

#define DISPLAY_PRINOTIFY_MESSAGE_VARIABLE   0x0144

Definition at line 1140 of file chan_skinny.c.

Referenced by _transmit_displayprinotifyvar().

◆ DISPLAY_PROMPT_STATUS_MESSAGE

#define DISPLAY_PROMPT_STATUS_MESSAGE   0x0112

Definition at line 1071 of file chan_skinny.c.

Referenced by transmit_displaypromptstatus().

◆ DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE

#define DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE   0x0145

Definition at line 1147 of file chan_skinny.c.

Referenced by transmit_displaypromptstatusvar().

◆ DISPLAYTEXT_MESSAGE

#define DISPLAYTEXT_MESSAGE   0x0099

Definition at line 628 of file chan_skinny.c.

◆ ENBLOC_CALL_MESSAGE

#define ENBLOC_CALL_MESSAGE   0x0004

Definition at line 312 of file chan_skinny.c.

Referenced by handle_message().

◆ FORWARD_STAT_MESSAGE

#define FORWARD_STAT_MESSAGE   0x0090

Definition at line 521 of file chan_skinny.c.

Referenced by transmit_cfwdstate().

◆ HEADSET_STATUS_MESSAGE

#define HEADSET_STATUS_MESSAGE   0x002B

Definition at line 402 of file chan_skinny.c.

Referenced by handle_message().

◆ htolel

#define htolel (   x)    bswap_32(x)

◆ htoles

#define htoles (   x)    bswap_16(x)

Definition at line 223 of file chan_skinny.c.

Referenced by transmit_softkeysetres().

◆ IP_PORT_MESSAGE

#define IP_PORT_MESSAGE   0x0002

Definition at line 302 of file chan_skinny.c.

Referenced by handle_message().

◆ KEEP_ALIVE_ACK_MESSAGE

#define KEEP_ALIVE_ACK_MESSAGE   0x0100

Definition at line 662 of file chan_skinny.c.

Referenced by transmit_keepaliveack().

◆ KEEP_ALIVE_MESSAGE

#define KEEP_ALIVE_MESSAGE   0x0000

Definition at line 285 of file chan_skinny.c.

Referenced by handle_message().

◆ KEYDEF_CONNECTED

#define KEYDEF_CONNECTED   1

Definition at line 695 of file chan_skinny.c.

Referenced by setsubstate(), and skinny_extensionstate_cb().

◆ KEYDEF_CONNWITHCONF

#define KEYDEF_CONNWITHCONF   7

Definition at line 701 of file chan_skinny.c.

◆ KEYDEF_CONNWITHTRANS

#define KEYDEF_CONNWITHTRANS   5

Definition at line 699 of file chan_skinny.c.

◆ KEYDEF_DADFD

#define KEYDEF_DADFD   6 /* Digits After Dialing First Digit */

Definition at line 700 of file chan_skinny.c.

Referenced by handle_keypad_button_message(), and skinny_dialer().

◆ KEYDEF_OFFHOOK

#define KEYDEF_OFFHOOK   4

Definition at line 698 of file chan_skinny.c.

Referenced by handle_soft_key_event_message(), and setsubstate().

◆ KEYDEF_OFFHOOKWITHFEAT

#define KEYDEF_OFFHOOKWITHFEAT   9

Definition at line 703 of file chan_skinny.c.

◆ KEYDEF_ONHOLD

#define KEYDEF_ONHOLD   2

Definition at line 696 of file chan_skinny.c.

Referenced by setsubstate().

◆ KEYDEF_ONHOOK

#define KEYDEF_ONHOOK   0

Definition at line 694 of file chan_skinny.c.

Referenced by handle_message(), and skinny_extensionstate_cb().

◆ KEYDEF_RINGIN

#define KEYDEF_RINGIN   3

Definition at line 697 of file chan_skinny.c.

Referenced by setsubstate().

◆ KEYDEF_RINGOUT

#define KEYDEF_RINGOUT   8

Definition at line 702 of file chan_skinny.c.

Referenced by setsubstate().

◆ KEYDEF_RINGOUTWITHTRANS

#define KEYDEF_RINGOUTWITHTRANS   13

Definition at line 707 of file chan_skinny.c.

Referenced by setsubstate().

◆ KEYDEF_SLACONNECTEDNOTACTIVE

#define KEYDEF_SLACONNECTEDNOTACTIVE   12

Definition at line 706 of file chan_skinny.c.

Referenced by setsubstate(), and skinny_extensionstate_cb().

◆ KEYDEF_SLAHOLD

#define KEYDEF_SLAHOLD   11

Definition at line 705 of file chan_skinny.c.

Referenced by skinny_extensionstate_cb().

◆ KEYDEF_UNKNOWN

#define KEYDEF_UNKNOWN   10

Definition at line 704 of file chan_skinny.c.

◆ KEYMASK_ALL

#define KEYMASK_ALL   0xFFFFFFFF

◆ KEYMASK_ANSWER

#define KEYMASK_ANSWER   (1 << 11)

Definition at line 744 of file chan_skinny.c.

◆ KEYMASK_BKSPC

#define KEYMASK_BKSPC   (1 << 8)

Definition at line 741 of file chan_skinny.c.

◆ KEYMASK_CFWDALL

#define KEYMASK_CFWDALL   (1 << 5)

Definition at line 738 of file chan_skinny.c.

◆ KEYMASK_CFWDBUSY

#define KEYMASK_CFWDBUSY   (1 << 6)

Definition at line 739 of file chan_skinny.c.

◆ KEYMASK_CFWDNOANSWER

#define KEYMASK_CFWDNOANSWER   (1 << 7)

Definition at line 740 of file chan_skinny.c.

◆ KEYMASK_CONFRN

#define KEYMASK_CONFRN   (1 << 13)

Definition at line 746 of file chan_skinny.c.

◆ KEYMASK_DND

#define KEYMASK_DND   (1 << 29)

Definition at line 752 of file chan_skinny.c.

◆ KEYMASK_ENDCALL

#define KEYMASK_ENDCALL   (1 << 9)

Definition at line 742 of file chan_skinny.c.

◆ KEYMASK_FORCEDIAL

#define KEYMASK_FORCEDIAL   (1 << 21)

Definition at line 754 of file chan_skinny.c.

Referenced by handle_keypad_button_message().

◆ KEYMASK_GPICKUP

#define KEYMASK_GPICKUP   (1 << 18)

Definition at line 751 of file chan_skinny.c.

◆ KEYMASK_HOLD

#define KEYMASK_HOLD   (1 << 3)

Definition at line 736 of file chan_skinny.c.

◆ KEYMASK_IDIVERT

#define KEYMASK_IDIVERT   (1 << 20)

Definition at line 753 of file chan_skinny.c.

◆ KEYMASK_INFO

#define KEYMASK_INFO   (1 << 12)

Definition at line 745 of file chan_skinny.c.

◆ KEYMASK_JOIN

#define KEYMASK_JOIN   (1 << 15)

Definition at line 748 of file chan_skinny.c.

◆ KEYMASK_MEETME

#define KEYMASK_MEETME   (1 << 16)

Definition at line 749 of file chan_skinny.c.

◆ KEYMASK_NEWCALL

#define KEYMASK_NEWCALL   (1 << 2)

Definition at line 735 of file chan_skinny.c.

◆ KEYMASK_NONE

#define KEYMASK_NONE   (1 << 0)

Definition at line 733 of file chan_skinny.c.

◆ KEYMASK_PARK

#define KEYMASK_PARK   (1 << 14)

Definition at line 747 of file chan_skinny.c.

◆ KEYMASK_PICKUP

#define KEYMASK_PICKUP   (1 << 17)

Definition at line 750 of file chan_skinny.c.

◆ KEYMASK_REDIAL

#define KEYMASK_REDIAL   (1 << 1)

Definition at line 734 of file chan_skinny.c.

◆ KEYMASK_RESUME

#define KEYMASK_RESUME   (1 << 10)

Definition at line 743 of file chan_skinny.c.

◆ KEYMASK_TRNSFER

#define KEYMASK_TRNSFER   (1 << 4)

Definition at line 737 of file chan_skinny.c.

◆ KEYPAD_BUTTON_MESSAGE

#define KEYPAD_BUTTON_MESSAGE   0x0003

Definition at line 304 of file chan_skinny.c.

Referenced by handle_message().

◆ letohl

#define letohl (   x)    bswap_32(x)

◆ letohs

#define letohs (   x)    bswap_16(x)

Definition at line 221 of file chan_skinny.c.

◆ LINE_STAT_RES_MESSAGE

#define LINE_STAT_RES_MESSAGE   0x0092

Definition at line 540 of file chan_skinny.c.

Referenced by transmit_linestatres().

◆ LINE_STATE_REQ_MESSAGE

#define LINE_STATE_REQ_MESSAGE   0x000B

Definition at line 358 of file chan_skinny.c.

Referenced by handle_message().

◆ MAX_SERVICEURL

#define MAX_SERVICEURL   256

Definition at line 1104 of file chan_skinny.c.

◆ MAXCALLINFOSTR

#define MAXCALLINFOSTR   256

Definition at line 1112 of file chan_skinny.c.

Referenced by transmit_callinfo_variable(), and transmit_displaypromptstatusvar().

◆ MAXDISPLAYNOTIFYSTR

#define MAXDISPLAYNOTIFYSTR   32

Definition at line 1113 of file chan_skinny.c.

Referenced by _transmit_displayprinotifyvar().

◆ MESSAGE2STR_BUFSIZE

#define MESSAGE2STR_BUFSIZE   35

Definition at line 266 of file chan_skinny.c.

◆ OCTAL_ANSWER

#define OCTAL_ANSWER   "\200\013" /* Answer */

Definition at line 770 of file chan_skinny.c.

◆ OCTAL_BARGE

#define OCTAL_BARGE   "\200\103" /* Barge */

Definition at line 826 of file chan_skinny.c.

◆ OCTAL_BARGEEXIST

#define OCTAL_BARGEEXIST   "\200\105" /* Another Barge exists */

Definition at line 828 of file chan_skinny.c.

◆ OCTAL_BARGEFAIL

#define OCTAL_BARGEFAIL   "\200\104" /* Failed to setup Barge */

Definition at line 827 of file chan_skinny.c.

◆ OCTAL_BKSPC

#define OCTAL_BKSPC   "\200\010" /* << */

Definition at line 767 of file chan_skinny.c.

◆ OCTAL_BUSY

#define OCTAL_BUSY   "\200\031" /* Busy */

Definition at line 784 of file chan_skinny.c.

Referenced by setsubstate().

◆ OCTAL_CALLBACK

#define OCTAL_CALLBACK   "\200\101" /* CallBack */

Definition at line 824 of file chan_skinny.c.

◆ OCTAL_CALLDURTIMEOUT

#define OCTAL_CALLDURTIMEOUT   "\200\131" /* Max Call Duration Timeout */

Definition at line 848 of file chan_skinny.c.

◆ OCTAL_CALLPARK

#define OCTAL_CALLPARK   "\200\035" /* Call Park */

Definition at line 788 of file chan_skinny.c.

◆ OCTAL_CALLPROCEED

#define OCTAL_CALLPROCEED   "\200\036" /* Call Proceed */

Definition at line 789 of file chan_skinny.c.

◆ OCTAL_CALLWAITING

#define OCTAL_CALLWAITING   "\200\033" /* Call Waiting */

Definition at line 786 of file chan_skinny.c.

Referenced by setsubstate().

◆ OCTAL_CALLXFER

#define OCTAL_CALLXFER   "\200\034" /* Call Transfer */

Definition at line 787 of file chan_skinny.c.

◆ OCTAL_CANTCOMPCNF

#define OCTAL_CANTCOMPCNF   "\200\046" /* Can Not Complete Conference */

Definition at line 797 of file chan_skinny.c.

◆ OCTAL_CANTCOMPLXFER

#define OCTAL_CANTCOMPLXFER   "\200\122" /* Can Not Complete Transfer */

Definition at line 841 of file chan_skinny.c.

◆ OCTAL_CANTJOINCALLS

#define OCTAL_CANTJOINCALLS   "\200\123" /* Can Not Join Calls */

Definition at line 842 of file chan_skinny.c.

◆ OCTAL_CBARGE

#define OCTAL_CBARGE   "\200\121" /* cBarge */

Definition at line 840 of file chan_skinny.c.

◆ OCTAL_CFWDALL

#define OCTAL_CFWDALL   "\200\005" /* CFwdALL */

Definition at line 764 of file chan_skinny.c.

◆ OCTAL_CFWDBUSY

#define OCTAL_CFWDBUSY   "\200\006" /* CFwdBusy */

Definition at line 765 of file chan_skinny.c.

◆ OCTAL_CFWDNOAN

#define OCTAL_CFWDNOAN   "\200\007" /* CFwdNoAnswer */

Definition at line 766 of file chan_skinny.c.

◆ OCTAL_CM1

#define OCTAL_CM1   "\200\167" /* CallManager 1 */

Definition at line 878 of file chan_skinny.c.

◆ OCTAL_CM2

#define OCTAL_CM2   "\200\170" /* CallManager 2 */

Definition at line 879 of file chan_skinny.c.

◆ OCTAL_CM3

#define OCTAL_CM3   "\200\171" /* CallManager 3 */

Definition at line 880 of file chan_skinny.c.

◆ OCTAL_CM4

#define OCTAL_CM4   "\200\172" /* CallManager 4 */

Definition at line 881 of file chan_skinny.c.

◆ OCTAL_CM5

#define OCTAL_CM5   "\200\173" /* CallManager 5 */

Definition at line 882 of file chan_skinny.c.

◆ OCTAL_CONFERENCE

#define OCTAL_CONFERENCE   "\200\064" /* Conference */

Definition at line 811 of file chan_skinny.c.

◆ OCTAL_CONFLIST

#define OCTAL_CONFLIST   "\200\117" /* ConfList */

Definition at line 838 of file chan_skinny.c.

◆ OCTAL_CONFRN

#define OCTAL_CONFRN   "\200\015" /* Confrn */

Definition at line 772 of file chan_skinny.c.

◆ OCTAL_CONNECTED

#define OCTAL_CONNECTED   "\200\030" /* Connected */

Definition at line 783 of file chan_skinny.c.

Referenced by setsubstate(), and skinny_extensionstate_cb().

◆ OCTAL_CUROPTS

#define OCTAL_CUROPTS   "\200\023" /* Your current options */

Definition at line 778 of file chan_skinny.c.

◆ OCTAL_DIRTRFR

#define OCTAL_DIRTRFR   "\200\115" /* DirTrfr */

Definition at line 836 of file chan_skinny.c.

◆ OCTAL_DIVALL

#define OCTAL_DIVALL   "\200\100" /* DivAll */

Definition at line 823 of file chan_skinny.c.

◆ OCTAL_DND

#define OCTAL_DND   "\200\077" /* DND */

Definition at line 822 of file chan_skinny.c.

◆ OCTAL_DNS1

#define OCTAL_DNS1   "\200\160" /* DNS Server 1 */

Definition at line 871 of file chan_skinny.c.

◆ OCTAL_DNS2

#define OCTAL_DNS2   "\200\161" /* DNS Server 2 */

Definition at line 872 of file chan_skinny.c.

◆ OCTAL_DNS3

#define OCTAL_DNS3   "\200\162" /* DNS Server 3 */

Definition at line 873 of file chan_skinny.c.

◆ OCTAL_DNS4

#define OCTAL_DNS4   "\200\163" /* DNS Server 4 */

Definition at line 874 of file chan_skinny.c.

◆ OCTAL_DNS5

#define OCTAL_DNS5   "\200\164" /* DNS Server 5 */

Definition at line 875 of file chan_skinny.c.

◆ OCTAL_DOMAIN

#define OCTAL_DOMAIN   "\200\147" /* Domain Name */

Definition at line 862 of file chan_skinny.c.

◆ OCTAL_ENDCALL

#define OCTAL_ENDCALL   "\200\011" /* EndCall */

Definition at line 768 of file chan_skinny.c.

◆ OCTAL_ENTRNUM

#define OCTAL_ENTRNUM   "\200\040" /* Enter number */

Definition at line 791 of file chan_skinny.c.

Referenced by setsubstate().

◆ OCTAL_ERRDB

#define OCTAL_ERRDB   "\200\060" /* Error Database */

Definition at line 807 of file chan_skinny.c.

◆ OCTAL_ERRDBCFG

#define OCTAL_ERRDBCFG   "\200\057" /* Error DBConfig */

Definition at line 806 of file chan_skinny.c.

◆ OCTAL_ERRMISMATCH

#define OCTAL_ERRMISMATCH   "\200\063" /* Error Mismatch */

Definition at line 810 of file chan_skinny.c.

◆ OCTAL_ERRNOLIC

#define OCTAL_ERRNOLIC   "\200\056" /* Error No License */

Definition at line 805 of file chan_skinny.c.

◆ OCTAL_ERRPASSLMT

#define OCTAL_ERRPASSLMT   "\200\061" /* Error Pass Limit */

Definition at line 808 of file chan_skinny.c.

◆ OCTAL_ERRUNK

#define OCTAL_ERRUNK   "\200\062" /* Error Unknown */

Definition at line 809 of file chan_skinny.c.

◆ OCTAL_EXTXFERRESTRICT

#define OCTAL_EXTXFERRESTRICT   "\200\141" /* External Transfer Restricted */

Definition at line 856 of file chan_skinny.c.

◆ OCTAL_FROM

#define OCTAL_FROM   "\200\027" /* From */

Definition at line 782 of file chan_skinny.c.

Referenced by setsubstate().

◆ OCTAL_FWDEDTO

#define OCTAL_FWDEDTO   "\200\045" /* Forwarded to */

Definition at line 796 of file chan_skinny.c.

◆ OCTAL_GPICKUP

#define OCTAL_GPICKUP   "\200\022" /* GPickUp */

Definition at line 777 of file chan_skinny.c.

◆ OCTAL_HAVEVMAIL

#define OCTAL_HAVEVMAIL   "\200\044" /* You Have VoiceMail */

Definition at line 795 of file chan_skinny.c.

◆ OCTAL_HITRAFFIC

#define OCTAL_HITRAFFIC   "\200\112" /* High Traffic Try Again Later */

Definition at line 833 of file chan_skinny.c.

◆ OCTAL_HOLD

#define OCTAL_HOLD   "\200\003" /* Hold */

Definition at line 762 of file chan_skinny.c.

◆ OCTAL_HOLDDURTIMEOUT

#define OCTAL_HOLDDURTIMEOUT   "\200\132" /* Max Hold Duration Timeout */

Definition at line 849 of file chan_skinny.c.

◆ OCTAL_HOST

#define OCTAL_HOST   "\200\146" /* Host Name */

Definition at line 861 of file chan_skinny.c.

◆ OCTAL_IDIVERT

#define OCTAL_IDIVERT   "\200\120" /* iDivert */

Definition at line 839 of file chan_skinny.c.

◆ OCTAL_IMMDIV

#define OCTAL_IMMDIV   "\200\073" /* ImmDiv */

Definition at line 818 of file chan_skinny.c.

◆ OCTAL_INCOMPATDEV

#define OCTAL_INCOMPATDEV   "\200\106" /* Incompatible device type */

Definition at line 829 of file chan_skinny.c.

◆ OCTAL_INCONFALREADY

#define OCTAL_INCONFALREADY   "\200\052" /* In Conference Already */

Definition at line 801 of file chan_skinny.c.

◆ OCTAL_INFO

#define OCTAL_INFO   "\200\014" /* Info */

Definition at line 771 of file chan_skinny.c.

◆ OCTAL_INSUFBANDW

#define OCTAL_INSUFBANDW   "\200\067" /* Not Enough Bandwidth */

Definition at line 814 of file chan_skinny.c.

◆ OCTAL_INTRCPT

#define OCTAL_INTRCPT   "\200\074" /* Intrcpt */

Definition at line 819 of file chan_skinny.c.

◆ OCTAL_INUSEREMOTE

#define OCTAL_INUSEREMOTE   "\200\037" /* In Use Remote */

Definition at line 790 of file chan_skinny.c.

◆ OCTAL_INVALCONFPART

#define OCTAL_INVALCONFPART   "\200\051" /* Invalid Conference Participant */

Definition at line 800 of file chan_skinny.c.

◆ OCTAL_IPADD

#define OCTAL_IPADD   "\200\150" /* IP Address */

Definition at line 863 of file chan_skinny.c.

◆ OCTAL_JOIN

#define OCTAL_JOIN   "\200\017" /* Join */

Definition at line 774 of file chan_skinny.c.

◆ OCTAL_KEYNOTACTIVE

#define OCTAL_KEYNOTACTIVE   "\200\055" /* Key Is Not Active */

Definition at line 804 of file chan_skinny.c.

◆ OCTAL_LINEINUSE

#define OCTAL_LINEINUSE   "\200\032" /* Line In Use */

Definition at line 785 of file chan_skinny.c.

◆ OCTAL_MACADD

#define OCTAL_MACADD   "\200\145" /* Mac Address */

Definition at line 860 of file chan_skinny.c.

◆ OCTAL_MAXPARTEXCEED

#define OCTAL_MAXPARTEXCEED   "\200\054" /* Exceed Maximum Parties */

Definition at line 803 of file chan_skinny.c.

◆ OCTAL_MCID

#define OCTAL_MCID   "\200\114" /* MCID */

Definition at line 835 of file chan_skinny.c.

◆ OCTAL_MCIDSUCCESS

#define OCTAL_MCIDSUCCESS   "\200\124" /* Mcid Successful */

Definition at line 843 of file chan_skinny.c.

◆ OCTAL_MEETME

#define OCTAL_MEETME   "\200\020" /* MeetMe */

Definition at line 775 of file chan_skinny.c.

◆ OCTAL_NETCNGREROUT

#define OCTAL_NETCNGREROUT   "\200\102" /* Network congestion,rerouting */

Definition at line 825 of file chan_skinny.c.

◆ OCTAL_NEWCALL

#define OCTAL_NEWCALL   "\200\002" /* New Call */

Definition at line 761 of file chan_skinny.c.

◆ OCTAL_NOCONFBRDG

#define OCTAL_NOCONFBRDG   "\200\047" /* No Conference Bridge */

Definition at line 798 of file chan_skinny.c.

◆ OCTAL_NOPARTINFO

#define OCTAL_NOPARTINFO   "\200\053" /* No Participant Info */

Definition at line 802 of file chan_skinny.c.

◆ OCTAL_NOPRIMARYCTL

#define OCTAL_NOPRIMARYCTL   "\200\050" /* Can Not Hold Primary Control */

Definition at line 799 of file chan_skinny.c.

◆ OCTAL_NUMNOTCFG

#define OCTAL_NUMNOTCFG   "\200\125" /* Number Not Configured */

Definition at line 844 of file chan_skinny.c.

◆ OCTAL_OFFHOOK

#define OCTAL_OFFHOOK   "\200\024" /* Off Hook */

Definition at line 779 of file chan_skinny.c.

◆ OCTAL_ONHOOK

#define OCTAL_ONHOOK   "\200\025" /* On Hook */

Definition at line 780 of file chan_skinny.c.

◆ OCTAL_OPICKUP

#define OCTAL_OPICKUP   "\200\133" /* OPickUp */

Definition at line 850 of file chan_skinny.c.

◆ OCTAL_PARK

#define OCTAL_PARK   "\200\016" /* Park */

Definition at line 773 of file chan_skinny.c.

◆ OCTAL_PARKAT

#define OCTAL_PARKAT   "\200\041" /* Call park At */

Definition at line 792 of file chan_skinny.c.

◆ OCTAL_PARKNO

#define OCTAL_PARKNO   "\200\065" /* Park Number */

Definition at line 812 of file chan_skinny.c.

◆ OCTAL_PARKNONUM

#define OCTAL_PARKNONUM   "\200\107" /* No Park Number Available */

Definition at line 830 of file chan_skinny.c.

◆ OCTAL_PARKREVERSION

#define OCTAL_PARKREVERSION   "\200\110" /* CallPark Reversion */

Definition at line 831 of file chan_skinny.c.

◆ OCTAL_PICKUP

#define OCTAL_PICKUP   "\200\021" /* PickUp */

Definition at line 776 of file chan_skinny.c.

◆ OCTAL_PRIMONLY

#define OCTAL_PRIMONLY   "\200\042" /* Primary Only */

Definition at line 793 of file chan_skinny.c.

◆ OCTAL_PRIVATE

#define OCTAL_PRIVATE   "\200\066" /* Private */

Definition at line 813 of file chan_skinny.c.

◆ OCTAL_QRT

#define OCTAL_QRT   "\200\113" /* QRT */

Definition at line 834 of file chan_skinny.c.

◆ OCTAL_REDIAL

#define OCTAL_REDIAL   "\200\001" /* Redial */

Definition at line 760 of file chan_skinny.c.

◆ OCTAL_RESUME

#define OCTAL_RESUME   "\200\012" /* Resume */

Definition at line 769 of file chan_skinny.c.

◆ OCTAL_RINGOUT

#define OCTAL_RINGOUT   "\200\026" /* Ring out */

Definition at line 781 of file chan_skinny.c.

Referenced by setsubstate().

◆ OCTAL_RMLSTC

#define OCTAL_RMLSTC   "\200\071" /* RmLstC */

Definition at line 816 of file chan_skinny.c.

◆ OCTAL_ROUTER1

#define OCTAL_ROUTER1   "\200\153" /* Default Router 1 */

Definition at line 866 of file chan_skinny.c.

◆ OCTAL_ROUTER2

#define OCTAL_ROUTER2   "\200\154" /* Default Router 2 */

Definition at line 867 of file chan_skinny.c.

◆ OCTAL_ROUTER3

#define OCTAL_ROUTER3   "\200\155" /* Default Router 3 */

Definition at line 868 of file chan_skinny.c.

◆ OCTAL_ROUTER4

#define OCTAL_ROUTER4   "\200\156" /* Default Router 4 */

Definition at line 869 of file chan_skinny.c.

◆ OCTAL_ROUTER5

#define OCTAL_ROUTER5   "\200\157" /* Default Router 5 */

Definition at line 870 of file chan_skinny.c.

◆ OCTAL_SECERROR

#define OCTAL_SECERROR   "\200\126" /* Security Error */

Definition at line 845 of file chan_skinny.c.

◆ OCTAL_SELECT

#define OCTAL_SELECT   "\200\116" /* Select */

Definition at line 837 of file chan_skinny.c.

◆ OCTAL_SETWTCH

#define OCTAL_SETWTCH   "\200\075" /* SetWtch */

Definition at line 820 of file chan_skinny.c.

◆ OCTAL_SRVNOTACTIVE

#define OCTAL_SRVNOTACTIVE   "\200\111" /* Service is not Active */

Definition at line 832 of file chan_skinny.c.

◆ OCTAL_SUBMASK

#define OCTAL_SUBMASK   "\200\151" /* Subnet Mask */

Definition at line 864 of file chan_skinny.c.

◆ OCTAL_TFTP1

#define OCTAL_TFTP1   "\200\152" /* TFTP Server 1 */

Definition at line 865 of file chan_skinny.c.

◆ OCTAL_TMPFAIL

#define OCTAL_TMPFAIL   "\200\043" /* Temp Fail */

Definition at line 794 of file chan_skinny.c.

◆ OCTAL_TRANSFER

#define OCTAL_TRANSFER   "\200\004" /* Transfer */

Definition at line 763 of file chan_skinny.c.

◆ OCTAL_TRNSFVM

#define OCTAL_TRNSFVM   "\200\076" /* TrnsfVM */

Definition at line 821 of file chan_skinny.c.

◆ OCTAL_UNKNUM

#define OCTAL_UNKNUM   "\200\070" /* Unknown Number */

Definition at line 815 of file chan_skinny.c.

◆ OCTAL_URLDIRS

#define OCTAL_URLDIRS   "\200\175" /* Directories URL */

Definition at line 884 of file chan_skinny.c.

◆ OCTAL_URLINFO

#define OCTAL_URLINFO   "\200\174" /* Information URL */

Definition at line 883 of file chan_skinny.c.

◆ OCTAL_URLMSGS

#define OCTAL_URLMSGS   "\200\176" /* Messages URL */

Definition at line 885 of file chan_skinny.c.

◆ OCTAL_URLSRVS

#define OCTAL_URLSRVS   "\200\177" /* Services URL */

Definition at line 886 of file chan_skinny.c.

◆ OCTAL_VIDBANDWNA

#define OCTAL_VIDBANDWNA   "\200\127" /* Video Bandwidth Unavailable */

Definition at line 846 of file chan_skinny.c.

◆ OCTAL_VIDMODE

#define OCTAL_VIDMODE   "\200\130" /* VidMode */

Definition at line 847 of file chan_skinny.c.

◆ OCTAL_VLANADID

#define OCTAL_VLANADID   "\200\166" /* Admin. VLAN Id */

Definition at line 877 of file chan_skinny.c.

◆ OCTAL_VLANOPID

#define OCTAL_VLANOPID   "\200\165" /* Operational VLAN Id */

Definition at line 876 of file chan_skinny.c.

◆ OCTAL_VOICEMAIL

#define OCTAL_VOICEMAIL   "\200\072" /* Voicemail */

Definition at line 817 of file chan_skinny.c.

◆ OFFHOOK_MESSAGE

#define OFFHOOK_MESSAGE   0x0006

Definition at line 324 of file chan_skinny.c.

Referenced by handle_message().

◆ ONHOOK_MESSAGE

#define ONHOOK_MESSAGE   0x0007

Definition at line 330 of file chan_skinny.c.

Referenced by handle_message().

◆ OPEN_RECEIVE_CHANNEL_ACK_MESSAGE

#define OPEN_RECEIVE_CHANNEL_ACK_MESSAGE   0x0022

Definition at line 376 of file chan_skinny.c.

Referenced by handle_message().

◆ OPEN_RECEIVE_CHANNEL_MESSAGE

#define OPEN_RECEIVE_CHANNEL_MESSAGE   0x0105

Definition at line 664 of file chan_skinny.c.

Referenced by transmit_connect().

◆ PACKET_TIMEOUT

#define PACKET_TIMEOUT   10000

Definition at line 7518 of file chan_skinny.c.

Referenced by skinny_session().

◆ REGISTER_ACK_MESSAGE

#define REGISTER_ACK_MESSAGE   0x0081

Definition at line 410 of file chan_skinny.c.

Referenced by transmit_registerack().

◆ REGISTER_AVAILABLE_LINES_MESSAGE

#define REGISTER_AVAILABLE_LINES_MESSAGE   0x002D

Definition at line 403 of file chan_skinny.c.

Referenced by handle_message().

◆ REGISTER_MESSAGE

#define REGISTER_MESSAGE   0x0001

Definition at line 288 of file chan_skinny.c.

Referenced by handle_message().

◆ REGISTER_REJ_MESSAGE

#define REGISTER_REJ_MESSAGE   0x009D

Definition at line 641 of file chan_skinny.c.

Referenced by transmit_registerrej().

◆ RESET_MESSAGE

#define RESET_MESSAGE   0x009F

Definition at line 657 of file chan_skinny.c.

Referenced by transmit_reset().

◆ SELECT_SOFT_KEYS_MESSAGE

#define SELECT_SOFT_KEYS_MESSAGE   0x0110

Definition at line 1055 of file chan_skinny.c.

Referenced by transmit_selectsoftkeys().

◆ SERVER_REQUEST_MESSAGE

#define SERVER_REQUEST_MESSAGE   0x0012

Definition at line 366 of file chan_skinny.c.

Referenced by handle_message().

◆ SERVER_RES_MESSAGE

#define SERVER_RES_MESSAGE   0x009E

Definition at line 646 of file chan_skinny.c.

Referenced by transmit_serverres().

◆ SERVICEURL_STAT_MESSAGE

#define SERVICEURL_STAT_MESSAGE   0x012F

Definition at line 1105 of file chan_skinny.c.

Referenced by transmit_serviceurlstat().

◆ SERVICEURL_STATREQ_MESSAGE

#define SERVICEURL_STATREQ_MESSAGE   0x0033

Definition at line 405 of file chan_skinny.c.

Referenced by handle_message().

◆ SET_LAMP_MESSAGE

#define SET_LAMP_MESSAGE   0x0086

Definition at line 442 of file chan_skinny.c.

Referenced by transmit_lamp_indication().

◆ SET_MICROPHONE_MESSAGE

#define SET_MICROPHONE_MESSAGE   0x0089

Definition at line 455 of file chan_skinny.c.

Referenced by transmit_microphone_mode().

◆ SET_RINGER_MESSAGE

#define SET_RINGER_MESSAGE   0x0085

Definition at line 434 of file chan_skinny.c.

Referenced by transmit_ringer_mode().

◆ SET_SPEAKER_MESSAGE

#define SET_SPEAKER_MESSAGE   0x0088

Definition at line 449 of file chan_skinny.c.

Referenced by transmit_speaker_mode().

◆ SKINNY_ALERT

#define SKINNY_ALERT   0x24

Definition at line 1307 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_BARGIN

#define SKINNY_BARGIN   0x43

Definition at line 1313 of file chan_skinny.c.

◆ SKINNY_BEEPBONK

#define SKINNY_BEEPBONK   0x33

Definition at line 1312 of file chan_skinny.c.

◆ SKINNY_BUSY

#define SKINNY_BUSY   6

Definition at line 1291 of file chan_skinny.c.

Referenced by callstate2str(), and setsubstate().

◆ SKINNY_BUSYTONE

#define SKINNY_BUSYTONE   0x23

Definition at line 1306 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_CALLREMOTEMULTILINE

#define SKINNY_CALLREMOTEMULTILINE   13

Definition at line 1298 of file chan_skinny.c.

Referenced by setsubstate(), and skinny_extensionstate_cb().

◆ SKINNY_CALLWAIT

#define SKINNY_CALLWAIT   9

Definition at line 1294 of file chan_skinny.c.

Referenced by callstate2str(), and setsubstate().

◆ SKINNY_CALLWAITTONE

#define SKINNY_CALLWAITTONE   0x2D

Definition at line 1309 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_CFWD_ALL

#define SKINNY_CFWD_ALL   (1 << 0)

◆ SKINNY_CFWD_BUSY

#define SKINNY_CFWD_BUSY   (1 << 1)

◆ SKINNY_CFWD_NOANSWER

#define SKINNY_CFWD_NOANSWER   (1 << 2)

◆ SKINNY_CONGESTION

#define SKINNY_CONGESTION   7

Definition at line 1292 of file chan_skinny.c.

Referenced by callstate2str(), and setsubstate().

◆ SKINNY_CONNECTED

#define SKINNY_CONNECTED   5

◆ SKINNY_CX_CONF

#define SKINNY_CX_CONF   3

Definition at line 1335 of file chan_skinny.c.

◆ SKINNY_CX_CONFERENCE

#define SKINNY_CX_CONFERENCE   3

Definition at line 1336 of file chan_skinny.c.

◆ SKINNY_CX_INACTIVE

#define SKINNY_CX_INACTIVE   4

Definition at line 1338 of file chan_skinny.c.

Referenced by skinny_new().

◆ SKINNY_CX_MUTE

#define SKINNY_CX_MUTE   4

Definition at line 1337 of file chan_skinny.c.

◆ SKINNY_CX_RECVONLY

#define SKINNY_CX_RECVONLY   1

Definition at line 1333 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_CX_SENDONLY

#define SKINNY_CX_SENDONLY   0

Definition at line 1332 of file chan_skinny.c.

◆ SKINNY_CX_SENDRECV

#define SKINNY_CX_SENDRECV   2

Definition at line 1334 of file chan_skinny.c.

Referenced by skinny_answer().

◆ SKINNY_DEBUG

#define SKINNY_DEBUG (   type,
  verb_level,
  text,
  ... 
)
Value:
do{ \
if (skinnydebug & (type)) { \
ast_verb(verb_level, "[%d] " text, ast_get_tid(), ##__VA_ARGS__); \
} \
}while(0)
static const char type[]
Definition: chan_ooh323.c:109
char * text
Definition: app_queue.c:1508
static int skinnydebug
Definition: chan_skinny.c:146
int ast_get_tid(void)
Get current thread ID.
Definition: main/utils.c:2504

Definition at line 157 of file chan_skinny.c.

Referenced by _transmit_displayprinotify(), _transmit_displayprinotifyvar(), accept_thread(), activatesub(), destroy_rtp(), dialandactivatesub(), dumpsub(), handle_button_template_req_message(), handle_capabilities_res_message(), handle_keepalive_message(), handle_keypad_button_message(), handle_message(), handle_open_receive_channel_ack_message(), handle_soft_key_event_message(), handle_stimulus_message(), setsubstate(), skinny_answer(), skinny_call(), skinny_cfwd_cb(), skinny_dialer(), skinny_dialer_cb(), skinny_extensionstate_cb(), skinny_get_rtp_peer(), skinny_hangup(), skinny_indicate(), skinny_new(), skinny_sched_add(), skinny_sched_del(), skinny_set_rtp_peer(), skinny_transfer_attended(), skinny_transfer_blind(), start_rtp(), transmit_activatecallplane(), transmit_backspace(), transmit_callinfo(), transmit_callinfo_variable(), transmit_callstate(), transmit_capabilitiesreq(), transmit_cfwdstate(), transmit_clear_display_message(), transmit_clearprinotify(), transmit_clearpromptmessage(), transmit_closereceivechannel(), transmit_connect(), transmit_definetimedate(), transmit_dialednumber(), transmit_displaynotify(), transmit_displaypromptstatus(), transmit_displaypromptstatusvar(), transmit_keepaliveack(), transmit_lamp_indication(), transmit_linestatres(), transmit_microphone_mode(), transmit_registerack(), transmit_registerrej(), transmit_reset(), transmit_ringer_mode(), transmit_selectsoftkeys(), transmit_serverres(), transmit_serviceurlstat(), transmit_softkeysetres(), transmit_softkeytemplateres(), transmit_speaker_mode(), transmit_speeddialstatres(), transmit_start_tone(), transmit_startmediatransmission(), transmit_stop_tone(), transmit_stopmediatransmission(), transmit_versionres(), and update_connectedline().

◆ SKINNY_DEVICE_12

#define SKINNY_DEVICE_12   4

Definition at line 1246 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_12SP

#define SKINNY_DEVICE_12SP   3

Definition at line 1245 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_12SPPLUS

#define SKINNY_DEVICE_12SPPLUS   2

Definition at line 1244 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_30SPPLUS

#define SKINNY_DEVICE_30SPPLUS   1

Definition at line 1243 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_30VIP

#define SKINNY_DEVICE_30VIP   5

Definition at line 1247 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7902

#define SKINNY_DEVICE_7902   30008

Definition at line 1273 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7905

#define SKINNY_DEVICE_7905   20000

Definition at line 1269 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7906

#define SKINNY_DEVICE_7906   369

Definition at line 1262 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7910

#define SKINNY_DEVICE_7910   6

Definition at line 1248 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7911

#define SKINNY_DEVICE_7911   307

Definition at line 1257 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7912

#define SKINNY_DEVICE_7912   30007

Definition at line 1272 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7914

#define SKINNY_DEVICE_7914   124 /* Expansion module */

Definition at line 1255 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7920

#define SKINNY_DEVICE_7920   30002

Definition at line 1270 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7921

#define SKINNY_DEVICE_7921   365

Definition at line 1261 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7931

#define SKINNY_DEVICE_7931   348

Definition at line 1260 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7935

#define SKINNY_DEVICE_7935   9

Definition at line 1251 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7936

#define SKINNY_DEVICE_7936   30019

Definition at line 1276 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7937

#define SKINNY_DEVICE_7937   431

Definition at line 1264 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7940

#define SKINNY_DEVICE_7940   8

Definition at line 1250 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7941

#define SKINNY_DEVICE_7941   115

Definition at line 1253 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7941GE

#define SKINNY_DEVICE_7941GE   309

Definition at line 1259 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7942

#define SKINNY_DEVICE_7942   434

Definition at line 1265 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7945

#define SKINNY_DEVICE_7945   435

Definition at line 1266 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7960

#define SKINNY_DEVICE_7960   7

Definition at line 1249 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7961

#define SKINNY_DEVICE_7961   30018

Definition at line 1275 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7961GE

#define SKINNY_DEVICE_7961GE   308

Definition at line 1258 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7962

#define SKINNY_DEVICE_7962   404 /* Not found */

Definition at line 1263 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7965

#define SKINNY_DEVICE_7965   436

Definition at line 1267 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7970

#define SKINNY_DEVICE_7970   30006

Definition at line 1271 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7971

#define SKINNY_DEVICE_7971   119

Definition at line 1254 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7975

#define SKINNY_DEVICE_7975   437

Definition at line 1268 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_7985

#define SKINNY_DEVICE_7985   302

Definition at line 1256 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_ATA186

#define SKINNY_DEVICE_ATA186   12 /* Cisco ATA-186 */

Definition at line 1252 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_CIPC

#define SKINNY_DEVICE_CIPC   30016 /* Cisco IP Communicator */

Definition at line 1274 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_NONE

#define SKINNY_DEVICE_NONE   0

Definition at line 1242 of file chan_skinny.c.

Referenced by device2str().

◆ SKINNY_DEVICE_OPTIONS

#define SKINNY_DEVICE_OPTIONS

Definition at line 1561 of file chan_skinny.c.

◆ SKINNY_DEVICE_SCCPGATEWAY_AN

#define SKINNY_DEVICE_SCCPGATEWAY_AN   30027 /* Analog gateway */

Definition at line 1277 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_SCCPGATEWAY_BRI

#define SKINNY_DEVICE_SCCPGATEWAY_BRI   30028 /* BRI gateway */

Definition at line 1278 of file chan_skinny.c.

Referenced by device2str(), and get_button_template().

◆ SKINNY_DEVICE_UNKNOWN

#define SKINNY_DEVICE_UNKNOWN   -1

Definition at line 1241 of file chan_skinny.c.

Referenced by device2str().

◆ SKINNY_DEVICECONTAINER

#define SKINNY_DEVICECONTAINER   1

Definition at line 1544 of file chan_skinny.c.

◆ SKINNY_DIALTONE

#define SKINNY_DIALTONE   0x21

Definition at line 1305 of file chan_skinny.c.

Referenced by handle_soft_key_event_message(), and setsubstate().

◆ SKINNY_HOLD

#define SKINNY_HOLD   8

Definition at line 1293 of file chan_skinny.c.

Referenced by callstate2str(), setsubstate(), and skinny_extensionstate_cb().

◆ SKINNY_INCOMING

#define SKINNY_INCOMING   1

◆ SKINNY_INVALID

#define SKINNY_INVALID   14

Definition at line 1299 of file chan_skinny.c.

◆ SKINNY_LAMP_BLINK

#define SKINNY_LAMP_BLINK   5

Definition at line 1320 of file chan_skinny.c.

Referenced by mwi_event_cb(), setsubstate(), and skinny_extensionstate_cb().

◆ SKINNY_LAMP_FLASH

#define SKINNY_LAMP_FLASH   4

Definition at line 1319 of file chan_skinny.c.

Referenced by skinny_extensionstate_cb().

◆ SKINNY_LAMP_OFF

#define SKINNY_LAMP_OFF   1

◆ SKINNY_LAMP_ON

#define SKINNY_LAMP_ON   2

◆ SKINNY_LAMP_WINK

#define SKINNY_LAMP_WINK   3

Definition at line 1318 of file chan_skinny.c.

Referenced by setsubstate(), and skinny_extensionstate_cb().

◆ SKINNY_LINE_OPTIONS

#define SKINNY_LINE_OPTIONS

Definition at line 1420 of file chan_skinny.c.

◆ SKINNY_LINECONTAINER

#define SKINNY_LINECONTAINER   2

Definition at line 1545 of file chan_skinny.c.

Referenced by config_line().

◆ SKINNY_MAX_CAPABILITIES

#define SKINNY_MAX_CAPABILITIES   18

Definition at line 346 of file chan_skinny.c.

Referenced by handle_capabilities_res_message().

◆ SKINNY_MAX_PACKET

#define SKINNY_MAX_PACKET   2000

Definition at line 188 of file chan_skinny.c.

Referenced by skinny_session(), and transmit_response_bysession().

◆ SKINNY_MICOFF

#define SKINNY_MICOFF   2

Definition at line 1284 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_MICON

#define SKINNY_MICON   1

Definition at line 1283 of file chan_skinny.c.

◆ SKINNY_NOTONE

#define SKINNY_NOTONE   0x7F

Definition at line 1314 of file chan_skinny.c.

◆ SKINNY_OFFHOOK

#define SKINNY_OFFHOOK   1

◆ SKINNY_ONHOOK

#define SKINNY_ONHOOK   2

◆ SKINNY_OUTGOING

#define SKINNY_OUTGOING   2

◆ SKINNY_PARK

#define SKINNY_PARK   11

Definition at line 1296 of file chan_skinny.c.

◆ SKINNY_PROGRESS

#define SKINNY_PROGRESS   12

Definition at line 1297 of file chan_skinny.c.

Referenced by callstate2str(), and setsubstate().

◆ SKINNY_REORDER

#define SKINNY_REORDER   0x25

Definition at line 1308 of file chan_skinny.c.

Referenced by setsubstate(), skinny_dialer(), and skinny_newcall().

◆ SKINNY_RING_FEATURE

#define SKINNY_RING_FEATURE   4

Definition at line 1325 of file chan_skinny.c.

◆ SKINNY_RING_INSIDE

#define SKINNY_RING_INSIDE   2

Definition at line 1323 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_RING_OFF

#define SKINNY_RING_OFF   1

◆ SKINNY_RING_OUTSIDE

#define SKINNY_RING_OUTSIDE   3

Definition at line 1324 of file chan_skinny.c.

◆ SKINNY_RINGIN

#define SKINNY_RINGIN   4

Definition at line 1289 of file chan_skinny.c.

Referenced by callstate2str(), setsubstate(), and skinny_extensionstate_cb().

◆ SKINNY_RINGOUT

#define SKINNY_RINGOUT   3

Definition at line 1288 of file chan_skinny.c.

Referenced by callstate2str(), and setsubstate().

◆ SKINNY_SDCONTAINER

#define SKINNY_SDCONTAINER   4

Definition at line 1547 of file chan_skinny.c.

Referenced by config_parse_variables(), and skinny_extensionstate_cb().

◆ SKINNY_SILENCE

#define SKINNY_SILENCE   0x00 /* Note sure this is part of the protocol, remove? */

Definition at line 1304 of file chan_skinny.c.

◆ SKINNY_SPEAKEROFF

#define SKINNY_SPEAKEROFF   2

Definition at line 1281 of file chan_skinny.c.

Referenced by dumpsub().

◆ SKINNY_SPEAKERON

#define SKINNY_SPEAKERON   1

◆ SKINNY_SUBLINECONTAINER

#define SKINNY_SUBLINECONTAINER   3

Definition at line 1546 of file chan_skinny.c.

Referenced by config_parse_variables(), and skinny_extensionstate_cb().

◆ SKINNY_TRANSFER

#define SKINNY_TRANSFER   10

Definition at line 1295 of file chan_skinny.c.

◆ SKINNY_ZIP

#define SKINNY_ZIP   0x32

Definition at line 1311 of file chan_skinny.c.

Referenced by setsubstate().

◆ SKINNY_ZIPZIP

#define SKINNY_ZIPZIP   0x31

Definition at line 1310 of file chan_skinny.c.

◆ SOFT_KEY_EVENT_MESSAGE

#define SOFT_KEY_EVENT_MESSAGE   0x0026

Definition at line 393 of file chan_skinny.c.

Referenced by handle_message().

◆ SOFT_KEY_SET_REQ_MESSAGE

#define SOFT_KEY_SET_REQ_MESSAGE   0x0025

Definition at line 391 of file chan_skinny.c.

Referenced by handle_message().

◆ SOFT_KEY_SET_RES_MESSAGE

#define SOFT_KEY_SET_RES_MESSAGE   0x0109

Definition at line 1040 of file chan_skinny.c.

Referenced by transmit_softkeysetres().

◆ SOFT_KEY_TEMPLATE_REQ_MESSAGE

#define SOFT_KEY_TEMPLATE_REQ_MESSAGE   0x0028

Definition at line 401 of file chan_skinny.c.

Referenced by handle_message().

◆ SOFT_KEY_TEMPLATE_RES_MESSAGE

#define SOFT_KEY_TEMPLATE_RES_MESSAGE   0x0108

Definition at line 682 of file chan_skinny.c.

Referenced by transmit_softkeytemplateres().

◆ SOFTKEY_ANSWER

#define SOFTKEY_ANSWER   0x0B

Definition at line 720 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_BKSPC

#define SOFTKEY_BKSPC   0x08

Definition at line 717 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_CFWDALL

#define SOFTKEY_CFWDALL   0x05

Definition at line 714 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_CFWDBUSY

#define SOFTKEY_CFWDBUSY   0x06

Definition at line 715 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_CFWDNOANSWER

#define SOFTKEY_CFWDNOANSWER   0x07

Definition at line 716 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_CONFRN

#define SOFTKEY_CONFRN   0x0D

Definition at line 722 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_DND

#define SOFTKEY_DND   0x13

Definition at line 728 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_ENDCALL

#define SOFTKEY_ENDCALL   0x09

Definition at line 718 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_FORCEDIAL

#define SOFTKEY_FORCEDIAL   0x15

Definition at line 730 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_GPICKUP

#define SOFTKEY_GPICKUP   0x12

Definition at line 727 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_HOLD

#define SOFTKEY_HOLD   0x03

Definition at line 712 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_IDIVERT

#define SOFTKEY_IDIVERT   0x14

Definition at line 729 of file chan_skinny.c.

◆ SOFTKEY_INFO

#define SOFTKEY_INFO   0x0C

Definition at line 721 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_JOIN

#define SOFTKEY_JOIN   0x0F

Definition at line 724 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_MEETME

#define SOFTKEY_MEETME   0x10

Definition at line 725 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_NEWCALL

#define SOFTKEY_NEWCALL   0x02

Definition at line 711 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_NONE

#define SOFTKEY_NONE   0x00

Definition at line 709 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_PARK

#define SOFTKEY_PARK   0x0E

Definition at line 723 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_PICKUP

#define SOFTKEY_PICKUP   0x11

Definition at line 726 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_REDIAL

#define SOFTKEY_REDIAL   0x01

Definition at line 710 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_RESUME

#define SOFTKEY_RESUME   0x0A

Definition at line 719 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SOFTKEY_TRNSFER

#define SOFTKEY_TRNSFER   0x04

Definition at line 713 of file chan_skinny.c.

Referenced by handle_soft_key_event_message().

◆ SPEED_DIAL_STAT_REQ_MESSAGE

#define SPEED_DIAL_STAT_REQ_MESSAGE   0x000A

Definition at line 353 of file chan_skinny.c.

Referenced by handle_message().

◆ SPEED_DIAL_STAT_RES_MESSAGE

#define SPEED_DIAL_STAT_RES_MESSAGE   0x0091

Definition at line 533 of file chan_skinny.c.

Referenced by transmit_speeddialstatres().

◆ START_MEDIA_TRANSMISSION_MESSAGE

#define START_MEDIA_TRANSMISSION_MESSAGE   0x008A

Definition at line 460 of file chan_skinny.c.

Referenced by transmit_startmediatransmission().

◆ START_TONE_MESSAGE

#define START_TONE_MESSAGE   0x0082

Definition at line 419 of file chan_skinny.c.

Referenced by transmit_start_tone().

◆ STIMULUS_AUTOANSWER

#define STIMULUS_AUTOANSWER   0x11

Definition at line 583 of file chan_skinny.c.

◆ STIMULUS_CALLPARK

#define STIMULUS_CALLPARK   0x7E

Definition at line 587 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_CALLPICKUP

#define STIMULUS_CALLPICKUP   0x7F

Definition at line 588 of file chan_skinny.c.

◆ STIMULUS_CONFERENCE

#define STIMULUS_CONFERENCE   0x7D

Definition at line 586 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_DISPLAY

#define STIMULUS_DISPLAY   0x08

Definition at line 580 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_DND

#define STIMULUS_DND   0x3F

Definition at line 585 of file chan_skinny.c.

Referenced by handle_soft_key_event_message(), and handle_stimulus_message().

◆ STIMULUS_FORWARDALL

#define STIMULUS_FORWARDALL   0x05

Definition at line 577 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_FORWARDBUSY

#define STIMULUS_FORWARDBUSY   0x06

Definition at line 578 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_FORWARDNOANSWER

#define STIMULUS_FORWARDNOANSWER   0x07

Definition at line 579 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_HOLD

#define STIMULUS_HOLD   0x03

Definition at line 575 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_LINE

#define STIMULUS_LINE   0x09

◆ STIMULUS_MESSAGE

#define STIMULUS_MESSAGE   0x0005

Definition at line 317 of file chan_skinny.c.

Referenced by handle_message().

◆ STIMULUS_NONE

#define STIMULUS_NONE   0xFF

Definition at line 589 of file chan_skinny.c.

◆ STIMULUS_REDIAL

#define STIMULUS_REDIAL   0x01

Definition at line 573 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_SERVICEURL

#define STIMULUS_SERVICEURL   0x14

Definition at line 584 of file chan_skinny.c.

◆ STIMULUS_SPEEDDIAL

#define STIMULUS_SPEEDDIAL   0x02

Definition at line 574 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_TRANSFER

#define STIMULUS_TRANSFER   0x04

Definition at line 576 of file chan_skinny.c.

Referenced by handle_stimulus_message().

◆ STIMULUS_VOICEMAIL

#define STIMULUS_VOICEMAIL   0x0F

Definition at line 582 of file chan_skinny.c.

Referenced by handle_stimulus_message(), and mwi_event_cb().

◆ STOP_MEDIA_TRANSMISSION_MESSAGE

#define STOP_MEDIA_TRANSMISSION_MESSAGE   0x008B

Definition at line 492 of file chan_skinny.c.

Referenced by transmit_stopmediatransmission().

◆ STOP_TONE_MESSAGE

#define STOP_TONE_MESSAGE   0x0083

Definition at line 427 of file chan_skinny.c.

Referenced by transmit_stop_tone().

◆ SUBSTATE2STR_BUFSIZE

#define SUBSTATE2STR_BUFSIZE   15

Definition at line 276 of file chan_skinny.c.

Referenced by substate2str().

◆ SUBSTATE_BUSY

#define SUBSTATE_BUSY   6

Definition at line 1377 of file chan_skinny.c.

Referenced by setsubstate(), skinny_indicate(), and substate2str().

◆ SUBSTATE_CALLWAIT

#define SUBSTATE_CALLWAIT   9

Definition at line 1380 of file chan_skinny.c.

Referenced by activatesub(), dumpsub(), setsubstate(), and substate2str().

◆ SUBSTATE_CONGESTION

#define SUBSTATE_CONGESTION   7

Definition at line 1378 of file chan_skinny.c.

Referenced by setsubstate(), skinny_indicate(), and substate2str().

◆ SUBSTATE_CONNECTED

#define SUBSTATE_CONNECTED   5

◆ SUBSTATE_DIALING

#define SUBSTATE_DIALING   101

Definition at line 1382 of file chan_skinny.c.

Referenced by dialandactivatesub(), setsubstate(), and substate2str().

◆ SUBSTATE_HOLD

#define SUBSTATE_HOLD   8

◆ SUBSTATE_OFFHOOK

#define SUBSTATE_OFFHOOK   1

◆ SUBSTATE_ONHOOK

#define SUBSTATE_ONHOOK   2

Definition at line 1373 of file chan_skinny.c.

Referenced by activatesub(), dumpsub(), setsubstate(), and substate2str().

◆ SUBSTATE_PROGRESS

#define SUBSTATE_PROGRESS   12

Definition at line 1381 of file chan_skinny.c.

Referenced by setsubstate(), skinny_indicate(), and substate2str().

◆ SUBSTATE_RINGIN

#define SUBSTATE_RINGIN   4

Definition at line 1375 of file chan_skinny.c.

Referenced by activatesub(), dumpsub(), setsubstate(), skinny_call(), and substate2str().

◆ SUBSTATE_RINGOUT

#define SUBSTATE_RINGOUT   3

Definition at line 1374 of file chan_skinny.c.

Referenced by setsubstate(), skinny_indicate(), and substate2str().

◆ SUBSTATE_UNSET

#define SUBSTATE_UNSET   0

Definition at line 1371 of file chan_skinny.c.

Referenced by handle_stimulus_message(), skinny_request(), and substate2str().

◆ TIME_DATE_REQ_MESSAGE

#define TIME_DATE_REQ_MESSAGE   0x000D

Definition at line 363 of file chan_skinny.c.

Referenced by handle_message().

◆ TYPE_DEF_DEVICE

#define TYPE_DEF_DEVICE   2

Definition at line 7760 of file chan_skinny.c.

Referenced by config_load(), and config_parse_variables().

◆ TYPE_DEF_LINE

#define TYPE_DEF_LINE   4

Definition at line 7761 of file chan_skinny.c.

Referenced by config_load(), and config_parse_variables().

◆ TYPE_DEVICE

#define TYPE_DEVICE   8

Definition at line 7762 of file chan_skinny.c.

Referenced by config_device(), and config_parse_variables().

◆ TYPE_GENERAL

#define TYPE_GENERAL   1

Definition at line 7759 of file chan_skinny.c.

Referenced by config_load(), and config_parse_variables().

◆ TYPE_LINE

#define TYPE_LINE   16

Definition at line 7763 of file chan_skinny.c.

Referenced by config_line(), and config_parse_variables().

◆ UNREGISTER_MESSAGE

#define UNREGISTER_MESSAGE   0x0027

Definition at line 400 of file chan_skinny.c.

Referenced by handle_message().

◆ VERSION_REQ_MESSAGE

#define VERSION_REQ_MESSAGE   0x000F

Definition at line 365 of file chan_skinny.c.

Referenced by handle_message().

◆ VERSION_RES_MESSAGE

#define VERSION_RES_MESSAGE   0x0098

Definition at line 623 of file chan_skinny.c.

Referenced by transmit_versionres().

Enumeration Type Documentation

◆ skinny_codecs

Enumerator
SKINNY_CODEC_ALAW 
SKINNY_CODEC_ULAW 
SKINNY_CODEC_G722 
SKINNY_CODEC_G723_1 
SKINNY_CODEC_G729A 
SKINNY_CODEC_G726_32 
SKINNY_CODEC_H261 
SKINNY_CODEC_H263 

Definition at line 175 of file chan_skinny.c.

Function Documentation

◆ __init_callstate2str_threadbuf()

static void __init_callstate2str_threadbuf ( void  )
static

Definition at line 278 of file chan_skinny.c.

289 {

◆ __init_control2str_threadbuf()

static void __init_control2str_threadbuf ( void  )
static

Definition at line 272 of file chan_skinny.c.

289 {

◆ __init_device2str_threadbuf()

static void __init_device2str_threadbuf ( void  )
static

Definition at line 269 of file chan_skinny.c.

289 {

◆ __init_message2str_threadbuf()

static void __init_message2str_threadbuf ( void  )
static

Definition at line 265 of file chan_skinny.c.

289 {

◆ __init_substate2str_threadbuf()

static void __init_substate2str_threadbuf ( void  )
static

Definition at line 275 of file chan_skinny.c.

289 {

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 8832 of file chan_skinny.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 8832 of file chan_skinny.c.

◆ _skinny_message_clear()

static char* _skinny_message_clear ( int  type,
int  fd,
struct mansession s,
const struct message m,
int  argc,
const char *const *  argv 
)
static

Definition at line 4702 of file chan_skinny.c.

References AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, CLI_SHOWUSAGE, CLI_SUCCESS, d, skinny_device::list, priority, and transmit_clearprinotify().

Referenced by handle_skinny_message_clear().

4703 {
4704  struct skinny_device *d;
4705 
4706  if (argc != 5) {
4707  return CLI_SHOWUSAGE;
4708  }
4709 
4712  if (!strcasecmp(argv[3], d->name)) {
4713  int priority = atoi(argv[4]);
4714  transmit_clearprinotify(d, priority);
4715  }
4716  }
4718  return CLI_SUCCESS;
4719 }
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:39
struct skinny_device::@147 list
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:139
static struct test_val d
static int priority
#define CLI_SHOWUSAGE
Definition: cli.h:45
static void transmit_clearprinotify(struct skinny_device *d, int priority)
Definition: chan_skinny.c:2834
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
#define CLI_SUCCESS
Definition: cli.h:44

◆ _skinny_message_set()

static char* _skinny_message_set ( int  type,
int  fd,
struct mansession s,
const struct message m,
int  argc,
const char *const *  argv 
)
static

Definition at line 4652 of file chan_skinny.c.

References ast_copy_string(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, CLI_SHOWUSAGE, CLI_SUCCESS, d, skinny_device::list, priority, send_displayprinotify(), and timeout.

Referenced by handle_skinny_message_set().

4653 {
4654  struct skinny_device *d;
4655  char text_buf[32];
4656 
4657  if (argc < 7) {
4658  return CLI_SHOWUSAGE;
4659  }
4660 
4663  if (!strcasecmp(argv[3], d->name)) {
4664  int i;
4665  char *strp = text_buf;
4666  int charleft = sizeof(text_buf);
4667  int priority = atoi(argv[4]);
4668  int timeout = atoi(argv[5]);
4669  ast_copy_string(strp, argv[6], charleft);
4670  charleft -= strlen(strp);
4671  strp += strlen(strp);
4672  for(i=7; i<argc; i++) {
4673  ast_copy_string(strp++, " ", charleft--);
4674  ast_copy_string(strp, argv[i], charleft);
4675  charleft -= strlen(strp);
4676  strp += strlen(strp);
4677  }
4678  send_displayprinotify(d, text_buf, "", timeout, priority);
4679  }
4680  }
4682  return CLI_SUCCESS;
4683 }
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:39
struct skinny_device::@147 list
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:139
static struct test_val d
static int timeout
Definition: cdr_mysql.c:86
static int priority
#define CLI_SHOWUSAGE
Definition: cli.h:45
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
#define CLI_SUCCESS
Definition: cli.h:44
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
static void send_displayprinotify(struct skinny_device *d, const char *text, const char *extratext, int timeout, int priority)
Definition: chan_skinny.c:2902

◆ _skinny_show_device()

static char* _skinny_show_device ( int  type,
int  fd,
struct mansession s,
const struct message m,
int  argc,
const char *const *  argv 
)
static

Definition at line 4192 of file chan_skinny.c.

References skinny_device::addons, ast_cli(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_inet_ntoa(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_str_alloca, astman_append(), skinny_device::cap, CLI_SHOWUSAGE, CLI_SUCCESS, skinny_device::confcap, d, device2str(), skinny_serviceurl::displayName, skinny_speeddial::exten, skinny_speeddial::isHint, skinny_speeddial::label, skinny_device::lines, S_OR, skinny_device::serviceurls, skinny_device::session, skinnysession::sin, skinny_device::speeddials, skinny_addon::type, and skinny_serviceurl::url.

Referenced by handle_skinny_show_device(), and manager_skinny_show_device().

4193 {
4194  struct skinny_device *d;
4195  struct skinny_line *l;
4196  struct skinny_speeddial *sd;
4197  struct skinny_addon *sa;
4198  struct skinny_serviceurl *surl;
4199  struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
4200 
4201  if (argc < 4) {
4202  return CLI_SHOWUSAGE;
4203  }
4204 
4206  AST_LIST_TRAVERSE(&devices, d, list) {
4207  if (!strcasecmp(argv[3], d->id) || !strcasecmp(argv[3], d->name)) {
4208  int numlines = 0, numaddons = 0, numspeeddials = 0, numserviceurls = 0;
4209 
4210  AST_LIST_TRAVERSE(&d->lines, l, list){
4211  numlines++;
4212  }
4213 
4214  AST_LIST_TRAVERSE(&d->addons, sa, list) {
4215  numaddons++;
4216  }
4217 
4218  AST_LIST_TRAVERSE(&d->speeddials, sd, list) {
4219  numspeeddials++;
4220  }
4221 
4222  AST_LIST_TRAVERSE(&d->serviceurls, surl, list) {
4223  numserviceurls++;
4224  }
4225 
4226  if (type == 0) { /* CLI */
4227  ast_cli(fd, "Name: %s\n", d->name);
4228  ast_cli(fd, "Id: %s\n", d->id);
4229  ast_cli(fd, "version: %s\n", S_OR(d->version_id, "Unknown"));
4230  ast_cli(fd, "Ip address: %s\n", (d->session ? ast_inet_ntoa(d->session->sin.sin_addr) : "Unknown"));
4231  ast_cli(fd, "Port: %d\n", (d->session ? ntohs(d->session->sin.sin_port) : 0));
4232  ast_cli(fd, "Device Type: %s\n", device2str(d->type));
4233  ast_cli(fd, "Conf Codecs: %s\n", ast_format_cap_get_names(d->confcap, &codec_buf));
4234  ast_cli(fd, "Neg Codecs: %s\n", ast_format_cap_get_names(d->cap, &codec_buf));
4235  ast_cli(fd, "Registered: %s\n", (d->session ? "Yes" : "No"));
4236  ast_cli(fd, "Lines: %d\n", numlines);
4237  AST_LIST_TRAVERSE(&d->lines, l, list) {
4238  ast_cli(fd, " %s (%s)\n", l->name, l->label);
4239  }
4240  ast_cli(fd, "Addons: %d\n", numaddons);
4241  AST_LIST_TRAVERSE(&d->addons, sa, list) {
4242  ast_cli(fd, " %s\n", sa->type);
4243  }
4244  ast_cli(fd, "Speeddials: %d\n", numspeeddials);
4245  AST_LIST_TRAVERSE(&d->speeddials, sd, list) {
4246  ast_cli(fd, " %s (%s) ishint: %d\n", sd->exten, sd->label, sd->isHint);
4247  }
4248  ast_cli(fd, "ServiceURLs: %d\n", numserviceurls);
4249  AST_LIST_TRAVERSE(&d->serviceurls, surl, list) {
4250  ast_cli(fd, " %s (%s)\n", surl->displayName, surl->url);
4251  }
4252  } else { /* manager */
4253  astman_append(s, "Channeltype: SKINNY\r\n");
4254  astman_append(s, "ObjectName: %s\r\n", d->name);
4255  astman_append(s, "ChannelObjectType: device\r\n");
4256  astman_append(s, "Id: %s\r\n", d->id);
4257  astman_append(s, "version: %s\r\n", S_OR(d->version_id, "Unknown"));
4258  astman_append(s, "Ipaddress: %s\r\n", (d->session ? ast_inet_ntoa(d->session->sin.sin_addr) : "Unknown"));
4259  astman_append(s, "Port: %d\r\n", (d->session ? ntohs(d->session->sin.sin_port) : 0));
4260  astman_append(s, "DeviceType: %s\r\n", device2str(d->type));
4261  astman_append(s, "Codecs: %s\r\n", ast_format_cap_get_names(d->confcap, &codec_buf));
4262  astman_append(s, "CodecOrder: %s\r\n", ast_format_cap_get_names(d->cap, &codec_buf));
4263  astman_append(s, "Devicestatus: %s\r\n", (d->session?"registered":"unregistered"));
4264  astman_append(s, "NumberOfLines: %d\r\n", numlines);
4265  AST_LIST_TRAVERSE(&d->lines, l, list) {
4266  astman_append(s, "Line: %s (%s)\r\n", l->name, l->label);
4267  }
4268  astman_append(s, "NumberOfAddons: %d\r\n", numaddons);
4269  AST_LIST_TRAVERSE(&d->addons, sa, list) {
4270  astman_append(s, "Addon: %s\r\n", sa->type);
4271  }
4272  astman_append(s, "NumberOfSpeeddials: %d\r\n", numspeeddials);
4273  AST_LIST_TRAVERSE(&d->speeddials, sd, list) {
4274  astman_append(s, "Speeddial: %s (%s) ishint: %d\r\n", sd->exten, sd->label, sd->isHint);
4275  }
4276  astman_append(s, "ServiceURLs: %d\r\n", numserviceurls);
4277  AST_LIST_TRAVERSE(&d->serviceurls, surl, list) {
4278  astman_append(s, " %s (%s)\r\n", surl->displayName, surl->url);
4279  }
4280  }
4281  }
4282  }
4284  return CLI_SUCCESS;
4285 }
static const char type[]
Definition: chan_ooh323.c:109
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:39
void astman_append(struct mansession *s, const char *fmt,...)
Definition: manager.c:3080
struct skinnysession * session
Definition: chan_skinny.c:1586
char displayName[40]
Definition: chan_skinny.c:1539
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:139
#define AST_FORMAT_CAP_NAMES_LEN
Definition: format_cap.h:326
static struct test_val d
struct skinny_device::@145 serviceurls
char exten[AST_MAX_EXTENSION]
Definition: chan_skinny.c:1526
#define ast_str_alloca(init_len)
Definition: strings.h:800
struct ast_format_cap * cap
Definition: chan_skinny.c:1588
void ast_cli(int fd, const char *fmt,...)
Definition: clicompat.c:6
struct sockaddr_in sin
Definition: chan_skinny.c:1617
static char * device2str(int type)
Definition: chan_skinny.c:3999
struct skinny_device::@144 speeddials
struct ast_format_cap * confcap
Definition: chan_skinny.c:1589
char url[MAX_SERVICEURL]
Definition: chan_skinny.c:1538
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define CLI_SHOWUSAGE
Definition: cli.h:45
struct skinny_device::@143 lines
struct skinny_device::@146 addons
const char * ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf)
Get the names of codecs of a set of formats.
Definition: format_cap.c:736
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
const char * ast_inet_ntoa(struct in_addr ia)
thread-safe replacement for inet_ntoa().
Definition: main/utils.c:782
#define CLI_SUCCESS
Definition: cli.h:44
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
char type[10]
Definition: chan_skinny.c:1556

◆ _skinny_show_devices()

static char* _skinny_show_devices ( int  fd,
int *  total,
struct mansession s,
const struct message m,
int  argc,
const char *const *  argv 
)
static

Definition at line 4088 of file chan_skinny.c.

References ast_cli(), ast_inet_ntoa(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_strlen_zero, astman_append(), astman_get_header(), CLI_SHOWUSAGE, CLI_SUCCESS, d, device2str(), id, skinny_device::lines, skinny_line::list, skinny_device::session, and skinnysession::sin.

Referenced by handle_skinny_show_devices(), and manager_skinny_show_devices().

4089 {
4090  struct skinny_device *d;
4091  struct skinny_line *l;
4092  const char *id;
4093  char idtext[256] = "";
4094  int total_devices = 0;
4095 
4096  if (s) { /* Manager - get ActionID */
4097  id = astman_get_header(m, "ActionID");
4098  if (!ast_strlen_zero(id))
4099  snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
4100  }
4101 
4102  switch (argc) {
4103  case 3:
4104  break;
4105  default:
4106  return CLI_SHOWUSAGE;
4107  }
4108 
4109  if (!s) {
4110  ast_cli(fd, "Name DeviceId IP Type R NL\n");
4111  ast_cli(fd, "-------------------- ---------------- --------------- --------------- - --\n");
4112  }
4113 
4116  int numlines = 0;
4117  total_devices++;
4118  AST_LIST_TRAVERSE(&d->lines, l, list) {
4119  numlines++;
4120  }
4121  if (!s) {
4122  ast_cli(fd, "%-20s %-16s %-15s %-15s %c %2d\n",
4123  d->name,
4124  d->id,
4125  d->session?ast_inet_ntoa(d->session->sin.sin_addr):"",
4126  device2str(d->type),
4127  d->session?'Y':'N',
4128  numlines);
4129  } else {
4130  astman_append(s,
4131  "Event: DeviceEntry\r\n%s"
4132  "Channeltype: SKINNY\r\n"
4133  "ObjectName: %s\r\n"
4134  "ChannelObjectType: device\r\n"
4135  "DeviceId: %s\r\n"
4136  "IPaddress: %s\r\n"
4137  "Type: %s\r\n"
4138  "Devicestatus: %s\r\n"
4139  "NumberOfLines: %d\r\n",
4140  idtext,
4141  d->name,
4142  d->id,
4143  d->session?ast_inet_ntoa(d->session->sin.sin_addr):"-none-",
4144  device2str(d->type),
4145  d->session?"registered":"unregistered",
4146  numlines);
4147  }
4148  }
4150 
4151  if (total)
4152  *total = total_devices;
4153 
4154  return CLI_SUCCESS;
4155 }
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:39
void astman_append(struct mansession *s, const char *fmt,...)
Definition: manager.c:3080
struct skinnysession * session
Definition: chan_skinny.c:1586
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:139
static struct test_val d
void ast_cli(int fd, const char *fmt,...)
Definition: clicompat.c:6
const char * astman_get_header(const struct message *m, char *var)
Get header from mananger transaction.
Definition: manager.c:2820
#define ast_strlen_zero(foo)
Definition: strings.h:52
struct sockaddr_in sin
Definition: chan_skinny.c:1617
static char * device2str(int type)
Definition: chan_skinny.c:3999
#define CLI_SHOWUSAGE
Definition: cli.h:45
struct skinny_device::@143 lines
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
struct skinny_line::@137 list
const char * ast_inet_ntoa(struct in_addr ia)
thread-safe replacement for inet_ntoa().
Definition: main/utils.c:782
#define CLI_SUCCESS
Definition: cli.h:44
static int total
Definition: res_adsi.c:968
enum queue_result id
Definition: app_queue.c:1507

◆ _skinny_show_line()

static char* _skinny_show_line ( int  type,
int  fd,
struct mansession s,
const struct message m,
int  argc,
const char *const *  argv 
)
static

Definition at line 4443 of file chan_skinny.c.

References ast_callerid_merge(), ast_channel_amaflags2string(), ast_cli(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, AST_LIST_FIRST, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_print_group(), ast_print_namedgroups(), ast_str_alloca, ast_str_reset(), astman_append(), skinny_line::cap, CLI_SHOWUSAGE, CLI_SUCCESS, skinny_line::confcap, skinny_subline::context, d, skinny_subline::exten, skinny_device::lines, skinny_subline::name, S_COR, S_OR, SKINNY_CFWD_ALL, SKINNY_CFWD_BUSY, SKINNY_CFWD_NOANSWER, and skinny_line::sublines.

Referenced by handle_skinny_show_line(), and manager_skinny_show_line().

4444 {
4445  struct skinny_device *d;
4446  struct skinny_line *l;
4447  struct skinny_subline *subline;
4448  struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
4449  char group_buf[256];
4450  char cbuf[256];
4451 
4452  switch (argc) {
4453  case 4:
4454  break;
4455  case 6:
4456  break;
4457  default:
4458  return CLI_SHOWUSAGE;
4459  }
4460 
4462 
4463  /* Show all lines matching the one supplied */
4464  AST_LIST_TRAVERSE(&devices, d, list) {
4465  if (argc == 6 && (strcasecmp(argv[5], d->id) && strcasecmp(argv[5], d->name))) {
4466  continue;
4467  }
4468  AST_LIST_TRAVERSE(&d->lines, l, list) {
4469  struct ast_str *tmp_str = ast_str_alloca(512);
4470 
4471  if (strcasecmp(argv[3], l->name)) {
4472  continue;
4473  }
4474  if (type == 0) { /* CLI */
4475  ast_cli(fd, "Line: %s\n", l->name);
4476  ast_cli(fd, "On Device: %s\n", d->name);
4477  ast_cli(fd, "Line Label: %s\n", l->label);
4478  ast_cli(fd, "Extension: %s\n", S_OR(l->exten, "<not set>"));
4479  ast_cli(fd, "Context: %s\n", l->context);
4480  ast_cli(fd, "CallGroup: %s\n", ast_print_group(group_buf, sizeof(group_buf), l->callgroup));
4481  ast_cli(fd, "PickupGroup: %s\n", ast_print_group(group_buf, sizeof(group_buf), l->pickupgroup));
4482  ast_cli(fd, "NamedCallGroup: %s\n", ast_print_namedgroups(&tmp_str, l->named_callgroups));
4483  ast_str_reset(tmp_str);
4484  ast_cli(fd, "NamedPickupGroup: %s\n", ast_print_namedgroups(&tmp_str, l->named_pickupgroups));
4485  ast_str_reset(tmp_str);
4486  ast_cli(fd, "Language: %s\n", S_OR(l->language, "<not set>"));
4487  ast_cli(fd, "Accountcode: %s\n", S_OR(l->accountcode, "<not set>"));
4488  ast_cli(fd, "AmaFlag: %s\n", ast_channel_amaflags2string(l->amaflags));
4489  ast_cli(fd, "CallerId Number: %s\n", S_OR(l->cid_num, "<not set>"));
4490  ast_cli(fd, "CallerId Name: %s\n", S_OR(l->cid_name, "<not set>"));
4491  ast_cli(fd, "Hide CallerId: %s\n", (l->hidecallerid ? "Yes" : "No"));
4492  ast_cli(fd, "CFwdAll: %s\n", S_COR((l->cfwdtype & SKINNY_CFWD_ALL), l->call_forward_all, "<not set>"));
4493  ast_cli(fd, "CFwdBusy: %s\n", S_COR((l->cfwdtype & SKINNY_CFWD_BUSY), l->call_forward_busy, "<not set>"));
4494  ast_cli(fd, "CFwdNoAnswer: %s\n", S_COR((l->cfwdtype & SKINNY_CFWD_NOANSWER), l->call_forward_noanswer, "<not set>"));
4495  ast_cli(fd, "CFwdTimeout: %dms\n", l->callfwdtimeout);
4496  ast_cli(fd, "VoicemailBox: %s\n", S_OR(l->mailbox, "<not set>"));
4497  ast_cli(fd, "VoicemailNumber: %s\n", S_OR(l->vmexten, "<not set>"));
4498  ast_cli(fd, "MWIblink: %d\n", l->mwiblink);
4499  ast_cli(fd, "Regextension: %s\n", S_OR(l->regexten, "<not set>"));
4500  ast_cli(fd, "Regcontext: %s\n", S_OR(l->regcontext, "<not set>"));
4501  ast_cli(fd, "MoHInterpret: %s\n", S_OR(l->mohinterpret, "<not set>"));
4502  ast_cli(fd, "MoHSuggest: %s\n", S_OR(l->mohsuggest, "<not set>"));
4503  ast_cli(fd, "Last dialed nr: %s\n", S_OR(l->lastnumberdialed, "<no calls made yet>"));
4504  ast_cli(fd, "Last CallerID: %s\n", S_OR(l->lastcallerid, "<not set>"));
4505  ast_cli(fd, "Transfer enabled: %s\n", (l->transfer ? "Yes" : "No"));
4506  ast_cli(fd, "Callwaiting: %s\n", (l->callwaiting ? "Yes" : "No"));
4507  ast_cli(fd, "3Way Calling: %s\n", (l->threewaycalling ? "Yes" : "No"));
4508  ast_cli(fd, "Can forward: %s\n", (l->cancallforward ? "Yes" : "No"));
4509  ast_cli(fd, "Do Not Disturb: %s\n", (l->dnd ? "Yes" : "No"));
4510  ast_cli(fd, "NAT: %s\n", (l->nat ? "Yes" : "No"));
4511  ast_cli(fd, "immediate: %s\n", (l->immediate ? "Yes" : "No"));
4512  ast_cli(fd, "Group: %d\n", l->group);
4513  ast_cli(fd, "Parkinglot: %s\n", S_OR(l->parkinglot, "<not set>"));
4514  ast_cli(fd, "Conf Codecs: %s\n", ast_format_cap_get_names(l->confcap, &codec_buf));
4515  ast_cli(fd, "Neg Codecs: %s\n", ast_format_cap_get_names(l->cap, &codec_buf));
4516  if (AST_LIST_FIRST(&l->sublines)) {
4517  ast_cli(fd, "Sublines:\n");
4518  AST_LIST_TRAVERSE(&l->sublines, subline, list) {
4519  ast_cli(fd, " %s, %s@%s\n", subline->name, subline->exten, subline->context);
4520  }
4521  }
4522  ast_cli(fd, "\n");
4523  } else { /* manager */
4524  astman_append(s, "Channeltype: SKINNY\r\n");
4525  astman_append(s, "ObjectName: %s\r\n", l->name);
4526  astman_append(s, "ChannelObjectType: line\r\n");
4527  astman_append(s, "Device: %s\r\n", d->name);
4528  astman_append(s, "LineLabel: %s\r\n", l->label);
4529  astman_append(s, "Extension: %s\r\n", S_OR(l->exten, "<not set>"));
4530  astman_append(s, "Context: %s\r\n", l->context);
4531  astman_append(s, "CallGroup: %s\r\n", ast_print_group(group_buf, sizeof(group_buf), l->callgroup));
4532  astman_append(s, "PickupGroup: %s\r\n", ast_print_group(group_buf, sizeof(group_buf), l->pickupgroup));
4533  astman_append(s, "NamedCallGroup: %s\r\n", ast_print_namedgroups(&tmp_str, l->named_callgroups));
4534  ast_str_reset(tmp_str);
4535  astman_append(s, "NamedPickupGroup: %s\r\n", ast_print_namedgroups(&tmp_str, l->named_pickupgroups));
4536  ast_str_reset(tmp_str);
4537  astman_append(s, "Language: %s\r\n", S_OR(l->language, "<not set>"));
4538  astman_append(s, "Accountcode: %s\r\n", S_OR(l->accountcode, "<not set>"));
4539  astman_append(s, "AMAflags: %s\r\n", ast_channel_amaflags2string(l->amaflags));
4540  astman_append(s, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), l->cid_name, l->cid_num, ""));
4541  astman_append(s, "HideCallerId: %s\r\n", (l->hidecallerid ? "Yes" : "No"));
4542  astman_append(s, "CFwdAll: %s\r\n", S_COR((l->cfwdtype & SKINNY_CFWD_ALL), l->call_forward_all, "<not set>"));
4543  astman_append(s, "CFwdBusy: %s\r\n", S_COR((l->cfwdtype & SKINNY_CFWD_BUSY), l->call_forward_busy, "<not set>"));
4544  astman_append(s, "CFwdNoAnswer: %s\r\n", S_COR((l->cfwdtype & SKINNY_CFWD_NOANSWER), l->call_forward_noanswer, "<not set>"));
4545  astman_append(s, "VoicemailBox: %s\r\n", S_OR(l->mailbox, "<not set>"));
4546  astman_append(s, "VoicemailNumber: %s\r\n", S_OR(l->vmexten, "<not set>"));
4547  astman_append(s, "MWIblink: %d\r\n", l->mwiblink);
4548  astman_append(s, "RegExtension: %s\r\n", S_OR(l->regexten, "<not set>"));
4549  astman_append(s, "Regcontext: %s\r\n", S_OR(l->regcontext, "<not set>"));
4550  astman_append(s, "MoHInterpret: %s\r\n", S_OR(l->mohinterpret, "<not set>"));
4551  astman_append(s, "MoHSuggest: %s\r\n", S_OR(l->mohsuggest, "<not set>"));
4552  astman_append(s, "LastDialedNr: %s\r\n", S_OR(l->lastnumberdialed, "<no calls made yet>"));
4553  astman_append(s, "LastCallerID: %s\r\n", S_OR(l->lastcallerid, "<not set>"));
4554  astman_append(s, "Transfer: %s\r\n", (l->transfer ? "Yes" : "No"));
4555  astman_append(s, "Callwaiting: %s\r\n", (l->callwaiting ? "Yes" : "No"));
4556  astman_append(s, "3WayCalling: %s\r\n", (l->threewaycalling ? "Yes" : "No"));
4557  astman_append(s, "CanForward: %s\r\n", (l->cancallforward ? "Yes" : "No"));
4558  astman_append(s, "DoNotDisturb: %s\r\n", (l->dnd ? "Yes" : "No"));
4559  astman_append(s, "NAT: %s\r\n", (l->nat ? "Yes" : "No"));
4560  astman_append(s, "immediate: %s\r\n", (l->immediate ? "Yes" : "No"));
4561  astman_append(s, "Group: %d\r\n", l->group);
4562  astman_append(s, "Parkinglot: %s\r\n", S_OR(l->parkinglot, "<not set>"));
4563  astman_append(s, "Codecs: %s\r\n", ast_format_cap_get_names(l->confcap, &codec_buf));
4564  astman_append(s, "\r\n");
4565  }
4566  }
4567  }
4568 
4570  return CLI_SUCCESS;
4571 }
static const char type[]
Definition: chan_ooh323.c:109
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:39
void astman_append(struct mansession *s, const char *fmt,...)
Definition: manager.c:3080
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Definition: linkedlists.h:420
struct ast_format_cap * confcap
Definition: chan_skinny.c:1477
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:139
#define AST_FORMAT_CAP_NAMES_LEN
Definition: format_cap.h:326
static struct test_val d
#define SKINNY_CFWD_BUSY
Definition: chan_skinny.c:1328
struct skinny_line::@136 sublines
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
Definition: channel.c:4418
#define ast_str_alloca(init_len)
Definition: strings.h:800
char exten[AST_MAX_EXTENSION]
Definition: chan_skinny.c:1508
void ast_cli(int fd, const char *fmt,...)
Definition: clicompat.c:6
char context[AST_MAX_CONTEXT]
Definition: chan_skinny.c:1507
char * ast_print_group(char *buf, int buflen, ast_group_t group)
Print call and pickup groups into buffer.
Definition: channel.c:8133
char * ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num, const char *unknown)
Definition: callerid.c:1073
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
Definition: strings.h:85
#define SKINNY_CFWD_NOANSWER
Definition: chan_skinny.c:1329
struct ast_format_cap * cap
Definition: chan_skinny.c:1476
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define CLI_SHOWUSAGE
Definition: cli.h:45
struct skinny_device::@143 lines
#define SKINNY_CFWD_ALL
Definition: chan_skinny.c:1327
const char * ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf)
Get the names of codecs of a set of formats.
Definition: format_cap.c:736
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
#define CLI_SUCCESS
Definition: cli.h:44
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *groups)
Print named call groups and named pickup groups.
Definition: channel.c:8158

◆ _skinny_show_lines()

static char* _skinny_show_lines ( int  fd,
int *  total,
struct mansession s,
const struct message m,
int  argc,
const char *const *  argv 
)
static

Definition at line 4324 of file chan_skinny.c.

References skinny_line::activesub, ao2_cleanup, ast_channel_bridge_peer(), ast_channel_name(), ast_cli(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_strlen_zero, astman_append(), astman_get_header(), CLI_SHOWUSAGE, CLI_SUCCESS, skinny_line::device, id, skinny_subchannel::list, skinny_subchannel::owner, RAII_VAR, sub, and skinny_line::sub.

Referenced by handle_skinny_show_lines(), and manager_skinny_show_lines().

4325 {
4326  struct skinny_line *l;
4327  struct skinny_subchannel *sub;
4328  int total_lines = 0;
4329  int verbose = 0;
4330  const char *id;
4331  char idtext[256] = "";
4332 
4333  if (s) { /* Manager - get ActionID */
4334  id = astman_get_header(m, "ActionID");
4335  if (!ast_strlen_zero(id))
4336  snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
4337  }
4338 
4339  switch (argc) {
4340  case 4:
4341  verbose = 1;
4342  break;
4343  case 3:
4344  verbose = 0;
4345  break;
4346  default:
4347  return CLI_SHOWUSAGE;
4348  }
4349 
4350  if (!s) {
4351  ast_cli(fd, "Name Device Name Instance Label \n");
4352  ast_cli(fd, "-------------------- -------------------- -------- --------------------\n");
4353  }
4354  AST_LIST_LOCK(&lines);
4355  AST_LIST_TRAVERSE(&lines, l, all) {
4356  total_lines++;
4357  if (!s) {
4358  ast_cli(fd, "%-20s %-20s %8d %-20s\n",
4359  l->name,
4360  (l->device ? l->device->name : "Not connected"),
4361  l->instance,
4362  l->label);
4363  if (verbose) {
4364  AST_LIST_TRAVERSE(&l->sub, sub, list) {
4365  RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(sub->owner), ao2_cleanup);
4366 
4367  ast_cli(fd, " %s> %s to %s\n",
4368  (sub == l->activesub?"Active ":"Inactive"),
4369  ast_channel_name(sub->owner),
4370  bridged ? ast_channel_name(bridged) : ""
4371  );
4372  }
4373  }
4374  } else {
4375  astman_append(s,
4376  "Event: LineEntry\r\n%s"
4377  "Channeltype: SKINNY\r\n"
4378  "ObjectName: %s\r\n"
4379  "ChannelObjectType: line\r\n"
4380  "Device: %s\r\n"
4381  "Instance: %d\r\n"
4382  "Label: %s\r\n",
4383  idtext,
4384  l->name,
4385  (l->device ? l->device->name : "None"),
4386  l->instance,
4387  l->label);
4388  }
4389  }
4391 
4392  if (total) {
4393  *total = total_lines;
4394  }
4395 
4396  return CLI_SUCCESS;
4397 }
Main Channel structure associated with a channel.
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:39
void astman_append(struct mansession *s, const char *fmt,...)
Definition: manager.c:3080
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:139
struct skinny_device * device
Definition: chan_skinny.c:1475
void ast_cli(int fd, const char *fmt,...)
Definition: clicompat.c:6
struct skinny_line::@135 sub
const char * astman_get_header(const struct message *m, char *var)
Get header from mananger transaction.
Definition: manager.c:2820
#define ast_strlen_zero(foo)
Definition: strings.h:52
struct skinny_subchannel * activesub
Definition: chan_skinny.c:1470
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:911
struct ast_channel * owner
Definition: chan_skinny.c:1389
#define CLI_SHOWUSAGE
Definition: cli.h:45
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
#define CLI_SUCCESS
Definition: cli.h:44
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel&#39;s bridge peer only if the bridge is two-party.
Definition: channel.c:10765
const char * ast_channel_name(const struct ast_channel *chan)
struct skinny_subchannel::@134 list
struct stasis_forward * sub
Definition: res_corosync.c:240
static int total
Definition: res_adsi.c:968
enum queue_result id
Definition: app_queue.c:1507

◆ _transmit_displayprinotify()

static void _transmit_displayprinotify ( struct skinny_device d,
const char *  text,
const char *  extratext,
int  timeout,
int  priority 
)
static

Definition at line 2847 of file chan_skinny.c.

References ast_copy_string(), skinny_req::data, DEBUG_PACKET, DISPLAY_PRINOTIFY_MESSAGE, skinny_data::displayprinotify, htolel, display_prinotify_message::priority, req_alloc(), SKINNY_DEBUG, display_prinotify_message::text, display_prinotify_message::timeout, and transmit_response().

Referenced by send_displayprinotify().

2848 {
2849  struct skinny_req *req;
2850 
2851  if (!(req = req_alloc(sizeof(struct display_prinotify_message), DISPLAY_PRINOTIFY_MESSAGE)))
2852  return;
2853 
2856 
2857  if ((char)*text == '\200') {
2858  int octalstrlen = strlen(text);
2860  ast_copy_string(req->data.displayprinotify.text+octalstrlen, extratext, sizeof(req->data.displayprinotify.text)-octalstrlen);
2861  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE to %s, '\\%03o\\%03o', '%s', timeout=%d, priority=%d\n",
2862  d->name, (unsigned)*text, (unsigned)*(text+1), extratext, timeout, priority);
2863  } else {
2865  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE to %s, '%s', timeout=%d, priority=%d\n",
2866  d->name, text, timeout, priority);
2867  }
2868 
2869  transmit_response(d, req);
2870 }
union skinny_data data
Definition: chan_skinny.c:1216
#define DEBUG_PACKET
Definition: chan_skinny.c:150
static void transmit_response(struct skinny_device *d, struct skinny_req *req)
Definition: chan_skinny.c:2418
static int timeout
Definition: cdr_mysql.c:86
char * text
Definition: app_queue.c:1508
#define htolel(x)
Definition: chan_skinny.c:222
static int priority
struct display_prinotify_message displayprinotify
Definition: chan_skinny.c:1207
char text[MAXDISPLAYNOTIFYSTR]
Definition: chan_skinny.c:1119
#define SKINNY_DEBUG(type, verb_level, text,...)
Definition: chan_skinny.c:157
#define DISPLAY_PRINOTIFY_MESSAGE
Definition: chan_skinny.c:1115
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
static struct skinny_req * req_alloc(size_t size, int response_message)
Definition: chan_skinny.c:1869

◆ _transmit_displayprinotifyvar()

static void _transmit_displayprinotifyvar ( struct skinny_device d,
const char *  text,
const char *  extratext,
int  timeout,
int  priority 
)
static

Definition at line 2872 of file chan_skinny.c.

References ast_copy_string(), skinny_req::data, DEBUG_PACKET, DISPLAY_PRINOTIFY_MESSAGE_VARIABLE, skinny_data::displayprinotifyvar, htolel, skinny_req::len, MAXDISPLAYNOTIFYSTR, display_prinotify_message_variable::priority, req_alloc(), SKINNY_DEBUG, display_prinotify_message_variable::text, display_prinotify_message_variable::timeout, and transmit_response().

Referenced by send_displayprinotify().

2873 {
2874  struct skinny_req *req;
2875  int packetlen;
2876 
2878  return;
2879 
2882 
2883  if ((char)*text == '\200') {
2884  int octalstrlen = strlen(text);
2886  ast_copy_string(req->data.displayprinotifyvar.text+octalstrlen, extratext, sizeof(req->data.displayprinotifyvar.text)-octalstrlen);
2887  packetlen = req->len - MAXDISPLAYNOTIFYSTR + strlen(text) + strlen(extratext);
2888  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE_VARIABLE to %s, '\\%03o\\%03o', '%s', timeout=%d, priority=%d\n",
2889  d->name, (unsigned)*text, (unsigned)*(text+1), extratext, timeout, priority);
2890  } else {
2892  packetlen = req->len - MAXDISPLAYNOTIFYSTR + strlen(text);
2893  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE_VARIABLE to %s, '%s', timeout=%d, priority=%d\n",
2894  d->name, text, timeout, priority);
2895  }
2896 
2897  req->len = (packetlen & ~0x3) + 4;
2898 
2899  transmit_response(d, req);
2900 }
union skinny_data data
Definition: chan_skinny.c:1216
#define DEBUG_PACKET
Definition: chan_skinny.c:150
#define DISPLAY_PRINOTIFY_MESSAGE_VARIABLE
Definition: chan_skinny.c:1140
static void transmit_response(struct skinny_device *d, struct skinny_req *req)
Definition: chan_skinny.c:2418
uint32_t len
Definition: chan_skinny.c:1213
static int timeout
Definition: cdr_mysql.c:86
char * text
Definition: app_queue.c:1508
#define htolel(x)
Definition: chan_skinny.c:222
static int priority
#define MAXDISPLAYNOTIFYSTR
Definition: chan_skinny.c:1113
#define SKINNY_DEBUG(type, verb_level, text,...)
Definition: chan_skinny.c:157
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
char text[MAXDISPLAYNOTIFYSTR]
Definition: chan_skinny.c:1144
struct display_prinotify_message_variable displayprinotifyvar
Definition: chan_skinny.c:1208
static struct skinny_req * req_alloc(size_t size, int response_message)
Definition: chan_skinny.c:1869

◆ accept_thread()

static void* accept_thread ( void *  ignore)
static

Definition at line 7657 of file chan_skinny.c.

References ast_atomic_fetchadd_int(), ast_calloc, ast_log, ast_mutex_init, ast_pthread_create, AST_PTHREADT_NULL, auth_limit, skinnysession::auth_timeout_sched, DEBUG_THREAD, destroy_session(), errno, skinnysession::fd, skinnysession::keepalive_timeout_sched, skinnysession::lock, LOG_NOTICE, LOG_WARNING, NULL, skinnysession::sin, SKINNY_DEBUG, skinny_session(), skinnysock, skinnysession::t, and unauth_sessions.

Referenced by config_load().

7658 {
7659  int as;
7660  struct sockaddr_in sin;
7661  socklen_t sinlen;
7662  struct skinnysession *s;
7663  int arg = 1;
7664 
7665  for (;;) {
7666  sinlen = sizeof(sin);
7667  as = accept(skinnysock, (struct sockaddr *)&sin, &sinlen);
7668  if (as < 0) {
7669  ast_log(LOG_NOTICE, "Accept returned -1: %s\n", strerror(errno));
7670  continue;
7671  }
7672 
7674  close(as);
7676  continue;
7677  }
7678 
7679  if (setsockopt(as, IPPROTO_TCP, TCP_NODELAY, (char *) &arg, sizeof(arg)) < 0) {
7680  ast_log(LOG_WARNING, "Failed to set TCP_NODELAY on Skinny TCP connection: %s\n", strerror(errno));
7681  }
7682 
7683  if (!(s = ast_calloc(1, sizeof(struct skinnysession)))) {
7684  close(as);
7686  continue;
7687  }
7688 
7689  ast_mutex_init(&s->lock);
7690  memcpy(&s->sin, &sin, sizeof(sin));
7691  s->fd = as;
7692  s->auth_timeout_sched = -1;
7693  s->keepalive_timeout_sched = -1;
7694 
7695  if (ast_pthread_create(&s->t, NULL, skinny_session, s)) {
7696  s->t = AST_PTHREADT_NULL;
7697  destroy_session(s);
7698  }
7699  }
7700  SKINNY_DEBUG(DEBUG_THREAD, 3, "Killing accept thread\n");
7701  close(as);
7702  return 0;
7703 }
ast_mutex_t lock
Definition: chan_skinny.c:1615
#define LOG_WARNING
Definition: logger.h:274
static void destroy_session(struct skinnysession *s)
Definition: chan_skinny.c:7426
#define DEBUG_THREAD
Definition: chan_skinny.c:154
int keepalive_timeout_sched
Definition: chan_skinny.c:1624
static int auth_limit
Definition: chan_skinny.c:203
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
#define ast_log
Definition: astobj2.c:42
struct sockaddr_in sin
Definition: chan_skinny.c:1617
int auth_timeout_sched
Definition: chan_skinny.c:1623
#define AST_PTHREADT_NULL
Definition: lock.h:66
#define SKINNY_DEBUG(type, verb_level, text,...)
Definition: chan_skinny.c:157
int errno
static int unauth_sessions
Definition: chan_skinny.c:204
#define LOG_NOTICE
Definition: logger.h:263
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:204
#define ast_pthread_create(a, b, c, d)
Definition: utils.h:559
pthread_t t
Definition: chan_skinny.c:1614
static int skinnysock
Definition: chan_skinny.c:1237
#define ast_mutex_init(pmutex)
Definition: lock.h:184
static void * skinny_session(void *data)
Definition: chan_skinny.c:7520

◆ activatesub()

static void activatesub ( struct skinny_subchannel sub,
int  state 
)
static

Definition at line 6049 of file chan_skinny.c.

References skinny_line::activesub, skinny_subchannel::callid, DEBUG_SUB, skinny_subchannel::line, setsubstate(), SKINNY_DEBUG, sub, skinny_subchannel::substate, SUBSTATE_CALLWAIT, SUBSTATE_HOLD, SUBSTATE_ONHOOK, and SUBSTATE_RINGIN.

Referenced by dialandactivatesub(), handle_hold_button(), and handle_soft_key_event_message().

6050 {
6051  struct skinny_line *l = sub->line;
6052 
6053  SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Activating, and deactivating sub %u\n",
6054  sub->callid, l->activesub ? l->activesub->callid : 0);
6055 
6056  if (sub == l->activesub) {
6057  setsubstate(sub, state);
6058  } else {
6059  if (l->activesub) {
6060  if (l->activesub->substate == SUBSTATE_RINGIN) {
6062  } else if (l->activesub->substate != SUBSTATE_HOLD) {
6064  }
6065  }
6066  l->activesub = sub;
6067  setsubstate(sub, state);
6068  }
6069 }
#define SUBSTATE_RINGIN
Definition: chan_skinny.c:1375
#define SUBSTATE_CALLWAIT
Definition: chan_skinny.c:1380
struct skinny_line * line
Definition: chan_skinny.c:1416
unsigned int callid
Definition: chan_skinny.c:1392
struct skinny_subchannel * activesub
Definition: chan_skinny.c:1470
#define DEBUG_SUB
Definition: chan_skinny.c:149
static void setsubstate(struct skinny_subchannel *sub, int state)
Definition: chan_skinny.c:5560
#define SKINNY_DEBUG(type, verb_level, text,...)
Definition: chan_skinny.c:157
#define SUBSTATE_HOLD
Definition: chan_skinny.c:1379
#define SUBSTATE_ONHOOK
Definition: chan_skinny.c:1373
struct stasis_forward * sub
Definition: res_corosync.c:240

◆ add_var()

static struct ast_variable* add_var ( const char *  buf,
struct ast_variable list 
)
static

implement the setvar config line

Definition at line 1993 of file chan_skinny.c.

References ast_strdupa, ast_variable_new, ast_variable::next, and NULL.

Referenced by config_parse_variables().

1994 {
1995  struct ast_variable *tmpvar = NULL;
1996  char *varname = ast_strdupa(buf), *varval = NULL;
1997 
1998  if ((varval = strchr(varname,'='))) {
1999  *varval++ = '\0';
2000  if ((tmpvar = ast_variable_new(varname, varval, ""))) {
2001  tmpvar->next = list;
2002  list = tmpvar;
2003  }
2004  }
2005  return list;
2006 }
struct ast_variable * next
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
Structure for variables, used for configurations and for channel variables.
#define NULL
Definition: resample.c:96
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
#define ast_variable_new(name, value, filename)

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 8832 of file chan_skinny.c.

◆ callstate2str()

static char* callstate2str ( int  ind)
static

Definition at line 2342 of file chan_skinny.c.

References ast_threadstorage_get(), CALLSTATE2STR_BUFSIZE, callstate2str_threadbuf, SKINNY_BUSY, SKINNY_CALLWAIT, SKINNY_CONGESTION, SKINNY_CONNECTED, SKINNY_HOLD, SKINNY_OFFHOOK, SKINNY_ONHOOK, SKINNY_PROGRESS, SKINNY_RINGIN, SKINNY_RINGOUT, and tmp().

Referenced by transmit_callstate().

2343 {
2344  char *tmp;
2345 
2346  switch (ind) {
2347  case SKINNY_OFFHOOK:
2348  return "SKINNY_OFFHOOK";
2349  case SKINNY_ONHOOK:
2350  return "SKINNY_ONHOOK";
2351  case SKINNY_RINGOUT:
2352  return "SKINNY_RINGOUT";
2353  case SKINNY_RINGIN:
2354  return "SKINNY_RINGIN";
2355  case SKINNY_CONNECTED:
2356  return "SKINNY_CONNECTED";
2357  case SKINNY_BUSY:
2358  return "SKINNY_BUSY";
2359  case SKINNY_CONGESTION:
2360  return "SKINNY_CONGESTION";
2361  case SKINNY_PROGRESS:
2362  return "SKINNY_PROGRESS";
2363  case SKINNY_HOLD:
2364  return "SKINNY_HOLD";
2365  case SKINNY_CALLWAIT:
2366  return "SKINNY_CALLWAIT";
2367  default:
2369  return "Unknown";
2370  snprintf(tmp, CALLSTATE2STR_BUFSIZE, "UNKNOWN-%d", ind);
2371  return tmp;
2372  }
2373 }
#define SKINNY_HOLD
Definition: chan_skinny.c:1293
#define SKINNY_RINGIN
Definition: chan_skinny.c:1289
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
#define SKINNY_CONGESTION
Definition: chan_skinny.c:1292
#define CALLSTATE2STR_BUFSIZE
Definition: chan_skinny.c:279
static int tmp()
Definition: bt_open.c:389
#define SKINNY_CONNECTED
Definition: chan_skinny.c:1290
static struct ast_threadstorage callstate2str_threadbuf
Definition: chan_skinny.c:278
#define SKINNY_PROGRESS
Definition: chan_skinny.c:1297
#define SKINNY_CALLWAIT
Definition: chan_skinny.c:1294
#define SKINNY_OFFHOOK
Definition: chan_skinny.c:1286
#define SKINNY_ONHOOK
Definition: chan_skinny.c:1287
#define SKINNY_BUSY
Definition: chan_skinny.c:1291
#define SKINNY_RINGOUT
Definition: chan_skinny.c:1288

◆ cleanup_stale_contexts()

static void cleanup_stale_contexts ( char *  new,
char *  old 
)
static

Definition at line 2187 of file chan_skinny.c.

References ast_context_destroy_by_name(), ast_copy_string(), AST_MAX_CONTEXT, NULL, and strsep().

Referenced by config_parse_variables().

2188 {
2189  char *oldcontext, *newcontext, *stalecontext, *stringp, newlist[AST_MAX_CONTEXT];
2190 
2191  while ((oldcontext = strsep(&old, "&"))) {
2192  stalecontext = NULL;
2193  ast_copy_string(newlist, new, sizeof(newlist));
2194  stringp = newlist;
2195  while ((newcontext = strsep(&stringp, "&"))) {
2196  if (strcmp(newcontext, oldcontext) == 0) {
2197  /* This is not the context you're looking for */
2198  stalecontext = NULL;
2199  break;
2200  } else if (strcmp(newcontext, oldcontext)) {
2201  stalecontext = oldcontext;
2202  }
2203 
2204  }
2205  ast_context_destroy_by_name(stalecontext, "Skinny");
2206  }
2207 }
#define NULL
Definition: resample.c:96
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.
Definition: pbx.c:8244
#define AST_MAX_CONTEXT
Definition: channel.h:136
char * strsep(char **str, const char *delims)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401

◆ codec_ast2skinny()

static int codec_ast2skinny ( const struct ast_format astcodec)
static

Definition at line 2129 of file chan_skinny.c.

References ast_format_alaw, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_g722, ast_format_g723, ast_format_g726, ast_format_g729, ast_format_h261, ast_format_h263, ast_format_ulaw, SKINNY_CODEC_ALAW, SKINNY_CODEC_G722, SKINNY_CODEC_G723_1, SKINNY_CODEC_G726_32, SKINNY_CODEC_G729A, SKINNY_CODEC_H261, SKINNY_CODEC_H263, and SKINNY_CODEC_ULAW.

Referenced by transmit_connect(), and transmit_startmediatransmission().

2130 {
2132  return SKINNY_CODEC_ALAW;
2133  } else if (ast_format_cmp(astcodec, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL) {
2134  return SKINNY_CODEC_ULAW;
2135  } else if (ast_format_cmp(astcodec, ast_format_g722) == AST_FORMAT_CMP_EQUAL) {
2136  return SKINNY_CODEC_G722;
2137  } else if (ast_format_cmp(astcodec, ast_format_g723) == AST_FORMAT_CMP_EQUAL) {
2138  return SKINNY_CODEC_G723_1;
2139  } else if (ast_format_cmp(astcodec, ast_format_g729) == AST_FORMAT_CMP_EQUAL) {
2140  return SKINNY_CODEC_G729A;
2141  } else if (ast_format_cmp(astcodec, ast_format_g726) == AST_FORMAT_CMP_EQUAL) {
2142  return SKINNY_CODEC_G726_32;
2143  } else if (ast_format_cmp(astcodec, ast_format_h261) == AST_FORMAT_CMP_EQUAL) {
2144  return SKINNY_CODEC_H261;
2145  } else if (ast_format_cmp(astcodec, ast_format_h263) == AST_FORMAT_CMP_EQUAL) {
2146  return SKINNY_CODEC_H263;
2147  } else {
2148  return 0;
2149  }
2150 }
struct ast_format * ast_format_g726
Built-in cached g726 format.
Definition: format_cache.c:116
struct ast_format * ast_format_g723
Built-in cached g723.1 format.
Definition: format_cache.c:151
struct ast_format * ast_format_ulaw
Built-in cached ulaw format.
Definition: format_cache.c:86
struct ast_format * ast_format_g722
Built-in cached g722 format.
Definition: format_cache.c:111
struct ast_format * ast_format_h261
Built-in cached h261 format.
Definition: format_cache.c:166
enum ast_format_cmp_res ast_format_cmp(const struct ast_format *format1, const struct ast_format *format2)
Compare two formats.
Definition: format.c:201
struct ast_format * ast_format_alaw
Built-in cached alaw format.
Definition: format_cache.c:91
struct ast_format * ast_format_g729
Built-in cached g729 format.
Definition: format_cache.c:156
struct ast_format * ast_format_h263
Built-in cached h263 format.
Definition: format_cache.c:171

◆ codec_skinny2ast()

static struct ast_format* codec_skinny2ast ( enum skinny_codecs  skinnycodec)
static

Definition at line 2105 of file chan_skinny.c.

References ast_format_alaw, ast_format_g722, ast_format_g723, ast_format_g726, ast_format_g729, ast_format_h261, ast_format_h263, ast_format_none, ast_format_ulaw, SKINNY_CODEC_ALAW, SKINNY_CODEC_G722, SKINNY_CODEC_G723_1, SKINNY_CODEC_G726_32, SKINNY_CODEC_G729A, SKINNY_CODEC_H261, SKINNY_CODEC_H263, and SKINNY_CODEC_ULAW.

Referenced by handle_capabilities_res_message().

2106 {
2107  switch (skinnycodec) {
2108  case SKINNY_CODEC_ALAW:
2109  return ast_format_alaw;
2110  case SKINNY_CODEC_ULAW:
2111  return ast_format_ulaw;
2112  case SKINNY_CODEC_G722:
2113  return ast_format_g722;
2114  case SKINNY_CODEC_G723_1:
2115  return ast_format_g723;
2116  case SKINNY_CODEC_G729A:
2117  return ast_format_g729;
2118  case SKINNY_CODEC_G726_32:
2119  return ast_format_g726; /* XXX Is this right? */
2120  case SKINNY_CODEC_H261:
2121  return ast_format_h261;
2122  case SKINNY_CODEC_H263:
2123  return ast_format_h263;
2124  default:
2125  return ast_format_none;
2126  }
2127 }
struct ast_format * ast_format_g726
Built-in cached g726 format.
Definition: format_cache.c:116
struct ast_format * ast_format_g723
Built-in cached g723.1 format.
Definition: format_cache.c:151
struct ast_format * ast_format_ulaw
Built-in cached ulaw format.
Definition: format_cache.c:86
struct ast_format * ast_format_g722
Built-in cached g722 format.
Definition: format_cache.c:111
struct ast_format * ast_format_none
Built-in "null" format.
Definition: format_cache.c:251
struct ast_format * ast_format_h261
Built-in cached h261 format.
Definition: format_cache.c:166
struct ast_format * ast_format_alaw
Built-in cached alaw format.
Definition: format_cache.c:91
struct ast_format * ast_format_g729
Built-in cached g729 format.
Definition: format_cache.c:156
struct ast_format * ast_format_h263
Built-in cached h263 format.
Definition: format_cache.c:171

◆ complete_skinny_debug()

static char* complete_skinny_debug ( const char *  line,
const char *  word,
int  pos,
int  state 
)
static

Definition at line 3762 of file chan_skinny.c.

References ast_copy_string(), ast_strdup, buf, and NULL.

Referenced by handle_skinny_set_debug().

3763 {
3764  const char *debugOpts[]={ "all","audio","hint","keepalive","lock","off","packet","show","sub","template","thread",NULL };
3765  char *wordptr = (char *)word;
3766  char buf[32];
3767  char *bufptr = buf;
3768  int buflen = sizeof(buf);
3769  int wordlen;
3770  int which = 0;
3771  int i = 0;
3772 
3773  if (*word == '+' || *word == '-' || *word == '!') {
3774  *bufptr = *word;
3775  wordptr++;
3776  bufptr++;
3777  buflen--;
3778  }
3779  wordlen = strlen(wordptr);
3780 
3781  while (debugOpts[i]) {
3782  if (!strncasecmp(wordptr, debugOpts[i], wordlen) && ++which > state) {
3783  ast_copy_string(bufptr, debugOpts[i], buflen);
3784  return ast_strdup(buf);
3785  }
3786  i++;
3787  }
3788 
3789  return NULL;
3790 }
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
#define NULL
Definition: resample.c:96
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
short word

◆ complete_skinny_devices()

static char* complete_skinny_devices ( const char *  word,
int  state 
)
static

Definition at line 3904 of file chan_skinny.c.

References AST_LIST_TRAVERSE, ast_strdup, d, skinny_device::list, and NULL.

Referenced by complete_skinny_reset(), complete_skinny_show_device(), and complete_skinny_show_line().

3905 {
3906  struct skinny_device *d;
3907  int wordlen = strlen(word), which = 0;
3908 
3910  if (!strncasecmp(word, d->name, wordlen) && ++which > state) {
3911  return ast_strdup(d->name);
3912  }
3913  }
3914 
3915  return NULL;
3916 }
struct skinny_device::@147 list
static struct test_val d
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
#define NULL
Definition: resample.c:96
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
short word

◆ complete_skinny_reset()

static char* complete_skinny_reset ( const char *  line,
const char *  word,
int  pos,
int  state 
)
static

Definition at line 3923 of file chan_skinny.c.

References ast_cli_complete(), complete_skinny_devices(), and NULL.

Referenced by handle_skinny_reset().

3924 {
3925