Brekeke SIP Server Wiki

2. Rejecting

Here are some examples of error messages returned for rejecting calls. Error responses specified in the handling variable $action are sent to the request sender. The session for which an error response was returned will not be routed to the call destination.

For the response codes, refer to RFC3261.

 

Ex 1. Returning a “603 Decline” response if the callee isn’t registered
Matching Patterns Deploy Patterns
$request = ^INVITE
$registered = false
$action = 603

Ex 2. Returning a “486 Busy” response if the callee’s SIP URI is sip:user@host
Matching Patterns Deploy Patterns
$request = ^INVITE
$geturi( To ) = sip:user@host
$action = 486

 

Ex 3. Returning a “402 Payment Required” response if the callee’s name prefix is “9”
Matching Patterns Deploy Patterns
$request = ^INVITE
To = sip:9.+@
$action = 402

Ex 4. Returning a “404 Not Found” response if the caller’s name is “user”
Matching Patterns Deploy Patterns
$request = ^INVITE
From = sip:user@
$action = 404

 

 Ex 5. Returning a “403 Forbidden” response if the call is from an IP address with the prefix “192.168”

Matching Patterns Deploy Patterns
$request = ^INVITE
$addr = 192\.168\.
$action = 403

Ex 6. Returning a “406 Not Acceptable” response if the Content-Type header is  “application/text”
Matching Patterns Deploy Patterns
$request = ^INVITE
Content-Type=^application/text$
$action = 406

Ex 7. Returning a “503 Service Unavailable” response if the User-Agent header contains “TEST”
Matching Patterns Deploy Patterns
$request = ^INVITE
User-Agent = TEST
$action = 503

 

Ex 8. Returning a “483 Too Many Hops” response if the Max-Forwards’ value is 5 or less
Matching Patterns Deploy Patterns
$request = ^INVITE
Max-Forwards = ^[0-5]$
$action = 483

 

Ex 9. Returning a “480 Temporarily Unavailable” response from 0:00AM to 7:59AM
Matching Patterns Deploy Patterns
$request = ^INVITE
$time = ^0[0-7]:
$action = 480

 

Ex 10. Returning a “400 Bad Request” response if the request method is SUBSCRIBE
Matching Patterns Deploy Patterns
$request = ^SUBSCRIBE
$action = 400

 

 

Yes No
Suggest Edit