[asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Vlasis Hatzistavrou

Hello,

On an Asterisk 1.4.33.1 in a simple scenario:

[test]
exten = _X.,1,Dial(SIP/12345@peer01,,,)

exten = i,1,Hangup(${HANGUPCAUSE})
exten = t,1,Hangup(${HANGUPCAUSE})
exten = h,1,Hangup(${HANGUPCAUSE})


I have noticed that no matter what value we set in the Hangup(cause 
code)  commands, if the call is not answered by peer01 for any reason, 
the actual cause code returned to the calling party is a 503, no matter 
what the ${HANGUPCAUSE} is.


Even if we set a fixed value like Hangup(1) (which should give a 404) or 
Hangup(17) (which should give a 486), the cause code returned is always 
a 503.


Has anyone else noticed this? I went through the issue tracker but I 
couldn't find any relevant bug posted in the past. I am certain that in 
previous versions I could set the reply message to the desired value, so 
I wonder if this is a bug in this particular version (1.4.33.1).


--
Best regards,
Vlasis Hatzistavrou.


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Jim Dickenson
My guess is since the call was never answered you should be looking at 
${DIALSTATUS}
-- 
Jim Dickenson
mailto:dicken...@cfmc.com

CfMC
http://www.cfmc.com/



On Apr 15, 2011, at 5:02 AM, Vlasis Hatzistavrou wrote:

 Hello,
 
 On an Asterisk 1.4.33.1 in a simple scenario:
 
 [test]
 exten = _X.,1,Dial(SIP/12345@peer01,,,)
 
 exten = i,1,Hangup(${HANGUPCAUSE})
 exten = t,1,Hangup(${HANGUPCAUSE})
 exten = h,1,Hangup(${HANGUPCAUSE})
 
 
 I have noticed that no matter what value we set in the Hangup(cause code)  
 commands, if the call is not answered by peer01 for any reason, the actual 
 cause code returned to the calling party is a 503, no matter what the 
 ${HANGUPCAUSE} is.
 
 Even if we set a fixed value like Hangup(1) (which should give a 404) or 
 Hangup(17) (which should give a 486), the cause code returned is always a 503.
 
 Has anyone else noticed this? I went through the issue tracker but I couldn't 
 find any relevant bug posted in the past. I am certain that in previous 
 versions I could set the reply message to the desired value, so I wonder if 
 this is a bug in this particular version (1.4.33.1).
 
 -- 
 Best regards,
 Vlasis Hatzistavrou.
 
 
 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello
 
 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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Vlasis Hatzistavrou

Hello Jim,

Thank you for the reply.

The problem is not reading the ${HANGUPCAUSE} or the ${DIALSTATUS}. It 
is that the Hangup(cause) command seems to ignore its argument and 
just sends a 503 cause to the caller for all unanswered calls no matter 
what...


Hangup(cause) was working as expected in previous versions and I 
wonder if something was broken along the way that went by unnoticed. I 
am just asking in the list in case I am missing something too obvious 
before posting a bug.


--
Best regards,
Vlasis Hatzistavrou.



On 15/4/2011 4:22 μμ, Jim Dickenson wrote:

My guess is since the call was never answered you should be looking at 
${DIALSTATUS}



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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

Re: [asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Jim Dickenson
If what you showed is your whole dialplan then none of the i or t or h 
extensions are going to be executed for a non answered call.
-- 
Jim Dickenson
mailto:dicken...@cfmc.com

CfMC
http://www.cfmc.com/



On Apr 15, 2011, at 6:46 AM, Vlasis Hatzistavrou wrote:

 Hello Jim,
 
 Thank you for the reply.
 
 The problem is not reading the ${HANGUPCAUSE} or the ${DIALSTATUS}. It is 
 that the Hangup(cause) command seems to ignore its argument and just sends 
 a 503 cause to the caller for all unanswered calls no matter what...
 
 Hangup(cause) was working as expected in previous versions and I wonder if 
 something was broken along the way that went by unnoticed. I am just asking 
 in the list in case I am missing something too obvious before posting a bug.
 
 -- 
 Best regards,
 Vlasis Hatzistavrou.
 
 
 
 On 15/4/2011 4:22 μμ, Jim Dickenson wrote:
 My guess is since the call was never answered you should be looking at 
 ${DIALSTATUS}
 
 
 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello
 
 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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Steve Davies
On 15 April 2011 13:02, Vlasis Hatzistavrou vh...@kinetix.gr wrote:
 Hello,

 On an Asterisk 1.4.33.1 in a simple scenario:

 [test]
 exten = _X.,1,Dial(SIP/12345@peer01,,,)

 exten = i,1,Hangup(${HANGUPCAUSE})
 exten = t,1,Hangup(${HANGUPCAUSE})
 exten = h,1,Hangup(${HANGUPCAUSE})


 I have noticed that no matter what value we set in the Hangup(cause code)
  commands, if the call is not answered by peer01 for any reason, the actual
 cause code returned to the calling party is a 503, no matter what the
 ${HANGUPCAUSE} is.

 Even if we set a fixed value like Hangup(1) (which should give a 404) or
 Hangup(17) (which should give a 486), the cause code returned is always a
 503.

 Has anyone else noticed this? I went through the issue tracker but I
 couldn't find any relevant bug posted in the past. I am certain that in
 previous versions I could set the reply message to the desired value, so I
 wonder if this is a bug in this particular version (1.4.33.1).


Strictly speaking you can only Hangup (BYE) an answered and fully
established call. In SIP terms, a hangup that occurs before an answer
is a CANCEL, and I believe a CANCEL is always represented by a 503
code in chan_sip.

Regards,
Steve

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Vlasis Hatzistavrou
The h extension is executed after the remote end peer01 rejects the call 
with a 408. I verified it by altering the dialplan as:


[test]
exten = _X.,1,Dial(SIP/12345@peer01,,,)

exten = i,1,Hangup(${HANGUPCAUSE})
exten = t,1,Hangup(${HANGUPCAUSE})
exten = h,1,NoOp(Hangup cause is: ${HANGUPCAUSE})
exten = h,n,Hangup(${HANGUPCAUSE})

and I saw in the Asterisk CLI that the correct hangupcause is shown.

--
Best regards,
Vlasis Hatzistavrou.



On 15/4/2011 5:01 μμ, Jim Dickenson wrote:

If what you showed is your whole dialplan then none of the i or t or h 
extensions are going to be executed for a non answered call.



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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

Re: [asterisk-users] Possible bug in Hangup() (Asterisk 1.4.x)

2011-04-15 Thread Vlasis Hatzistavrou

Hello Steve,

On 15/4/2011 5:07 μμ, Steve Davies wrote:

Strictly speaking you can only Hangup (BYE) an answered and fully
established call. In SIP terms, a hangup that occurs before an answer
is a CANCEL, and I believe a CANCEL is always represented by a 503
code in chan_sip.

Regards,
Steve

I see what you mean, but it is the called end (peer01) that rejects the 
call with a 408 message, it is not the originator that is canceling the 
call.


The call flow is this:

Caller-Asterisk-Peer01

and Asterisk receives a STATUS 408 message from Peer01 instead of an answer.

Asterisk then sends a STATUS 503 to the Caller, instead of sending a 
STATUS 408. The question is how to copy the correct cause code from 
the terminating end to the originating end.


I tried setting Hangup(1) to send a 404 to the called, a Hangup(17) to 
send a 486 to the caller and pretty much any other value in the Hangup() 
but Asterisk will keep on sending a 503.


I don't believe that my memory fails me, I'm pretty sure I could set a 
desirable cause in the Hangup() command in previous versions...


--
Best regards,
Vlasis Hatzistavrou.


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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