Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-28 Thread Douglas Garstang
Ah jeez. All I wanted to do was connect to a carrier and then perform fail over 
logic based on their SIP response.
Not supposed to be difficult. This is what Asterisk is supposed to be good at.
We have a SIP module, why not have SIP responses available to the module.

Now, I have to look at the lossy HANGUPCAUSE variable and make a best guess.
Not an ideal situation.

We're trying to improve the ASR's we get from providers. They are low, and 
often they fail calls for no particular reason. They all do it, even the big 
ones like Verizon. Checking their responses for purpose of trying another 
carrier on the fly, and reporting is pretty critical.

Doug.


- Original Message 
From: Raj Jain [EMAIL PROTECTED]
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@lists.digium.com
Sent: Saturday, October 27, 2007 11:29:21 AM
Subject: Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE


  The only place where it is reasonable to customize is in the 
  specification of the channel in the configuration file.  
 That is where 
  you would customize, for example, whether DTMF is inband, 
 SIP INFO, or 
  RFC 2833, as well as what codecs will be negotiated for that 
  particular user/peer.
  
 
 But you already have the SIP_HEADER function, which is quite 
 contradictory to what you say. This allows users who know 
 what they are doing to examine headers directly. We use this 
 a lot. What would be the harm in having a SIP_RESPONSE 
 function or something alike? 

I'd agree that SIP response code should be accessible from the dial
 plan.
Knowing the exact SIP response code could be critical for making call
processing decisions. The conversion of SIP response codes to Q.931
 codes
(HANGUPCAUSE) is just too lossy. Building a truly protocol agnostic
 dial
plan API is a worthy goal. But, I think it is somewhat of an unsolvable
problem. The signaling protocols are very different and for various
 reasons
people have always wanted access to native information elements carried
 in
the protocol.

Perhaps, a very simple solution for this problem could be to support a
keyword such as TOPLINE in the SIP_HEADER function to fetch the
 topmost
line in a SIP message. This will not only get the caller the response
 code
for SIP response messages, but will also have the nice byproduct of
 making
the Request-URI available if the message in question is a SIP request.

- Raj


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-27 Thread Torbjörn Abrahamsson
 Well, unfortunately for you, that is the exact opposite of 
 the philosophy of the Asterisk codebase.  Every attempt is 
 made to genericize the channel driver interface so that you 
 do not need to know the details of the underlying driver.  
 Where we have failed to do so in the past, we are attempting 
 to rectify in current approaches.
 
 The only place where it is reasonable to customize is in the 
 specification of the channel in the configuration file.  That 
 is where you would customize, for example, whether DTMF is 
 inband, SIP INFO, or RFC 2833, as well as what codecs will be 
 negotiated for that particular user/peer.
 

But you already have the SIP_HEADER function, which is quite contradictory
to what you say. This allows users who know what they are doing to examine
headers directly. We use this a lot. What would be the harm in having a
SIP_RESPONSE function or something alike? It would allow for those who want
to have this information to get it and act accordingly in the dialplan. I
know I have missed this possibility, and instead tried to puzzle together
information from DIAL_STATUS and HANGUP_CAUSE. I do agree with the general
assumption that the dialplan should be generic, but in reality this is often
not the case. You add a SIP-header to tell the client to auto-answer or to
change the ring tone, or something like that. I guess that there are
similiar ways customize things in IAX or ZAP, and thereby making the
dialplans not so generic. Our dialplans often depend heavliy on SIP, but
that is of course a result of us working in a SIP-only environment.

// T


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-27 Thread Raj Jain
  http://www.faqs.org/rfcs/rfc3398.html

 The conversion is lossy. More than 1 SIP cause code is 
 mapped to a Q.931 cause code (in Asterisk at least). See
 hangup_sip2cause() in chan_sip.c

True. The conversion is lossy in that respect and most of the times
semantically incorrect simply because of the fundamental differences between
SIP and ISUP. In fact, many new SIP response codes have been defined and
will be defined in the future since RFC 3398 was written
(http://www.iana.org/assignments/sip-parameters). And as far as I can tell a
revision of RFC 3398 is not in works in the IETF. 

- Raj 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Philipp Kempgen
 Sent: Friday, October 26, 2007 11:37 AM
 To: Asterisk Users
 Subject: Re: [asterisk-users] Getting SIP Response Code from 
 HANGUPCAUSE
 
 Eric ManxPower Wieling wrote:
 
  On 10/25/07, Douglas Garstang [EMAIL PROTECTED] wrote:
  I'd like to grab the SIP response code that comes back from an 
  INVITE. The HANGUPCAUSE gives the converted ISDN cause 
 code. Anyone 
  know of a way to get the SIP response code instead?
  
  There is an RFC for this.  I don't know if Asterisk follows 
 the RFC or not.
  
  http://www.faqs.org/rfcs/rfc3398.html
 
 The conversion is lossy. More than 1 SIP cause code is 
 mapped to a Q.931 cause code (in Asterisk at least). See
 hangup_sip2cause() in chan_sip.c
 
 Regards,
   Philipp Kempgen
 
 --
 amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
 Let's use IT to solve problems and not to create new ones.
   Asterisk? - http://www.das-asterisk-buch.de
 
 Geschäftsführer: Stefan Wintermeyer
 Handelsregister: Neuwied B 14998
 
 ___
 --Bandwidth and Colocation Provided by http://www.api-digital.com--
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-27 Thread Tilghman Lesher
On Saturday 27 October 2007 08:14:05 Torbjörn Abrahamsson wrote:
  Well, unfortunately for you, that is the exact opposite of
  the philosophy of the Asterisk codebase.  Every attempt is
  made to genericize the channel driver interface so that you
  do not need to know the details of the underlying driver.
  Where we have failed to do so in the past, we are attempting
  to rectify in current approaches.
 
  The only place where it is reasonable to customize is in the
  specification of the channel in the configuration file.  That
  is where you would customize, for example, whether DTMF is
  inband, SIP INFO, or RFC 2833, as well as what codecs will be
  negotiated for that particular user/peer.

 But you already have the SIP_HEADER function, which is quite contradictory

If you read all of what I said, you'd see that it's not contradictory at all.
I said that there are places where we've failed to maintain that segregation
and that we're working to rectify that, where possible.

 to what you say. This allows users who know what they are doing to examine
 headers directly. We use this a lot. What would be the harm in having a
 SIP_RESPONSE function or something alike? It would allow for those who want
 to have this information to get it and act accordingly in the dialplan. I
 know I have missed this possibility, and instead tried to puzzle together
 information from DIAL_STATUS and HANGUP_CAUSE. I do agree with the general
 assumption that the dialplan should be generic, but in reality this is
 often not the case. You add a SIP-header to tell the client to auto-answer
 or to change the ring tone, or something like that. I guess that there are
 similiar ways customize things in IAX or ZAP, and thereby making the
 dialplans not so generic. Our dialplans often depend heavliy on SIP, but
 that is of course a result of us working in a SIP-only environment.

Not all of us are working in a SIP-only environment.

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-27 Thread Raj Jain
  The only place where it is reasonable to customize is in the 
  specification of the channel in the configuration file.  
 That is where 
  you would customize, for example, whether DTMF is inband, 
 SIP INFO, or 
  RFC 2833, as well as what codecs will be negotiated for that 
  particular user/peer.
  
 
 But you already have the SIP_HEADER function, which is quite 
 contradictory to what you say. This allows users who know 
 what they are doing to examine headers directly. We use this 
 a lot. What would be the harm in having a SIP_RESPONSE 
 function or something alike? 

I'd agree that SIP response code should be accessible from the dial plan.
Knowing the exact SIP response code could be critical for making call
processing decisions. The conversion of SIP response codes to Q.931 codes
(HANGUPCAUSE) is just too lossy. Building a truly protocol agnostic dial
plan API is a worthy goal. But, I think it is somewhat of an unsolvable
problem. The signaling protocols are very different and for various reasons
people have always wanted access to native information elements carried in
the protocol.

Perhaps, a very simple solution for this problem could be to support a
keyword such as TOPLINE in the SIP_HEADER function to fetch the topmost
line in a SIP message. This will not only get the caller the response code
for SIP response messages, but will also have the nice byproduct of making
the Request-URI available if the message in question is a SIP request.

- Raj


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Rizwan Hisham
I think you can use the 'ngrep' command to see the sip packets coming in
using the sip listening port. I dont know the exact command though, you will
have to lookit up urself. you will see the sip packets coming into ur system
and in those packets you can see the response code.

On 10/25/07, Douglas Garstang [EMAIL PROTECTED] wrote:

 I'd like to grab the SIP response code that comes back from an INVITE. The
 HANGUPCAUSE gives the converted ISDN cause code. Anyone know of a way to get
 the SIP response code instead?

 Doug.


 __
 Do You Yahoo!?
 Tired of spam? Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

 ___
 --Bandwidth and Colocation Provided by http://www.api-digital.com--

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




-- 
Best Regards
Rizwan Hisham
Software Engineer
Axvoice Inc.
www.axvoice.com
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Eric ManxPower Wieling
Rizwan Hisham wrote:
 I think you can use the 'ngrep' command to see the sip packets coming in
 using the sip listening port. I dont know the exact command though, you will
 have to lookit up urself. you will see the sip packets coming into ur system
 and in those packets you can see the response code.
 
 On 10/25/07, Douglas Garstang [EMAIL PROTECTED] wrote:
 I'd like to grab the SIP response code that comes back from an INVITE. The
 HANGUPCAUSE gives the converted ISDN cause code. Anyone know of a way to get
 the SIP response code instead?

There is an RFC for this.  I don't know if Asterisk follows the RFC or not.

http://www.faqs.org/rfcs/rfc3398.html

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Philipp Kempgen
Eric ManxPower Wieling wrote:

 On 10/25/07, Douglas Garstang [EMAIL PROTECTED] wrote:
 I'd like to grab the SIP response code that comes back from an INVITE. The
 HANGUPCAUSE gives the converted ISDN cause code. Anyone know of a way to get
 the SIP response code instead?
 
 There is an RFC for this.  I don't know if Asterisk follows the RFC or not.
 
 http://www.faqs.org/rfcs/rfc3398.html

The conversion is lossy. More than 1 SIP cause code is mapped
to a Q.931 cause code (in Asterisk at least). See
hangup_sip2cause() in chan_sip.c

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Douglas Garstang
Thanks. I am quite familiar with ngrep. I was asking how I could get the SIP 
response code from the dial plan.

Doug.

- Original Message 
From: Rizwan Hisham [EMAIL PROTECTED]
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@lists.digium.com
Sent: Friday, October 26, 2007 6:18:50 AM
Subject: Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE


I think you can use the 'ngrep' command to see the sip packets coming in using 
the sip listening port. I dont know the exact command though, you will have to 
lookit up urself. you will see the sip packets coming into ur system and in 
those packets you can see the response code.


On 10/25/07, Douglas Garstang [EMAIL PROTECTED] wrote:
I'd like to grab the SIP response code that comes back from an INVITE. The 
HANGUPCAUSE gives the converted ISDN cause code. Anyone know of a way to get 
the SIP response code instead? 


Doug.




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

http://mail.yahoo.com 

___
--Bandwidth and Colocation Provided by 
http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   
http://lists.digium.com/mailman/listinfo/asterisk-users




-- 
Best Regards
Rizwan Hisham
Software Engineer
Axvoice Inc.
www.axvoice.com






__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Tilghman Lesher
On Friday 26 October 2007 16:13:11 Douglas Garstang wrote:
 Thanks. I am quite familiar with ngrep. I was asking how I could get the
 SIP response code from the dial plan.

You cannot.  And you shouldn't have to.  The dialplan should be generic
to all protocols, not customized to SIP.

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread SIP
Tilghman Lesher wrote:
 On Friday 26 October 2007 16:13:11 Douglas Garstang wrote:
   
 Thanks. I am quite familiar with ngrep. I was asking how I could get the
 SIP response code from the dial plan.
 

 You cannot.  And you shouldn't have to.  The dialplan should be generic
 to all protocols, not customized to SIP.

   
I disagree that is SHOULDN'T be available. We should have the option to 
test for a SIP error return code of a specific type if we want. It can 
make the logic for SIP calls considerably nicer -- especially in a 
complex AGI.

Generally, I've found that dialplans should NOT be generic. They should 
be customised to your particular environment. If your environment is 
SIP, then the customisation should be available.

N.

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Tilghman Lesher
On Friday 26 October 2007 19:47:27 SIP wrote:
 Tilghman Lesher wrote:
  On Friday 26 October 2007 16:13:11 Douglas Garstang wrote:
  Thanks. I am quite familiar with ngrep. I was asking how I could get the
  SIP response code from the dial plan.
 
  You cannot.  And you shouldn't have to.  The dialplan should be generic
  to all protocols, not customized to SIP.

 I disagree that is SHOULDN'T be available. We should have the option to
 test for a SIP error return code of a specific type if we want. It can
 make the logic for SIP calls considerably nicer -- especially in a
 complex AGI.

 Generally, I've found that dialplans should NOT be generic. They should
 be customised to your particular environment. If your environment is
 SIP, then the customisation should be available.

Well, unfortunately for you, that is the exact opposite of the philosophy of
the Asterisk codebase.  Every attempt is made to genericize the channel
driver interface so that you do not need to know the details of the underlying
driver.  Where we have failed to do so in the past, we are attempting to
rectify in current approaches.

The only place where it is reasonable to customize is in the specification of
the channel in the configuration file.  That is where you would customize, for
example, whether DTMF is inband, SIP INFO, or RFC 2833, as well as what
codecs will be negotiated for that particular user/peer.

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-26 Thread Philipp Kempgen
SIP wrote:
 Tilghman Lesher wrote:
 On Friday 26 October 2007 16:13:11 Douglas Garstang wrote:

 I was asking how I could get the
 SIP response code from the dial plan.
 
 You cannot.  And you shouldn't have to.  The dialplan should be generic
 to all protocols, not customized to SIP.

That's the reasoning someone always comes up with.
Me too. :)
And it's true for probably 90 % of the people who are asking
for SIP response codes to be available in the dialplan.

 I disagree that is SHOULDN'T be available. We should have the option to 
 test for a SIP error return code of a specific type if we want. It can 
 make the logic for SIP calls considerably nicer -- especially in a 
 complex AGI.
 
 Generally, I've found that dialplans should NOT be generic. They should 
 be customised to your particular environment. If your environment is 
 SIP, then the customisation should be available.

I agree. Dialplans should be as generic as possible but if you
need/want to customize any of the default behavior and if know
what you're doing Asterisk shouldn't stop you.

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Getting SIP Response Code from HANGUPCAUSE

2007-10-25 Thread Douglas Garstang
I'd like to grab the SIP response code that comes back from an INVITE. The 
HANGUPCAUSE gives the converted ISDN cause code. Anyone know of a way to get 
the SIP response code instead? 

Doug.




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users