-
-
Notifications
You must be signed in to change notification settings - Fork 72
Dialplan Functions
We have added new dialplan function SCCPDevice(), SCCPLine() and SCCPChannel() to provide the ability to ask information about sccp device, sccp lines and sccp channels.
Previous dialplan functions SCCPSetCalledParty, SCCPSetMessage remain the same. SCCPSetCodec is now deprecated and should not be used anymore.
Note: Asterisk Dialplan Function Names are CAPS Sensitive, so make sure to check the spelling and caps.
Usage: SCCPDevice([deviceId|current],[option]);
the first param can be either "current" or a device ID like "SEP????????????"
the second param defines the information to be retrieved and can be on of these: ip, id, status, description, config_type, skinny_type, tz_offset, image_version, accessory_status, registration_state codecs, state, lines_registered, lines_count, last_number, capability, early_rtp, channel_count, supported_protocol_version used_protocol_version, mwi_light, dynamic|realtime, active_channel, transfer_channel, conference_channel, current_line button_config, pending_update, pending_delete, chanvar[varname], codec[codecname]
Within the dialplan you can use the function SCCPDevice to retrieve information about an SCCP Device like this:
Set(my_ip=${SCCPDevice(current,ip)}); Set(my_id=${SCCPDevice(current,id)}); Set(my_codecs=${SCCPDevice(current,codecs)}); Set(my_codec_g792=${SCCPDevice(current,codec[g792])}); Set(my_button_config=${SCCPDevice(current,button_config)}); Set(other_button_config=${SCCPDevice(SEP001122334455,button_config)});
to put the information of a/the device in a dialplan variable.
You can also use the Asterisk Hash Functionality to retrieve multiple keys in one call to SCCPDevice(), like this:
Set(HASH(_SCCP_DEV)=${SCCPDevice(current,id,description,ip,button_config,codecs,codec[2])}); Noop(Keys: ${HASHKEYS(SCCP_DEV)}); Noop(Id: ${HASH(SCCP_DEV,id)}); Noop(Desc: ${HASH(SCCP_DEV,description)}); Noop(Ip: ${HASH(SCCP_DEV,ip)}); Noop(button_config: ${HASH(SCCP_DEV,button_config)}); Noop(codecs: ${HASH(SCCP_DEV,codecs)}); Noop(codec[2]: ${HASH(SCCP_DEV,codec[2])});
Usage: SCCPLine([current|parent|linename],[option]);
the first param can be either "current", "parent" or a line name assigned to the line. "parent" refers to the line who forwarded the call to you and is only filled if this channel has been forwarded.
the second param defines the information to be retrieved and can be on of these: id, name, description, label, vmnum, trnsfvm, meetme, meetmenum, meetmeopts, context, language, accountcode, musicclass, amaflags, callgroup, pickupgroup, cid_name, cid_num, incoming_limit, channel_count, dynamic|realtime, pending_delete, pending_update, regexten, regcontext, adhoc_number, newmsgs, oldmsgs, num_lines, lines, chanvar[varname]
Within the dialplan you can use the function SCCPLine to retrieve information about an SCCP Line like this:
Set(my_line_name=${SCCPDevice(current,name)}); Set(my_line_descr=${SCCPLine(current,description)}); Set(my_line_devices=${SCCPLine(current,devices)}); Set(parent_line_id=${SCCPLine(parent,id)}); Set(other_line_id=${SCCPLine(98011,id)}); Set(other_line_devices=${SCCPLine(98011,devices)});
to put the information of a/the line in a dialplan variable.
You can also use the Asterisk Hash Functionality to retrieve multiple keys in one call to SCCPLine(), see above for an example.
Usage: SCCPChannel([current|callid],[option]);
the first param can be either "current" or a callid assigned to the channel.
the second param defines the information to be retrieved and can be on of these: callid, format, isCodecFix, codecs, capability, calledPartyName, calledPartyNumber, callingPartyName, callingPartyNumber originalCallingPartyName, originalCallingPartyNumber, originalCalledPartyName, originalCalledPartyNumber, lastRedirectingPartyName lastRedirectingPartyNumber, cgpnVoiceMailbox, cdpnVoiceMailbox, originalCdpnVoiceMailbox, lastRedirectingVoiceMailbox, passthrupartyid, state, previous_state, calltype, ringtype, dialed_number, device, line, answered_elsewhere, privacy, monitorEnabled, parent
De carefull with SCCPCHANNEL, When calling this you must provide a valid SCCP Channel. So check if the channel is of type SCCP before calling this function !
Within the dialplan you can use the function SCCPChannel to retrieve information about an SCCP channel like this:
Set(my_channel_callid=${SCCPChannel(current,callid)}); Set(my_channel_device=${SCCPChannel(current,device)}); Set(my_channel_line=${SCCPChannel(current,line)}); Set(my_channel_capability=${SCCPChannel(current,capability)}); Set(my_channel_called=${SCCPChannel(current,calledPartyName)}); Set(my_channel_calling=${SCCPChannel(current,callingPartyName)}); Set(my_channel_state=${SCCPChannel(current,state)}); Set(my_channel_calltype=${SCCPChannel(current,calltype)}); Set(my_channel_dialed_number=${SCCPChanell(current,dialed_number)}); Set(other_channel_dialed_number=${SCCPChannel(4,dialed_number)});
to put the information of the/a channel in a dialplan variable.
You can also use the Asterisk Hash Functionality to retrieve multiple keys in one call to SCCPLine(), see above for an example.
Usage: SCCPSetCalledParty("Name" )
Sets the name and number of the called party for use with chan_sccp.
Usage: SCCPSetMessage("Message"[,timeout])
Send a Message to the Calling Device (and remove after timeout, if timeout is omitted will stay until next/empty message).
Is now deprecated. Please use asterisk's 'Set(CHANNEL(codec)=%s)' instead.
Also See: Dialplan
- Getting-started
- Building and Installation Guide
- How to setup the chan_sccp Module
- Frequently Asked Questions
- Features
- Optional Features
- Troubleshooting
- GUI Frontend:
- Other:
- Sample device configs
- Configuration Hints and Tips
- Interesting/Remote Links
- Chan-SCCP developers
Guidelines: