Hangup an incoming PJSIP channel with a SIP response code
		
		
			
				May be one of...
				
				A numeric response code in the range 400 ->699
				A response code name from
				third-party/pjproject/source/pjsip/include/pjsip/sip_msg.h
				such as USE_IDENTITY_HEADER or 
				PJSIP_SC_USE_IDENTITY_HEADER
				
			
		
		
			
			Hangs up an incoming PJSIP channel and returns the
			specified SIP response code in the final response to the caller.
			
			
			
			
			This function must be called BEFORE anything that
			might cause any other final (non 1XX) response to be sent.
			For example calling Answer() or
			Playback without the
			noanswer option will cause the call
			to be answered and a final 200 response to be sent.
			
			
			
			As with the Hangup application, 
			the dialplan will terminate after calling this function.
			
			
			The cause code set on the channel will be translated to
			a standard ISDN cause code using the table defined in
			ast_sip_hangup_sip2cause() in res_pjsip.c
			
			
			
			same = n,PJSIPHangup(437)
			
			
			same = n,PJSIPHangup(UNSUPPORTED_CERTIFICATE)
			
			
			same = n,ExecIf($[${SOMEVALUE} = ${SOME_BAD_VALUE}]?PJSIPHangup(437))
			
		
	
	
		
			Hangup an incoming PJSIP channel with a SIP response code
		
		
			
			
			
		
		
			
			Hangs up an incoming PJSIP channel and returns the
			specified SIP response code in the final response to the caller.
			
			
			
			
			This function must be called BEFORE anything that
			might cause any other final (non 1XX) response to be sent.
			For example calling Answer() or
			Playback without the
			noanswer option will cause the call
			to be answered and a final 200 response to be sent.
			
			
			
			The cause code set on the channel will be translated to
			a standard ISDN cause code using the table defined in
			ast_sip_hangup_sip2cause() in res_pjsip.c
			
			
			
			Action: PJSIPHangup
			ActionID: 12345678
			Channel: PJSIP/alice-00000002
			Cause: 437
			
			
			Action: PJSIPHangup
			ActionID: 12345678
			Channel: PJSIP/alice-00000002
			Cause: UNSUPPORTED_CERTIFICATE
			
		
	
	
		
			Return a dial string for dialing all contacts on an AOR.
		
		
			
				Name of the endpoint
			
			
				Name of an AOR to use, if not specified the configured AORs on the endpoint are used
			
			
				Optional request user to use in the request URI
			
		
		
			Returns a properly formatted dial string for dialing all contacts on an AOR.
		
	
	
		
			Media and codec offerings to be set on an outbound SIP channel prior to dialing.
		
		
			
				types of media offered
			
		
		
			When read, returns the codecs offered based upon the media choice.
			When written, sets the codecs to offer when an outbound dial attempt is made,
			or when a session refresh is sent using PJSIP_SEND_SESSION_REFRESH.
			
		
		
			[PJSIP_SEND_SESSION_REFRESH]
		
	
	
		
			13.18.0
			14.7.0
			15.1.0
			16.0.0
		
		
			Get or change the DTMF mode for a SIP call.
		
		
		
		
			When read, returns the current DTMF mode
			When written, sets the current DTMF mode
			This function uses the same DTMF mode naming as the dtmf_mode configuration option
		
	
	
		
			Get or change the on-hold behavior for a SIP call.
		
		
		
		
			When read, returns the current moh passthrough mode
			When written, sets the current moh passthrough mode
			If yes, on-hold re-INVITEs are sent. If no, music on hold is generated.
			This function can be used to override the moh_passthrough configuration option
		
	
	
		
			13.12.0
			14.1.0
			15.0.0
		
		
			W/O: Initiate a session refresh via an UPDATE or re-INVITE on an established media session
		
		
			
				The type of update to send. Default is invite.
				
					
						Send the session refresh as a re-INVITE.
					
					
						Send the session refresh as an UPDATE.
					
				
			
		
		
			This function will cause the PJSIP stack to immediately refresh
			the media session for the channel. This will be done using either a
			re-INVITE (default) or an UPDATE request.
			
			This is most useful when combined with the PJSIP_MEDIA_OFFER
			dialplan function, as it allows the formats in use on a channel to be
			re-negotiated after call setup.
			
				The formats the endpoint supports are not
				checked or enforced by this function. Using this function to offer
				formats not supported by the endpoint may result
				in a loss of media.
			
			
			 ; Within some existing extension on an answered channel
			 same => n,Set(PJSIP_MEDIA_OFFER(audio)=!all,g722)
			 same => n,Set(PJSIP_SEND_SESSION_REFRESH()=invite)
			
		
		
			[PJSIP_MEDIA_OFFER]
		
	
	
		
			13.24.0
			16.1.0
			17.0.0
		
		
			Parse an uri and return a type part of the URI.
		
		
			
				URI to parse
			
			
				The type parameter specifies which URI part to read
				
					
						Display name.
					
					
						URI scheme.
					
					
						User part.
					
					
						Password part.
					
					
						Host part.
					
					
						Port number, or zero.
					
					
						User parameter.
					
					
						Method parameter.
					
					
						Transport parameter.
					
					
						TTL param, or -1.
					
					
						Loose routing param, or zero.
					
					
						Maddr param.
					
				
			
		
		
			Parse an URI and return a specified part of the URI.
		
	
	
		
			
				R/O Retrieve media related information.
				
					When rtp is specified, the
					type parameter must be provided. It specifies
					which RTP parameter to read.
					
						
							Retrieve the local address for RTP.
						
						
							Retrieve the remote address for RTP.
						
						
							If direct media is enabled, this address is the remote address
							used for RTP.
						
						
							Whether or not the media stream is encrypted.
							
								
									The media stream is not encrypted.
								
								
									The media stream is encrypted.
								
							
						
						
							Whether or not the media stream is currently restricted
							due to a call hold.
							
								
									The media stream is not held.
								
								
									The media stream is held.
								
							
						
					
				
				
					When rtp is specified, the
					media_type parameter may be provided. It specifies
					which media stream the chosen RTP parameter should be retrieved
					from.
					
						
							Retrieve information from the audio media stream.
							If not specified, audio is used
							by default.
						
						
							Retrieve information from the video media stream.
						
					
				
			
			
				R/O Retrieve RTCP statistics.
				
					When rtcp is specified, the
					statistic parameter must be provided. It specifies
					which RTCP statistic parameter to read.
					
						
							Retrieve a summary of all RTCP statistics.
							The following data items are returned in a semi-colon
							delineated list:
							
								
									Our Synchronization Source identifier
								
								
									Their Synchronization Source identifier
								
								
									Our lost packet count
								
								
									Received packet jitter
								
								
									Received packet count
								
								
									Transmitted packet jitter
								
								
									Transmitted packet count
								
								
									Remote lost packet count
								
								
									Round trip time
								
								
									Transmitted Media Experience Score
								
								
									Received Media Experience Score
								
							
						
						
							Retrieve a summary of all RTCP Jitter statistics.
							The following data items are returned in a semi-colon
							delineated list:
							
								
									Our minimum jitter
								
								
									Our max jitter
								
								
									Our average jitter
								
								
									Our jitter standard deviation
								
								
									Their minimum jitter
								
								
									Their max jitter
								
								
									Their average jitter
								
								
									Their jitter standard deviation
								
							
						
						
							Retrieve a summary of all RTCP packet loss statistics.
							The following data items are returned in a semi-colon
							delineated list:
							
								
									Our minimum lost packets
								
								
									Our max lost packets
								
								
									Our average lost packets
								
								
									Our lost packets standard deviation
								
								
									Their minimum lost packets
								
								
									Their max lost packets
								
								
									Their average lost packets
								
								
									Their lost packets standard deviation
								
							
						
						
							Retrieve a summary of all RTCP round trip time information.
							The following data items are returned in a semi-colon
							delineated list:
							
								
									Minimum round trip time
								
								
									Maximum round trip time
								
								
									Average round trip time
								
								
									Standard deviation round trip time
								
							
						
						
							Retrieve a summary of all RTCP Media Experience Score information.
							The following data items are returned in a semi-colon
							delineated list:
							
								
									Minimum MES based on us analysing received packets.
								
								
									Maximum MES based on us analysing received packets.
								
								
									Average MES based on us analysing received packets.
								
								
									Standard deviation MES based on us analysing received packets.
								
								
									Minimum MES based on data we get in Sender and Receiver Reports sent by the remote end
								
								
									Maximum MES based on data we get in Sender and Receiver Reports sent by the remote end
								
								
									Average MES based on data we get in Sender and Receiver Reports sent by the remote end
								
								
									Standard deviation MES based on data we get in Sender and Receiver Reports sent by the remote end
								
							
						
						Transmitted packet count
						Received packet count
						Transmitted packet jitter
						Received packet jitter
						Their max jitter
						Their minimum jitter
						Their average jitter
						Their jitter standard deviation
						Our max jitter
						Our minimum jitter
						Our average jitter
						Our jitter standard deviation
						Transmitted packet loss
						Received packet loss
						Their max lost packets
						Their minimum lost packets
						Their average lost packets
						Their lost packets standard deviation
						Our max lost packets
						Our minimum lost packets
						Our average lost packets
						Our lost packets standard deviation
						Round trip time
						Maximum round trip time
						Minimum round trip time
						Average round trip time
						Standard deviation round trip time
						Our Synchronization Source identifier
						Their Synchronization Source identifier
						
						Current MES based on us analyzing rtt, jitter and loss
						in the actual received RTP stream received from the remote end.
						I.E.  This is the MES for the incoming audio stream.
						
						
						Current MES based on rtt and the jitter and loss values in
						RTCP sender and receiver reports we receive from the
						remote end. I.E.  This is the MES for the outgoing audio stream.
						
						Max MES based on data we get in Sender and Receiver Reports sent by the remote end
						Min MES based on data we get in Sender and Receiver Reports sent by the remote end
						Average MES based on data we get in Sender and Receiver Reports sent by the remote end
						Standard deviation MES based on data we get in Sender and Receiver Reports sent by the remote end
						Max MES based on us analyzing the received RTP stream
						Min MES based on us analyzing the received RTP stream
						Average MES based on us analyzing the received RTP stream
						Standard deviation MES based on us analyzing the received RTP stream
					
				
				
					When rtcp is specified, the
					media_type parameter may be provided. It specifies
					which media stream the chosen RTCP parameter should be retrieved
					from.
					
						
							Retrieve information from the audio media stream.
							If not specified, audio is used
							by default.
						
						
							Retrieve information from the video media stream.
						
					
				
			
			
				R/O The name of the endpoint associated with this channel.
				Use the PJSIP_ENDPOINT function to obtain
				further endpoint related information.
			
			
				R/O The name of the contact associated with this channel.
				Use the PJSIP_CONTACT function to obtain
				further contact related information. Note this may not be present and if so
				is only available on outgoing legs.
			
			
				R/O The name of the AOR associated with this channel.
				Use the PJSIP_AOR function to obtain
				further AOR related information. Note this may not be present and if so
				is only available on outgoing legs.
			
			
				R/O Obtain information about the current PJSIP channel and its
				session.
				
					When pjsip is specified, the
					type parameter must be provided. It specifies
					which signalling parameter to read.
					
						
							The SIP call-id.
						
						
							Whether or not the signalling uses a secure transport.
							
								The signalling uses a non-secure transport.
								The signalling uses a secure transport.
							
						
						
							The contact URI where requests are sent.
						
						
							The local URI.
						
						
							Tag in From header
						
						
							The remote URI.
						
						
							Tag in To header
						
						
							The request URI of the incoming INVITE
							associated with the creation of this channel.
						
						
							The current state of any T.38 fax on this channel.
							
								T.38 faxing is disabled on this channel.
								Asterisk has sent a re-INVITE to the remote end to initiate a T.38 fax.
								The remote end has sent a re-INVITE to Asterisk to initiate a T.38 fax.
								A T.38 fax session has been enabled.
								A T.38 fax session was attempted but was rejected.
							
						
						
							On inbound calls, the full IP address and port number that
							the INVITE request was received on. On outbound
							calls, the full IP address and port number that the INVITE
							request was transmitted from.
						
						
							On inbound calls, the full IP address and port number that
							the INVITE request was received from. On outbound
							calls, the full IP address and port number that the INVITE
							request was transmitted to.
						
					
				
			
		
	
	
		
			; Log the current Call-ID
			same => n,Log(NOTICE, ${CHANNEL(pjsip,call-id)})
	
			; Log the destination address of the audio stream
			same => n,Log(NOTICE, ${CHANNEL(rtp,dest)})
	
			; Store the round-trip time associated with a
			; video stream in the CDR field video-rtt
			same => n,Set(CDR(video-rtt)=${CHANNEL(rtcp,rtt,video)})