Modify SIP OPTIONS

Hi …

Am using Asterisk 16 and I have SIP Trunk from the Operator , Below is my configuration

[MY-sip-trunk]
host=10.10.10.10
username=123123
defaultuser=123123
secret=1234
type=peer
qualify=no
insecure=port,invite
disallow=all
allow=alaw
dtmfmode=rfc2833
fromdomain=10.10.10.10
outboundproxy=10.10.10.10
context=trunkinbound
sendrpid=yes
trustrpid=no

Presently using this configuration my asterisk server is sending the OPTIONS message every one min as below.

OPTIONS sip:10.10.10.10 SIP/2.0
Via: SIP/2.0/UDP 10.10.10.11:5060;branch=z9hG4bK5e4c9ddd;rport
Max-Forwards: 70
**From: “asterisk” sip:asterisk**@10.10.10.11;tag=as24df186b
To: sip:10.10.10.10
Contact: sip:asterisk@10.10.10.11:5060
Call-ID: 2a9f466406ae199a09709cbb16c86d8f@10.10.10.11:5060
CSeq: 102 OPTIONS
User-Agent: MY Telephony
Date: Fri, 22 Mar 2019 05:36:36 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 10.10.10.11:5060;branch=z9hG4bK5e4c9ddd;rport=5060
Call-ID: 2a9f466406ae199a09709cbb16c86d8f@10.10.10.11:5060
From: "asterisk"sip:asterisk@10.10.10.11;tag=as24df186b
To: sip:10.10.10.10;tag=g4796vsa
CSeq: 102 OPTIONS
Warning: 399 03079.01234.A.005.402.228.0.6.08453.00000000.1075445762 “Invalid User”
Content-Length: 0

Am getting this SIP - 403 response from my SIP operator because of from header and contact header is going wrong. If am adding the fromuser in my sip.conf am able to send the proper header in OPTIONS message.

Is there any another parameter which i can use to send the From Header and Contact Header .? or any other suggestions ?

Typical normal behaviour. No action required. A 403 response still confirms that the peer is responding.

However please note that you have duplicates of some options, under current and deprecated names and I don’t know why you want to make the port insecure.

@david551

Thanks for the Reply.

am getting the 403 response and its confirming the peer is responding, but instead of 200 OK its sending 403 because of FROM header and Contact Header is going as asterisk instead of SIP Pilot number.

When i am setting as fromuser as pilot number it sending the FROM header and Contact Header with pilot number, Instead of setting in fromuser is there any parametr which can be used to set the FROMHeader in OPTION message.

Asterisk dosen’t care whether its is 403 or 200. In fact, in most cases, it will be 404. There is nothing to fix.

But is there any option where we can send the Proper SIP Header ?

The current header is proper. I’m not aware of any way of changing it on chan_sip and I’m not sufficiently familiar with pj_sip to know for that.

What is your real problem?

using chan_sip you will need to stick to the fromuser option

Hi Guys, I am sitting with an issue SIP provider want me to send CSeq: 102 INVITE but currently sending CSeq: 102 REGISTER. Do you guys perhaps know what is the best way to achieve this?

This doesn’t make sense. The verb part of CSEQ is tied to the corresponding request type. Different requests server different purposes, so you cannot replace one with another.

You are going to need to provide the complete SIP dialogue and explain what you are doing.

Also, you seem to have hijacked on old thread, as the CSEQ for OPTIONS would have to be something like: CSEQ 2 OPTIONS.

Also, you did not say whether you are using chan_sip (deprecated) or chan_pjsip.

Hi David, thanks for reply Iam using chan_sip. Below is how I set it up.

[providerusername]
canreinvite=no
trustrpid=yes
sendrpid=yes
host=providerhostname
port=5060
secret=providerpassword
disallow=all
allow=alaw
qualify=300
type=peer
dtmfmode=rfc2833
fromdomain=providerhostname
fromuser=provideruser
outboundproxy=IP address
insecure=port,invite

register => providerusername:providerpassword@providerhostname

[authentication]
auth = provideruser:providerpassword@providerhostname

If you delete this line, it won’t send REGISTER and therefore won’t send CSEQ: … REGISTER. However, unless you have a static IP address that the provider knows, you will not be able to receive any incoming calls. As such, I think there is a misunderstanding between you and the provider as to what the real problem is.

Thanks alot David, I will try to resolve with them and provide feedback!

@ David just that registration string and all is working on outbound now! Thanks alot for your help!