[asterisk-bugs] [Asterisk 0018016]: SIP Trunk ${DIALSTATUS} wrong return code - it is always "ANSWER" status

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Sep 21 04:56:34 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18016 
====================================================================== 
Reported By:                romirikos
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18016
Category:                   Channels/chan_sip/NewFeature
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.8.0-beta5 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-09-20 03:30 CDT
Last Modified:              2010-09-21 04:56 CDT
====================================================================== 
Summary:                    SIP Trunk ${DIALSTATUS} wrong return code - it is
always "ANSWER" status
Description: 
1. First I show my SIP Trunk and SIP phone user configuration

1.1 SIP Trunk configuration

[WMAG006-trunk]
  dtmfmode=rfc2833
  type=friend
  host=*** IP VoIP-Provider ***
  fromuser=*** My username ***
  fromdomain=*** VoIP-Provider Domain Name  ***
  username=*** username ***
  secret=*** password ***
  insecure=port,invite
  canreinvite=no
  qualify=yes
  callgroup=
  context=WMAG006-outbounds-calls
  nat=yes
  disallow=all
  allow=g729

1.2 SIP phone username configuration

[505]
  allow=all
  secret=505
  dtmfmode=rfc2833
  canreinvite=no
  context=WMAG006-outbounds-calls
  host=dynamic
  type=friend
  nat=yes
  port=5060
  qualify=yes
  dial=SIP/505
  permit=0.0.0.0/0.0.0.0
  callerid=505
  call-limit=50
  faxdetect=no
  disallow=all
  allow=g729

2. Here is my DialPlan in /etc/asterisk/extensions.conf

[WMAG006-outbounds-calls]
  ; England, Spain (Code number + phone number = 12 digits)
  ; exten => _XXXXXXXXXXXX,1,Set(CALLERID(all)=08000963317)
  ; exten => _XXXXXXXXXXXX,1,Dial(SIP/${EXTEN}@WMAG006-trunk,25,g)
  exten => _XXXXXXXXXXXX,1,Dial(SIP/WMAG006-trunk/${EXTEN},5,R)
  exten => _XXXXXXXXXXXX,n,Hangup()

  ; England 13 digits
  ;exten => _XXXXXXXXXXXXX,1,Dial(SIP/${EXTEN}@WMAG006-trunk,5)
  ;exten => _XXXXXXXXXXXXX,n,Hangup()

  ; USA, Australia (Code number + phone number = 11 digits)
  ;exten => _XXXXXXXXXXX,1,Dial(SIP/${EXTEN}@WMAG006-trunk,5)
  ;exten => _XXXXXXXXXXX,n,Hangup()

  ; Denmark (Code number + phone number = 10 digits)
  ;exten => _XXXXXXXXXX,1,Dial(SIP/${EXTEN}@WMAG006-trunk,5)
  ;exten => _XXXXXXXXXX,n,Hangup()

  exten => 505,1,Answer()
  exten => 505,n,Dial(SIP/505,25)
  exten => 505,n,Hangup()

  exten => 501,1,Answer()
  exten => 501,n,Dial(SIP/501,25)
  exten => 501,n,Hangup()

  exten => h,1,Goto(s-{DIALSTATUS},1)
  ; exten => h,1,System(/bin/sh -c "/bin/echo ${DIALSTATUS} >
/usr/local/asterisk/wmag006/status")

  exten => s-CANCEL,1,System(/bin/sh -c "/bin/echo Cancel >
/usr/local/asterisk/wmag006/status")
  exten => s-ANSWER,1,System(/bin/sh -c "/bin/echo Answer >
/usr/local/asterisk/wmag006/status")
  exten => s-NOANSWER,1,System(/bin/sh -c "/bin/echo NoAnswer >
/usr/local/asterisk/wmag006/status")
  exten => s-BUSY,1,System(/bin/sh -c "/bin/echo Busy `date +%F-%H:%M` >
/usr/local/asterisk/wmag006/status")
  exten => s-CONGESTION,1,System(/bin/sh -c "/bin/echo Congestion `date
+%F-%H:%M` > /usr/local/asterisk/wmag006/status")
  exten => s-CHANUNAVAIL,1,System(/bin/sh -c "/bin/echo Chanunavail `date
+%F-%H:%M` > /usr/local/asterisk/wmag006/status")

3. Debug output from Asterisk 1.8 CLI

    -- Registered SIP '505' at 192.168.0.7:2950
       > Saved useragent "sipLite" for peer 505
[Sep 20 11:30:58] NOTICE[30357]: chan_sip.c:19477
handle_response_peerpoke: Peer '505' is now Reachable. (24ms / 2000ms)
  == Using SIP RTP CoS mark 5
    -- Executing [380623880525 at WMAG006-outbounds-calls:1]
Dial("SIP/505-00000002", "SIP/WMAG006-trunk/380623880525,5,R") in new
stack
  == Using SIP RTP CoS mark 5
    -- Called WMAG006-trunk/380623880525
    -- SIP/WMAG006-trunk-00000003 answered SIP/505-00000002
    -- Locally bridging SIP/505-00000002 and SIP/WMAG006-trunk-00000003
    -- Executing [h at WMAG006-outbounds-calls:1] System("SIP/505-00000002",
"/bin/sh -c "/bin/echo ANSWER > /usr/local/asterisk/wmag006/status"") in
new stack
  == Spawn extension (WMAG006-outbounds-calls, 380623880525, 1) exited
non-zero on 'SIP/505-00000002'

-------------------------------------------------------------------------

  So, the issue is when I place the call through the SIP trunk it's always
return - "ANSWER" status even if the other side was BUSY, NOANSWER,
CONGESTION and etc. 
  But if I place the call between (Local IP phones that connected directly
to Asterisk 1.8) for example I call from 505 to 501 and it return RIGHT
${DIALSTATUS} code
====================================================================== 

---------------------------------------------------------------------- 
 (0127182) davidw (reporter) - 2010-09-21 04:56
 https://issues.asterisk.org/view.php?id=18016#c127182 
---------------------------------------------------------------------- 
The remote system has said that the call is answered.  This is not a bug.in
Asterisk.

<--- SIP read from 213.144.184.12:5060 --->
SIP/2.0 200 OK
CSeq: 103 INVITE


You should first try to get the remote system to fix their system.  If
that fails, you need to use a support (mailing list, forum, or IRC) channel
for asterisk, not a bug reporting one, to investigate possible workarounds. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-09-21 04:56 davidw         Note Added: 0127182                          
======================================================================




More information about the asterisk-bugs mailing list