You can restrict the calls coming on asterisk on SIP by ip address.
IE you can restrict the DTMF, Reinvites settings, Codec Settings.
For Example, for the calls coming to your asterisk from didx.org you can use the following settings in your sip.conf file
Path for sip.conf is
/etc/asterisk/sip.conf
[66.98.180.77]
host = 66.98.180.77
type = peer
insecure = very
disallow=all
allow= ulaw
context = default
canreinvite=no
The above will restrict all the calls coming from didx on your ip address, to Ulaw, and will close re-direct to your user directly
(canreinvite=no)
http://www.voip-info.org/wiki/index.php?page=Asterisk+sip+permit-deny-mask
Asterisk sip permit-deny-mask
* Edit
* History
IP address mask for SIP traffic
In a user/peer definition in sip.conf, you may limit SIP traffic to and from this peer to a certain IP or network
Syntax:
permit=<ipaddress>/<network mask>
deny=<ipaddress>/<network mask>
Order Matters! – The last matching rule is the one used. If no rule matches, then the connection is permitted.
Examples:
deny=192.168.40.38/255.255.255.255
Denies traffic from this IP address
permit=192.168.40.0/255.255.255.0
Allows traffic from this network
deny=0.0.0.0/0.0.0.0
permit=216.207.245.47/255.255.255.255
Deny every address except for the only one allowed.
You may have multiple rules for masking traffic. Rules are processed from the first to the last.