Name
	smsc mproc add

SYNOPSIS
	- General case (for customized mproc rules):
	smsc mproc add <class name> <id> <parameters list>

	- Default mproc rules implementation (<class name> is "mproc"):
	smsc mproc add mproc <id> networkidmask <networkId value> originnetworkidmask <networkId
	value> receiptnetworkidmask <networkId value> desttonmask <destination type of number>
	destnpimask <destination numbering plan	indicator>
	destdigmask <regular expression - destination number digits mask> sourcetonmask
	<source type of number> sourcenpimask <source numbering plan indicator> 
	sourcedigmask <regular expression - source number digits mask>
	imsidigitsmask <regular expression - imsi digits mask> nnndigitsmask <regular expression
	- NetworkNodeNumber digits mask> originatingmask <SS7_MO | SS7_HR | SMPP | SIP | HTTP |
	-1> origesmenamemask <regualar expression - origination ESME name mask>
	originatorsccpaddressmask <originator SCCP CallingPartyAddress mask> processingtype
	<delivery processing type: SS7_SRI | SS7_MT | SMPP | SIP | -1> errorcode <internal SMSC
	GW delivery error code value> tlv_<tlv tag key>_<tlv value type> <tlv value> percent 
	<percent value> newnetworkid <new networkId value> newdestton <new destination type of
	number> newdestnpi <new destination numbering plan indicator> adddestdigprefix <prefix
	value> addsourcedigprefix <prefix value> newsourceton <new source type of number>
	newsourcenpi <new source numbering plan indicator> newsourceaddr <new source address value> 
	newmtgt <new gt for mt message> newmttt <new tt for mt message> makecopy <false | true> 
	hrbypass <false | true> dropaftersri <false | true> newnetworkidaftersri <networkId value> 
	dropaftertempfail <false | true> newnetworkidaftertempfail <networkId value> droponarrival
	<false | true> rejectonarrival <NONE | DEFAULT | UNEXPECTED_DATA_VALUE | SYSTEM_FAILURE
	| THROTTLING | FACILITY_NOT_SUPPORTED> remove_tlv <tlv tag key>

DESCRIPTION
	This command is used to configure a new Message Processing Rule. If several mproc 
	rules match's with a message then all of them will be applied in ascending order of id field.

	There are several mproc rules triggers at which different actions may be applied.
	Here a trigger list in the orders rules are usually applied during of a SMS life cycle:
	- HrSri - in HR procedure after SRI response from a local HLR has been received
	- Arrival - after a message has arrived before invoking of Diameter interface and storing
	            to database / delivering
	- PreDelivery - when SMSC GW is going to route a message to some destination just before
	                a delivery attempt 
	- ImsiRequest - in MT procedure after SRI response from a subscriber's HLR has been received
	- DeliveryTempFailure - just after a message delivery failure with a temporary reason
	- Delivery - just after a message delivery success or failure with a permanent reason

	If routing is to be based only on mproc rules, its mandatory to specify for each ESME, SIP and
	SS7 GT its own networkId (all networkId are different) and specify a full set of mproc rules
	for changing of networkId. After the networkId has changed the message will be routed to the
	ESME / SIP / SS7 that belongs to the networkId. SMPP / SIP should be configured in this case
	so that they accepts all message that has been routed to their networkId. It is possible also]
	to have several ESME / SIP in one networkId subnetwork. Then inside the subnetwork all message
	will be routed based on ESME / SIP routingAddressRange value.

PARAMETERS

	Standard Parameters

	class name      - the name of class of mproc rules implementation. For the
	                default implementation (that is described here) class name is "mproc".
	id				- A unique id for this message processing rule. Rules are 
					sorted in ascending order based on this id. All the matching
					rules are applied.

	Optional Parameters

	- conditions

	networkidmask	- Rule will be applied only if a target SMS is in processing now in a networkId
					area that is equal to networkidmask (messages's networkId value is networkidmask).
					Set value to -1 as wild card to match all the network id's. Default value is -1.  	

	originnetworkidmask - Rule will be applied only if a target SMS has come to SMSC GW via networkId
					area with this rule's originnetworkidmask. Set value to -1 as wild card to match all 
					the network id's. Default value is -1.

	receiptnetworkidmask - Rule will be applied only if
					a) a message is a delivery receipt,
					b) the delivery receipt is recognized by SMSC GW
					c) an original message for the delivery receipt is found
					d) networkId of the original message == receiptnetworkidmask 
					Set value to -1 as wild card to match all the network id's. Default value is -1.

	desttonmask		- Rule will be applied only if destination type of number (TON) 
					of target SMS match's with this rule's desttonmask. Set value 
					to -1 as wild card to match all the TON. Valid values of TON are
						0 : Unknown
						1 : International
						2 : National
						3 : Network Specific
						4 : Subscriber
						5 : Alphanumeric
						6 : Abbreviated
						7 : Reserved
					Default value is -1.

	destnpimask		- Rule will be applied only if destination number plan indicator 
					(NPI) of target SMS match's with this rule's destnpimask. Set value 
					to -1 as wild card to match all the NPI. Valid values of TON are
						0  : Unknown
						1  : ISDN (E163/E164)
						3  : Data (X.121)
						4  : Telex (F.69)
						6  : Land Mobile (E.212)
						8  : National
						9  : Private
						10 : ERMES
						14 : Internet
						18 : WAP Client Id
					Default value is -1.

	destdigmask 	- Rule will be applied only if destination number of target SMS match's 
					with this rule's destdigmask. destdigmask is java regular expression. Set
					value to null or -1 as wild card to match all the digits of target SMS 
					destination. Default value is -1.

	sourcetonmask		- Rule will be applied only if source type of number (TON) 
					of target SMS match's with this rule's sourcetonmask. Set value 
					to -1 as wild card to match all the TON. Valid values of TON are
						0 : Unknown
						1 : International
						2 : National
						3 : Network Specific
						4 : Subscriber
						5 : Alphanumeric
						6 : Abbreviated
						7 : Reserved
					Default value is -1.

	sourcenpimask		- Rule will be applied only if source number plan indicator 
					(NPI) of target SMS match's with this rule's sourcenpimask. Set value 
					to -1 as wild card to match all the NPI. Valid values of TON are
						0  : Unknown
						1  : ISDN (E163/E164)
						3  : Data (X.121)
						4  : Telex (F.69)
						6  : Land Mobile (E.212)
						8  : National
						9  : Private
						10 : ERMES
						14 : Internet
						18 : WAP Client Id
					Default value is -1.

	sourcedigmask 	- Rule will be applied only if source number of target SMS match's 
					with this rule's sourcedigmask. sourcedigmask is java regular expression. Set
					value to null or -1 as wild card to match all the digits of target SMS 
					source. Default value is -1.

	imsidigitsmask  - Rule will be applied only if IMSI value was obtained after SRI request
					(during MT or HR procedure) and it match's with this rule's imsidigitsmask.
					imsidigitsmask is java regular expression. Set value to null or -1 as
					wild card to match all the digits of IMSIs. Default value is -1.

	nnndigitsmask   - Rule will be applied only if NNN (NetworkNodeNumber of VLR to where a
					subscriber is registered) value was obtained after SRI request
					(during MT or HR procedure) and it match's with this rule's nnndigitsmask.
					nnndigitsmask is java regular expression. Set value to null or -1 as
					wild card to match all the digits of IMSIs. Default value is -1.

	originatingmask	- Rule will be applied only if target SMS is originated from channel 
					as specified by originatingmask. Set value to -1 as wild card to match all 
					the origination type. Valid values are 
						SMPP
						SS7_MO
						SS7_HR
						SIP
						HTTP
					Default value is -1.

	origesmenamemask - Rule will be applied only if target SMS is originated from SMPP channel
					(ESME) and who's name match's with originating ESME name mask (Java Regular
					Expression). Set -1 as wild card to match all the ESME. Default value is -1.

	originatorsccpaddressmask - Rule will be applied only if target SMS is originated from SS7
					channel (MO or HR procedures) and CallingPartyAddress digits match's 
					with this rule's originatorsccpaddressmask. originatorsccpaddressmask is java
					regular expression. Set value to null or -1 as wild card to match all the digits
					of CallingPartyAddress digits. Default value is -1.

	processingtype   - Rule will be applied only if a Delivery step match's with this rule's
					processingtype value. Value -1 will match all steps. Default value is -1.
					Possible values are:
						SMPP    - delivery via SMPP channel
						SS7_SRI - sending of SRI request to HLR
						SS7_MT  - MT delivery to SS7 network
						SIP     - delivery via SIP channel

	errorcode        - Rule will be applied only if an internal SMSC GW's delivery error code value
					match's with this rule's errorcode. Value 0 means a successful delivery,
					non 0 value means some delivery error. You can specify several values via comma
					(example: "6,7,8"). Value -1 will match any error code. Default value is -1.
					A list of error code values can be found here:
					https://github.com/RestComm/smscgateway/blob/master/core/smsc-common-library/src/main/java/org/mobicents/smsc/library/ErrorCode.java

	tlv_<value type>_<tag key> - Rule will be applied only if message contains an optional parameter
					with tag is equal <tag key> and has a tag value with a type which equals the <value type>
					and a value which equals the value set here. Value -1 will match any optional parameter.
					Possible values for <value type> are
						string
						int
						byte
					Default value for <tag key> is -1.
					Default value for <value type> is string.
					Default value for <tag value> is -1.

	percent			- Once rule matches, this parameter will define the probability with which this rule will 
					be applied. 
					Default value is -1. 

	- actions

	newnetworkid	- Once rule match's, the target SMS's network id will be change to one set here. 
					This will allow to received SMS from different network and terminate on different
					network. Set this to -1 to keep original network id. Default value is -1.
					This action is for Arrival trigger.

	newdestton		- Once rule match's, the target SMS's destination type of number(TON) will be 
					changed to one set here. Set this to -1 to keep original TON. Default value is -1.
					This action is for Arrival trigger.
					
	newdestnpi		- Once rule match's, the target SMS's destination number plan indicator (NPI) will 
					be changed to one set here. Set this to -1 to keep original NPI. Default value is -1.
					This action is for Arrival trigger.
					
	adddestdigprefix - Once rule match's, the target SMS's destination number will be prefixed with 
					adddestdigprefix set here. Set this to -1 or null to keep original destination number. 
					Default value is -1.
					This action is for Arrival trigger.

	addsourcedigprefix  - Once rule match's, the source SMS's source number will be prefixed with 
					addsourcedigprefix set here. Set this to -1 or null to keep original source number. 
					Default value is -1.
					This action is for Arrival trigger.

	newsourceton		- Once rule match's, the target SMS's source type of number(TON) will be 
					changed to one set here. Set this to -1 to keep original TON. Default value is -1.
					This action is for Arrival trigger.
					
	newsourcenpi		- Once rule match's, the target SMS's source number plan indicator (NPI) will 
					be changed to one set here. Set this to -1 to keep original NPI. Default value is -1.
					This action is for Arrival trigger.
					
	newsourceaddr		- Once rule match's, the target SMS's source number will be changed to one set here. 
					Set this to -1 or null to keep original source number. 
					Default value is -1.
					This action is for Arrival trigger.
					
	newmtgt			- Once rule matches, the target SMS's destination global title (GT) will be 
					changed to one set with this command. Set this to -1 to keep original GT. Default value is "-1".
					This action is for Arrival trigger.
					
	newmttt			- Once rule matches, the target SMS's destination translation type (TT) will be 
					changed to one set with this command. Set this to -1 to keep original TT. Default value is -1.
					This action is for Arrival trigger.
					
	makecopy		- Once rule match's, and makecopy is set to true, a new copy of SMS is created. If new 
					SMS is created all above parameters like networkidmask, newnetworkid, newdestton, 
					newdestnpi, adddestdigprefix will be applied to the new SMS copy.																		  
					Default value is false.
					This action is for Arrival trigger.

	hrbypass        - Once rule match's inside Home Routing procedure after SMSC GW receives a response
					from a local HLR then SMSC GW will bypass HR procedure by sending back to an original
					SMSC GW origin original IMSI and NNN. 
					Default value is false.
					This action is for HrSri trigger.

	dropaftersri    - Once rule match's and if a MAP SRI success response is received, message will be
					dropped without delivery attempt. A delivery response in this case will contain extra
					fields (IMSI and NetworkNodeNumber values). This action is applied only for SMS that
					are attempted to be delivered to SS7 network. 
					Default value is false.
					This action is for ImsiRequest trigger.

	newnetworkidaftersri - Once rule match's and if a MAP SRI success response is received, message will
					be rerouted for delivery to another networkId. This action is applied only for SMS
					that are attempted to be delivered to SS7 network. Set this to -1 to to avoid of
					message rerouting in this step. Default value is -1.
					This action is for ImsiRequest trigger.

	newnetworkidafterpermfail - Once rule match's and if a message delivery has failed permanently,
					message will be rerouted for delivery to another networkId. Set this to -1 to to avoid
					of message rerouting in this step. Default value is -1.
					This action is for Delivery trigger.

	dropaftertempfail - Once rule match's and if a message delivery has failed temporary, message will be
					dropped without new delivery attempts.
					Default value is false.
					This action is for DeliveryTempFailure trigger.

	newnetworkidaftertempfail - Once rule match's and if a message delivery has failed temporary, message
					will be rerouted for delivery to another networkId. Set this to -1 to to avoid
					of message rerouting in this step. Default value is -1.
					This action is for DeliveryTempFailure trigger.
					
	droponarrival   - Once message is accepted by SMSC GW server and if rule matches, message will be 
					dropped without delivery attempt. 
					In this case a success response will be returned to a message originator. 
					Default value is false.
					This action is for Arrival trigger.

	rejectonarrival - Once message is accepted by SMSC GW and if rule matches, message will be 
					rejected without delivery attempt. 
					A reject response will be returned to a message originator. 
					Valid values are NONE, DEFAULT, UNEXPECTED_DATA_VALUE, SYSTEM_FAILURE, THROTTLING,
					FACILITY_NOT_SUPPORTED.
					Default value is NONE.
					This action is for Arrival trigger.

	remove_tlv 		- Once rule match's, the target SMS's optional parameter which matches the one set here
					will be removed. Set this to -1 not to remove any optional parameter. Default value is -1.
					This action is for Arrival trigger.
	
SEE ALSO
	smsc mproc modify, smsc mproc remove, smsc mproc show
