Hello,
I’m having an odd issue where my call forwards have stopped working when Asterisk receives a SIP 302 from a partner gateway. I’m having this issue on v 13.13.0 and 14.2.1
The situation should be that Asterisk receives a call from a registered softphone (Mike) -> Dials a peer (GW1) -> Peer returns 302 Redirect -> Asterisk forwards the call to an external Gateway (GW2).
This was working fine, and suddenly it changed. Now the call seems to wait for a timeout; after the softphone and sends a CANCEL, Asterisk sends the redirected invite.
In the samples below, the NOT Working Call shows a delay of 40 seconds between the "Now Forwarding … " message and the "Not accepting call completion … " message. When tracing the calls on both gateways, Asterisk does not send this invite until after the call is torn down. On the working call, the invite is forwarded immediately.
Working call
[Feb 2 16:15:53] VERBOSE[1938][C-00000002] netsock2.c: Using SIP RTP CoS mark 5
[Feb 2 16:15:53] VERBOSE[16774][C-00000002] pbx.c: Executing [16315554321@GW2:1] Dial(“SIP/Mike-00000005”, “SIP/GW1/16315554321,20”) in new stack
[Feb 2 16:15:53] VERBOSE[16774][C-00000002] netsock2.c: Using SIP RTP CoS mark 5
[Feb 2 16:15:53] VERBOSE[16774][C-00000002] app_dial.c: Called SIP/GW1/16315554321
[Feb 2 16:15:53] VERBOSE[1938][C-00000002] chan_sip.c: Got SIP response 302 “Moved Temporarily” back from 10.45.250.10:5060
[Feb 2 16:15:53] VERBOSE[16774][C-00000002] app_dial.c: Now forwarding SIP/Mike-00000005 to ‘SIP/31026*040116315554321::::UDP@10.45.250.20’ (thanks to SIP/GW1-00000006)
[Feb 2 16:15:53] VERBOSE[16774][C-00000002] netsock2.c: Using SIP RTP CoS mark 5
[Feb 2 16:15:53] NOTICE[16774][C-00000002] app_dial.c: Not accepting call completion offers from call-forward recipient SIP/10.45.250.20-00000007
[Feb 2 16:16:02] VERBOSE[16774][C-00000002] app_dial.c: SIP/10.45.250.20-00000007 is making progress passing it to SIP/Mike-00000005
[Feb 2 16:16:04] VERBOSE[16774][C-00000002] app_dial.c: SIP/10.45.250.20-00000007 answered SIP/Mike-00000005
[Feb 2 16:16:04] VERBOSE[16823][C-00000002] bridge_channel.c: Channel SIP/10.45.250.20-00000007 joined ‘simple_bridge’ basic-bridge <12779fd3-0659-4244-89d2-2ce5f6ed393b>
[Feb 2 16:16:04] VERBOSE[16774][C-00000002] bridge_channel.c: Channel SIP/Mike-00000005 joined ‘simple_bridge’ basic-bridge <12779fd3-0659-4244-89d2-2ce5f6ed393b>
[Feb 2 16:16:09] VERBOSE[16823][C-00000002] bridge_channel.c: Channel SIP/10.45.250.20-00000007 left ‘simple_bridge’ basic-bridge <12779fd3-0659-4244-89d2-2ce5f6ed393b>
[Feb 2 16:16:09] VERBOSE[16774][C-00000002] bridge_channel.c: Channel SIP/Mike-00000005 left ‘simple_bridge’ basic-bridge <12779fd3-0659-4244-89d2-2ce5f6ed393b>
[Feb 2 16:16:09] VERBOSE[16774][C-00000002] pbx.c: Spawn extension (GW2, 16315554321, 1) exited non-zero on ‘SIP/Mike-00000005’
NOT Working call
[Feb 8 17:08:25] VERBOSE[30759] chan_sip.c: Registered SIP ‘Mike’ at 10.50.26.36:54070
[Feb 8 17:08:28] VERBOSE[30759][C-0000000c] netsock2.c: Using SIP RTP CoS mark 5
[Feb 8 17:08:28] VERBOSE[1663][C-0000000c] pbx.c: Executing [6315554321@GW2:1] Dial(“SIP/Mike-0000001e”, “SIP/GW1/6315554321,20”) in new stack
[Feb 8 17:08:28] VERBOSE[1663][C-0000000c] netsock2.c: Using SIP RTP CoS mark 5
[Feb 8 17:08:28] VERBOSE[1663][C-0000000c] app_dial.c: Called SIP/GW1/6315554321
[Feb 8 17:08:28] VERBOSE[30759][C-0000000c] chan_sip.c: Got SIP response 302 “Moved Temporarily” back from 10.45.250.10:5060
[Feb 8 17:08:28] VERBOSE[1663][C-0000000c] app_dial.c: Now forwarding SIP/Mike-0000001e to ‘SIP/31026*08016315554321::::UDP@10.45.250.20’ (thanks to SIP/GW1-0000001f)
[Feb 8 17:08:28] VERBOSE[1663][C-0000000c] netsock2.c: Using SIP RTP CoS mark 5
[Feb 8 17:09:08] NOTICE[1663][C-0000000c] app_dial.c: Not accepting call completion offers from call-forward recipient SIP/10.45.250.20-00000020
[Feb 8 17:09:08] VERBOSE[1663][C-0000000c] app_dial.c: Nobody picked up in 20000 ms
[Feb 8 17:09:41] VERBOSE[1598] asterisk.c: Remote UNIX connection disconnected
Further, I can set this call up with channel originate command. There is still a long delay, but eventually the channels are bridged. On this CLI originated call, the SIP/Mike-00000009 was setup for 40 seconds before the call progressed:
From all originate:
[Feb 9 16:57:04] VERBOSE[32623] dial.c: Called Mike
[Feb 9 16:57:05] VERBOSE[32623] dial.c: SIP/Mike-00000009 is ringing
[Feb 9 16:57:05] VERBOSE[32623] dial.c: SIP/Mike-00000009 is ringing
[Feb 9 16:57:07] VERBOSE[32623] dial.c: SIP/Mike-00000009 answered
[Feb 9 16:57:07] VERBOSE[32623][C-00000004] pbx.c: Executing [16315554321@GW2:1] NoOp(“SIP/Mike-00000009”, “this is a new no op”) in new stack
[Feb 9 16:57:07] VERBOSE[32623][C-00000004] pbx.c: Executing [16315554321@GW2:2] Dial(“SIP/Mike-00000009”, “SIP/GW1/16315554321”) in new stack
[Feb 9 16:57:07] VERBOSE[32623][C-00000004] netsock2.c: Using SIP RTP CoS mark 5
[Feb 9 16:57:07] VERBOSE[32623][C-00000004] app_dial.c: Called SIP/GW1/16315554321
[Feb 9 16:57:07] VERBOSE[30739][C-00000004] chan_sip.c: Got SIP response 302 “Moved Temporarily” back from 10.45.250.10:5060
[Feb 9 16:57:07] VERBOSE[32623][C-00000004] app_dial.c: Now forwarding SIP/Mike-00000009 to ‘SIP/31026*080116315554321::::UDP@10.45.250.20’ (thanks to SIP/GW1-0000000a)
[Feb 9 16:57:07] VERBOSE[32623][C-00000004] netsock2.c: Using SIP RTP CoS mark 5
[Feb 9 16:57:47] NOTICE[32623][C-00000004] app_dial.c: Not accepting call completion offers from call-forward recipient SIP/10.45.250.20-0000000b
[Feb 9 16:57:47] VERBOSE[32623][C-00000004] res_rtp_asterisk.c: 0x7f65380077c0 – Probation passed - setting RTP source address to 10.50.26.39:40026
[Feb 9 16:57:51] VERBOSE[32623][C-00000004] app_dial.c: SIP/10.45.250.20-0000000b is making progress passing it to SIP/Mike-00000009
[Feb 9 16:57:51] VERBOSE[32623][C-00000004] res_rtp_asterisk.c: 0x7f6530018db0 – Probation passed - setting RTP source address to 10.45.250.20:29000
[Feb 9 16:57:53] VERBOSE[32623][C-00000004] pbx.c: Spawn extension (GW2, 16315554321, 2) exited non-zero on ‘SIP/Mike-00000009’
[root@localhost asterisk]#
CLI output of call originate
localhostCLI> channel originate SIP/Mike extension 16315554321@GW2
== Using SIP RTP CoS mark 5
– Called Mike
– SIP/Mike-00000009 is ringing
– SIP/Mike-00000009 is ringing
– SIP/Mike-00000009 answered
– Executing [16315554321@GW2:1] NoOp(“SIP/Mike-00000009”, “this is a new no op”) in new stack
– Executing [16315554321@GW2:2] Dial(“SIP/Mike-00000009”, “SIP/GW1/16315554321”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/GW1/16315554321
– Got SIP response 302 “Moved Temporarily” back from 10.45.250.10:5060
– Now forwarding SIP/Mike-00000009 to 'SIP/31026080116315554321::::UDP@10.45.250.20’ (thanks to SIP/GW1-0000000a)
== Using SIP RTP CoS mark 5
[Feb 9 16:57:47] NOTICE[32623][C-00000004]: app_dial.c:1002 do_forward: Not accepting call completion offers from call-forward recipient SIP/10.45.250.20-0000000b
> 0x7f65380077c0 – Probation passed - setting RTP source address to 10.50.26.39:40026
– SIP/10.45.250.20-0000000b is making progress passing it to SIP/Mike-00000009
> 0x7f6530018db0 – Probation passed - setting RTP source address to 10.45.250.20:29000
== Spawn extension (GW2, 16315554321, 2) exited non-zero on 'SIP/Mike-00000009’
localhost*CLI>
From sip.conf:
[GW2]
type=friend
host=10.45.250.20
port=5060
insecure=invite
context=INBOUND
;context=GW2
;qualify=yes
deny=0.0.0.0/0.0.0.0
permit=10.45.250.20/255.255.255.255
promiscredir=yes
[GW1]
type=friend
host=10.45.250.10
port=5060
insecure=invite
context=GW2
;qualify=yes
deny=0.0.0.0/0.0.0.0
permit=10.45.250.10/255.255.255.255
promiscredir=yes
[Mike]
type=friend
host=dynamic
secret=test1
context=GW2
qualify=yes
disallow=all
allow=ulaw
;deny=0.0.0.0/0.0.0.0
;permit=10.50.26.27/255.255.255.255
mailbox=Mike@demo