I'm trying to setup asterisk to make outbound calls via provider trunk. I'm using pjsip chan and FreeBPX ui. Incoming calls works, but outgoing produce SIP/2.0 403 Forbidden.
I examined pjsip history and found a problem - it is From field in invite packet. Provider wants From field as:
From: "792440XXXXX" <sip:792440XXXXX#multifon.ru>
but pjsip sends:
From: "Anonymous" <sip:792440XXXXX#multifon.ru>
I tried outbound route CID override and filled trunk/pjsip Settings/Advanced fields like "Contact user", "From Domain", "From user" but this didn't help.
What i'm doing wrong ?
From field in asterisk will be filled like this
From: "CALLERID(name)" <CALLERID(num)>
So you just have setup CALLERID(name) acordinly. Something like this
exten => _X.,n,Set(CALLERID(name)=${CALLERID(num)})
Related
I am having issues with mail bouncing when sending from my own server to my own active yahoo account using JavaMail. The mails are passing SPF, DKIM and DMARC according to google mail that receives the same messages being bounced by yahoo. I can send messages from other accounts to my yahoo account without issue.
The messages send fine from my server to ZMail, GMail, Microsoft mail. Looking at the emails, the only thing that I have noticed is the message header for the Message-Id. My messages have the following header:
Message-ID: <923936395.17.1634776639078#[internally visible hostname]>
I am wondering if this header could be the problem and whether there is a way in JavaMail or in the Apache James to set the hostname or IP address that gets used in this message so that rather than using the "internally visible hostname", I can get the hostname that is externally visible. I have been searching the available documentation for Apache James and JavaMail but have not found any parameters to try in order to resolve this.
According to the Decompiled SRC of sun mail it should be possible by setting some properties for your session.
props.setProperty("mail.from", user);
props.setProperty("mail.host", host);
//props.setProperty("mail.user", user);
The Id will be updated by the save method (saveChanges()) and will trigger an new ID generation (updateHeaders() -> updateMessageID()). (Looked up in the decompiled MimeMessage.class)
Leading to the HostPart called in javax.mail.internet.InternetAddress.
The relevant method is _getLocalAddress.
Here you can see that the values get extracted from the Properties or will fallback to your local machine.
Used Fields:
user.name
mail.from
mail.user
mail.host
The user.name property can also be looked up from the system props.
I just tried to get into Astersik and FreePBX because I'd like to set up a office phone network with different extensions for different people.
So I took a Raspberry Pi 3, downloaded the image here and followed this documentation. I thought for testing it should be fine.
It was so. Everything worked, no errors or something else while installation. So I opened the FreePBX site in my browser, logged in as admin, created a new user, a new Chain_SIP extension and linked both. Submitted this and applied the config (the red button in the right upper corner). I logged out, logged in with the credentials of the new user in FreePBX admin interface and the UCP interface. Everything was still fine.
Now I wanted to connect via a client to it and chose Empathy and came back to reality. I wasn't able to connect. Astersik full log tells me:
[2016-11-24 19:07:08] NOTICE[2004] chan_sip.c: Registration from
'' failed for '192.168.0.54:34061' - Wrong
password
I used that password which was shown during the process to create the extension. I tried the user (not the extension) credentials too, which didn't work and returned the same error, only 1003 is replaced by the user name.
Somewhere I found the command
asterisk -rx "sip show users"
which returns:
Username Secret Accountcode Def.Context ACL Forcerport
1003 12345678 from-internal Yes Yes
I'm sure, I missed something, but I have no ides what.
Could someone help me?
In FreePBX terminology user <> extension look at http://wiki.freepbx.org/pages/viewpage.action?pageId=5242941 for details. I believe, in your case you need to
asterisk -rx "sip show peers"
not
asterisk -rx "sip show users"
I have 10000 users, and i want to push notification SNS to each user, with different message.
So, i cannot use Topic in this case.
The problem is it delay too much. (About 1h30 hour for this to complete)
Any solution?
Thank you so much!
Endpoint is something like internal AWS Identificator for combination: platform+device token or smth else. When we want to send an message we use it as address point instead of real.
About adding Endpoint to SNS. Generally it looks like so:
You should register your platform in AWS SNS and receive e.g. for IOS - iOS app's Application ARN. It can be done via e.g. AWS Web Console
After you should create for each target user its endpoint with method like this:
$endPoint = $snsClient->createPlatformEndpoint([
'PlatformApplicationArn' => $SNS_APP_ARN,
'Token' => 'phone token'
]);
phone token for push notification is device-token. Endpoint generally is array/object which contains EndpointArn. Use it address when send message.
After that you can send an message to specific endpoint.
$snsClient->publish(
array(
'Message' => $pushMessage,
'TargetArn' => $endpointArn
));
I have two phone numbers registered with the same sip provider. I would like Asterisk/PJSIP to route phone #1 (18005551212) differently than phone #2 (18005551313).
[sipprovider-18005551212]
type=registration
client_uri=sip:18005551212#sip.provider.com:5060
[sipprovider-18005551313]
type=registration
client_uri=sip:18005551313#sip.provider.com:5060
The Contact provided by Asterisk during registration is the same for both (using default extension 's').
Contact: <sip:s#10.1.1.1:5060>;expires=120
Can I do any of the following:
1) When registering, provide an extension other than 's'? Allowing inbound calls to hit unique extensions in the dialplan.
2) Route to unique context based on the To: Header on the INVITE? (which holds the unique phone number called). I have tried using 'context=' in the pjsip.conf endpoint block, but no luck; routing is either by IP (which is the same for both phone numbers), or by name (which is based on the From: Header).
Any help or pointers would be appreciated.
You could try this from my extensions.conf
[inbound-sip]
exten => 3215445,1,Goto(sip-in-1,s,1)
exten => 2544221,1,Goto(sip-in-2,s,1)
[sip-in-1]
exten => s,1,Goto(internal-ext,6881,1)
Calls then end up in the relevant context for further processing and alerting etc. sip-in-1 or sip-in-2 in this case.
In your sip.conf or pjsip.conf you need to specify the inbound context for both numbers you have - in this case context = inbound-sip
You should enable sip debug and see if calls have anything like destination number.
If it have no - you have no way get info which not present.
If you have, you should create extension s and parse number info using SIP_HEADER function from sip request body.
Here is the issue:
I have an email server with OpenDKIM and Postfix installed as here:
http://www.serveridol.com/2012/02/17/opendkim-configuring-dkim-keys-on-postfix/
My TXT DNS record is on the main domain (Server domain name)
Here: senderServer.com
It works great when I send an email from senderServer.com using my FROM address as: anything#senderServer.com
The problem is when I send an email using my FROM address as: anything#otherDomain.com
The DKIM signature is added but using otherDomain as the domain value tag:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
d=otherDomain.com; s=20131125; t=1385596727;
bh=g3zLYH4xKxcPrHOD18z9YfpQcnk/GaJedfustWU5uGs=;
h=Date:To:Subject:From;
b=ujfsdhfu9hf9sdfs9df9sfs9fhsd9hfsfnsvkjnsdlvljsv
so, the server that is receiving the messages is not finding the DNS record which is obviously clear since the d= tag value is otherDomain.com instead senderServer.com
I would like to find the way to retrieve the d= value from the server name instead retrieve it from the FROM header email address... or override it to be always d=senderServer.com
Domain *
KeyFile /etc/postfix/dkim.key
Selector mail
in /etc/opendkim.conf to use the same key for multiple domains ( documentation )
and added no_milters to /etc/postfix/master.cf
made this line:
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
look like:
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
This prevented opendkim signing messages twice.