Problem With OPTIONS Requests.

Home » Asterisk Users » Problem With OPTIONS Requests.
Asterisk Users 4 Comments

I’m implementing a SBC with my Asterisk PBX but the keeps disabling the trunk group I’ve configured and I think it may be because Asterisk is returning a 4r04 to the OPTIONS.

I’ve created a test context and have put in a wildcard pattern match to try and catch those options but it doesn’t seem to work.

Is there a way to have asterisk respond with an 200 OK instead of a 404?

4 thoughts on - Problem With OPTIONS Requests.

  • Hey John,

    In one installation I have, we use several monitoring tools (nagios based and custom scripts based) and we have the following:

    ; Reply OK to SIP:OPTIONS
    [public]
    exten => s,1,Wait(1)
    same => n,Hangup
    : For Nagios exten => nagios,1,Wait(1)
    same => n,Hangup

    NOTES:

    1- We have context=public in sip.conf, if you have anything else, you must update the dialplan above accordingly.
    2- The second ‘nagios’ extension, is because the scripts need to send a user, so we have it preconfigured to “nagios”, if it’s from Kamailio it won’t send a user and thus it will match in the s,1 exten. Feel free to remove this one.

    Give it a try and let me know how it goes.

    Alternatively, you may also be able to configure your SBC
    (kamailio/opensips? if so check dispatcher docs for *_reply_codes modparam)
    to accept a 404 reply to a SIP:OPTIONS as a valid response.

    Hope it helps.

    Cheers, Joel.

  • I’ve got this setup in a test context.

    [test]
    exten => s,hint,SIP/7124
    exten => s,1,NoOP(Options to $EXTEN)
    same => n,Hangup()
    exten => _x.,hint,SIP/7124
    exten => _X.,1,NoOP(Options to $EXTEN)
    same => n,Hangup()

    exten => Anonymous,hint,SIP/7124
    exten => Anonymous,1,NoOP(Options to $EXTEN)
    same => n,Hangup()

    I added hints to see if that would make a difference and it hasn’t.

    I also made a ‘Anonymous’ peer to see if that would help without any luck.

  • Is `test` your default context (line context= in sip.conf)?

    If it is not, then try setting context=test in sip.conf and reload it.