[Home]

Summary:ASTERISK-00523: not Registered SIP ua reported as "busy"
Reporter:albor (albor)Labels:
Date Opened:2003-11-13 01:36:33.000-0600Date Closed:2008-01-15 14:37:59.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_sip_db_del_onunregister.diff.txt
Description:Call extension which is SIP phone. If SIP agent is not registered it will appear as "busy". It should be unavaiable.
Comments:By: Brian West (bkw918) 2003-11-13 15:56:55.000-0600

need you to do a sip show peers and return the results.  I see a similar situation with my cisco 7960's when I restart * and the phone hasn't sent a register request.  What endpoints are you using?

By: albor (albor) 2003-11-13 17:09:42.000-0600

I am dialing from 105 to "not Registered" extension. I expect to see unavailable rather then busy.

I am using Budgtone and SoftJoy endpoints.

silver-alb*CLI> show dialplan call_sip_0
[ Context 'call_sip_0' created by 'pbx_config' ]
 '_1XX' =>         1. Dial(SIP/BYEXTENSION|10)                   [pbx_config]
                   2. Voicemail(u${EXTEN})                       [pbx_config]
                   3. Hangup()                                   [pbx_config]
                   102. Voicemail(b${EXTEN})                     [pbx_config]
                   103. Hangup()                                 [pbx_config]
 '_2XX' =>         1. Dial(SIP/BYEXTENSION|10)                   [pbx_config]
                   2. Voicemail(u${EXTEN})                       [pbx_config]
                   3. Hangup()                                   [pbx_config]
                   102. Voicemail(b${EXTEN})                     [pbx_config]
                   103. Hangup()                                 [pbx_config]


silver-alb*CLI> sip show peers
Name/username    Host                 Mask             Port     Status
....
105/105 man      (Unspecified)   (D)  255.255.255.255  0        Unmonitored
....
102/102          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
101/101          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
  -- Executing Dial("SIP/105-1cb3", "SIP/BYEXTENSION|10") in new stack
 == Everyone is busy at this time
   -- Executing VoiceMail("SIP/105-1cb3", "b102") in new stack
 == Parsing '/etc/asterisk/voicemail.conf':   == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Playing 'vm-theperson'
   -- Playing 'digits/1'
   -- Playing 'digits/0'
   -- Playing 'digits/2'
   -- Playing 'vm-isonphone'
   -- Playing 'vm-intro'
   -- Playing 'beep'

By: Brian West (bkw918) 2003-11-13 17:27:27.000-0600

HOLD UP.. you have a config problem.. do not use BYEXTENSION and it will function properly.

[ Context 'macro-stdexten' created by 'pbx_config' ]
 's' =>            1. Dial(${ARG2}|20|tr)
                   2. Voicemail(u${ARG1})
                   3. Hangup()
                   103. Voicemail(b${ARG1})
                   104. Hangup()

asterisk*CLI> sip show peers
Name/username    Host                 Mask             Port     Status
19               (Unspecified)   (D)  255.255.255.255  0        Unmonitored
18               (Unspecified)   (D)  255.255.255.255  0        Unmonitored
17               (Unspecified)   (D)  255.255.255.255  0        Unmonitored
16               (Unspecified)   (D)  255.255.255.255  0        Unmonitored
15               (Unspecified)   (D)  255.255.255.255  0        Unmonitored


   -- Executing Macro("SIP/10-e9ff", "stdexten|15|SIP/15") in new stack
   -- Executing Dial("SIP/10-e9ff", "SIP/15|20|tr") in new stack
 == Everyone is busy at this time
   -- Executing VoiceMail("SIP/10-e9ff", "u15") in new stack
   -- Playing 'vm-theperson' (language 'en')
   -- Playing 'digits/1' (language 'en')
   -- Playing 'digits/5' (language 'en')
   -- Playing 'vm-isunavail' (language 'en')
 == Spawn extension (macro-stdexten, s, 2) exited non-zero on 'SIP/10-e9ff' in macro 'stdexten'
 == Spawn extension (default, s, 1) exited non-zero on 'SIP/10-e9ff'



This is a local config issue.  Try to stay way from BYEXTENSION because its going away and is no longer used.

bkw

edited on: 11-13-03 17:24

By: Brian West (bkw918) 2003-11-13 17:31:57.000-0600

Please let me know if that fixes your problem.

By: albor (albor) 2003-11-13 20:25:44.000-0600

Using Macros did not make any difference. Thank you for advise to move away from yet to be obsolete feature. ( BYEXTENSION )

I had in my configuration
102. Voicemail(b$...)
103. Hangup()

and you

103. Voicemail(b${ARG1})
104. Hangup()

I changed configuration and the problem gone. Thanks

By: albor (albor) 2003-11-13 21:09:28.000-0600

...oops previous change make sip_phone always anavailable

here is the trace

   -- Executing Macro("SIP/105-f75d", "sipext|106|SIP/106") in new stack
   -- Executing Dial("SIP/105-f75d", "SIP/106|10|tr") in new stack
   -- Called 106
   -- SIP/106-97f2 is ringing
   -- Nobody picked up in 10000 ms
   -- Executing VoiceMail("SIP/105-f75d", "u106") in new stack
 == Parsing '/etc/asterisk/voicemail.conf':   == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Playing 'vm-theperson'
   -- Playing 'digits/1'
   -- Playing 'digits/0'
   -- Playing 'digits/6'
   -- Playing 'vm-isunavail'
   -- Playing 'vm-intro'
   -- Playing 'beep'
   -- User ended message by pressing #
   -- Playing 'vm-msgsaved'
 == Parsing '/etc/asterisk/voicemail.conf':   == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Executing Hangup("SIP/105-f75d", "") in new stack
 == Spawn extension (macro-sipext, s, 3) exited non-zero on 'SIP/105-f75d' in macro 'sipext'
 == Spawn extension (internal_0, 106, 1) exited non-zero on 'SIP/105-f75d'
   -- Executing Macro("SIP/105-4250", "sipext|106|SIP/106") in new stack
   -- Executing Dial("SIP/105-4250", "SIP/106|10|tr") in new stack
   -- Called 106
   -- SIP/106-4d54 is ringing
   -- Got SIP response 486 "Busy Here" back from 192.168.1.225
   -- SIP/106-4d54 is busy
 == Everyone is busy at this time
   -- Executing VoiceMail("SIP/105-4250", "u106") in new stack
 == Parsing '/etc/asterisk/voicemail.conf':   == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Playing 'vm-theperson'
   -- Playing 'digits/1'
   -- Playing 'digits/0'
   -- Playing 'digits/6'
   -- Playing 'vm-isunavail'
   -- Playing 'vm-intro'
   -- Playing 'beep'
   -- Recording to /var/spool/asterisk/vm/msg0063
   -- User ended message by pressing #
   -- Playing 'vm-msgsaved'
 == Parsing '/etc/asterisk/voicemail.conf':   == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Executing Hangup("SIP/105-4250", "") in new stack
 == Spawn extension (macro-sipext, s, 3) exited non-zero on 'SIP/105-4250' in macro 'sipext'
 == Spawn extension (internal_0, 106, 1) exited non-zero on 'SIP/105-4250'
silver-alb*CLI>

By: Brian West (bkw918) 2003-11-13 21:16:13.000-0600

Local config issue.

By: albor (albor) 2003-11-13 22:07:10.000-0600

Changing configuration introduce different problem now.

Scenario 1
1. Dial(${ARG2}|10|tr)
2. Voicemail(u${ARG1})
3. Hangup()
102. Voicemail(b${ARG1})
103. Hangup()

Problem: Not Registered extensions execute busy 102

Scenario 2

1. Dial(${ARG2}|10|tr)
2. Voicemail(u${ARG1})
3. Hangup()
103. Voicemail(b${ARG1})
104. Hangup()

Problem: All unanswered calls execute unavailable 2.

Any ideas how to make both work correctly?

Try to change you you macro use 102 instead of 103 and 103 instead of 104. I hope you will see what I see.

By: Brian West (bkw918) 2003-11-13 22:39:53.000-0600

it will only do n+101 if the extension is in fact busy... most sip devices have call waiting.  You will have to disable call waiting for it to return 486 busy messages for * to execute the n+101 for busy.  Otherwise it will execute N+1 because it did infact ring the phone.. but nobody answered the callwaiting beep... thus it wasn't busy and nobody answered.   What sip devices do you have?

edited on: 11-13-03 22:34

By: albor (albor) 2003-11-13 23:45:15.000-0600

budgetone-100, SJphone (soft agent)

I do not know how to disable call waiting

edited on: 11-13-03 23:44

By: Brian West (bkw918) 2003-11-13 23:48:40.000-0600

No way to disable call waiting.. so you will always get the unavail message.  Wait for the upcoming firmware from grandstream to fix this.

bkw

By: albor (albor) 2003-11-13 23:58:32.000-0600

True for grandstream.

With SJphone you can reject the phone. See trace with 486(same as before). Still * use unavailable.
== Spawn extension (macro-sipext, s, 3) exited non-zero on 'SIP/105-f75d' in macro 'sipext'
== Spawn extension (internal_0, 106, 1) exited non-zero on 'SIP/105-f75d'
-- Executing Macro("SIP/105-4250", "sipext|106|SIP/106") in new stack
-- Executing Dial("SIP/105-4250", "SIP/106|10|tr") in new stack
-- Called 106
-- SIP/106-4d54 is ringing
-- Got SIP response 486 "Busy Here" back from 192.168.1.225
-- SIP/106-4d54 is busy
== Everyone is busy at this time
-- Executing VoiceMail("SIP/105-4250", "u106") in new stack
== Parsing '/etc/asterisk/voicemail.conf': == Parsing '/etc/asterisk/voicemail.conf': Found
-- Playing 'vm-theperson'
-- Playing 'digits/1'
-- Playing 'digits/0'
-- Playing 'digits/6'
-- Playing 'vm-isunavail'
-- Playing 'vm-intro'
-- Playing 'beep'
-- Recording to /var/spool/asterisk/vm/msg0063
-- User ended message by pressing #
-- Playing 'vm-msgsaved'
== Parsing '/etc/asterisk/voicemail.conf': == Parsing '/etc/asterisk/voicemail.conf': Found
-- Executing Hangup("SIP/105-4250", "") in new stack
== Spawn extension (macro-sipext, s, 3) exited non-zero on 'SIP/105-4250' in macro 'sipext'
== Spawn extension (internal_0, 106, 1) exited non-zero on 'SIP/105-4250'

edited on: 11-14-03 00:21

By: Mark Spencer (markster) 2003-11-17 10:37:32.000-0600

We need (and don't have) a way to differentiate CONGESTION from BUSY and also need a way that ast_request() can return why it failed (maybe with an additional parameter like cause or something that could pass that back).

By: albor (albor) 2003-11-17 18:25:47.000-0600

Here it goes according to RFC 3261
21.4.24 486 Busy Here

  The callee's end system was contacted successfully, but the callee is
  currently not willing or able to take additional calls at this end
  system.  The response MAY indicate a better time to call in the
  Retry-After header field.  The user could also be available
  elsewhere, such as through a voice mail service.  Status 600 (Busy
  Everywhere) SHOULD be used if the client knows that no other end
  system will be able to accept this call.

No doubt it is busy.

Another example:
   -- Executing Macro("SIP/105-8339", "sipext|105|SIP/105") in new stack
   -- Executing Dial("SIP/105-8339", "SIP/105|10|tr") in new stack
   -- Called 105
   -- Got SIP response 486 "" back from 192.168.1.244
   -- SIP/105-31f6 is busy
 == Everyone is busy at this time
   -- Executing VoiceMail("SIP/105-8339", "u105") in new stack
 == Parsing '/etc/asterisk/voicemail.conf':
 == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Playing 'vm/105/unavail'
   -- Playing 'vm-intro'
   -- Playing 'beep'

By: Brian West (bkw918) 2003-11-17 18:33:30.000-0600

Show me your sipext macro.  You have your logic reversed.  I get busy when busy or and unavail when no registerd just fine on mine.. and unavail when it rings and nobody answers.  So I would need to see your sipext macro to double check it.

edited on: 11-17-03 18:30

By: albor (albor) 2003-11-17 19:06:33.000-0600

show dialplan macro-sipext
[ Context 'macro-sipext' created by 'pbx_config' ]
's' =>            1. Dial(${ARG2}|10|tr)
                   2. Voicemail(u${ARG1})
                   3. Hangup()
                   103. Voicemail(b${ARG1})
                   104. Hangup()

[ Context 'call_sip_0' created by 'pbx_config' ]
 '100' =>          1. Macro(sipext|100|SIP/100)                  
 '101' =>          1. Macro(sipext|101|SIP/101)                  
 '102' =>          1. Macro(sipext|102|SIP/102)                  
 '103' =>          1. Macro(sipext|103|SIP/103)                  
 '104' =>          1. Macro(sipext|104|SIP/104)                  
 '105' =>          1. Macro(sipext|105|SIP/105)                  
 '106' =>          1. Macro(sipext|106|SIP/106)                  
 '107' =>          1. Macro(sipext|107|SIP/107)                  
 '108' =>          1. Macro(sipext|108|SIP/108)                  
 '109' =>          1. Macro(sipext|109|SIP/109)                  
 '200' =>          1. Macro(sipext|200|SIP/200)                  
 '201' =>          1. Macro(sipext|201|SIP/201)                  
 '202' =>          1. Macro(sipext|202|SIP/202)                  
 '203' =>          1. Macro(sipext|203|SIP/203)                  
 '204' =>          1. Macro(sipext|204|SIP/204)                  
 '205' =>          1. Macro(sipext|205|SIP/205)                  
 '206' =>          1. Macro(sipext|206|SIP/206)                  
 '207' =>          1. Macro(sipext|207|SIP/207)                  
 '208' =>          1. Macro(sipext|208|SIP/208)                  
 '209' =>          1. Macro(sipext|209|SIP/209)

By: Brian West (bkw918) 2003-11-18 17:26:34.000-0600

what does sip show peers have? when you get busy.. because I don't get the same results you do ....

By: albor (albor) 2003-11-19 18:26:51.000-0600

To generate this I use a trick. Agent is BudgeTone and it is calling it's own number.

209/209          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
208/208          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
207/207          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
206/206          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
205/205          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
204/204          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
203/203          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
202/202          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
201/201          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
109/109          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
108/108          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
107/107          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
106/106          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
105/105          192.168.1.244   (D)  255.255.255.255  5060     Unmonitored
104/104          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
103/103          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
102/102          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
101/101          (Unspecified)   (D)  255.255.255.255  0        Unmonitored
   -- Executing Macro("SIP/105-b105", "sipext|105|SIP/105") in new stack
   -- Executing Dial("SIP/105-b105", "SIP/105|10|tr") in new stack
   -- Called 105
   -- Got SIP response 486 "" back from 192.168.1.244
   -- SIP/105-c40e is busy
 == Everyone is busy at this time
   -- Executing VoiceMail("SIP/105-b105", "u105") in new stack
 == Parsing '/etc/asterisk/voicemail.conf':  
 == Parsing '/etc/asterisk/voicemail.conf': Found
   -- Playing 'vm/105/unavail'
   -- Playing 'vm-intro'
   -- Playing 'beep'
   -- User ended message by pressing #
   -- Playing 'vm-msgsaved'

By: Brian West (bkw918) 2003-11-19 18:35:10.000-0600

Thats the grandstream doing that.  My granstream does the same thing.  Where my 7960's and ATA-186's don't do that.  Personally the grandstream product isn't even close to good yet.

By: albor (albor) 2003-11-20 01:57:58.000-0600

Hm... agent send code 486 which is busy, asterisk receives as 486 busy and yet it picks unavailable branch. I think it is a bug. Thanks for your time anyway.

By: Brian West (bkw918) 2003-11-20 06:33:42.000-0600

I have reset this bug to open/new.

By: Brian West (bkw918) 2003-11-20 08:18:20.000-0600

I'm looking at this a bit closer and your grandstream is whats generating this 486 busy message that asterisk is responding to.  But why is this being treated as unavailable.  I see how it happens but why is the big question.  I'm digging thru the src to see if I can provide you with a fix.

By: Brian West (bkw918) 2003-11-20 08:25:12.000-0600

AH HA.. it is a config problem... we were both a little off. :P

[macro-stdexten]
exten => s,1,Dial(${ARG2},20,Tr)
exten => s,2,Voicemail(u${ARG1})
exten => s,3,Hangup
exten => s,102,Voicemail(b${ARG1})  <-- 102 not 103
exten => s,103,Hangup  <-- 103 and not 104


Looking at line 165 in app_dial made me realize I pasted you the wrong macro.  The N+101 didn't exist so it wasn't doing the busy message.. it was going to the next priority.   So this is infact a config issue.  Let me know if that fixes it.

bkw

By: Brian West (bkw918) 2003-11-20 08:45:39.000-0600

Find me on irc if that doesn't.. irc.freenode.net #asterisk bkw_ is my nick.

By: Brian West (bkw918) 2003-11-20 08:57:45.000-0600

I see what your saying now.. find me on IRC and we will try to do as mark says.

By: Brian West (bkw918) 2003-11-20 09:37:13.000-0600

[macro-sipexten]
exten => s,1,DBget(sipcheck=SIP/Registry/${ARG1})
exten => s,2,Dial(${ARG2},20,Tr)
exten => s,3,Voicemail(u${ARG1})
exten => s,4,Hangup
exten => s,102,Goto(s,3)
exten => s,103,Voicemail(b${ARG1})
exten => s,104,Hangup

The patch really isn't needed but we should really remove from SIP/Registry database if we un-register and not wait for the expire.  Since sip registrations are kept in the ASTDB we can check that to see if the client is really registered or not.  This only fixes half the problem.  We can still have a short period of time from when a client leaves and doesn't un-register till the time that the registration expires. (ie set registration intervals to like 60-300 seconds to mimimize this.)

At the CLI do a database show you will see the registrations.

bkw

edited on: 11-20-03 09:34

By: Brian West (bkw918) 2003-11-20 23:08:36.000-0600

Fixed in CVS

By: Digium Subversion (svnbot) 2008-01-15 14:37:59.000-0600

Repository: asterisk
Revision: 1770

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r1770 | markster | 2008-01-15 14:37:58 -0600 (Tue, 15 Jan 2008) | 2 lines

Delete on unregister (bug ASTERISK-523)

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

http://svn.digium.com/view/asterisk?view=rev&revision=1770