Asterisk not asnwer 200OK when receive the OPTION

I use Asterisk in version 13.38.1 and have a sip trunk with a operator. This operator work with Heartbeat. When I receive the OPTION in this trunk, my asterisk answer with 404 Not Found, but I need answer with 200OK. Following the option message and 404 not found messages:

How can I configure 200OK to answer to OPTIONS received?

OPTIONS:
OPTION:

From: sip:SBC@189.25.33.44;tag=m0pc3pnq
To: sip:200.27.181.45
CSeq: 1 OPTIONS
Contact: sip:189.25.33.44:36520;transport=udp;Hpt=8ea8_16;expires=65535
Accept: application/sdp
Max-Forwards: 70
Content-Length: 0

404 NOT FOUND:

From: sip:SBC@189.25.33.44;tag=m0pc3pnq
To: sip:200.27.181.45;tag=as44df6fc3
Call-ID: 0cm0r8rxtnvqrx0mpcn0vltcn0rvggco@44.33.25.189
[Generated Call-ID: 0cm0r8rxtnvqrx0mpcn0vltcn0rvggco@44.33.25.189]
CSeq: 1 OPTIONS
Server: Asterisk PBX 13.38.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0

sip.conf:

[SBC]
type=friend
context=heartbeat
host=189.25.33.44
qualify=yes

extension.conf:

[heartbeat]
exten => _.,1,Answer()
exten => _.,n,Playback(ss-noservice)
exten => _.,n,Hangup()

OPTIONS should produce the same response as Dial, except for SDP handling.

With sensible use, 404 is just as good as 200, as both indicate that there is a valid SIP UAS there. However, if you need a 200, you must set up extensions.conf so that call will match a valid extension. You haven’t provided the request URI line, but assuming it is the same as the To: URI, there is no user part, which means that Asterisk will treat it as an attempt to access extension “s”. The extension just has to exist; it won’t get run, but priority 1 must exist.

From what you’re telling me, I should have an Asterisk extension answer the call and hang up. I have a doubt, in the To field, beacuse this just only have IP address. How should I do it in context?

For example:

[my-context]
exten => s,1,Answer()

I actually said.

What the extension actually does depends on what should happen if someone really calls it.

The Request URI is used, not the To URI. If no user portion is present then “s” is used.

I explicitly assumed that the request URI was the same as the To: one and silently mapped the empty user to “s”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.