[asterisk-users] Specific SIP answers on incoming calls?

Alex Balashov abalashov at evaristesys.com
Sat Sep 20 02:54:59 CDT 2008


Stefan Gofferje wrote:
> Hi,
> 
> when I still had ISDN, I was using Hangup(causecode) to send e.g. "Wrong
> number" to unwelcome callers.
> Meanwhile, I am only using SIP providers (no PSTN lines any more) and I
> would like to do similar, i.e. send specific SIP headers. Besides "wrong
> number", I would especially like to send 302 temp moved with a specified
> address to deflect certain calls.
> Is there any way to send a specific reply out of the dialplan?

No.  The dial plan does not provide such low-level access to the SIP 
stack.  All that you can do is call the dial plan applications, and they 
will do whatever it is they do on the SIP level.

Also, keep in mind that the abstraction you are suggesting is leaky. 
The cause codes that Hangup() can send on the ISDN side are still 
*disconnection*-related cause codes.  You can't just send any kind of 
Q.931 / 921 response arbitrarily, even if it is valid from the 
perspective of the protocol's state machine.  That is logically 
analogous to what you are asking to do with SIP here.

Asterisk is not designed to expose low-level protocol details;  it's a 
relatively high-level application.  If you want to translate various SIP 
states Asterisk puts out into customised responses, you will probably 
need to use something like Kamailio / OpenSIPS (OpenSER) outboard with 
Asterisk to perform those translations.

-- Alex


-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599



More information about the asterisk-users mailing list