Asterisk - The Open Source Telephony Project  GIT-master-93d0901
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 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 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_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 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_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_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 int resolve_first_addr (const char *hostname, struct in_addr *sin_addr)
 Resolve the given hostname and save its IPv4 address. More...
 
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 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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_DEPRECATED, .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 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"
 
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 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 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 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 1095 of file chan_skinny.c.

◆ ALARM_MESSAGE

#define ALARM_MESSAGE   0x0020

Definition at line 371 of file chan_skinny.c.

◆ BKSP_REQ_MESSAGE

#define BKSP_REQ_MESSAGE   0x0119

Definition at line 691 of file chan_skinny.c.

◆ BT_AUTOANSWER

#define BT_AUTOANSWER   STIMULUS_AUTOANSWER

Definition at line 605 of file chan_skinny.c.

◆ BT_CALLPARK

#define BT_CALLPARK   STIMULUS_CALLPARK

Definition at line 609 of file chan_skinny.c.

◆ BT_CALLPICKUP

#define BT_CALLPICKUP   STIMULUS_CALLPICKUP

Definition at line 610 of file chan_skinny.c.

◆ BT_CONFERENCE

#define BT_CONFERENCE   STIMULUS_CONFERENCE

Definition at line 608 of file chan_skinny.c.

◆ BT_CUST_LINE

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

Definition at line 617 of file chan_skinny.c.

◆ BT_CUST_LINESPEEDDIAL

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

Definition at line 616 of file chan_skinny.c.

◆ BT_DISPLAY

#define BT_DISPLAY   STIMULUS_DISPLAY

Definition at line 602 of file chan_skinny.c.

◆ BT_DND

#define BT_DND   STIMULUS_DND

Definition at line 607 of file chan_skinny.c.

◆ BT_FORWARDALL

#define BT_FORWARDALL   STIMULUS_FORWARDALL

Definition at line 599 of file chan_skinny.c.

◆ BT_FORWARDBUSY

#define BT_FORWARDBUSY   STIMULUS_FORWARDBUSY

Definition at line 600 of file chan_skinny.c.

◆ BT_FORWARDNOANSWER

#define BT_FORWARDNOANSWER   STIMULUS_FORWARDNOANSWER

Definition at line 601 of file chan_skinny.c.

◆ BT_HOLD

#define BT_HOLD   STIMULUS_HOLD

Definition at line 597 of file chan_skinny.c.

◆ BT_LINE

#define BT_LINE   STIMULUS_LINE

Definition at line 603 of file chan_skinny.c.

◆ BT_NONE

#define BT_NONE   0x00

Definition at line 611 of file chan_skinny.c.

◆ BT_REDIAL

#define BT_REDIAL   STIMULUS_REDIAL

Definition at line 595 of file chan_skinny.c.

◆ BT_SERVICEURL

#define BT_SERVICEURL   STIMULUS_SERVICEURL

Definition at line 606 of file chan_skinny.c.

◆ BT_SPEEDDIAL

#define BT_SPEEDDIAL   STIMULUS_SPEEDDIAL

Definition at line 596 of file chan_skinny.c.

◆ BT_TRANSFER

#define BT_TRANSFER   STIMULUS_TRANSFER

Definition at line 598 of file chan_skinny.c.

◆ BT_VOICEMAIL

#define BT_VOICEMAIL   STIMULUS_VOICEMAIL

Definition at line 604 of file chan_skinny.c.

◆ BUTTON_TEMPLATE_REQ_MESSAGE

#define BUTTON_TEMPLATE_REQ_MESSAGE   0x000E

Definition at line 367 of file chan_skinny.c.

◆ BUTTON_TEMPLATE_RES_MESSAGE

#define BUTTON_TEMPLATE_RES_MESSAGE   0x0097

Definition at line 564 of file chan_skinny.c.

◆ CALL_INFO_MESSAGE

#define CALL_INFO_MESSAGE   0x008F

Definition at line 502 of file chan_skinny.c.

◆ CALL_INFO_MESSAGE_VARIABLE

#define CALL_INFO_MESSAGE_VARIABLE   0x014A

Definition at line 1130 of file chan_skinny.c.

◆ CALL_STATE_MESSAGE

#define CALL_STATE_MESSAGE   0x0111

Definition at line 1066 of file chan_skinny.c.

◆ CALLSTATE2STR_BUFSIZE

#define CALLSTATE2STR_BUFSIZE   15

Definition at line 282 of file chan_skinny.c.

◆ CAPABILITIES_REQ_MESSAGE

#define CAPABILITIES_REQ_MESSAGE   0x009B

Definition at line 642 of file chan_skinny.c.

◆ CAPABILITIES_RES_MESSAGE

#define CAPABILITIES_RES_MESSAGE   0x0010

Definition at line 339 of file chan_skinny.c.

◆ CDEV

#define CDEV   ((struct skinny_device *)item)

Definition at line 7794 of file chan_skinny.c.

◆ CDEV_OPTS

#define CDEV_OPTS   ((struct skinny_device_options *)item)

Definition at line 7793 of file chan_skinny.c.

◆ CLEAR_DISPLAY_MESSAGE

#define CLEAR_DISPLAY_MESSAGE   0x009A

Definition at line 637 of file chan_skinny.c.

◆ CLEAR_NOTIFY_MESSAGE

#define CLEAR_NOTIFY_MESSAGE   0x0115

Definition at line 636 of file chan_skinny.c.

◆ CLEAR_PRINOTIFY_MESSAGE

#define CLEAR_PRINOTIFY_MESSAGE   0x0121

Definition at line 1125 of file chan_skinny.c.

◆ CLEAR_PROMPT_MESSAGE

#define CLEAR_PROMPT_MESSAGE   0x0113

Definition at line 1083 of file chan_skinny.c.

◆ CLINE

#define CLINE   ((struct skinny_line *)item)

Definition at line 7792 of file chan_skinny.c.

◆ CLINE_OPTS

#define CLINE_OPTS   ((struct skinny_line_options *)item)

Definition at line 7791 of file chan_skinny.c.

◆ CLOSE_RECEIVE_CHANNEL_MESSAGE

#define CLOSE_RECEIVE_CHANNEL_MESSAGE   0x0106

Definition at line 678 of file chan_skinny.c.

◆ CONTROL2STR_BUFSIZE

#define CONTROL2STR_BUFSIZE   100

Definition at line 276 of file chan_skinny.c.

◆ DEFAULT_AUTH_LIMIT

#define DEFAULT_AUTH_LIMIT   50

Definition at line 193 of file chan_skinny.c.

◆ DEFAULT_AUTH_TIMEOUT

#define DEFAULT_AUTH_TIMEOUT   30

Definition at line 192 of file chan_skinny.c.

◆ DEFAULT_SKINNY_BACKLOG

#define DEFAULT_SKINNY_BACKLOG   2

Definition at line 190 of file chan_skinny.c.

◆ DEFAULT_SKINNY_PORT

#define DEFAULT_SKINNY_PORT   2000

Definition at line 189 of file chan_skinny.c.

◆ DEFINETIMEDATE_MESSAGE

#define DEFINETIMEDATE_MESSAGE   0x0094

Definition at line 551 of file chan_skinny.c.

◆ DEVICE2STR_BUFSIZE

#define DEVICE2STR_BUFSIZE   15

Definition at line 273 of file chan_skinny.c.

◆ DIALED_NUMBER_MESSAGE

#define DIALED_NUMBER_MESSAGE   0x011D

Definition at line 1100 of file chan_skinny.c.

◆ DIALTYPE_CFWD

#define DIALTYPE_CFWD   1<<1

Definition at line 1386 of file chan_skinny.c.

◆ DIALTYPE_NORMAL

#define DIALTYPE_NORMAL   1<<0

Definition at line 1385 of file chan_skinny.c.

◆ DIALTYPE_XFER

#define DIALTYPE_XFER   1<<2

Definition at line 1387 of file chan_skinny.c.

◆ DISPLAY_NOTIFY_MESSAGE

#define DISPLAY_NOTIFY_MESSAGE   0x0114

Definition at line 1089 of file chan_skinny.c.

◆ DISPLAY_PRINOTIFY_MESSAGE

#define DISPLAY_PRINOTIFY_MESSAGE   0x0120

Definition at line 1118 of file chan_skinny.c.

◆ DISPLAY_PRINOTIFY_MESSAGE_VARIABLE

#define DISPLAY_PRINOTIFY_MESSAGE_VARIABLE   0x0144

Definition at line 1143 of file chan_skinny.c.

◆ DISPLAY_PROMPT_STATUS_MESSAGE

#define DISPLAY_PROMPT_STATUS_MESSAGE   0x0112

Definition at line 1074 of file chan_skinny.c.

◆ DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE

#define DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE   0x0145

Definition at line 1150 of file chan_skinny.c.

◆ DISPLAYTEXT_MESSAGE

#define DISPLAYTEXT_MESSAGE   0x0099

Definition at line 631 of file chan_skinny.c.

◆ ENBLOC_CALL_MESSAGE

#define ENBLOC_CALL_MESSAGE   0x0004

Definition at line 315 of file chan_skinny.c.

◆ FORWARD_STAT_MESSAGE

#define FORWARD_STAT_MESSAGE   0x0090

Definition at line 524 of file chan_skinny.c.

◆ HEADSET_STATUS_MESSAGE

#define HEADSET_STATUS_MESSAGE   0x002B

Definition at line 405 of file chan_skinny.c.

◆ htolel

#define htolel (   x)    bswap_32(x)

Definition at line 225 of file chan_skinny.c.

◆ htoles

#define htoles (   x)    bswap_16(x)

Definition at line 226 of file chan_skinny.c.

◆ IP_PORT_MESSAGE

#define IP_PORT_MESSAGE   0x0002

Definition at line 305 of file chan_skinny.c.

◆ KEEP_ALIVE_ACK_MESSAGE

#define KEEP_ALIVE_ACK_MESSAGE   0x0100

Definition at line 665 of file chan_skinny.c.

◆ KEEP_ALIVE_MESSAGE

#define KEEP_ALIVE_MESSAGE   0x0000

Definition at line 288 of file chan_skinny.c.

◆ KEYDEF_CONNECTED

#define KEYDEF_CONNECTED   1

Definition at line 698 of file chan_skinny.c.

◆ KEYDEF_CONNWITHCONF

#define KEYDEF_CONNWITHCONF   7

Definition at line 704 of file chan_skinny.c.

◆ KEYDEF_CONNWITHTRANS

#define KEYDEF_CONNWITHTRANS   5

Definition at line 702 of file chan_skinny.c.

◆ KEYDEF_DADFD

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

Definition at line 703 of file chan_skinny.c.

◆ KEYDEF_OFFHOOK

#define KEYDEF_OFFHOOK   4

Definition at line 701 of file chan_skinny.c.

◆ KEYDEF_OFFHOOKWITHFEAT

#define KEYDEF_OFFHOOKWITHFEAT   9

Definition at line 706 of file chan_skinny.c.

◆ KEYDEF_ONHOLD

#define KEYDEF_ONHOLD   2

Definition at line 699 of file chan_skinny.c.

◆ KEYDEF_ONHOOK

#define KEYDEF_ONHOOK   0

Definition at line 697 of file chan_skinny.c.

◆ KEYDEF_RINGIN

#define KEYDEF_RINGIN   3

Definition at line 700 of file chan_skinny.c.

◆ KEYDEF_RINGOUT

#define KEYDEF_RINGOUT   8

Definition at line 705 of file chan_skinny.c.

◆ KEYDEF_RINGOUTWITHTRANS

#define KEYDEF_RINGOUTWITHTRANS   13

Definition at line 710 of file chan_skinny.c.

◆ KEYDEF_SLACONNECTEDNOTACTIVE

#define KEYDEF_SLACONNECTEDNOTACTIVE   12

Definition at line 709 of file chan_skinny.c.

◆ KEYDEF_SLAHOLD

#define KEYDEF_SLAHOLD   11

Definition at line 708 of file chan_skinny.c.

◆ KEYDEF_UNKNOWN

#define KEYDEF_UNKNOWN   10

Definition at line 707 of file chan_skinny.c.

◆ KEYMASK_ALL

#define KEYMASK_ALL   0xFFFFFFFF

Definition at line 735 of file chan_skinny.c.

◆ KEYMASK_ANSWER

#define KEYMASK_ANSWER   (1 << 11)

Definition at line 747 of file chan_skinny.c.

◆ KEYMASK_BKSPC

#define KEYMASK_BKSPC   (1 << 8)

Definition at line 744 of file chan_skinny.c.

◆ KEYMASK_CFWDALL

#define KEYMASK_CFWDALL   (1 << 5)

Definition at line 741 of file chan_skinny.c.

◆ KEYMASK_CFWDBUSY

#define KEYMASK_CFWDBUSY   (1 << 6)

Definition at line 742 of file chan_skinny.c.

◆ KEYMASK_CFWDNOANSWER

#define KEYMASK_CFWDNOANSWER   (1 << 7)

Definition at line 743 of file chan_skinny.c.

◆ KEYMASK_CONFRN

#define KEYMASK_CONFRN   (1 << 13)

Definition at line 749 of file chan_skinny.c.

◆ KEYMASK_DND

#define KEYMASK_DND   (1 << 29)

Definition at line 755 of file chan_skinny.c.

◆ KEYMASK_ENDCALL

#define KEYMASK_ENDCALL   (1 << 9)

Definition at line 745 of file chan_skinny.c.

◆ KEYMASK_FORCEDIAL

#define KEYMASK_FORCEDIAL   (1 << 21)

Definition at line 757 of file chan_skinny.c.

◆ KEYMASK_GPICKUP

#define KEYMASK_GPICKUP   (1 << 18)

Definition at line 754 of file chan_skinny.c.

◆ KEYMASK_HOLD

#define KEYMASK_HOLD   (1 << 3)

Definition at line 739 of file chan_skinny.c.

◆ KEYMASK_IDIVERT

#define KEYMASK_IDIVERT   (1 << 20)

Definition at line 756 of file chan_skinny.c.

◆ KEYMASK_INFO

#define KEYMASK_INFO   (1 << 12)

Definition at line 748 of file chan_skinny.c.

◆ KEYMASK_JOIN

#define KEYMASK_JOIN   (1 << 15)

Definition at line 751 of file chan_skinny.c.

◆ KEYMASK_MEETME

#define KEYMASK_MEETME   (1 << 16)

Definition at line 752 of file chan_skinny.c.

◆ KEYMASK_NEWCALL

#define KEYMASK_NEWCALL   (1 << 2)

Definition at line 738 of file chan_skinny.c.

◆ KEYMASK_NONE

#define KEYMASK_NONE   (1 << 0)

Definition at line 736 of file chan_skinny.c.

◆ KEYMASK_PARK

#define KEYMASK_PARK   (1 << 14)

Definition at line 750 of file chan_skinny.c.

◆ KEYMASK_PICKUP

#define KEYMASK_PICKUP   (1 << 17)

Definition at line 753 of file chan_skinny.c.

◆ KEYMASK_REDIAL

#define KEYMASK_REDIAL   (1 << 1)

Definition at line 737 of file chan_skinny.c.

◆ KEYMASK_RESUME

#define KEYMASK_RESUME   (1 << 10)

Definition at line 746 of file chan_skinny.c.

◆ KEYMASK_TRNSFER

#define KEYMASK_TRNSFER   (1 << 4)

Definition at line 740 of file chan_skinny.c.

◆ KEYPAD_BUTTON_MESSAGE

#define KEYPAD_BUTTON_MESSAGE   0x0003

Definition at line 307 of file chan_skinny.c.

◆ letohl

#define letohl (   x)    bswap_32(x)

Definition at line 223 of file chan_skinny.c.

◆ letohs

#define letohs (   x)    bswap_16(x)

Definition at line 224 of file chan_skinny.c.

◆ LINE_STAT_RES_MESSAGE

#define LINE_STAT_RES_MESSAGE   0x0092

Definition at line 543 of file chan_skinny.c.

◆ LINE_STATE_REQ_MESSAGE

#define LINE_STATE_REQ_MESSAGE   0x000B

Definition at line 361 of file chan_skinny.c.

◆ MAX_SERVICEURL

#define MAX_SERVICEURL   256

Definition at line 1107 of file chan_skinny.c.

◆ MAXCALLINFOSTR

#define MAXCALLINFOSTR   256

Definition at line 1115 of file chan_skinny.c.

◆ MAXDISPLAYNOTIFYSTR

#define MAXDISPLAYNOTIFYSTR   32

Definition at line 1116 of file chan_skinny.c.

◆ OCTAL_ANSWER

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

Definition at line 773 of file chan_skinny.c.

◆ OCTAL_BARGE

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

Definition at line 829 of file chan_skinny.c.

◆ OCTAL_BARGEEXIST

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

Definition at line 831 of file chan_skinny.c.

◆ OCTAL_BARGEFAIL

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

Definition at line 830 of file chan_skinny.c.

◆ OCTAL_BKSPC

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

Definition at line 770 of file chan_skinny.c.

◆ OCTAL_BUSY

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

Definition at line 787 of file chan_skinny.c.

◆ OCTAL_CALLBACK

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

Definition at line 827 of file chan_skinny.c.

◆ OCTAL_CALLDURTIMEOUT

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

Definition at line 851 of file chan_skinny.c.

◆ OCTAL_CALLPARK

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

Definition at line 791 of file chan_skinny.c.

◆ OCTAL_CALLPROCEED

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

Definition at line 792 of file chan_skinny.c.

◆ OCTAL_CALLWAITING

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

Definition at line 789 of file chan_skinny.c.

◆ OCTAL_CALLXFER

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

Definition at line 790 of file chan_skinny.c.

◆ OCTAL_CANTCOMPCNF

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

Definition at line 800 of file chan_skinny.c.

◆ OCTAL_CANTCOMPLXFER

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

Definition at line 844 of file chan_skinny.c.

◆ OCTAL_CANTJOINCALLS

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

Definition at line 845 of file chan_skinny.c.

◆ OCTAL_CBARGE

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

Definition at line 843 of file chan_skinny.c.

◆ OCTAL_CFWDALL

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

Definition at line 767 of file chan_skinny.c.

◆ OCTAL_CFWDBUSY

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

Definition at line 768 of file chan_skinny.c.

◆ OCTAL_CFWDNOAN

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

Definition at line 769 of file chan_skinny.c.

◆ OCTAL_CM1

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

Definition at line 881 of file chan_skinny.c.

◆ OCTAL_CM2

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

Definition at line 882 of file chan_skinny.c.

◆ OCTAL_CM3

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

Definition at line 883 of file chan_skinny.c.

◆ OCTAL_CM4

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

Definition at line 884 of file chan_skinny.c.

◆ OCTAL_CM5

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

Definition at line 885 of file chan_skinny.c.

◆ OCTAL_CONFERENCE

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

Definition at line 814 of file chan_skinny.c.

◆ OCTAL_CONFLIST

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

Definition at line 841 of file chan_skinny.c.

◆ OCTAL_CONFRN

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

Definition at line 775 of file chan_skinny.c.

◆ OCTAL_CONNECTED

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

Definition at line 786 of file chan_skinny.c.

◆ OCTAL_CUROPTS

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

Definition at line 781 of file chan_skinny.c.

◆ OCTAL_DIRTRFR

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

Definition at line 839 of file chan_skinny.c.

◆ OCTAL_DIVALL

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

Definition at line 826 of file chan_skinny.c.

◆ OCTAL_DND

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

Definition at line 825 of file chan_skinny.c.

◆ OCTAL_DNS1

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

Definition at line 874 of file chan_skinny.c.

◆ OCTAL_DNS2

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

Definition at line 875 of file chan_skinny.c.

◆ OCTAL_DNS3

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

Definition at line 876 of file chan_skinny.c.

◆ OCTAL_DNS4

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

Definition at line 877 of file chan_skinny.c.

◆ OCTAL_DNS5

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

Definition at line 878 of file chan_skinny.c.

◆ OCTAL_DOMAIN

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

Definition at line 865 of file chan_skinny.c.

◆ OCTAL_ENDCALL

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

Definition at line 771 of file chan_skinny.c.

◆ OCTAL_ENTRNUM

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

Definition at line 794 of file chan_skinny.c.

◆ OCTAL_ERRDB

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

Definition at line 810 of file chan_skinny.c.

◆ OCTAL_ERRDBCFG

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

Definition at line 809 of file chan_skinny.c.

◆ OCTAL_ERRMISMATCH

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

Definition at line 813 of file chan_skinny.c.

◆ OCTAL_ERRNOLIC

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

Definition at line 808 of file chan_skinny.c.

◆ OCTAL_ERRPASSLMT

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

Definition at line 811 of file chan_skinny.c.

◆ OCTAL_ERRUNK

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

Definition at line 812 of file chan_skinny.c.

◆ OCTAL_EXTXFERRESTRICT

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

Definition at line 859 of file chan_skinny.c.

◆ OCTAL_FROM

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

Definition at line 785 of file chan_skinny.c.

◆ OCTAL_FWDEDTO

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

Definition at line 799 of file chan_skinny.c.

◆ OCTAL_GPICKUP

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

Definition at line 780 of file chan_skinny.c.

◆ OCTAL_HAVEVMAIL

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

Definition at line 798 of file chan_skinny.c.

◆ OCTAL_HITRAFFIC

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

Definition at line 836 of file chan_skinny.c.

◆ OCTAL_HOLD

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

Definition at line 765 of file chan_skinny.c.

◆ OCTAL_HOLDDURTIMEOUT

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

Definition at line 852 of file chan_skinny.c.

◆ OCTAL_HOST

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

Definition at line 864 of file chan_skinny.c.

◆ OCTAL_IDIVERT

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

Definition at line 842 of file chan_skinny.c.

◆ OCTAL_IMMDIV

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

Definition at line 821 of file chan_skinny.c.

◆ OCTAL_INCOMPATDEV

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

Definition at line 832 of file chan_skinny.c.

◆ OCTAL_INCONFALREADY

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

Definition at line 804 of file chan_skinny.c.

◆ OCTAL_INFO

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

Definition at line 774 of file chan_skinny.c.

◆ OCTAL_INSUFBANDW

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

Definition at line 817 of file chan_skinny.c.

◆ OCTAL_INTRCPT

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

Definition at line 822 of file chan_skinny.c.

◆ OCTAL_INUSEREMOTE

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

Definition at line 793 of file chan_skinny.c.

◆ OCTAL_INVALCONFPART

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

Definition at line 803 of file chan_skinny.c.

◆ OCTAL_IPADD

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

Definition at line 866 of file chan_skinny.c.

◆ OCTAL_JOIN

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

Definition at line 777 of file chan_skinny.c.

◆ OCTAL_KEYNOTACTIVE

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

Definition at line 807 of file chan_skinny.c.

◆ OCTAL_LINEINUSE

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

Definition at line 788 of file chan_skinny.c.

◆ OCTAL_MACADD

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

Definition at line 863 of file chan_skinny.c.

◆ OCTAL_MAXPARTEXCEED

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

Definition at line 806 of file chan_skinny.c.

◆ OCTAL_MCID

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

Definition at line 838 of file chan_skinny.c.

◆ OCTAL_MCIDSUCCESS

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

Definition at line 846 of file chan_skinny.c.

◆ OCTAL_MEETME

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

Definition at line 778 of file chan_skinny.c.

◆ OCTAL_NETCNGREROUT

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

Definition at line 828 of file chan_skinny.c.

◆ OCTAL_NEWCALL

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

Definition at line 764 of file chan_skinny.c.

◆ OCTAL_NOCONFBRDG

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

Definition at line 801 of file chan_skinny.c.

◆ OCTAL_NOPARTINFO

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

Definition at line 805 of file chan_skinny.c.

◆ OCTAL_NOPRIMARYCTL

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

Definition at line 802 of file chan_skinny.c.

◆ OCTAL_NUMNOTCFG

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

Definition at line 847 of file chan_skinny.c.

◆ OCTAL_OFFHOOK

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

Definition at line 782 of file chan_skinny.c.

◆ OCTAL_ONHOOK

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

Definition at line 783 of file chan_skinny.c.

◆ OCTAL_OPICKUP

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

Definition at line 853 of file chan_skinny.c.

◆ OCTAL_PARK

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

Definition at line 776 of file chan_skinny.c.

◆ OCTAL_PARKAT

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

Definition at line 795 of file chan_skinny.c.

◆ OCTAL_PARKNO

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

Definition at line 815 of file chan_skinny.c.

◆ OCTAL_PARKNONUM

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

Definition at line 833 of file chan_skinny.c.

◆ OCTAL_PARKREVERSION

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

Definition at line 834 of file chan_skinny.c.

◆ OCTAL_PICKUP

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

Definition at line 779 of file chan_skinny.c.

◆ OCTAL_PRIMONLY

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

Definition at line 796 of file chan_skinny.c.

◆ OCTAL_PRIVATE

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

Definition at line 816 of file chan_skinny.c.

◆ OCTAL_QRT

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

Definition at line 837 of file chan_skinny.c.

◆ OCTAL_REDIAL

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

Definition at line 763 of file chan_skinny.c.

◆ OCTAL_RESUME

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

Definition at line 772 of file chan_skinny.c.

◆ OCTAL_RINGOUT

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

Definition at line 784 of file chan_skinny.c.

◆ OCTAL_RMLSTC

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

Definition at line 819 of file chan_skinny.c.

◆ OCTAL_ROUTER1

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

Definition at line 869 of file chan_skinny.c.

◆ OCTAL_ROUTER2

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

Definition at line 870 of file chan_skinny.c.

◆ OCTAL_ROUTER3

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

Definition at line 871 of file chan_skinny.c.

◆ OCTAL_ROUTER4

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

Definition at line 872 of file chan_skinny.c.

◆ OCTAL_ROUTER5

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

Definition at line 873 of file chan_skinny.c.

◆ OCTAL_SECERROR

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

Definition at line 848 of file chan_skinny.c.

◆ OCTAL_SELECT

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

Definition at line 840 of file chan_skinny.c.

◆ OCTAL_SETWTCH

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

Definition at line 823 of file chan_skinny.c.

◆ OCTAL_SRVNOTACTIVE

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

Definition at line 835 of file chan_skinny.c.

◆ OCTAL_SUBMASK

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

Definition at line 867 of file chan_skinny.c.

◆ OCTAL_TFTP1

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

Definition at line 868 of file chan_skinny.c.

◆ OCTAL_TMPFAIL

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

Definition at line 797 of file chan_skinny.c.

◆ OCTAL_TRANSFER

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

Definition at line 766 of file chan_skinny.c.

◆ OCTAL_TRNSFVM

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

Definition at line 824 of file chan_skinny.c.

◆ OCTAL_UNKNUM

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

Definition at line 818 of file chan_skinny.c.

◆ OCTAL_URLDIRS

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

Definition at line 887 of file chan_skinny.c.

◆ OCTAL_URLINFO

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

Definition at line 886 of file chan_skinny.c.

◆ OCTAL_URLMSGS

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

Definition at line 888 of file chan_skinny.c.

◆ OCTAL_URLSRVS

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

Definition at line 889 of file chan_skinny.c.

◆ OCTAL_VIDBANDWNA

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

Definition at line 849 of file chan_skinny.c.

◆ OCTAL_VIDMODE

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

Definition at line 850 of file chan_skinny.c.

◆ OCTAL_VLANADID

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

Definition at line 880 of file chan_skinny.c.

◆ OCTAL_VLANOPID

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

Definition at line 879 of file chan_skinny.c.

◆ OCTAL_VOICEMAIL

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

Definition at line 820 of file chan_skinny.c.

◆ OFFHOOK_MESSAGE

#define OFFHOOK_MESSAGE   0x0006

Definition at line 327 of file chan_skinny.c.

◆ ONHOOK_MESSAGE

#define ONHOOK_MESSAGE   0x0007

Definition at line 333 of file chan_skinny.c.

◆ OPEN_RECEIVE_CHANNEL_ACK_MESSAGE

#define OPEN_RECEIVE_CHANNEL_ACK_MESSAGE   0x0022

Definition at line 379 of file chan_skinny.c.

◆ OPEN_RECEIVE_CHANNEL_MESSAGE

#define OPEN_RECEIVE_CHANNEL_MESSAGE   0x0105

Definition at line 667 of file chan_skinny.c.

◆ PACKET_TIMEOUT

#define PACKET_TIMEOUT   10000

Definition at line 7519 of file chan_skinny.c.

◆ REGISTER_ACK_MESSAGE

#define REGISTER_ACK_MESSAGE   0x0081

Definition at line 413 of file chan_skinny.c.

◆ REGISTER_AVAILABLE_LINES_MESSAGE

#define REGISTER_AVAILABLE_LINES_MESSAGE   0x002D

Definition at line 406 of file chan_skinny.c.

◆ REGISTER_MESSAGE

#define REGISTER_MESSAGE   0x0001

Definition at line 291 of file chan_skinny.c.

◆ REGISTER_REJ_MESSAGE

#define REGISTER_REJ_MESSAGE   0x009D

Definition at line 644 of file chan_skinny.c.

◆ RESET_MESSAGE

#define RESET_MESSAGE   0x009F

Definition at line 660 of file chan_skinny.c.

◆ SELECT_SOFT_KEYS_MESSAGE

#define SELECT_SOFT_KEYS_MESSAGE   0x0110

Definition at line 1058 of file chan_skinny.c.

◆ SERVER_REQUEST_MESSAGE

#define SERVER_REQUEST_MESSAGE   0x0012

Definition at line 369 of file chan_skinny.c.

◆ SERVER_RES_MESSAGE

#define SERVER_RES_MESSAGE   0x009E

Definition at line 649 of file chan_skinny.c.

◆ SERVICEURL_STAT_MESSAGE

#define SERVICEURL_STAT_MESSAGE   0x012F

Definition at line 1108 of file chan_skinny.c.

◆ SERVICEURL_STATREQ_MESSAGE

#define SERVICEURL_STATREQ_MESSAGE   0x0033

Definition at line 408 of file chan_skinny.c.

◆ SET_LAMP_MESSAGE

#define SET_LAMP_MESSAGE   0x0086

Definition at line 445 of file chan_skinny.c.

◆ SET_MICROPHONE_MESSAGE

#define SET_MICROPHONE_MESSAGE   0x0089

Definition at line 458 of file chan_skinny.c.

◆ SET_RINGER_MESSAGE

#define SET_RINGER_MESSAGE   0x0085

Definition at line 437 of file chan_skinny.c.

◆ SET_SPEAKER_MESSAGE

#define SET_SPEAKER_MESSAGE   0x0088

Definition at line 452 of file chan_skinny.c.

◆ SKINNY_ALERT

#define SKINNY_ALERT   0x24

Definition at line 1308 of file chan_skinny.c.

◆ SKINNY_BARGIN

#define SKINNY_BARGIN   0x43

Definition at line 1314 of file chan_skinny.c.

◆ SKINNY_BEEPBONK

#define SKINNY_BEEPBONK   0x33

Definition at line 1313 of file chan_skinny.c.

◆ SKINNY_BUSY

#define SKINNY_BUSY   6

Definition at line 1292 of file chan_skinny.c.

◆ SKINNY_BUSYTONE

#define SKINNY_BUSYTONE   0x23

Definition at line 1307 of file chan_skinny.c.

◆ SKINNY_CALLREMOTEMULTILINE

#define SKINNY_CALLREMOTEMULTILINE   13

Definition at line 1299 of file chan_skinny.c.

◆ SKINNY_CALLWAIT

#define SKINNY_CALLWAIT   9

Definition at line 1295 of file chan_skinny.c.

◆ SKINNY_CALLWAITTONE

#define SKINNY_CALLWAITTONE   0x2D

Definition at line 1310 of file chan_skinny.c.

◆ SKINNY_CFWD_ALL

#define SKINNY_CFWD_ALL   (1 << 0)

Definition at line 1328 of file chan_skinny.c.

◆ SKINNY_CFWD_BUSY

#define SKINNY_CFWD_BUSY   (1 << 1)

Definition at line 1329 of file chan_skinny.c.

◆ SKINNY_CFWD_NOANSWER

#define SKINNY_CFWD_NOANSWER   (1 << 2)

Definition at line 1330 of file chan_skinny.c.

◆ SKINNY_CONGESTION

#define SKINNY_CONGESTION   7

Definition at line 1293 of file chan_skinny.c.

◆ SKINNY_CONNECTED

#define SKINNY_CONNECTED   5

Definition at line 1291 of file chan_skinny.c.

◆ SKINNY_CX_CONF

#define SKINNY_CX_CONF   3

Definition at line 1336 of file chan_skinny.c.

◆ SKINNY_CX_CONFERENCE

#define SKINNY_CX_CONFERENCE   3

Definition at line 1337 of file chan_skinny.c.

◆ SKINNY_CX_INACTIVE

#define SKINNY_CX_INACTIVE   4

Definition at line 1339 of file chan_skinny.c.

◆ SKINNY_CX_MUTE

#define SKINNY_CX_MUTE   4

Definition at line 1338 of file chan_skinny.c.

◆ SKINNY_CX_RECVONLY

#define SKINNY_CX_RECVONLY   1

Definition at line 1334 of file chan_skinny.c.

◆ SKINNY_CX_SENDONLY

#define SKINNY_CX_SENDONLY   0

Definition at line 1333 of file chan_skinny.c.

◆ SKINNY_CX_SENDRECV

#define SKINNY_CX_SENDRECV   2

Definition at line 1335 of file chan_skinny.c.

◆ SKINNY_DEBUG

#define SKINNY_DEBUG (   type,
  verb_level,
  text,
  ... 
)

Definition at line 167 of file chan_skinny.c.

◆ SKINNY_DEVICE_12

#define SKINNY_DEVICE_12   4

Definition at line 1247 of file chan_skinny.c.

◆ SKINNY_DEVICE_12SP

#define SKINNY_DEVICE_12SP   3

Definition at line 1246 of file chan_skinny.c.

◆ SKINNY_DEVICE_12SPPLUS

#define SKINNY_DEVICE_12SPPLUS   2

Definition at line 1245 of file chan_skinny.c.

◆ SKINNY_DEVICE_30SPPLUS

#define SKINNY_DEVICE_30SPPLUS   1

Definition at line 1244 of file chan_skinny.c.

◆ SKINNY_DEVICE_30VIP

#define SKINNY_DEVICE_30VIP   5

Definition at line 1248 of file chan_skinny.c.

◆ SKINNY_DEVICE_7902

#define SKINNY_DEVICE_7902   30008

Definition at line 1274 of file chan_skinny.c.

◆ SKINNY_DEVICE_7905

#define SKINNY_DEVICE_7905   20000

Definition at line 1270 of file chan_skinny.c.

◆ SKINNY_DEVICE_7906

#define SKINNY_DEVICE_7906   369

Definition at line 1263 of file chan_skinny.c.

◆ SKINNY_DEVICE_7910

#define SKINNY_DEVICE_7910   6

Definition at line 1249 of file chan_skinny.c.

◆ SKINNY_DEVICE_7911

#define SKINNY_DEVICE_7911   307

Definition at line 1258 of file chan_skinny.c.

◆ SKINNY_DEVICE_7912

#define SKINNY_DEVICE_7912   30007

Definition at line 1273 of file chan_skinny.c.

◆ SKINNY_DEVICE_7914

#define SKINNY_DEVICE_7914   124 /* Expansion module */

Definition at line 1256 of file chan_skinny.c.

◆ SKINNY_DEVICE_7920

#define SKINNY_DEVICE_7920   30002

Definition at line 1271 of file chan_skinny.c.

◆ SKINNY_DEVICE_7921

#define SKINNY_DEVICE_7921   365

Definition at line 1262 of file chan_skinny.c.

◆ SKINNY_DEVICE_7931

#define SKINNY_DEVICE_7931   348

Definition at line 1261 of file chan_skinny.c.

◆ SKINNY_DEVICE_7935

#define SKINNY_DEVICE_7935   9

Definition at line 1252 of file chan_skinny.c.

◆ SKINNY_DEVICE_7936

#define SKINNY_DEVICE_7936   30019

Definition at line 1277 of file chan_skinny.c.

◆ SKINNY_DEVICE_7937

#define SKINNY_DEVICE_7937   431

Definition at line 1265 of file chan_skinny.c.

◆ SKINNY_DEVICE_7940

#define SKINNY_DEVICE_7940   8

Definition at line 1251 of file chan_skinny.c.

◆ SKINNY_DEVICE_7941

#define SKINNY_DEVICE_7941   115

Definition at line 1254 of file chan_skinny.c.

◆ SKINNY_DEVICE_7941GE

#define SKINNY_DEVICE_7941GE   309

Definition at line 1260 of file chan_skinny.c.

◆ SKINNY_DEVICE_7942

#define SKINNY_DEVICE_7942   434

Definition at line 1266 of file chan_skinny.c.

◆ SKINNY_DEVICE_7945

#define SKINNY_DEVICE_7945   435

Definition at line 1267 of file chan_skinny.c.

◆ SKINNY_DEVICE_7960

#define SKINNY_DEVICE_7960   7

Definition at line 1250 of file chan_skinny.c.

◆ SKINNY_DEVICE_7961

#define SKINNY_DEVICE_7961   30018

Definition at line 1276 of file chan_skinny.c.

◆ SKINNY_DEVICE_7961GE

#define SKINNY_DEVICE_7961GE   308

Definition at line 1259 of file chan_skinny.c.

◆ SKINNY_DEVICE_7962

#define SKINNY_DEVICE_7962   404 /* Not found */

Definition at line 1264 of file chan_skinny.c.

◆ SKINNY_DEVICE_7965

#define SKINNY_DEVICE_7965   436

Definition at line 1268 of file chan_skinny.c.

◆ SKINNY_DEVICE_7970

#define SKINNY_DEVICE_7970   30006

Definition at line 1272 of file chan_skinny.c.

◆ SKINNY_DEVICE_7971

#define SKINNY_DEVICE_7971   119

Definition at line 1255 of file chan_skinny.c.

◆ SKINNY_DEVICE_7975

#define SKINNY_DEVICE_7975   437

Definition at line 1269 of file chan_skinny.c.

◆ SKINNY_DEVICE_7985

#define SKINNY_DEVICE_7985   302

Definition at line 1257 of file chan_skinny.c.

◆ SKINNY_DEVICE_ATA186

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

Definition at line 1253 of file chan_skinny.c.

◆ SKINNY_DEVICE_CIPC

#define SKINNY_DEVICE_CIPC   30016 /* Cisco IP Communicator */

Definition at line 1275 of file chan_skinny.c.

◆ SKINNY_DEVICE_NONE

#define SKINNY_DEVICE_NONE   0

Definition at line 1243 of file chan_skinny.c.

◆ SKINNY_DEVICE_OPTIONS

#define SKINNY_DEVICE_OPTIONS

Definition at line 1562 of file chan_skinny.c.

◆ SKINNY_DEVICE_SCCPGATEWAY_AN

#define SKINNY_DEVICE_SCCPGATEWAY_AN   30027 /* Analog gateway */

Definition at line 1278 of file chan_skinny.c.

◆ SKINNY_DEVICE_SCCPGATEWAY_BRI

#define SKINNY_DEVICE_SCCPGATEWAY_BRI   30028 /* BRI gateway */

Definition at line 1279 of file chan_skinny.c.

◆ SKINNY_DEVICE_UNKNOWN

#define SKINNY_DEVICE_UNKNOWN   -1

Definition at line 1242 of file chan_skinny.c.

◆ SKINNY_DEVICECONTAINER

#define SKINNY_DEVICECONTAINER   1

Definition at line 1545 of file chan_skinny.c.

◆ SKINNY_DIALTONE

#define SKINNY_DIALTONE   0x21

Definition at line 1306 of file chan_skinny.c.

◆ SKINNY_HOLD

#define SKINNY_HOLD   8

Definition at line 1294 of file chan_skinny.c.

◆ SKINNY_INCOMING

#define SKINNY_INCOMING   1

Definition at line 1302 of file chan_skinny.c.

◆ SKINNY_INVALID

#define SKINNY_INVALID   14

Definition at line 1300 of file chan_skinny.c.

◆ SKINNY_LAMP_BLINK

#define SKINNY_LAMP_BLINK   5

Definition at line 1321 of file chan_skinny.c.

◆ SKINNY_LAMP_FLASH

#define SKINNY_LAMP_FLASH   4

Definition at line 1320 of file chan_skinny.c.

◆ SKINNY_LAMP_OFF

#define SKINNY_LAMP_OFF   1

Definition at line 1317 of file chan_skinny.c.

◆ SKINNY_LAMP_ON

#define SKINNY_LAMP_ON   2

Definition at line 1318 of file chan_skinny.c.

◆ SKINNY_LAMP_WINK

#define SKINNY_LAMP_WINK   3

Definition at line 1319 of file chan_skinny.c.

◆ SKINNY_LINE_OPTIONS

#define SKINNY_LINE_OPTIONS

Definition at line 1421 of file chan_skinny.c.

◆ SKINNY_LINECONTAINER

#define SKINNY_LINECONTAINER   2

Definition at line 1546 of file chan_skinny.c.

◆ SKINNY_MAX_CAPABILITIES

#define SKINNY_MAX_CAPABILITIES   18

Definition at line 349 of file chan_skinny.c.

◆ SKINNY_MAX_PACKET

#define SKINNY_MAX_PACKET   2000

Definition at line 191 of file chan_skinny.c.

◆ SKINNY_MICOFF

#define SKINNY_MICOFF   2

Definition at line 1285 of file chan_skinny.c.

◆ SKINNY_MICON

#define SKINNY_MICON   1

Definition at line 1284 of file chan_skinny.c.

◆ SKINNY_NOTONE

#define SKINNY_NOTONE   0x7F

Definition at line 1315 of file chan_skinny.c.

◆ SKINNY_OFFHOOK

#define SKINNY_OFFHOOK   1

Definition at line 1287 of file chan_skinny.c.

◆ SKINNY_ONHOOK

#define SKINNY_ONHOOK   2

Definition at line 1288 of file chan_skinny.c.

◆ SKINNY_OUTGOING

#define SKINNY_OUTGOING   2

Definition at line 1303 of file chan_skinny.c.

◆ SKINNY_PARK

#define SKINNY_PARK   11

Definition at line 1297 of file chan_skinny.c.

◆ SKINNY_PROGRESS

#define SKINNY_PROGRESS   12

Definition at line 1298 of file chan_skinny.c.

◆ SKINNY_REORDER

#define SKINNY_REORDER   0x25

Definition at line 1309 of file chan_skinny.c.

◆ SKINNY_RING_FEATURE

#define SKINNY_RING_FEATURE   4

Definition at line 1326 of file chan_skinny.c.

◆ SKINNY_RING_INSIDE

#define SKINNY_RING_INSIDE   2

Definition at line 1324 of file chan_skinny.c.

◆ SKINNY_RING_OFF

#define SKINNY_RING_OFF   1

Definition at line 1323 of file chan_skinny.c.

◆ SKINNY_RING_OUTSIDE

#define SKINNY_RING_OUTSIDE   3

Definition at line 1325 of file chan_skinny.c.

◆ SKINNY_RINGIN

#define SKINNY_RINGIN   4

Definition at line 1290 of file chan_skinny.c.

◆ SKINNY_RINGOUT

#define SKINNY_RINGOUT   3

Definition at line 1289 of file chan_skinny.c.

◆ SKINNY_SDCONTAINER

#define SKINNY_SDCONTAINER   4

Definition at line 1548 of file chan_skinny.c.

◆ SKINNY_SILENCE

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

Definition at line 1305 of file chan_skinny.c.

◆ SKINNY_SPEAKEROFF

#define SKINNY_SPEAKEROFF   2

Definition at line 1282 of file chan_skinny.c.

◆ SKINNY_SPEAKERON

#define SKINNY_SPEAKERON   1

Definition at line 1281 of file chan_skinny.c.

◆ SKINNY_SUBLINECONTAINER

#define SKINNY_SUBLINECONTAINER   3

Definition at line 1547 of file chan_skinny.c.

◆ SKINNY_TRANSFER

#define SKINNY_TRANSFER   10

Definition at line 1296 of file chan_skinny.c.

◆ SKINNY_ZIP

#define SKINNY_ZIP   0x32

Definition at line 1312 of file chan_skinny.c.

◆ SKINNY_ZIPZIP

#define SKINNY_ZIPZIP   0x31

Definition at line 1311 of file chan_skinny.c.

◆ SOFT_KEY_EVENT_MESSAGE

#define SOFT_KEY_EVENT_MESSAGE   0x0026

Definition at line 396 of file chan_skinny.c.

◆ SOFT_KEY_SET_REQ_MESSAGE

#define SOFT_KEY_SET_REQ_MESSAGE   0x0025

Definition at line 394 of file chan_skinny.c.

◆ SOFT_KEY_SET_RES_MESSAGE

#define SOFT_KEY_SET_RES_MESSAGE   0x0109

Definition at line 1043 of file chan_skinny.c.

◆ SOFT_KEY_TEMPLATE_REQ_MESSAGE

#define SOFT_KEY_TEMPLATE_REQ_MESSAGE   0x0028

Definition at line 404 of file chan_skinny.c.

◆ SOFT_KEY_TEMPLATE_RES_MESSAGE

#define SOFT_KEY_TEMPLATE_RES_MESSAGE   0x0108

Definition at line 685 of file chan_skinny.c.

◆ SOFTKEY_ANSWER

#define SOFTKEY_ANSWER   0x0B

Definition at line 723 of file chan_skinny.c.

◆ SOFTKEY_BKSPC

#define SOFTKEY_BKSPC   0x08

Definition at line 720 of file chan_skinny.c.

◆ SOFTKEY_CFWDALL

#define SOFTKEY_CFWDALL   0x05

Definition at line 717 of file chan_skinny.c.

◆ SOFTKEY_CFWDBUSY

#define SOFTKEY_CFWDBUSY   0x06

Definition at line 718 of file chan_skinny.c.

◆ SOFTKEY_CFWDNOANSWER

#define SOFTKEY_CFWDNOANSWER   0x07

Definition at line 719 of file chan_skinny.c.

◆ SOFTKEY_CONFRN

#define SOFTKEY_CONFRN   0x0D

Definition at line 725 of file chan_skinny.c.

◆ SOFTKEY_DND

#define SOFTKEY_DND   0x13

Definition at line 731 of file chan_skinny.c.

◆ SOFTKEY_ENDCALL

#define SOFTKEY_ENDCALL   0x09

Definition at line 721 of file chan_skinny.c.

◆ SOFTKEY_FORCEDIAL

#define SOFTKEY_FORCEDIAL   0x15

Definition at line 733 of file chan_skinny.c.

◆ SOFTKEY_GPICKUP

#define SOFTKEY_GPICKUP   0x12

Definition at line 730 of file chan_skinny.c.

◆ SOFTKEY_HOLD

#define SOFTKEY_HOLD   0x03

Definition at line 715 of file chan_skinny.c.

◆ SOFTKEY_IDIVERT

#define SOFTKEY_IDIVERT   0x14

Definition at line 732 of file chan_skinny.c.

◆ SOFTKEY_INFO

#define SOFTKEY_INFO   0x0C

Definition at line 724 of file chan_skinny.c.

◆ SOFTKEY_JOIN

#define SOFTKEY_JOIN   0x0F

Definition at line 727 of file chan_skinny.c.

◆ SOFTKEY_MEETME

#define SOFTKEY_MEETME   0x10

Definition at line 728 of file chan_skinny.c.

◆ SOFTKEY_NEWCALL

#define SOFTKEY_NEWCALL   0x02

Definition at line 714 of file chan_skinny.c.

◆ SOFTKEY_NONE

#define SOFTKEY_NONE   0x00

Definition at line 712 of file chan_skinny.c.

◆ SOFTKEY_PARK

#define SOFTKEY_PARK   0x0E

Definition at line 726 of file chan_skinny.c.

◆ SOFTKEY_PICKUP

#define SOFTKEY_PICKUP   0x11

Definition at line 729 of file chan_skinny.c.

◆ SOFTKEY_REDIAL

#define SOFTKEY_REDIAL   0x01

Definition at line 713 of file chan_skinny.c.

◆ SOFTKEY_RESUME

#define SOFTKEY_RESUME   0x0A

Definition at line 722 of file chan_skinny.c.

◆ SOFTKEY_TRNSFER

#define SOFTKEY_TRNSFER   0x04

Definition at line 716 of file chan_skinny.c.

◆ SPEED_DIAL_STAT_REQ_MESSAGE

#define SPEED_DIAL_STAT_REQ_MESSAGE   0x000A

Definition at line 356 of file chan_skinny.c.

◆ SPEED_DIAL_STAT_RES_MESSAGE

#define SPEED_DIAL_STAT_RES_MESSAGE   0x0091

Definition at line 536 of file chan_skinny.c.

◆ START_MEDIA_TRANSMISSION_MESSAGE

#define START_MEDIA_TRANSMISSION_MESSAGE   0x008A

Definition at line 463 of file chan_skinny.c.

◆ START_TONE_MESSAGE

#define START_TONE_MESSAGE   0x0082

Definition at line 422 of file chan_skinny.c.

◆ STIMULUS_AUTOANSWER

#define STIMULUS_AUTOANSWER   0x11

Definition at line 586 of file chan_skinny.c.

◆ STIMULUS_CALLPARK

#define STIMULUS_CALLPARK   0x7E

Definition at line 590 of file chan_skinny.c.

◆ STIMULUS_CALLPICKUP

#define STIMULUS_CALLPICKUP   0x7F

Definition at line 591 of file chan_skinny.c.

◆ STIMULUS_CONFERENCE

#define STIMULUS_CONFERENCE   0x7D

Definition at line 589 of file chan_skinny.c.

◆ STIMULUS_DISPLAY

#define STIMULUS_DISPLAY   0x08

Definition at line 583 of file chan_skinny.c.

◆ STIMULUS_DND

#define STIMULUS_DND   0x3F

Definition at line 588 of file chan_skinny.c.

◆ STIMULUS_FORWARDALL

#define STIMULUS_FORWARDALL   0x05

Definition at line 580 of file chan_skinny.c.

◆ STIMULUS_FORWARDBUSY

#define STIMULUS_FORWARDBUSY   0x06

Definition at line 581 of file chan_skinny.c.

◆ STIMULUS_FORWARDNOANSWER

#define STIMULUS_FORWARDNOANSWER   0x07

Definition at line 582 of file chan_skinny.c.

◆ STIMULUS_HOLD

#define STIMULUS_HOLD   0x03

Definition at line 578 of file chan_skinny.c.

◆ STIMULUS_LINE

#define STIMULUS_LINE   0x09

Definition at line 584 of file chan_skinny.c.

◆ STIMULUS_MESSAGE

#define STIMULUS_MESSAGE   0x0005

Definition at line 320 of file chan_skinny.c.

◆ STIMULUS_NONE

#define STIMULUS_NONE   0xFF

Definition at line 592 of file chan_skinny.c.

◆ STIMULUS_REDIAL

#define STIMULUS_REDIAL   0x01

Definition at line 576 of file chan_skinny.c.

◆ STIMULUS_SERVICEURL

#define STIMULUS_SERVICEURL   0x14

Definition at line 587 of file chan_skinny.c.

◆ STIMULUS_SPEEDDIAL

#define STIMULUS_SPEEDDIAL   0x02

Definition at line 577 of file chan_skinny.c.

◆ STIMULUS_TRANSFER

#define STIMULUS_TRANSFER   0x04

Definition at line 579 of file chan_skinny.c.

◆ STIMULUS_VOICEMAIL

#define STIMULUS_VOICEMAIL   0x0F

Definition at line 585 of file chan_skinny.c.

◆ STOP_MEDIA_TRANSMISSION_MESSAGE

#define STOP_MEDIA_TRANSMISSION_MESSAGE   0x008B

Definition at line 495 of file chan_skinny.c.

◆ STOP_TONE_MESSAGE

#define STOP_TONE_MESSAGE   0x0083

Definition at line 430 of file chan_skinny.c.

◆ SUBSTATE2STR_BUFSIZE

#define SUBSTATE2STR_BUFSIZE   15

Definition at line 279 of file chan_skinny.c.

◆ SUBSTATE_BUSY

#define SUBSTATE_BUSY   6

Definition at line 1378 of file chan_skinny.c.

◆ SUBSTATE_CALLWAIT

#define SUBSTATE_CALLWAIT   9

Definition at line 1381 of file chan_skinny.c.

◆ SUBSTATE_CONGESTION

#define SUBSTATE_CONGESTION   7

Definition at line 1379 of file chan_skinny.c.

◆ SUBSTATE_CONNECTED

#define SUBSTATE_CONNECTED   5

Definition at line 1377 of file chan_skinny.c.

◆ SUBSTATE_DIALING

#define SUBSTATE_DIALING   101

Definition at line 1383 of file chan_skinny.c.

◆ SUBSTATE_HOLD

#define SUBSTATE_HOLD   8

Definition at line 1380 of file chan_skinny.c.

◆ SUBSTATE_OFFHOOK

#define SUBSTATE_OFFHOOK   1

Definition at line 1373 of file chan_skinny.c.

◆ SUBSTATE_ONHOOK

#define SUBSTATE_ONHOOK   2

Definition at line 1374 of file chan_skinny.c.

◆ SUBSTATE_PROGRESS

#define SUBSTATE_PROGRESS   12

Definition at line 1382 of file chan_skinny.c.

◆ SUBSTATE_RINGIN

#define SUBSTATE_RINGIN   4

Definition at line 1376 of file chan_skinny.c.

◆ SUBSTATE_RINGOUT

#define SUBSTATE_RINGOUT   3

Definition at line 1375 of file chan_skinny.c.

◆ SUBSTATE_UNSET

#define SUBSTATE_UNSET   0

Definition at line 1372 of file chan_skinny.c.

◆ TIME_DATE_REQ_MESSAGE

#define TIME_DATE_REQ_MESSAGE   0x000D

Definition at line 366 of file chan_skinny.c.

◆ TYPE_DEF_DEVICE

#define TYPE_DEF_DEVICE   2

Definition at line 7786 of file chan_skinny.c.

◆ TYPE_DEF_LINE

#define TYPE_DEF_LINE   4

Definition at line 7787 of file chan_skinny.c.

◆ TYPE_DEVICE

#define TYPE_DEVICE   8

Definition at line 7788 of file chan_skinny.c.

◆ TYPE_GENERAL

#define TYPE_GENERAL   1

Definition at line 7785 of file chan_skinny.c.

◆ TYPE_LINE

#define TYPE_LINE   16

Definition at line 7789 of file chan_skinny.c.

◆ UNREGISTER_MESSAGE

#define UNREGISTER_MESSAGE   0x0027

Definition at line 403 of file chan_skinny.c.

◆ VERSION_REQ_MESSAGE

#define VERSION_REQ_MESSAGE   0x000F

Definition at line 368 of file chan_skinny.c.

◆ VERSION_RES_MESSAGE

#define VERSION_RES_MESSAGE   0x0098

Definition at line 626 of file chan_skinny.c.

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 178 of file chan_skinny.c.

178  {
179  SKINNY_CODEC_ALAW = 2,
180  SKINNY_CODEC_ULAW = 4,
181  SKINNY_CODEC_G722 = 6,
183  SKINNY_CODEC_G729A = 12,
184  SKINNY_CODEC_G726_32 = 82, /* XXX Which packing order does this translate to? */
185  SKINNY_CODEC_H261 = 100,
186  SKINNY_CODEC_H263 = 101
187 };
@ SKINNY_CODEC_H261
Definition: chan_skinny.c:185
@ SKINNY_CODEC_H263
Definition: chan_skinny.c:186
@ SKINNY_CODEC_ULAW
Definition: chan_skinny.c:180
@ SKINNY_CODEC_G729A
Definition: chan_skinny.c:183
@ SKINNY_CODEC_G723_1
Definition: chan_skinny.c:182
@ SKINNY_CODEC_G722
Definition: chan_skinny.c:181
@ SKINNY_CODEC_G726_32
Definition: chan_skinny.c:184
@ SKINNY_CODEC_ALAW
Definition: chan_skinny.c:179

Function Documentation

◆ __init_callstate2str_threadbuf()

static void __init_callstate2str_threadbuf ( void  )
static

Definition at line 281 of file chan_skinny.c.

292 {

◆ __init_control2str_threadbuf()

static void __init_control2str_threadbuf ( void  )
static

Definition at line 275 of file chan_skinny.c.

292 {

◆ __init_device2str_threadbuf()

static void __init_device2str_threadbuf ( void  )
static

Definition at line 272 of file chan_skinny.c.

292 {

◆ __init_substate2str_threadbuf()

static void __init_substate2str_threadbuf ( void  )
static

Definition at line 278 of file chan_skinny.c.

292 {

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 8854 of file chan_skinny.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 8854 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 4703 of file chan_skinny.c.

4704 {
4705  struct skinny_device *d;
4706 
4707  if (argc != 5) {
4708  return CLI_SHOWUSAGE;
4709  }
4710 
4713  if (!strcasecmp(argv[3], d->name)) {
4714  int priority = atoi(argv[4]);
4716  }
4717  }
4719  return CLI_SUCCESS;
4720 }
static int priority
static void transmit_clearprinotify(struct skinny_device *d, int priority)
Definition: chan_skinny.c:2835
#define CLI_SHOWUSAGE
Definition: cli.h:45
#define CLI_SUCCESS
Definition: cli.h:44
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:491
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:40
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:140
struct skinny_device::@141 list
const char * name
static struct test_val d

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

◆ _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 4653 of file chan_skinny.c.

4654 {
4655  struct skinny_device *d;
4656  char text_buf[32];
4657 
4658  if (argc < 7) {
4659  return CLI_SHOWUSAGE;
4660  }
4661 
4664  if (!strcasecmp(argv[3], d->name)) {
4665  int i;
4666  char *strp = text_buf;
4667  int charleft = sizeof(text_buf);
4668  int priority = atoi(argv[4]);
4669  int timeout = atoi(argv[5]);
4670  ast_copy_string(strp, argv[6], charleft);
4671  charleft -= strlen(strp);
4672  strp += strlen(strp);
4673  for(i=7; i<argc; i++) {
4674  ast_copy_string(strp++, " ", charleft--);
4675  ast_copy_string(strp, argv[i], charleft);
4676  charleft -= strlen(strp);
4677  strp += strlen(strp);
4678  }
4679  send_displayprinotify(d, text_buf, "", timeout, priority);
4680  }
4681  }
4683  return CLI_SUCCESS;
4684 }
static void send_displayprinotify(struct skinny_device *d, const char *text, const char *extratext, int timeout, int priority)
Definition: chan_skinny.c:2903
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:404

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

Referenced by handle_skinny_message_set().

◆ _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 4193 of file chan_skinny.c.

4194 {
4195  struct skinny_device *d;
4196  struct skinny_line *l;
4197  struct skinny_speeddial *sd;
4198  struct skinny_addon *sa;
4199  struct skinny_serviceurl *surl;
4200  struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
4201 
4202  if (argc < 4) {
4203  return CLI_SHOWUSAGE;
4204  }
4205 
4207  AST_LIST_TRAVERSE(&devices, d, list) {
4208  if (!strcasecmp(argv[3], d->id) || !strcasecmp(argv[3], d->name)) {
4209  int numlines = 0, numaddons = 0, numspeeddials = 0, numserviceurls = 0;
4210 
4211  AST_LIST_TRAVERSE(&d->lines, l, list){
4212  numlines++;
4213  }
4214 
4215  AST_LIST_TRAVERSE(&d->addons, sa, list) {
4216  numaddons++;
4217  }
4218 
4219  AST_LIST_TRAVERSE(&d->speeddials, sd, list) {
4220  numspeeddials++;
4221  }
4222 
4223  AST_LIST_TRAVERSE(&d->serviceurls, surl, list) {
4224  numserviceurls++;
4225  }
4226 
4227  if (type == 0) { /* CLI */
4228  ast_cli(fd, "Name: %s\n", d->name);
4229  ast_cli(fd, "Id: %s\n", d->id);
4230  ast_cli(fd, "version: %s\n", S_OR(d->version_id, "Unknown"));
4231  ast_cli(fd, "Ip address: %s\n", (d->session ? ast_inet_ntoa(d->session->sin.sin_addr) : "Unknown"));
4232  ast_cli(fd, "Port: %d\n", (d->session ? ntohs(d->session->sin.sin_port) : 0));
4233  ast_cli(fd, "Device Type: %s\n", device2str(d->type));
4234  ast_cli(fd, "Conf Codecs: %s\n", ast_format_cap_get_names(d->confcap, &codec_buf));
4235  ast_cli(fd, "Neg Codecs: %s\n", ast_format_cap_get_names(d->cap, &codec_buf));
4236  ast_cli(fd, "Registered: %s\n", (d->session ? "Yes" : "No"));
4237  ast_cli(fd, "Lines: %d\n", numlines);
4238  AST_LIST_TRAVERSE(&d->lines, l, list) {
4239  ast_cli(fd, " %s (%s)\n", l->name, l->label);
4240  }
4241  ast_cli(fd, "Addons: %d\n", numaddons);
4242  AST_LIST_TRAVERSE(&d->addons, sa, list) {
4243  ast_cli(fd, " %s\n", sa->type);
4244  }
4245  ast_cli(fd, "Speeddials: %d\n", numspeeddials);
4246  AST_LIST_TRAVERSE(&d->speeddials, sd, list) {
4247  ast_cli(fd, " %s (%s) ishint: %d\n", sd->exten, sd->label, sd->isHint);
4248  }
4249  ast_cli(fd, "ServiceURLs: %d\n", numserviceurls);
4250  AST_LIST_TRAVERSE(&d->serviceurls, surl, list) {
4251  ast_cli(fd, " %s (%s)\n", surl->displayName, surl->url);
4252  }
4253  } else { /* manager */
4254  astman_append(s, "Channeltype: SKINNY\r\n");
4255  astman_append(s, "ObjectName: %s\r\n", d->name);
4256  astman_append(s, "ChannelObjectType: device\r\n");
4257  astman_append(s, "Id: %s\r\n", d->id);
4258  astman_append(s, "version: %s\r\n", S_OR(d->version_id, "Unknown"));
4259  astman_append(s, "Ipaddress: %s\r\n", (d->session ? ast_inet_ntoa(d->session->sin.sin_addr) : "Unknown"));
4260  astman_append(s, "Port: %d\r\n", (d->session ? ntohs(d->session->sin.sin_port) : 0));
4261  astman_append(s, "DeviceType: %s\r\n", device2str(d->type));
4262  astman_append(s, "Codecs: %s\r\n", ast_format_cap_get_names(d->confcap, &codec_buf));
4263  astman_append(s, "CodecOrder: %s\r\n", ast_format_cap_get_names(d->cap, &codec_buf));
4264  astman_append(s, "Devicestatus: %s\r\n", (d->session?"registered":"unregistered"));
4265  astman_append(s, "NumberOfLines: %d\r\n", numlines);
4266  AST_LIST_TRAVERSE(&d->lines, l, list) {
4267  astman_append(s, "Line: %s (%s)\r\n", l->name, l->label);
4268  }
4269  astman_append(s, "NumberOfAddons: %d\r\n", numaddons);
4270  AST_LIST_TRAVERSE(&d->addons, sa, list) {
4271  astman_append(s, "Addon: %s\r\n", sa->type);
4272  }
4273  astman_append(s, "NumberOfSpeeddials: %d\r\n", numspeeddials);
4274  AST_LIST_TRAVERSE(&d->speeddials, sd, list) {
4275  astman_append(s, "Speeddial: %s (%s) ishint: %d\r\n", sd->exten, sd->label, sd->isHint);
4276  }
4277  astman_append(s, "ServiceURLs: %d\r\n", numserviceurls);
4278  AST_LIST_TRAVERSE(&d->serviceurls, surl, list) {
4279  astman_append(s, " %s (%s)\r\n", surl->displayName, surl->url);
4280  }
4281  }
4282  }
4283  }
4285  return CLI_SUCCESS;
4286 }
static const char type[]
Definition: chan_ooh323.c:109
static char * device2str(int type)
Definition: chan_skinny.c:4000
void ast_cli(int fd, const char *fmt,...)
Definition: clicompat.c:6
#define AST_FORMAT_CAP_NAMES_LEN
Definition: format_cap.h:324
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:734
void astman_append(struct mansession *s, const char *fmt,...)
Definition: manager.c:3080
const char * ast_inet_ntoa(struct in_addr ia)
thread-safe replacement for inet_ntoa().
Definition: main/utils.c:928
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition: strings.h:80
#define ast_str_alloca(init_len)
Definition: strings.h:824
Support for dynamic strings.
Definition: strings.h:602
char type[10]
Definition: chan_skinny.c:1557
char displayName[40]
Definition: chan_skinny.c:1540
char url[MAX_SERVICEURL]
Definition: chan_skinny.c:1539
char exten[AST_MAX_EXTENSION]
Definition: chan_skinny.c:1527

References 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(), CLI_SHOWUSAGE, CLI_SUCCESS, d, device2str(), skinny_serviceurl::displayName, skinny_speeddial::exten, skinny_speeddial::isHint, skinny_speeddial::label, test_val::name, S_OR, skinny_addon::type, type, and skinny_serviceurl::url.

Referenced by handle_skinny_show_device(), and manager_skinny_show_device().

◆ _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 4089 of file chan_skinny.c.

4090 {
4091  struct skinny_device *d;
4092  struct skinny_line *l;
4093  const char *id;
4094  char idtext[256] = "";
4095  int total_devices = 0;
4096 
4097  if (s) { /* Manager - get ActionID */
4098  id = astman_get_header(m, "ActionID");
4099  if (!ast_strlen_zero(id))
4100  snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
4101  }
4102 
4103  switch (argc) {
4104  case 3:
4105  break;
4106  default:
4107  return CLI_SHOWUSAGE;
4108  }
4109 
4110  if (!s) {
4111  ast_cli(fd, "Name DeviceId IP Type R NL\n");
4112  ast_cli(fd, "-------------------- ---------------- --------------- --------------- - --\n");
4113  }
4114 
4117  int numlines = 0;
4118  total_devices++;
4119  AST_LIST_TRAVERSE(&d->lines, l, list) {
4120  numlines++;
4121  }
4122  if (!s) {
4123  ast_cli(fd, "%-20s %-16s %-15s %-15s %c %2d\n",
4124  d->name,
4125  d->id,
4126  d->session?ast_inet_ntoa(d->session->sin.sin_addr):"",
4127  device2str(d->type),
4128  d->session?'Y':'N',
4129  numlines);
4130  } else {
4131  astman_append(s,
4132  "Event: DeviceEntry\r\n%s"
4133  "Channeltype: SKINNY\r\n"
4134  "ObjectName: %s\r\n"
4135  "ChannelObjectType: device\r\n"
4136  "DeviceId: %s\r\n"
4137  "IPaddress: %s\r\n"
4138  "Type: %s\r\n"
4139  "Devicestatus: %s\r\n"
4140  "NumberOfLines: %d\r\n",
4141  idtext,
4142  d->name,
4143  d->id,
4144  d->session?ast_inet_ntoa(d->session->sin.sin_addr):"-none-",
4145  device2str(d->type),
4146  d->session?"registered":"unregistered",
4147  numlines);
4148  }
4149  }
4151 
4152  if (total)
4153  *total = total_devices;
4154 
4155  return CLI_SUCCESS;
4156 }
enum queue_result id
Definition: app_queue.c:1608
const char * astman_get_header(const struct message *m, char *var)
Get header from manager transaction.
Definition: manager.c:2820
static int total
Definition: res_adsi.c:968
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
struct skinny_line::@131 list

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_line::list, test_val::name, and total.

Referenced by handle_skinny_show_devices(), and manager_skinny_show_devices().

◆ _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 4444 of file chan_skinny.c.

4445 {
4446  struct skinny_device *d;
4447  struct skinny_line *l;
4448  struct skinny_subline *subline;
4449  struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
4450  char group_buf[256];
4451  char cbuf[256];
4452 
4453  switch (argc) {
4454  case 4:
4455  break;
4456  case 6:
4457  break;
4458  default:
4459  return CLI_SHOWUSAGE;
4460  }
4461 
4463 
4464  /* Show all lines matching the one supplied */
4465  AST_LIST_TRAVERSE(&devices, d, list) {
4466  if (argc == 6 && (strcasecmp(argv[5], d->id) && strcasecmp(argv[5], d->name))) {
4467  continue;
4468  }
4469  AST_LIST_TRAVERSE(&d->lines, l, list) {
4470  struct ast_str *tmp_str = ast_str_alloca(512);
4471 
4472  if (strcasecmp(argv[3], l->name)) {
4473  continue;
4474  }
4475  if (type == 0) { /* CLI */
4476  ast_cli(fd, "Line: %s\n", l->name);
4477  ast_cli(fd, "On Device: %s\n", d->name);
4478  ast_cli(fd, "Line Label: %s\n", l->label);
4479  ast_cli(fd, "Extension: %s\n", S_OR(l->exten, "<not set>"));
4480  ast_cli(fd, "Context: %s\n", l->context);
4481  ast_cli(fd, "CallGroup: %s\n", ast_print_group(group_buf, sizeof(group_buf), l->callgroup));
4482  ast_cli(fd, "PickupGroup: %s\n", ast_print_group(group_buf, sizeof(group_buf), l->pickupgroup));
4483  ast_cli(fd, "NamedCallGroup: %s\n", ast_print_namedgroups(&tmp_str, l->named_callgroups));
4484  ast_str_reset(tmp_str);
4485  ast_cli(fd, "NamedPickupGroup: %s\n", ast_print_namedgroups(&tmp_str, l->named_pickupgroups));
4486  ast_str_reset(tmp_str);
4487  ast_cli(fd, "Language: %s\n", S_OR(l->language, "<not set>"));
4488  ast_cli(fd, "Accountcode: %s\n", S_OR(l->accountcode, "<not set>"));
4489  ast_cli(fd, "AmaFlag: %s\n", ast_channel_amaflags2string(l->amaflags));
4490  ast_cli(fd, "CallerId Number: %s\n", S_OR(l->cid_num, "<not set>"));
4491  ast_cli(fd, "CallerId Name: %s\n", S_OR(l->cid_name, "<not set>"));
4492  ast_cli(fd, "Hide CallerId: %s\n", (l->hidecallerid ? "Yes" : "No"));
4493  ast_cli(fd, "CFwdAll: %s\n", S_COR((l->cfwdtype & SKINNY_CFWD_ALL), l->call_forward_all, "<not set>"));
4494  ast_cli(fd, "CFwdBusy: %s\n", S_COR((l->cfwdtype & SKINNY_CFWD_BUSY), l->call_forward_busy, "<not set>"));
4495  ast_cli(fd, "CFwdNoAnswer: %s\n", S_COR((l->cfwdtype & SKINNY_CFWD_NOANSWER), l->call_forward_noanswer, "<not set>"));
4496  ast_cli(fd, "CFwdTimeout: %dms\n", l->callfwdtimeout);
4497  ast_cli(fd, "VoicemailBox: %s\n", S_OR(l->mailbox, "<not set>"));
4498  ast_cli(fd, "VoicemailNumber: %s\n", S_OR(l->vmexten, "<not set>"));
4499  ast_cli(fd, "MWIblink: %d\n", l->mwiblink);
4500  ast_cli(fd, "Regextension: %s\n", S_OR(l->regexten, "<not set>"));
4501  ast_cli(fd, "Regcontext: %s\n", S_OR(l->regcontext, "<not set>"));
4502  ast_cli(fd, "MoHInterpret: %s\n", S_OR(l->mohinterpret, "<not set>"));
4503  ast_cli(fd, "MoHSuggest: %s\n", S_OR(l->mohsuggest, "<not set>"));
4504  ast_cli(fd, "Last dialed nr: %s\n", S_OR(l->lastnumberdialed, "<no calls made yet>"));
4505  ast_cli(fd, "Last CallerID: %s\n", S_OR(l->lastcallerid, "<not set>"));
4506  ast_cli(fd, "Transfer enabled: %s\n", (l->transfer ? "Yes" : "No"));
4507  ast_cli(fd, "Callwaiting: %s\n", (l->callwaiting ? "Yes" : "No"));
4508  ast_cli(fd, "3Way Calling: %s\n", (l->threewaycalling ? "Yes" : "No"));
4509  ast_cli(fd, "Can forward: %s\n", (l->cancallforward ? "Yes" : "No"));
4510  ast_cli(fd, "Do Not Disturb: %s\n", (l->dnd ? "Yes" : "No"));
4511  ast_cli(fd, "NAT: %s\n", (l->nat ? "Yes" : "No"));
4512  ast_cli(fd, "immediate: %s\n", (l->immediate ? "Yes" : "No"));
4513  ast_cli(fd, "Group: %d\n", l->group);
4514  ast_cli(fd, "Parkinglot: %s\n", S_OR(l->parkinglot, "<not set>"));
4515  ast_cli(fd, "Conf Codecs: %s\n", ast_format_cap_get_names(l->confcap, &codec_buf));
4516  ast_cli(fd, "Neg Codecs: %s\n", ast_format_cap_get_names(l->cap, &codec_buf));
4517  if (AST_LIST_FIRST(&l->sublines)) {
4518  ast_cli(fd, "Sublines:\n");
4519  AST_LIST_TRAVERSE(&l->sublines, subline, list) {
4520  ast_cli(fd, " %s, %s@%s\n", subline->name, subline->exten, subline->context);
4521  }
4522  }
4523  ast_cli(fd, "\n");
4524  } else { /* manager */
4525  astman_append(s, "Channeltype: SKINNY\r\n");
4526  astman_append(s, "ObjectName: %s\r\n", l->name);
4527  astman_append(s, "ChannelObjectType: line\r\n");
4528  astman_append(s, "Device: %s\r\n", d->name);
4529  astman_append(s, "LineLabel: %s\r\n", l->label);
4530  astman_append(s, "Extension: %s\r\n", S_OR(l->exten, "<not set>"));
4531  astman_append(s, "Context: %s\r\n", l->context);
4532  astman_append(s, "CallGroup: %s\r\n", ast_print_group(group_buf, sizeof(group_buf), l->callgroup));
4533  astman_append(s, "PickupGroup: %s\r\n", ast_print_group(group_buf, sizeof(group_buf), l->pickupgroup));
4534  astman_append(s, "NamedCallGroup: %s\r\n", ast_print_namedgroups(&tmp_str, l->named_callgroups));
4535  ast_str_reset(tmp_str);
4536  astman_append(s, "NamedPickupGroup: %s\r\n", ast_print_namedgroups(&tmp_str, l->named_pickupgroups));
4537  ast_str_reset(tmp_str);
4538  astman_append(s, "Language: %s\r\n", S_OR(l->language, "<not set>"));
4539  astman_append(s, "Accountcode: %s\r\n", S_OR(l->accountcode, "<not set>"));
4540  astman_append(s, "AMAflags: %s\r\n", ast_channel_amaflags2string(l->amaflags));
4541  astman_append(s, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), l->cid_name, l->cid_num, ""));
4542  astman_append(s, "HideCallerId: %s\r\n", (l->hidecallerid ? "Yes" : "No"));
4543  astman_append(s, "CFwdAll: %s\r\n", S_COR((l->cfwdtype & SKINNY_CFWD_ALL), l->call_forward_all, "<not set>"));
4544  astman_append(s, "CFwdBusy: %s\r\n", S_COR((l->cfwdtype & SKINNY_CFWD_BUSY), l->call_forward_busy, "<not set>"));
4545  astman_append(s, "CFwdNoAnswer: %s\r\n", S_COR((l->cfwdtype & SKINNY_CFWD_NOANSWER), l->call_forward_noanswer, "<not set>"));
4546  astman_append(s, "VoicemailBox: %s\r\n", S_OR(l->mailbox, "<not set>"));
4547  astman_append(s, "VoicemailNumber: %s\r\n", S_OR(l->vmexten, "<not set>"));
4548  astman_append(s, "MWIblink: %d\r\n", l->mwiblink);
4549  astman_append(s, "RegExtension: %s\r\n", S_OR(l->regexten, "<not set>"));
4550  astman_append(s, "Regcontext: %s\r\n", S_OR(l->regcontext, "<not set>"));
4551  astman_append(s, "MoHInterpret: %s\r\n", S_OR(l->mohinterpret, "<not set>"));
4552  astman_append(s, "MoHSuggest: %s\r\n", S_OR(l->mohsuggest, "<not set>"));
4553  astman_append(s, "LastDialedNr: %s\r\n", S_OR(l->lastnumberdialed, "<no calls made yet>"));
4554  astman_append(s, "LastCallerID: %s\r\n", S_OR(l->lastcallerid, "<not set>"));
4555  astman_append(s, "Transfer: %s\r\n", (l->transfer ? "Yes" : "No"));
4556  astman_append(s, "Callwaiting: %s\r\n", (l->callwaiting ? "Yes" : "No"));
4557  astman_append(s, "3WayCalling: %s\r\n", (l->threewaycalling ? "Yes" : "No"));
4558  astman_append(s, "CanForward: %s\r\n", (l->cancallforward ? "Yes" : "No"));
4559  astman_append(s, "DoNotDisturb: %s\r\n", (l->dnd ? "Yes" : "No"));
4560  astman_append(s, "NAT: %s\r\n", (l->nat ? "Yes" : "No"));
4561  astman_append(s, "immediate: %s\r\n", (l->immediate ? "Yes" : "No"));
4562  astman_append(s, "Group: %d\r\n", l->group);
4563  astman_append(s, "Parkinglot: %s\r\n", S_OR(l->parkinglot, "<not set>"));
4564  astman_append(s, "Codecs: %s\r\n", ast_format_cap_get_names(l->confcap, &codec_buf));
4565  astman_append(s, "\r\n");
4566  }
4567  }
4568  }
4569 
4571  return CLI_SUCCESS;
4572 }
char * ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num, const char *unknown)
Definition: callerid.c:1073
#define SKINNY_CFWD_ALL
Definition: chan_skinny.c:1328
#define SKINNY_CFWD_BUSY
Definition: chan_skinny.c:1329
#define SKINNY_CFWD_NOANSWER
Definition: chan_skinny.c:1330
char * ast_print_group(char *buf, int buflen, ast_group_t group)
Print call and pickup groups into buffer.
Definition: channel.c:8114
char * ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *groups)
Print named call groups and named pickup groups.
Definition: channel.c:8139
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
Definition: channel.c:4408
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Definition: linkedlists.h:421
#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:87
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:672
struct ast_format_cap * confcap
Definition: chan_skinny.c:1478
struct skinny_line::@130 sublines
struct ast_format_cap * cap
Definition: chan_skinny.c:1477
char exten[AST_MAX_EXTENSION]
Definition: chan_skinny.c:1509
char context[AST_MAX_CONTEXT]
Definition: chan_skinny.c:1508

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_subline::name, test_val::name, S_COR, S_OR, SKINNY_CFWD_ALL, SKINNY_CFWD_BUSY, SKINNY_CFWD_NOANSWER, skinny_line::sublines, and type.

Referenced by handle_skinny_show_line(), and manager_skinny_show_line().

◆ _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 4325 of file chan_skinny.c.

4326 {
4327  struct skinny_line *l;
4328  struct skinny_subchannel *sub;
4329  int total_lines = 0;
4330  int verbose = 0;
4331  const char *id;
4332  char idtext[256] = "";
4333 
4334  if (s) { /* Manager - get ActionID */
4335  id = astman_get_header(m, "ActionID");
4336  if (!ast_strlen_zero(id))
4337  snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
4338  }
4339 
4340  switch (argc) {
4341  case 4:
4342  verbose = 1;
4343  break;
4344  case 3:
4345  verbose = 0;
4346  break;
4347  default:
4348  return CLI_SHOWUSAGE;
4349  }
4350 
4351  if (!s) {
4352  ast_cli(fd, "Name Device Name Instance Label \n");
4353  ast_cli(fd, "-------------------- -------------------- -------- --------------------\n");
4354  }
4355  AST_LIST_LOCK(&lines);
4356  AST_LIST_TRAVERSE(&lines, l, all) {
4357  total_lines++;
4358  if (!s) {
4359  ast_cli(fd, "%-20s %-20s %8d %-20s\n",
4360  l->name,
4361  (l->device ? l->device->name : "Not connected"),
4362  l->instance,
4363  l->label);
4364  if (verbose) {
4365  AST_LIST_TRAVERSE(&l->sub, sub, list) {
4366  RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(sub->owner), ao2_cleanup);
4367 
4368  ast_cli(fd, " %s> %s to %s\n",
4369  (sub == l->activesub?"Active ":"Inactive"),
4370  ast_channel_name(sub->owner),
4371  bridged ? ast_channel_name(bridged) : ""
4372  );
4373  }
4374  }
4375  } else {
4376  astman_append(s,
4377  "Event: LineEntry\r\n%s"
4378  "Channeltype: SKINNY\r\n"
4379  "ObjectName: %s\r\n"
4380  "ChannelObjectType: line\r\n"
4381  "Device: %s\r\n"
4382  "Instance: %d\r\n"
4383  "Label: %s\r\n",
4384  idtext,
4385  l->name,
4386  (l->device ? l->device->name : "None"),
4387  l->instance,
4388  l->label);
4389  }
4390  }
4392 
4393  if (total) {
4394  *total = total_lines;
4395  }
4396 
4397  return CLI_SUCCESS;
4398 }
#define ao2_cleanup(obj)
Definition: astobj2.h:1934
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
Definition: channel.c:10750
struct stasis_forward * sub
Definition: res_corosync.c:240
Main Channel structure associated with a channel.
struct skinny_device * device
Definition: chan_skinny.c:1476
struct skinny_line::@129 sub
struct skinny_subchannel * activesub
Definition: chan_skinny.c:1471
struct skinny_subchannel::@128 list
#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:936

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, RAII_VAR, skinny_line::sub, sub, and total.

Referenced by handle_skinny_show_lines(), and manager_skinny_show_lines().

◆ _transmit_displayprinotify()

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

Definition at line 2848 of file chan_skinny.c.

2849 {
2850  struct skinny_req *req;
2851 
2852  if (!(req = req_alloc(sizeof(struct display_prinotify_message), DISPLAY_PRINOTIFY_MESSAGE)))
2853  return;
2854 
2855  req->data.displayprinotify.timeout = htolel(timeout);
2857 
2858  if ((char)*text == '\200') {
2859  int octalstrlen = strlen(text);
2861  ast_copy_string(req->data.displayprinotify.text+octalstrlen, extratext, sizeof(req->data.displayprinotify.text)-octalstrlen);
2862  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE to %s, '\\%03o\\%03o', '%s', timeout=%d, priority=%d\n",
2863  d->name, (unsigned)*text, (unsigned)*(text+1), extratext, timeout, priority);
2864  } else {
2866  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE to %s, '%s', timeout=%d, priority=%d\n",
2867  d->name, text, timeout, priority);
2868  }
2869 
2870  transmit_response(d, req);
2871 }
char * text
Definition: app_queue.c:1609
#define htolel(x)
Definition: chan_skinny.c:225
#define DISPLAY_PRINOTIFY_MESSAGE
Definition: chan_skinny.c:1118
static struct skinny_req * req_alloc(size_t size, int response_message)
Definition: chan_skinny.c:1870
#define SKINNY_DEBUG(type, verb_level, text,...)
Definition: chan_skinny.c:167
static void transmit_response(struct skinny_device *d, struct skinny_req *req)
Definition: chan_skinny.c:2419
char text[MAXDISPLAYNOTIFYSTR]
Definition: chan_skinny.c:1122
union skinny_data data
Definition: chan_skinny.c:1219
struct display_prinotify_message displayprinotify
Definition: chan_skinny.c:1210

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

Referenced by send_displayprinotify().

◆ _transmit_displayprinotifyvar()

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

Definition at line 2873 of file chan_skinny.c.

2874 {
2875  struct skinny_req *req;
2876  int packetlen;
2877 
2879  return;
2880 
2881  req->data.displayprinotifyvar.timeout = htolel(timeout);
2883 
2884  if ((char)*text == '\200') {
2885  int octalstrlen = strlen(text);
2887  ast_copy_string(req->data.displayprinotifyvar.text+octalstrlen, extratext, sizeof(req->data.displayprinotifyvar.text)-octalstrlen);
2888  packetlen = req->len - MAXDISPLAYNOTIFYSTR + strlen(text) + strlen(extratext);
2889  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE_VARIABLE to %s, '\\%03o\\%03o', '%s', timeout=%d, priority=%d\n",
2890  d->name, (unsigned)*text, (unsigned)*(text+1), extratext, timeout, priority);
2891  } else {
2893  packetlen = req->len - MAXDISPLAYNOTIFYSTR + strlen(text);
2894  SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE_VARIABLE to %s, '%s', timeout=%d, priority=%d\n",
2895  d->name, text, timeout, priority);
2896  }
2897 
2898  req->len = (packetlen & ~0x3) + 4;
2899 
2900  transmit_response(d, req);
2901 }
#define DISPLAY_PRINOTIFY_MESSAGE_VARIABLE
Definition: chan_skinny.c:1143
#define MAXDISPLAYNOTIFYSTR
Definition: chan_skinny.c:1116
char text[MAXDISPLAYNOTIFYSTR]
Definition: chan_skinny.c:1147
uint32_t len
Definition: chan_skinny.c:1216
struct display_prinotify_message_variable displayprinotifyvar
Definition: chan_skinny.c:1211

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

Referenced by send_displayprinotify().

◆ accept_thread()

static void* accept_thread ( void *  ignore)
static

Definition at line 7658 of file chan_skinny.c.

7659 {
7660  int as;
7661  struct sockaddr_in sin;
7662  socklen_t sinlen;
7663  struct skinnysession *s;
7664  int arg = 1;
7665 
7666  for (;;) {
7667  sinlen = sizeof(sin);
7668  as = accept(skinnysock, (struct sockaddr *)&sin, &sinlen);
7669  if (as < 0) {
7670  ast_log(LOG_NOTICE, "Accept returned -1: %s\n", strerror(errno));
7671  continue;
7672  }
7673 
7675  close(as);
7677  continue;
7678  }
7679 
7680  if (setsockopt(as, IPPROTO_TCP, TCP_NODELAY, (char *) &arg, sizeof(arg)) < 0) {
7681  ast_log(LOG_WARNING, "Failed to set TCP_NODELAY on Skinny TCP connection: %s\n", strerror(errno));
7682  }
7683 
7684  if (!(s = ast_calloc(1, sizeof(struct skinnysession)))) {
7685  close(as);
7687  continue;
7688  }
7689 
7690  ast_mutex_init(&s->lock);
7691  memcpy(&s->sin, &sin, sizeof(sin));
7692  s->fd = as;
7693  s->auth_timeout_sched = -1;
7694  s->keepalive_timeout_sched = -1;
7695 
7696  if (ast_pthread_create(&s->t, NULL, skinny_session, s)) {
7697  s->t = AST_PTHREADT_NULL;
7698  destroy_session(s);
7699  }
7700  }
7701  SKINNY_DEBUG(DEBUG_THREAD, 3, "Killing accept thread\n");
7702  close(as);
7703  return 0;
7704 }
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:202
#define ast_log
Definition: astobj2.c:42
static int skinnysock
Definition: chan_skinny.c:1238
static void * skinny_session(void *data)
Definition: chan_skinny.c:7521
static int auth_limit
Definition: chan_skinny.c:206
static int unauth_sessions
Definition: chan_skinny.c:207
static void destroy_session(struct skinnysession *s)
Definition: chan_skinny.c:7427
#define AST_PTHREADT_NULL
Definition: lock.h:66
#define ast_mutex_init(pmutex)
Definition: lock.h:184
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 LOG_NOTICE
Definition: logger.h:264
#define LOG_WARNING
Definition: logger.h:275
int errno
#define NULL
Definition: resample.c:96
int auth_timeout_sched
Definition: chan_skinny.c:1624
int keepalive_timeout_sched
Definition: chan_skinny.c:1625
pthread_t t
Definition: chan_skinny.c:1615
struct sockaddr_in sin
Definition: chan_skinny.c:1618
ast_mutex_t lock
Definition: chan_skinny.c:1616
#define ast_pthread_create(a, b, c, d)
Definition: utils.h:579

References ast_atomic_fetchadd_int(), ast_calloc, ast_log, ast_mutex_init, ast_pthread_create, AST_PTHREADT_NULL, auth_limit, skinnysession::auth_timeout_sched, 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().

◆ activatesub()

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

Definition at line 6050 of file chan_skinny.c.

6051 {
6052  struct skinny_line *l = sub->line;
6053 
6054  SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Activating, and deactivating sub %u\n",
6055  sub->callid, l->activesub ? l->activesub->callid : 0);
6056 
6057  if (sub == l->activesub) {
6058  setsubstate(sub, state);
6059  } else {
6060  if (l->activesub) {
6061  if (l->activesub->substate == SUBSTATE_RINGIN) {
6063  } else if (l->activesub->substate != SUBSTATE_HOLD) {
6065  }
6066  }
6067  l->activesub = sub;
6068  setsubstate(sub, state);
6069  }
6070 }
static void setsubstate(struct skinny_subchannel *sub, int state)
Definition: chan_skinny.c:5561
#define SUBSTATE_RINGIN
Definition: chan_skinny.c:1376
#define SUBSTATE_ONHOOK
Definition: chan_skinny.c:1374
#define SUBSTATE_HOLD
Definition: chan_skinny.c:1380
#define SUBSTATE_CALLWAIT
Definition: chan_skinny.c:1381
unsigned int callid
Definition: chan_skinny.c:1393

References skinny_line::activesub, skinny_subchannel::callid, 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().

◆ add_var()

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

implement the setvar config line

Definition at line 1994 of file chan_skinny.c.

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

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

Referenced by config_parse_variables().

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 8854 of file chan_skinny.c.

◆ cleanup_stale_contexts()

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

Definition at line 2188 of file chan_skinny.c.

2189 {
2190  char *oldcontext, *newcontext, *stalecontext, *stringp, newlist[AST_MAX_CONTEXT];
2191 
2192  while ((oldcontext = strsep(&old, "&"))) {
2193  stalecontext = NULL;
2194  ast_copy_string(newlist, new, sizeof(newlist));
2195  stringp = newlist;
2196  while ((newcontext = strsep(&stringp, "&"))) {
2197  if (strcmp(newcontext, oldcontext) == 0) {
2198  /* This is not the context you're looking for */
2199  stalecontext = NULL;
2200  break;
2201  } else if (strcmp(newcontext, oldcontext)) {
2202  stalecontext = oldcontext;
2203  }
2204 
2205  }
2206  ast_context_destroy_by_name(stalecontext, "Skinny");
2207  }
2208 }
#define AST_MAX_CONTEXT
Definition: channel.h:135
char * strsep(char **str, const char *delims)
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.

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

Referenced by config_parse_variables().

◆ codec_ast2skinny()

static int codec_ast2skinny ( const struct ast_format astcodec)
static

Definition at line 2130 of file chan_skinny.c.

2131 {
2133  return SKINNY_CODEC_ALAW;
2134  } else if (ast_format_cmp(astcodec, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL) {
2135  return SKINNY_CODEC_ULAW;
2136  } else if (ast_format_cmp(astcodec, ast_format_g722) == AST_FORMAT_CMP_EQUAL) {
2137  return SKINNY_CODEC_G722;
2138  } else if (ast_format_cmp(astcodec, ast_format_g723) == AST_FORMAT_CMP_EQUAL) {
2139  return SKINNY_CODEC_G723_1;
2140  } else if (ast_format_cmp(astcodec, ast_format_g729) == AST_FORMAT_CMP_EQUAL) {
2141  return SKINNY_CODEC_G729A;
2142  } else if (ast_format_cmp(astcodec, ast_format_g726) == AST_FORMAT_CMP_EQUAL) {
2143  return SKINNY_CODEC_G726_32;
2144  } else if (ast_format_cmp(astcodec, ast_format_h261) == AST_FORMAT_CMP_EQUAL) {
2145  return SKINNY_CODEC_H261;
2146  } else if (ast_format_cmp(astcodec, ast_format_h263) == AST_FORMAT_CMP_EQUAL) {
2147  return SKINNY_CODEC_H263;
2148  } else {
2149  return 0;
2150  }
2151 }
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
@ AST_FORMAT_CMP_EQUAL
Definition: format.h:36
struct ast_format * ast_format_h263
Built-in cached h263 format.
Definition: format_cache.c:166
struct ast_format * ast_format_g726
Built-in cached g726 format.
Definition: format_cache.c:111
struct ast_format * ast_format_ulaw
Built-in cached ulaw format.
Definition: format_cache.c:86
struct ast_format * ast_format_g723
Built-in cached g723.1 format.
Definition: format_cache.c:146
struct ast_format * ast_format_alaw
Built-in cached alaw format.
Definition: format_cache.c:91
struct ast_format * ast_format_h261
Built-in cached h261 format.
Definition: format_cache.c:161
struct ast_format * ast_format_g722
Built-in cached g722 format.
Definition: format_cache.c:106
struct ast_format * ast_format_g729
Built-in cached g729 format.
Definition: format_cache.c:151

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().

◆ codec_skinny2ast()

static struct ast_format* codec_skinny2ast ( enum skinny_codecs  skinnycodec)
static

Definition at line 2106 of file chan_skinny.c.

2107 {
2108  switch (skinnycodec) {
2109  case SKINNY_CODEC_ALAW:
2110  return ast_format_alaw;
2111  case SKINNY_CODEC_ULAW:
2112  return ast_format_ulaw;
2113  case SKINNY_CODEC_G722:
2114  return ast_format_g722;
2115  case SKINNY_CODEC_G723_1:
2116  return ast_format_g723;
2117  case SKINNY_CODEC_G729A:
2118  return ast_format_g729;
2119  case SKINNY_CODEC_G726_32:
2120  return ast_format_g726; /* XXX Is this right? */
2121  case SKINNY_CODEC_H261:
2122  return ast_format_h261;
2123  case SKINNY_CODEC_H263:
2124  return ast_format_h263;
2125  default:
2126  return ast_format_none;
2127  }
2128 }
struct ast_format * ast_format_none
Built-in "null" format.
Definition: format_cache.c:246

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().

◆ complete_skinny_devices()

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

Definition at line 3905 of file chan_skinny.c.

3906 {
3907  struct skinny_device *d;
3908  int wordlen = strlen(word), which = 0;
3909 
3911  if (!strncasecmp(word, d->name, wordlen) && ++which > state) {
3912  return ast_strdup(d->name);
3913  }
3914  }
3915 
3916  return NULL;
3917 }
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:241
short word

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

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

◆ complete_skinny_reset()

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

Definition at line 3924 of file chan_skinny.c.

3925 {
3926  if (pos == 2) {
3927  static const char * const completions[] = { "all", NULL };
3928  char *ret = ast_cli_complete(word, completions, state);
3929  if (!ret) {
3930  ret = complete_skinny_devices(word, state - 1);
3931  }
3932  return ret;
3933  } else if (pos == 3) {
3934  static const char * const completions[] = { "restart", NULL };
3935  return ast_cli_complete(word, completions, state);
3936  }
3937 
3938  return NULL;
3939 }
static char * complete_skinny_devices(const char *word, int state)
Definition: chan_skinny.c:3905
char * ast_cli_complete(const char *word, const char *const choices[], int pos)
Definition: main/cli.c:1843

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

Referenced by handle_skinny_reset().

◆ complete_skinny_show_device()

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

Definition at line 3919 of file chan_skinny.c.

3920 {
3921  return (pos == 3 ? complete_skinny_devices(word, state) : NULL);
3922 }

References complete_skinny_devices(), and NULL.

Referenced by handle_skinny_message_set(), and handle_skinny_show_device().

◆ complete_skinny_show_line()

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

Definition at line 3941 of file chan_skinny.c.

3942 {
3943  if (pos == 3) {
3944  struct skinny_device *d;
3945  struct skinny_line *l;
3946  int wordlen = strlen(word), which = 0;
3947 
3949  AST_LIST_TRAVERSE(&d->lines, l, list) {
3950  if (!strncasecmp(word, l->name, wordlen) && ++which > state) {
3951  return ast_strdup(l->name);
3952  }
3953  }
3954  }
3955  } else if (pos == 4) {
3956  static const char * const completions[] = { "on", NULL };
3957  return ast_cli_complete(word, completions, state);
3958  } else if (pos == 5) {
3960  }
3961 
3962  return NULL;
3963 }

References ast_cli_complete(), AST_LIST_TRAVERSE, ast_strdup, complete_skinny_devices(), d, skinny_line::list, and NULL.

Referenced by handle_skinny_show_line().

◆ config_device()

static struct skinny_device* config_device ( const char *  dname,
struct ast_variable v 
)
static

Definition at line 8374 of file chan_skinny.c.

8375 {
8376  struct skinny_device *d, *temp;
8377  struct skinny_line *l, *ltemp;
8378  struct skinny_subchannel *sub;
8379  int update = 0;
8380 
8381  ast_log(LOG_NOTICE, "Configuring skinny device %s.\n", dname);
8382 
8384  AST_LIST_TRAVERSE(&devices, temp, list) {
8385  if (!strcasecmp(dname, temp->name) && temp->prune) {
8386  update = 1;
8387  break;
8388  }
8389  }
8390 
8391  if (!(d = skinny_device_alloc(dname))) {
8392  ast_verb(1, "Unable to allocate memory for device %s.\n", dname);
8394  return NULL;
8395  }
8396  memcpy(d, default_device, sizeof(*default_device));
8397  ast_mutex_init(&d->lock);
8398  ast_copy_string(d->name, dname, sizeof(d->name));
8401 
8402  ast_mutex_lock(&d->lock);
8404 
8406 
8407  if (!AST_LIST_FIRST(&d->lines)) {
8408  ast_log(LOG_ERROR, "A Skinny device must have at least one line!\n");
8409  ast_mutex_unlock(&d->lock);
8410  return NULL;
8411  }
8412  if (/*d->addr.sin_addr.s_addr && */!ntohs(d->addr.sin_port)) {
8413  d->addr.sin_port = htons(DEFAULT_SKINNY_PORT);
8414  }
8415 
8416  if (skinnyreload){
8418  AST_LIST_TRAVERSE(&devices, temp, list) {
8419  if (strcasecmp(d->id, temp->id) || !temp->prune || !temp->session) {
8420  continue;
8421  }
8422  ast_mutex_lock(&d->lock);
8423  d->session = temp->session;
8424  d->session->device = d;
8425  d->hookstate = temp->hookstate;
8426 
8427  AST_LIST_LOCK(&d->lines);
8428  AST_LIST_TRAVERSE(&d->lines, l, list){
8429 
8430  AST_LIST_LOCK(&temp->lines);
8431  AST_LIST_TRAVERSE(&temp->lines, ltemp, list) {
8432  if (strcasecmp(l->name, ltemp->name)) {
8433  continue;
8434  }
8435  ast_mutex_lock(&ltemp->lock);
8436  l->instance = ltemp->instance;
8437  if (l == temp->activeline) {
8438  d->activeline = l;
8439  }
8440  if (!AST_LIST_EMPTY(&ltemp->sub)) {
8441  ast_mutex_lock(&l->lock);
8442  l->sub = ltemp->sub;
8443  l->activesub = ltemp->activesub;
8444  AST_LIST_TRAVERSE(&l->sub, sub, list) {
8445  sub->line = l;
8446  }
8447  ast_mutex_unlock(&l->lock);
8448  }
8449  ast_mutex_unlock(&ltemp->lock);
8450  }
8451  AST_LIST_UNLOCK(&temp->lines);
8452  }
8453  AST_LIST_UNLOCK(&d->lines);
8454  ast_mutex_unlock(&d->lock);
8455  }
8457  }
8458 
8459  ast_mutex_unlock(&d->lock);
8460 
8461  ast_verb(3, "%s config for device '%s'\n", update ? "Updated" : (skinnyreload ? "Reloaded" : "Created"), d->name);
8462 
8463  return d;
8464 
8465 }
#define TYPE_DEVICE
Definition: chan_skinny.c:7788
static void config_parse_variables(int type, void *item, struct ast_variable *vptr)
Definition: chan_skinny.c:7796
static int skinnyreload
Definition: chan_skinny.c:1231
static struct ast_format_cap * default_cap
Definition: chan_skinny.c:176
static struct skinny_device_options * default_device
Definition: chan_skinny.c:1610
#define DEFAULT_SKINNY_PORT
Definition: chan_skinny.c:189
static struct skinny_device * skinny_device_alloc(const char *dname)
Definition: chan_skinny.c:1702
@ AST_MEDIA_TYPE_UNKNOWN
Definition: codec.h:31
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Definition: codec_g726.c:367
int ast_format_cap_append_from_cap(struct ast_format_cap *dst, const struct ast_format_cap *src, enum ast_media_type type)
Append the formats of provided type in src to dst.
Definition: format_cap.c:269
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
Definition: linkedlists.h:450
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:731
#define ast_mutex_unlock(a)
Definition: lock.h:188
#define ast_mutex_lock(a)
Definition: lock.h:187
#define LOG_ERROR
Definition: logger.h:286
#define ast_verb(level,...)
Definition: logger.h:462
struct skinny_line * activeline
Definition: chan_skinny.c:1588
struct skinnysession * session
Definition: chan_skinny.c:1587
struct skinny_device::@137 lines
SKINNY_LINE_OPTIONS ast_mutex_t lock
Definition: chan_skinny.c:1468

References skinny_device::activeline, skinny_line::activesub, ast_copy_string(), ast_format_cap_append_from_cap(), AST_LIST_EMPTY, AST_LIST_FIRST, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, AST_MEDIA_TYPE_UNKNOWN, ast_mutex_init, ast_mutex_lock, ast_mutex_unlock, ast_verb, config_parse_variables(), d, default_cap, default_device, DEFAULT_SKINNY_PORT, skinny_device::lines, skinny_subchannel::list, skinny_line::lock, LOG_ERROR, LOG_NOTICE, test_val::name, NULL, skinny_device::session, skinny_device_alloc(), skinnyreload, skinny_line::sub, sub, TYPE_DEVICE, and update().

Referenced by config_load().

◆ config_line()

static struct skinny_line* config_line ( const char *  lname,
struct ast_variable v 
)
static

Definition at line 8309 of file chan_skinny.c.

8310 {
8311  struct skinny_line *l, *temp;
8312  int update = 0;
8313  struct skinny_container *container;
8314 
8315  ast_log(LOG_NOTICE, "Configuring skinny line %s.\n", lname);
8316 
8317  /* We find the old line and remove it just before the new
8318  line is created */
8319  AST_LIST_LOCK(&lines);
8320  AST_LIST_TRAVERSE(&lines, temp, all) {
8321  if (!strcasecmp(lname, temp->name) && temp->prune) {
8322  update = 1;
8323  break;
8324  }
8325  }
8326 
8327  if (!(l = skinny_line_alloc())) {
8328  ast_verb(1, "Unable to allocate memory for line %s.\n", lname);
8330  return NULL;
8331  }
8332  if (!(container = ast_calloc(1, sizeof(*container)))) {
8333  ast_log(LOG_WARNING, "Unable to allocate memory for line %s container.\n", lname);
8336  return NULL;
8337  }
8338 
8340  container->data = l;
8341  l->container = container;
8342 
8343  memcpy(l, default_line, sizeof(*default_line));
8344  ast_mutex_init(&l->lock);
8345  ast_copy_string(l->name, lname, sizeof(l->name));
8347  AST_LIST_INSERT_TAIL(&lines, l, all);
8348 
8349  ast_mutex_lock(&l->lock);
8351 
8353 
8354  if (!ast_strlen_zero(l->mailbox)) {
8355  ast_verb(3, "Setting mailbox '%s' on line %s\n", l->mailbox, l->name);
8356  l->mwi_event_sub = ast_mwi_subscribe_pool(l->mailbox, mwi_event_cb, l);
8357  }
8358 
8359  if (!ast_strlen_zero(vmexten) && ast_strlen_zero(l->vmexten)) {
8360  ast_copy_string(l->vmexten, vmexten, sizeof(l->vmexten));
8361  }
8362 
8363  ast_mutex_unlock(&l->lock);
8364 
8365  /* We do not want to unlink or free the line yet, it needs
8366  to be available to detect a device reconfig when we load the
8367  devices. Old lines will be pruned after the reload completes */
8368 
8369  ast_verb(3, "%s config for line '%s'\n", update ? "Updated" : (skinnyreload ? "Reloaded" : "Created"), l->name);
8370 
8371  return l;
8372 }
static struct skinny_line * skinny_line_destroy(struct skinny_line *l)
Definition: chan_skinny.c:1692
static struct skinny_line_options * default_line
Definition: chan_skinny.c:1498
static void mwi_event_cb(void *userdata, struct stasis_subscription *sub, struct stasis_message *msg)
Definition: chan_skinny.c:3555
static char vmexten[AST_MAX_EXTENSION]
Definition: chan_skinny.c:209
static struct skinny_line * skinny_line_alloc(void)
Definition: chan_skinny.c:1675
#define TYPE_LINE
Definition: chan_skinny.c:7789
#define SKINNY_LINECONTAINER
Definition: chan_skinny.c:1546
struct ast_mwi_subscriber * ast_mwi_subscribe_pool(const char *mailbox, stasis_subscription_cb callback, void *data)
Add an MWI state subscriber, and stasis subscription to the mailbox.
Definition: mwi.c:235
struct ao2_container * container
Definition: res_fax.c:502
struct ast_mwi_subscriber * mwi_event_sub
Definition: chan_skinny.c:1470
struct skinny_container * container
Definition: chan_skinny.c:1469

References ast_calloc, ast_copy_string(), ast_format_cap_append_from_cap(), AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, AST_MEDIA_TYPE_UNKNOWN, ast_mutex_init, ast_mutex_lock, ast_mutex_unlock, ast_mwi_subscribe_pool(), ast_strlen_zero(), ast_verb, skinny_line::confcap, config_parse_variables(), skinny_line::container, container, default_cap, default_line, skinny_line::lock, LOG_NOTICE, LOG_WARNING, mwi_event_cb(), skinny_line::mwi_event_sub, NULL, skinny_line_alloc(), skinny_line_destroy(), SKINNY_LINECONTAINER, skinnyreload, TYPE_LINE, update(), and vmexten.

Referenced by config_load().

◆ config_load()

static int config_load ( void  )
static

Definition at line 8467 of file chan_skinny.c.

8468 {
8469  int on = 1;
8470  struct ast_config *cfg;
8471  char *cat;
8472  int oldport = ntohs(bindaddr.sin_port);
8473  struct ast_flags config_flags = { 0 };
8474 
8475  ast_log(LOG_NOTICE, "Configuring skinny from %s\n", config);
8476 
8477  if (gethostname(ourhost, sizeof(ourhost))) {
8478  ast_log(LOG_WARNING, "Unable to get hostname, Skinny disabled.\n");
8479  return 0;
8480  }
8481  cfg = ast_config_load(config, config_flags);
8482 
8483  /* We *must* have a config file otherwise stop immediately */
8484  if (!cfg || cfg == CONFIG_STATUS_FILEINVALID) {
8485  ast_log(LOG_NOTICE, "Unable to load config %s, Skinny disabled.\n", config);
8486  return -1;
8487  }
8488 
8489  memset(&bindaddr, 0, sizeof(bindaddr));
8490  immed_dialchar = '\0';
8491  memset(&vmexten, '\0', sizeof(vmexten));
8492 
8493 
8494  /* Copy the default jb config over global_jbconf */
8495  memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
8496 
8497  /* load the general section */
8498  cat = ast_category_browse(cfg, "general");
8500 
8501  if (ntohl(bindaddr.sin_addr.s_addr)) {
8502  __ourip = bindaddr.sin_addr;
8503  } else {
8505  ast_log(LOG_WARNING, "Unable to get our IP address, Skinny disabled\n");
8506  ast_config_destroy(cfg);
8507  return 0;
8508  }
8509  }
8510  if (!ntohs(bindaddr.sin_port)) {
8511  bindaddr.sin_port = htons(DEFAULT_SKINNY_PORT);
8512  }
8513  bindaddr.sin_family = AF_INET;
8514 
8515  /* load the lines sections */
8517  cat = ast_category_browse(cfg, "lines");
8518  while (cat && strcasecmp(cat, "general") && strcasecmp(cat, "devices")) {
8519  config_line(cat, ast_variable_browse(cfg, cat));
8520  cat = ast_category_browse(cfg, cat);
8521  }
8522 
8523  /* load the devices sections */
8525  cat = ast_category_browse(cfg, "devices");
8526  while (cat && strcasecmp(cat, "general") && strcasecmp(cat, "lines")) {
8527  config_device(cat, ast_variable_browse(cfg, cat));
8528  cat = ast_category_browse(cfg, cat);
8529  }
8530 
8532  if ((skinnysock > -1) && (ntohs(bindaddr.sin_port) != oldport)) {
8533  close(skinnysock);
8534  skinnysock = -1;
8535  }
8536  if (skinnysock < 0) {
8537  skinnysock = socket(AF_INET, SOCK_STREAM, 0);
8538  if(setsockopt(skinnysock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
8539  ast_log(LOG_ERROR, "Set Socket Options failed: errno %d, %s\n", errno, strerror(errno));
8540  ast_config_destroy(cfg);
8542  return 0;
8543  }
8544  if (skinnysock < 0) {
8545  ast_log(LOG_WARNING, "Unable to create Skinny socket: %s\n", strerror(errno));
8546  } else {
8547  if (bind(skinnysock, (struct sockaddr *)&bindaddr, sizeof(bindaddr)) < 0) {
8548  ast_log(LOG_WARNING, "Failed to bind to %s:%d: %s\n",
8549  ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port),
8550  strerror(errno));
8551  close(skinnysock);
8552  skinnysock = -1;
8553  ast_config_destroy(cfg);
8555  return 0;
8556  }
8557  if (listen(skinnysock, DEFAULT_SKINNY_BACKLOG)) {
8558  ast_log(LOG_WARNING, "Failed to start listening to %s:%d: %s\n",
8559  ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port),
8560  strerror(errno));
8561  close(skinnysock);
8562  skinnysock = -1;
8563  ast_config_destroy(cfg);
8565  return 0;
8566  }
8567  ast_verb(2, "Skinny listening on %s:%d\n",
8568  ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
8569  ast_set_qos(skinnysock, qos.tos, qos.cos, "Skinny");
8571  }
8572  }
8574  ast_config_destroy(cfg);
8575  return 1;
8576 }
#define TYPE_DEF_LINE
Definition: chan_skinny.c:7787
static struct in_addr __ourip
Definition: chan_skinny.c:1237
static struct ast_jb_conf default_jbconf
Definition: chan_skinny.c:257
static pthread_t accept_t
Definition: chan_skinny.c:1239
static struct sockaddr_in bindaddr
Definition: chan_skinny.c:1234
static int resolve_first_addr(const char *hostname, struct in_addr *sin_addr)
Resolve the given hostname and save its IPv4 address.
Definition: chan_skinny.c:7771
static struct skinny_device * config_device(const char *dname, struct ast_variable *v)
Definition: chan_skinny.c:8374
static const char config[]
Definition: chan_skinny.c:174
static struct @126 qos
static char immed_dialchar
Definition: chan_skinny.c:208
static struct ast_jb_conf global_jbconf
Definition: chan_skinny.c:265
#define DEFAULT_SKINNY_BACKLOG
Definition: chan_skinny.c:190
#define TYPE_DEF_DEVICE
Definition: chan_skinny.c:7786
#define TYPE_GENERAL
Definition: chan_skinny.c:7785
static struct skinny_line * config_line(const char *lname, struct ast_variable *v)
Definition: chan_skinny.c:8309
static void * accept_thread(void *ignore)
Definition: chan_skinny.c:7658
static ast_mutex_t netlock
Definition: chan_skinny.c:1355
static char ourhost[256]
Definition: chan_skinny.c:1235
#define ast_config_load(filename, flags)
Load a config file.
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
Definition: extconf.c:3327
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
Definition: extconf.c:1289
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
Definition: extconf.c:1215
int ast_set_qos(int sockfd, int tos, int cos, const char *desc)
Set type of service.
Definition: netsock2.c:621
Structure used to handle boolean flags.
Definition: utils.h:199
General jitterbuffer configuration.
Definition: abstract_jb.h:70
#define ast_pthread_create_background(a, b, c, d)
Definition: utils.h:587

References __ourip, accept_t, accept_thread(), ast_category_browse(), ast_config_destroy(), ast_config_load, ast_inet_ntoa(), ast_log, ast_mutex_lock, ast_mutex_unlock, ast_pthread_create_background, ast_set_qos(), ast_variable_browse(), ast_verb, bindaddr, config, config_device(), config_line(), config_parse_variables(), CONFIG_STATUS_FILEINVALID, default_device, default_jbconf, default_line, DEFAULT_SKINNY_BACKLOG, DEFAULT_SKINNY_PORT, errno, global_jbconf, immed_dialchar, LOG_ERROR, LOG_NOTICE, LOG_WARNING, netlock, NULL, ourhost, qos, resolve_first_addr(), skinnysock, TYPE_DEF_DEVICE, TYPE_DEF_LINE, TYPE_GENERAL, and vmexten.

Referenced by load_module(), and skinny_reload().

◆ config_parse_variables()

static void config_parse_variables ( int  type,
void *  item,
struct ast_variable vptr 
)
static

Definition at line 7796 of file chan_skinny.c.

7797 {
7798  struct ast_variable *v;
7799  int lineInstance = 1;
7800  int speeddialInstance = 1;
7801  int serviceUrlInstance = 1;
7802 
7803  while(vptr) {
7804  v = vptr;
7805  vptr = vptr->next;
7806 
7807  if (type & (TYPE_GENERAL)) {
7808  char newcontexts[AST_MAX_CONTEXT];
7809  char oldcontexts[AST_MAX_CONTEXT];
7810  char *stringp, *context, *oldregcontext;
7811  if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) {
7812  v = v->next;
7813  continue;
7814  }
7815  if (!strcasecmp(v->name, "bindaddr")) {
7816  if (resolve_first_addr(v->value, &bindaddr.sin_addr)) {
7817  ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
7818  }
7819  continue;
7820  } else if (!strcasecmp(v->name, "keepalive")) {
7821  keep_alive = atoi(v->value);
7822  continue;
7823  } else if (!strcasecmp(v->name, "authtimeout")) {
7824  int timeout = atoi(v->value);
7825 
7826  if (timeout < 1) {
7827  ast_log(LOG_WARNING, "Invalid authtimeout value '%s', using default value\n", v->value);
7829  } else {
7830  auth_timeout = timeout;
7831  }
7832  continue;
7833  } else if (!strcasecmp(v->name, "authlimit")) {
7834  int limit = atoi(v->value);
7835 
7836  if (limit < 1) {
7837  ast_log(LOG_WARNING, "Invalid authlimit value '%s', using default value\n", v->value);
7839  } else {
7840  auth_limit = limit;
7841  }
7842  continue;
7843  } else if (!strcasecmp(v->name, "regcontext")) {
7844  ast_copy_string(newcontexts, v->value, sizeof(newcontexts));
7845  stringp = newcontexts;
7846  /* Initialize copy of current global_regcontext for later use in removing stale contexts */
7847  ast_copy_string(oldcontexts, regcontext, sizeof(oldcontexts));
7848  oldregcontext = oldcontexts;
7849  /* Let's remove any contexts that are no longer defined in regcontext */
7850  cleanup_stale_contexts(stringp, oldregcontext);
7851  /* Create contexts if they don't exist already */
7852  while ((context = strsep(&stringp, "&"))) {
7853