Stefan Gofferje
2008-Sep-19 23:27 UTC
[asterisk-users] Specific SIP answers on incoming calls?
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? Terve, Stefan -- Last words of a stormchaser: "Where is that rotation on the radar?!"
Alex Balashov
2008-Sep-20 07:54 UTC
[asterisk-users] Specific SIP answers on incoming calls?
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
Philipp von Klitzing
2008-Sep-20 11:14 UTC
[asterisk-users] Specific SIP answers on incoming calls?
Hi!> > 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.You might want to try the app Transfer() to send a SIP REFER. http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+transfer Philipp