Hello,
I’m quite new to asterisk.
I’ve set up asterisk v.13.1 + FreePBX 12.0 on a Centos 6.6 VPS.
I thought I needed to NAT the machine so after reading some, I decided to use the PJSIP stack rather than the Chan_SIP stack.
I have set up one trunk on FreePBX that works fine, inbound and outbound, except it is just for test.
Now I need to set up the production outbound/inbound trunk.
I have tried many combinations of parameters, but registration fails.
The provider pointed out that I am sending them the wrong string in the “Contact” field.
The problem is that somebody somewhere is filling in the fields with the wrong values.
CSeq: 10248 REGISTER
Contact: <sip:s@149.210.xx.xx:5060>
I have no idea where the “s” comes from, and the IP is my server’s, instead of the provider’s.
It should look like this:
CSeq: 1791 REGISTER
Contact: <sip:0381xxxxx@80.244.xx.xx:5060>;q=0.1;expires=120
Server: VoIP Connect v3.0
where the first part is my username and the IP address is the provider’s.
I have read the asterisk page about outbound registrations https://wiki.asterisk.org/wiki/display/AST/Configuring+Outbound+Registrations and it is quite clear from the examples that only the username part should be specified.
I have checked the pjsip.registration.conf file that FreePBX produces and it looks ok.
If I add the “advanced” parameters it will write them in, including “Contact”, “Client URI” and "ServerURI"
If I leave them blank the lines are deleted.
If I fill the Contact field in FreePBX with the whole contact URI, asterisk throws an error:
res_sorcery_config.c: Could not create an object of type ‘registration’
If I set the “Contact” field to @<provider’s IP address>
asterisk will try to add another address to the end of it.
[2015-02-27 01:22:17] DEBUG[822] pjsip: sip_reg.c Invalid Contact: "<sip:0381xxxxxx@80.244.xx.xx:5060@149.210.xx.xx:5060>"
[2015-02-27 01:22:17] DEBUG[821] threadpool.c: Increasing threadpool SIP's size by 5
[2015-02-27 01:22:17] ERROR[822] res_sorcery_config.c: Could not create an object of type 'registration' with id 'trunk-enuvola' from configuration file 'pjsip.conf'
[2015-02-27 01:22:17] DEBUG[822] config.c: Parsing /etc/asterisk/pjsip.conf
Any suggestions?