Dial Multiple Phones- DND problem

Hello guys, I have a some problem with ringing multiple phones simultanously.
I would like to set one extension which should call multiple phones (in other office) simultaneously, something like Dial(SIP/exten1&SIP/exten2). In my case I have two astersik sever and I use IAX between asterisks. Let’s assume that serverA has extensions range 3XXX and severB extensions range 4XXX. The phones which I want to call are connected to serverB,f.e.: 4004 and 4003. I need to create extension 4445(4447) on serverA which call 4003 and 4004. I use dundi for advertising extensions (I have other asterisk servers). I just want to add that all normal calls work in both directions from (serverA-serverB and serverB-serverA). I tried set this 4445/(4447) extension using Local channel variables in two ways: with Dial() application and with Queue(). Here are a parts of configuraton files from serverA:

===extensions.conf====

[Queues]
exten => 4447,1,Answer()
exten => 4447,n,Queue(itemerg)
exten => 4447,n,Hangup()

[it-emergency]
exten => 4445,1,Dial(Local/100@it-emerg&Local/101@it-emerg)
exten => 4445,2,Hangup()

[it-emerg]
exten => 100,1,Goto(lookup-dundi,4003,1)
exten => 101,1,Goto(lookup-dundi,4004,1)

[users]
include => lookup-dundi
include => it-emergency
include => Queues
include => outgoing-local

====queues.conf=========

[code]
[general]
autofill=yes
shared_lastcall=yes

[itemerg]
musicclass=default
;strategy=rrmemory
strategy=ringall
joinempty=yes
leavewhenempty=yes
ringinuse=no

member => Local/100@it-emerg
member => Local/101@it-emerg[/code]

It works until the DND is enabled on f.e. 4003. When DND is enabled and I dial 4445/4447 from phone with 3099 number, then in aster CLI> I got something like this:

[Nov 30 17:02:13]     -- Executing [4445@users:1] Dial("SIP/3099-0000010a", "Local/100@it-emerg&Local/101@it-emerg,30") in new stack
[Nov 30 17:02:13]     -- Called 100@it-emerg
[Nov 30 17:02:13]     -- Executing [100@it-emerg:1] Goto("Local/100@it-emerg-4861;2", "users,4003,1") in new stack
[Nov 30 17:02:13]     -- Goto (users,4003,1)
[Nov 30 17:02:13]     -- Called 101@it-emerg
[Nov 30 17:02:13]     -- Executing [101@it-emerg:1] Goto("Local/101@it-emerg-e651;2", "users,4004,1") in new stack
[Nov 30 17:02:13]     -- Goto (users,4004,1)
[Nov 30 17:02:13]     -- Called iaxuser:+pDtIhClxxA+29MQxAR9eg==@IP_serverB/4003
[Nov 30 17:02:13]     -- Call accepted by IPADDR (format alaw)
[Nov 30 17:02:13]     -- Format for call is alaw
[Nov 30 17:02:13]     -- IAX2/IP_serverB:4569-561 is ringing
[Nov 30 17:02:13]     -- Local/100@it-emerg-4861;1 is ringing
[Nov 30 17:02:13]     -- Called iaxuser:+pDtIhClxxA+29MQxAR9eg==@IP_serverB/4004
[Nov 30 17:02:13]     -- Call accepted by IP_serverB (format alaw)
[Nov 30 17:02:13]     -- Format for call is alaw
[Nov 30 17:02:13]     -- IAX2/IP_serverB:4569-2709 answered Local/101@it-emerg-e651;2
[Nov 30 17:02:13]     -- Local/101@it-emerg-e651;1 answered SIP/3099-0000010a
[Nov 30 17:02:13]     -- Hungup 'IAX2/IP_serverB:4569-561'
[Nov 30 17:02:13]   == Spawn extension (users, 4003, 1) exited non-zero on 'Local/100@it-emerg-4861;2'
[Nov 30 17:02:14]     -- Hungup 'IAX2/IP_serverB:4569-2709'
[Nov 30 17:02:14]   == Spawn extension (users, 4004, 1) exited non-zero on 'Local/101@it-emerg-e651;2'
[Nov 30 17:02:14]   == Spawn extension (users, 4445, 1) exited non-zero on 'SIP/3099-0000010a'
[Nov 30 17:02:30]   == Using SIP RTP TOS bits 184
[Nov 30 17:02:30]   == Using SIP RTP CoS mark 5
[Nov 30 17:02:30]   == Using SIP VRTP TOS bits 136
[Nov 30 17:02:30]   == Using SIP VRTP CoS mark 6
[Nov 30 17:02:30]     -- Executing [4447@users:1] Answer("SIP/3099-0000010b", "") in new stack
[Nov 30 17:02:30]     -- Executing [4447@users:2] Queue("SIP/3099-0000010b", "itemerg") in new stack
[Nov 30 17:02:30]     -- Started music on hold, class 'default', on SIP/3099-0000010b
[Nov 30 17:02:30]     -- Executing [100@it-emerg:1] Goto("Local/100@it-emerg-f054;2", "users,4003,1") in new stack
[Nov 30 17:02:30]     -- Goto (users,4003,1)
[Nov 30 17:02:30]     -- Executing [101@it-emerg:1] Goto("Local/101@it-emerg-5af9;2", "users,4004,1") in new stack
[Nov 30 17:02:30]     -- Goto (users,4004,1)
[Nov 30 17:02:30]     -- Called iaxuser:+pDtIhClxxA+29MQxAR9eg==@IP_serverB/4003
[Nov 30 17:02:30]     -- Called iaxuser:+pDtIhClxxA+29MQxAR9eg==@IP_serverB/4004
[Nov 30 17:02:30]     -- Call accepted by IP_serverB (format alaw)
[Nov 30 17:02:30]     -- Format for call is alaw
[Nov 30 17:02:30]     -- Call accepted by IP_serverB (format alaw)
[Nov 30 17:02:30]     -- Format for call is alaw
[Nov 30 17:02:30]     -- IAX2/IP_serverB:4569-3357 answered Local/101@it-emerg-5af9;2
[Nov 30 17:02:30]     -- Local/101@it-emerg-5af9;1 answered SIP/3099-0000010b
[Nov 30 17:02:30]     -- Hungup 'IAX2/IP_serverB:4569-641'
[Nov 30 17:02:30]     -- Stopped music on hold on SIP/3099-0000010b

and on the phone display there is “Hung up” or “Call Ended” message.

Could someone please help me?
Does anyoone has an idea what could it be related to?

The phone will show hungup for calls because of this:

exten => 4447,1,Answer()

Maybe you have a redundant Answer on the other side, as well?

What is the CLI output of server B during a failed call?

[quote=“david55”]The phone will show hungup for calls because of this:

exten => 4447,1,Answer()

Maybe you have a redundant Answer on the other side, as well?[/quote]

on the other side there is a macro-phone

[macro-phone]
exten => s,1,Dial(SIP/${MACRO_EXTEN},25)
exten => s,n,Goto(${DIALSTATUS},1)
exten => ANSWER,1,Hangup
exten => CANCEL,1,Hangup
exten => NOANSWER,1,Voicemail(${MACRO_EXTEN}@default,u)
exten => BUSY,1,Voicemail(${MACRO_EXTEN}@default,b)
exten => CONGESTION,1,Voicemail(${MACRO_EXTEN}@default,b)
exten => a,1,VoicemailMain(${MACRO_EXTEN}@default)
exten => CHANUNAVAIL,1,Playback(invalidnum)
exten => CHANUNAVAIL,2,Hangup

I replaced

but the result is the same:

serverA output:

[Dec 1 17:35:54] == Using SIP RTP TOS bits 184 [Dec 1 17:35:54] == Using SIP RTP CoS mark 5 [Dec 1 17:35:54] -- Executing [4447@users:1] Verbose("SIP/3099-00000009", "2,"3099" <3099>entering the itemerg queue") in new stack [Dec 1 17:35:54] == "3099" <3099>entering the itemerg queue [Dec 1 17:35:54] -- Executing [4447@users:2] Queue("SIP/3099-00000009", "itemerg") in new stack [Dec 1 17:35:54] -- Started music on hold, class 'default', on SIP/3099-00000009 [Dec 1 17:35:54] -- Executing [100@it-emerg:1] Goto("Local/100@it-emerg-dc34;2", "lookup-dundi,4003,1") in new stack [Dec 1 17:35:54] -- Goto (lookup-dundi,4003,1) [Dec 1 17:35:54] -- Executing [101@it-emerg:1] Goto("Local/101@it-emerg-e273;2", "lookup-dundi,4004,1") in new stack [Dec 1 17:35:54] -- Goto (lookup-dundi,4004,1) [Dec 1 17:35:54] -- Called IAX2/iaxuser:KqZWNOxSa0AjybcioKppDw==@IP_serverB/4003 [Dec 1 17:35:54] -- Called IAX2/iaxuser:KqZWNOxSa0AjybcioKppDw==@IP_serverB/4004 [Dec 1 17:35:54] -- Call accepted by IP_serverB (format alaw) [Dec 1 17:35:54] -- Format for call is alaw [Dec 1 17:35:54] -- Call accepted by IP_serverB (format alaw) [Dec 1 17:35:54] -- Format for call is alaw [Dec 1 17:35:54] -- IAX2/IP_serverB:4569-4246 is ringing [Dec 1 17:35:54] -- Local/100@it-emerg-dc34;1 is ringing [Dec 1 17:35:54] -- IAX2/IP_serverB:4569-16 is ringing [Dec 1 17:35:54] -- Local/101@it-emerg-e273;1 is ringing [Dec 1 17:35:56] -- Stopped music on hold on SIP/3099-00000009 [Dec 1 17:35:56] -- Hungup 'IAX2/IP_serverB:4569-4246' [Dec 1 17:35:56] -- Hungup 'IAX2/IP_serverB:4569-16' [Dec 1 17:35:56] == Spawn extension (users, 4447, 2) exited non-zero on 'SIP/3099-00000009' [Dec 1 17:35:56] == Spawn extension (lookup-dundi, 4004, 1) exited non-zero on 'Local/101@it-emerg-e273;2' [Dec 1 17:35:56] == Spawn extension (lookup-dundi, 4003, 1) exited non-zero on 'Local/100@it-emerg-dc34;2' [Dec 1 17:36:03] == Using SIP RTP TOS bits 184 [Dec 1 17:36:03] == Using SIP RTP CoS mark 5 [Dec 1 17:36:03] -- Executing [4447@users:1] Verbose("SIP/3099-0000000a", "2,"3099" <3099>entering the itemerg queue") in new stack [Dec 1 17:36:03] == "3099" <3099>entering the itemerg queue [Dec 1 17:36:03] -- Executing [4447@users:2] Queue("SIP/3099-0000000a", "itemerg") in new stack [Dec 1 17:36:03] -- Started music on hold, class 'default', on SIP/3099-0000000a [Dec 1 17:36:03] -- Executing [100@it-emerg:1] Goto("Local/100@it-emerg-e7e5;2", "lookup-dundi,4003,1") in new stack [Dec 1 17:36:03] -- Goto (lookup-dundi,4003,1) [Dec 1 17:36:03] -- Executing [101@it-emerg:1] Goto("Local/101@it-emerg-badd;2", "lookup-dundi,4004,1") in new stack [Dec 1 17:36:03] -- Goto (lookup-dundi,4004,1) [Dec 1 17:36:03] -- Called IAX2/iaxuser:KqZWNOxSa0AjybcioKppDw==@IP_serverB/4003 [Dec 1 17:36:03] -- Called IAX2/iaxuser:KqZWNOxSa0AjybcioKppDw==@IP_serverB/4004 [Dec 1 17:36:03] -- Call accepted by IP_serverB (format alaw) [Dec 1 17:36:03] -- Format for call is alaw [Dec 1 17:36:03] -- Call accepted by IP_serverB (format alaw) [Dec 1 17:36:03] -- Format for call is alaw [Dec 1 17:36:03] -- IAX2/IP_serverB:4569-2796 answered Local/100@it-emerg-e7e5;2 [Dec 1 17:36:03] -- Local/100@it-emerg-e7e5;1 answered SIP/3099-0000000a [Dec 1 17:36:03] -- Hungup 'IAX2/IP_serverB:4569-1935' [Dec 1 17:36:03] == Spawn extension (lookup-dundi, 4004, 1) exited non-zero on 'Local/101@it-emerg-badd;2' [Dec 1 17:36:03] -- Stopped music on hold on SIP/3099-0000000a [Dec 1 17:36:03] -- Hungup 'IAX2/IP_serverB:4569-2796' [Dec 1 17:36:03] == Spawn extension (lookup-dundi, 4003, 1) exited non-zero on 'Local/100@it-emerg-e7e5;2' [Dec 1 17:36:03] == Spawn extension (users, 4447, 2) exited non-zero on 'SIP/3099-0000000a''

here is a serverB output:

[Dec 1 17:35:54] -- Accepting AUTHENTICATED call from IP_serverA.250: > requested format = alaw, > requested prefs = (), > actual format = alaw, > host prefs = (alaw|gsm|g726), > priority = mine [Dec 1 17:35:54] -- Executing [4003@incoming-dundi:1] Macro("IAX2/iaxuser-1616", "phone,0") in new stack [Dec 1 17:35:54] -- Executing [s@macro-phone:1] Dial("IAX2/iaxuser-1616", "SIP/4003,25") in new stack [Dec 1 17:35:54] == Using SIP RTP TOS bits 184 [Dec 1 17:35:54] == Using SIP RTP CoS mark 5 [Dec 1 17:35:54] -- Called SIP/4003 [Dec 1 17:35:54] -- Accepting AUTHENTICATED call from IP_serverA.250: > requested format = alaw, > requested prefs = (), > actual format = alaw, > host prefs = (alaw|gsm|g726), > priority = mine [Dec 1 17:35:54] -- Executing [4004@incoming-dundi:1] Macro("IAX2/iaxuser-5086", "phone,0") in new stack [Dec 1 17:35:54] -- Executing [s@macro-phone:1] Dial("IAX2/iaxuser-5086", "SIP/4004,25") in new stack [Dec 1 17:35:54] == Using SIP RTP TOS bits 184 [Dec 1 17:35:54] == Using SIP RTP CoS mark 5 [Dec 1 17:35:54] -- SIP/4003-00000019 is ringing [Dec 1 17:35:54] -- Called SIP/4004 [Dec 1 17:35:54] -- SIP/4004-0000001a is ringing [Dec 1 17:35:56] == Spawn extension (macro-phone, s, 1) exited non-zero on 'IAX2/iaxuser-5086' in macro 'phone' [Dec 1 17:35:56] == Spawn extension (incoming-dundi, 4004, 1) exited non-zero on 'IAX2/iaxuser-5086' [Dec 1 17:35:56] -- Hungup 'IAX2/iaxuser-5086' [Dec 1 17:35:56] == Spawn extension (macro-phone, s, 1) exited non-zero on 'IAX2/iaxuser-1616' in macro 'phone' [Dec 1 17:35:56] == Spawn extension (incoming-dundi, 4003, 1) exited non-zero on 'IAX2/iaxuser-1616' [Dec 1 17:35:56] -- Hungup 'IAX2/iaxuser-1616' [Dec 1 17:36:03] -- Accepting AUTHENTICATED call from IP_serverA.250: > requested format = alaw, > requested prefs = (), > actual format = alaw, > host prefs = (alaw|gsm|g726), > priority = mine [Dec 1 17:36:03] -- Executing [4003@incoming-dundi:1] Macro("IAX2/iaxuser-1007", "phone,0") in new stack [Dec 1 17:36:03] -- Executing [s@macro-phone:1] Dial("IAX2/iaxuser-1007", "SIP/4003,25") in new stack [Dec 1 17:36:03] == Using SIP RTP TOS bits 184 [Dec 1 17:36:03] == Using SIP RTP CoS mark 5 [Dec 1 17:36:03] -- Accepting AUTHENTICATED call from IP_serverA.250: > requested format = alaw, > requested prefs = (), > actual format = alaw, > host prefs = (alaw|gsm|g726), > priority = mine [Dec 1 17:36:03] -- Executing [4004@incoming-dundi:1] Macro("IAX2/iaxuser-2940", "phone,0") in new stack [Dec 1 17:36:03] -- Called SIP/4003 [Dec 1 17:36:03] -- Executing [s@macro-phone:1] Dial("IAX2/iaxuser-2940", "SIP/4004,25") in new stack [Dec 1 17:36:03] == Using SIP RTP TOS bits 184 [Dec 1 17:36:03] == Using SIP RTP CoS mark 5 [Dec 1 17:36:03] -- Got SIP response 486 "Busy Here" back from 192.168.204.103:5060 [Dec 1 17:36:03] -- SIP/4003-0000001b is busy [Dec 1 17:36:03] == Everyone is busy/congested at this time (1:1/0/0) [Dec 1 17:36:03] -- Executing [s@macro-phone:2] Goto("IAX2/iaxuser-1007", "BUSY,1") in new stack [Dec 1 17:36:03] -- Goto (macro-phone,BUSY,1) [Dec 1 17:36:03] -- Executing [BUSY@macro-phone:1] VoiceMail("IAX2/iaxuser-1007", "4003@default,b") in new stack [Dec 1 17:36:03] -- Called SIP/4004 [Dec 1 17:36:03] == Spawn extension (macro-phone, s, 1) exited non-zero on 'IAX2/iaxuser-2940' in macro 'phone' [Dec 1 17:36:03] == Spawn extension (incoming-dundi, 4004, 1) exited non-zero on 'IAX2/iaxuser-2940' [Dec 1 17:36:03] -- Hungup 'IAX2/iaxuser-2940' [Dec 1 17:36:03] WARNING[2953]: chan_sip.c:20539 handle_response: Remote host can't match request CANCEL to call '7978f4c72e6116c147d988702721c504@192.168.204.1:5060'. Giving up. [Dec 1 17:36:03] WARNING[13298]: app_voicemail.c:5644 leave_voicemail: No entry in voicemail config file for '4003' [Dec 1 17:36:03] -- Auto fallthrough, channel 'IAX2/iaxuser-1007' status is 'BUSY' [Dec 1 17:36:03] -- Hungup 'IAX2/iaxuser-1007'

Your first post was a Dial and a Queue, both answered over the IAX connection. Your second one showed two Queues, one answered and the other not. They are not directly comparable.

Removing the Answer was to prevent the phone seeing the call as always answered, and therefore reporting hung up, when you used the Queue. The second trace shows no indication that the incoming channel was answered, in one of the two cases.

[quote=“david55”]Your first post was a Dial and a Queue, both answered over the IAX connection. Your second one showed two Queues, one answered and the other not. They are not directly comparable.
[/quote]

The problem is that in both causes the IAX connecton were answered, but when one of those phones return BUSY status, then all connection are hung.

[quote=“david55”]
The second trace shows no indication that the incoming channel was answered, in one of the two cases.[/quote]

Sorry, but I’m not advanced asterisk user, and I don’t really understand what your last sentence does mean. Could you explain it?

I also noticed that if I replace:

exten => BUSY,1,Voicemail(${MACRO_EXTEN}@default,b)

by:

exten => BUSY,1,Hangup

in [macro-phone] there is no problem with DND when is enabled, but of course I’m aware that there would not be voicemail messages when called number is busy. So it would be good if the voicemail system could work with this soultion.

Compare the occurrences of lines like:

Nov 30 17:02:13] – Local/101@it-emerg-e651;1 answered SIP/3099-0000010a

Yes, you have right, but as you an see, just after the answer there is Hungup.

[Nov 30 17:02:13]     -- Local/101@it-emerg-e651;1 answered SIP/3099-0000010a
[Nov 30 17:02:13]     -- Hungup 'IAX2/IP_serverB:4569-561'
[Nov 30 17:02:13]   == Spawn extension (users, 4003, 1) exited non-zero on 'Local/100@it-emerg-4861;2'
[Nov 30 17:02:14]     -- Hungup 'IAX2/IP_serverB:4569-2709'

The phone where DND was not enabled was ringing for just 1 sec, or even shorter.

Disabling Voicemail is not a good solution for me, so maybe you have any other ideas?