Register a SIP number

Hi,

I just bought a SIP phone number via OVH with the following informations:
LINE: +33123456789
NUMBER: 0033123456789
LOGIN USERNAME: 0033123456789
AUTH USERNAME: 0033123456789
DOMAIN: XXX.fr.sip.ovh
PASSWORD: cOuCou1234?*

When I update sip.conf with
[general]
port = 9099
qualiffier = non
disallow = all
allow = ulaw
allow = g729
srvlookup = yes
register => 0033123456789:cOuCou1234?*@XXX.fr.sip.ovh
context=0033123456789
bindport=18756
allow=alaw,ulaw,slin,gsm,g729,g723

[0033123456789]
type=friend
host=XXX.fr.sip.ovh
context=incoming
language=fr
insecure=invite,port
username=0033123456789
secret=cOuCou1234?*

when I reload I have:
WARNING[12119]: chan_sip.c:24891 handle_response_register: Got error 400 on register to @XXX.fr.sip.ovh, giving up (check config)
like if the ?
is a problem in the password.

Why does it not work?

Second question:
Every command on ASTERISK CLI appears 2 times…what to do?

Thank you!

You should upgrade to chan_pjsip, as chan_sip is not longer supported, and not included in the latest version of Asterisk.

You have’t made use of the auth username information and username does nothing for where you use it. It is not clear why they have given both LINE and NUMBER. Where did they tell you so use 9099?

type=friend with insecure=invite is a security vulnerability. insecure=port should only be used if you are sure you need it. Provides should normally be peers.

400 says that the request is malformed, which should not be possible. It also says you should look for a Reason header, in the response, for further information. However, in the end, you may have to ask the provider why they gave this, somewhat unusual, response.

I hope that isn’t your real password. I don’t see any real point in redacting the provider’s domain name.

I’ve no idea about the double commands.

Hi
Thanks for your answer!
I am using ASTERISK 20. I just have to copy past what I have in sip.conf to pjsip.conf?

From LINE to PASSWORD, that are the informations gave by OVH and they provide the PHONE NUMBER and the LINE…

For my project, I developed a nodejs code using ari-client to originate a call and play sound files according to what the calle says.
And in this configuration I added the port 9099 to communicate with a websocket.

Thanks for the tip I will use peers.

This not my real phone number or password, but the real password ended with ?* and maybe that is reason that it is not possible to register on asterisk because when I use a false password I have

Host dnsmgr Username Refresh State Reg.Time
XXX.fr.sip.ovh:5060 N 0033123456789 120 No Authentication

that is normal because of the bad password
but if I use the real password I have
ip55*CLI> sip show registry Host dnsmgr Username Refresh State Reg.Time
XXX.fr.sip.ovh:5060 N * 120 Rejected
where you can see that the command register recognize only starting to * from 0033123456789:cOuCou1234?*@XXX.fr.sip.ovh which is the provided command on the OVH wesite.

Thanks

I found the solution. The problem was the default password given by OVH.
On the french website they ask to use special characters but in the english website they limit the special characters to (e.g. %, #, :, $, *).

If anybody has good practices for ARI originate using SIP phone number please don’t hesitate :slight_smile:
I use:
await this.localChannel.originate({
endpoint: this.options.dialstring,
formats: this.options.format,
extension: ‘s’,
context: ‘default’,
priority: 1,
timeout: 30,
app: “externalMedia”,
callerId: ‘+123456789’,
appArgs: ‘dialed’,
});

with in sip.conf:
[general]
qualiffier = no
disallow = all
srvlookup = yes
register=>0033123456789:123456789@xxxx.fr.sip.ovh:5060
context=0033123456789
bindport=18756
allow=alaw,ulaw,slin,gsm,g729,g723

[0033123456789]
type=peer
host=xxxx.fr.sip.ovh
context=incoming
language=fr
insecure=peers
username=0033123456789
secret=123456789

Thanks