SIP Registration on asterisk - asterisk

Remote computer with static ip trying to register on my asterisk(1.8).
peer settings:
[remotepeer]
type = peer
host = dynamic
insecure = port,invite
context = remotepeer-Inbound
directmedia = no
dtmfmode = rfc2833
callcounter = yes
nat = no
contactpermit=1.1.1.1/32
permit=1.1.1.0/24
username = remotepeer
secret = remotepeerpass
When the peer is registering i got:
[Apr 13 10:15:55] WARNING[23037]: chan_sip.c:14609 parse_register_contact: Domain '1.1.1.1:5060' disallowed by contact ACL (violating IP 1.1.1.1)
[Apr 13 10:15:55] WARNING[23037]: chan_sip.c:15394 register_verify: Registration denied because of contact ACL`
When I set dynamic_exclude_static = no the peer is registering.
I dont want to allow registration from any IP.
How to set dynamic_exclude_static = yes and allow the registration for peer(ip of that peer is fixed)?

You have host=dynamic ... have you tried host = 1.1.1.1, since you don't want dynamic registrations anyway?

Related

RabbitMQ SSL Configuration: DotNet Client

I am trying to connect (dotnet client) to RabbitMQ. I enabled the Peer verification option from the RabbitMQ config file.
_factory = new ConnectionFactory
{
HostName = Endpoint,
UserName = Username,
Password = Password,
Port = 5671,
VirtualHost = "/",
AutomaticRecoveryEnabled = true
};
sslOption = new SslOption
{
Version = SslProtocols.Tls12,
Enabled = true,
AcceptablePolicyErrors = System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors
| System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch,
ServerName = "", // ?
Certs = X509CertCollection
}
Below are my client certification details which I am passing through "X509CertCollection".
CertSubject: CN=myhostname, O=MyOrganizationName, C=US // myhostname is the name of my client host.
So, if I pass "myhostname" value into sslOption.ServerName, it works. If I pass some garbage value, it still works.
As per documentation of RabbitMQ, these two value should be match i.e. certCN value and serverName. What will be the value of sslOption.ServerName here and why?
My Bad. I found the reason. Posting as it might help someone.
Reason: As I set a policy "System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch".

Exim: Add X-Report-Abuse: TEXT to report abuse Headers

I am using Exim and Dovecot.
I want add to all outgoing email an anti-abuse header like:
X-Report-Abuse: TEXT to report abuse
How I can do this?
Thanks in advance
Thanks, this is not helping me.
I added the line where you told but also incoming email have the X-Report-Abuse heder.
I cannot find that on my Exim
send_to_gateway:
I added the headers_add = X-Report-Abuse: TEXT to report abuse here:
This transport is used for delivering messages over SMTP connections.
remote_smtp:
driver = smtp
dkim_domain = ${lc:${domain:$h_from:}}
dkim_selector = x
dkim_private_key = /etc/exim/dkim.private.key
dkim_canon = relaxed
headers_add = X-Report-Abuse: Please report any abuse text
this is working if the outgoing email are sent from an email client, is not working if email is sent by SMTP from a PHP script or app like wordpress or other PHP app.
This adds a header to outgoing messages:
Add this line to your exim.conf file within your outgoing router(s) configuration:
headers_add = X-Report-Abuse: TEXT to report abuse
For example
begin routers
...
send_to_gateway:
driver = manualroute
domains = !+local_domains
transport = remote_smtp
route_list = * smtp.myisp.net
headers_add = X-Report-Abuse: TEXT to report abuse
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
headers_add = X-Report-Abuse: TEXT to report abuse
no_more

How to allow inbound calls in pjsip and Asterisk 13?

I have configured Asterisk 13.13.1 with PJProject 2.5.5 and enable PJSIP as SIP driver (without compiling chan_sip).
I have the fully configured system and it's working but I have some problems with incoming calls. I have few numbers connected with my host and when I calling from any public number I noticed this info on asterisk remote console:
[Feb 24 14:27:16] NOTICE[5291]: res_pjsip/pjsip_distributor.c:525 log_failed_request: Request 'INVITE' from '"zzzzz" <sip:zzzzz#192.168.34.1>' failed for '192.168.34.1:5062' (callid: 0e07e7607f8f62dd225347363173bb9f#192.168.34.1:5062) - No matching endpoint found
And if I add the number which is calling to my Asterisk to endpoints then it's working - I can pick up this call.
How to add the possibility to allow all inbound calls?
You need to create an anonymous endpoint to accept inbound calls from unknown endpoints.
Be aware that adding an anonymous endpoint opens the system to extension scanning attacks where scanners try to find out which extensions you have configured in your system. They do this either to spam you with advertising calls, or exploit call transferring to call long distance numbers, or for some other ulterior motive.
After creating an anonymous endpoint, associate it with a context different from that used by your extensions. This prevents them from dialing long-distance through your trunks.
To add an anonymous endpoint in pjsip.conf, add the following lines:
[anonymous]
type=endpoint
context=anonymous
disallow=all
allow=speex,g726,g722,ilbc,gsm,alaw
In the dialplan extensions.conf:
[anonymous]
exten => _XXXXX,1,GotoIf(${DIALPLAN_EXISTS(local-extensions,${EXTEN},1)}?local-extensions,${EXTEN},1)
same => n,Hangup(1)
local-extensions is the context listing your local extensions.
It looks like your missing something from you pjsip config. My basic config is as follows and is based on a sipgate setup with an internal extension. This config has been extracted from a running box (though usernames & passwords have been removed);
pjsip.conf
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0
[reg_sipgate_premium]
type = registration
retry_interval = 20
max_retries = 10
contact_user = 0000000
expiration = 120
transport = transport-udp
outbound_auth = auth_sipgate_premium
client_uri = sip:0000000#sipgate.co.uk:5060
server_uri = sip:sipgate.co.uk:5060
[auth_sipgate_premium]
type = auth
username = 0000000
password = password
[sipgate_aor_premium]
type = aor
contact = sip:0000000#sipgate.co.uk
[sipgate-preimum]
type = endpoint
context = incomingsipgate
dtmf_mode = rfc4733
disallow = all
allow = alaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
timers = yes
from_user = 0000000
from_domain = sipgate.co.uk
language = en
outbound_auth = auth_sipgate_premium
aors = sipgate_aor_premium
extensions.conf
[incomingsipgate]
exten => 0000000,1,Goto(sipgate-in-premium,0000000,1)
[sipgate-in-premium]
exten => 0000000,1,Verbose(Incoming call from Sipgate line CallerID=${CALLERID(all)})
exten => 0000000,2,Goto(internal-ext,120,1)
[internal-ext]
exten => 120,1,Dial(SCCP/120,20,o,CallerID=${CALLERID(all)})
This line is used to catch any free phone (0500) number and route it via sipgate when a user internally dials 90500xxxxxxx;
exten => _90500.,1,Dial(PJSIP/${EXTEN:1}#sipgate-preimum)
For sure, the problem is in your incoming line operator context. The problem is not in pjsip - it is in dialplan. Please check your trunk (or registration context value to understand proper dialplan section:
[outer]
exten=>_1234567,1,NoOp(Incoming call to public number 1234567)
exten=>_1234567,n,GoTo(outer,3333,1)
exten=>_1234567,n,Hangup()
exten=>_3333,1,NoOp(Transfered from public context to local extension 3333)
exten=>_3333,n,Dial(PJSIP/${EXTEN},180)
exten=>_3333,n,Hangup()
Change 1234567 to your public number and 3333 to the local number that has to receive this incoming call. And of course, set outer as context for incoming calls number provider registration (trunk).

PHPUnit Symfony set IP address for the client

I need to test behavior of the feature which depends on the users IP address. The user should be redirected to different pages depending on his IP address.
I create client like that: $this->client = static::createClient();
Is there any way to do that?
Try to create different clients:
$this->client1 = static::createClient([], ['REMOTE_ADDR' => '11.11.11.11']);
$this->client2 = static::createClient([], ['REMOTE_ADDR' => '22.22.22.22']);

How to plublic goagent service on local area network

Default goagent setting on 127.0.0.1:8087.I want public my goagent proxy service on 192.168.1.101:8080 so that my iphone can also visit facebook.
is there any idea?
You just need to configure the proxy.ini(in folder 'local') as below:
[listen]
ip = your-hostname
port = 8087
visible = 1
debuginfo = 0
Replace your-hostname with your real hostname.

Resources