Asterisk ring twice when using Dial Application

Here is the application I used in the code:

$this->client->exec('Dial', [__transfer_number, __timeout, G()]);

Here is a snapshot of my asterisk:

`
– AGI Script Executing Application: (Dial) Options: (SIP/trunk_test/7573342035,30,G(from-answer,1698835192,1))
== Using SIP RTP CoS mark 5

– Called SIP/trunk_test/7573342035

– SIP/trunk_test-000003ab is ringing

– Local/1698835192@outreach-00000396;1 is ringing

– SIP/trunk_test-000003ab is ringing

– SIP/trunk_test-000003ab redirecting info has changed, passing it to Local/1698835192@outreach-00000396;2

– SIP/trunk_test-000003ab is busy

== Everyone is busy/congested at this time (1:1/0/0)`

Summary:

First, the asterisk dial SIP/trunk_test. Then I hang up/ don’t pick up. But instead of nothing happened after that. there’s another call to my phone number so I have to hang up/ don’t pick up again.

Goal:

After the first hangup/don’t pick up there will be no more calls to my number.

1 Like

You would need to provide the complete SIP trace from “sip set debug on” to show what is actually happening at a SIP level.

Sure, here is the completed sip trace:

Really destroying SIP dialog '441f699a0e8b1c340c20747d5559a7fe@127.0.1.1' Method: REGISTER
Really destroying SIP dialog '2957a17e04b938004af90b915a0b900a@127.0.1.1' Method: REGISTER
Really destroying SIP dialog '0ec4a51b3d74cd245ad94fc91bfbe6e6@127.0.1.1' Method: REGISTER
[Nov  2 09:26:21] WARNING[951]: pbx_spool.c:253 parse_line: Invalid retrytime at line 4 of /var/spool/asterisk/outgoing/1698891981.call
    -- Attempting call on Local/1698891981@outreach for application Wait(3600) (Retry 1)
    -- Called 1698891981@outreach
    -- Executing [1698891981@outreach:1] AGI("Local/1698891981@outreach-000003b4;2", "callflow/outreach.php,1698891981")
    -- Launched AGI Script /var/lib/asterisk/agi-bin/callflow/outreach.php
 callflow/outreach.php,1698891981: Incoming callflow phone call.
 callflow/outreach.php,1698891981: Find phone numbers for outreach.
 callflow/outreach.php,1698891981: Finded call flow design.
[Nov  2 09:26:22] WARNING[78090][C-000003e5]: chan_sip.c:23340 func_headers_read2: This function can only be used on SIP channels.
[Nov  2 09:26:22] WARNING[78090][C-000003e5]: chan_sip.c:23275 func_header_read: This function requires a header name.
 callflow/outreach.php,1698891981: Start call flow design.
 callflow/outreach.php,1698891981: Call setting init to get and set asterisk and callflow varriable
 callflow/outreach.php,1698891981: Incomming setting callflow
 callflow/outreach.php,1698891981: Go to action: Check Outreach By
 callflow/outreach.php,1698891981: Go to action: Dial


  AGI Script Executing Application: (Dial) Options: (SIP/7573342035@trunk_test,30,G(from-answer,1698891981,1))
  == Using SIP RTP CoS mark 5
Audio is at 17924
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 64.2.142.26:5060:
INVITE sip:7573342035@xxxxx.xxxx:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168.1.121:5060;branch=z9hG4bK0cc34020;rport
Max-Forwards: 70
From: <sip:2065621001@192.168.1.121>;tag=as2db0452d
To: <sip:7573342035@xxxxx.xxxx:5060>
Contact: <sip:2065621001@192.168.1.121:5060;transport=tcp>
Call-ID: 2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 18.14.0
Date: Thu, 02 Nov 2023 02:26:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 240

v=0
o=root 569534293 569534293 IN IP4 192.168.1.121
s=Asterisk PBX 18.14.0
c=IN IP4 192.168.1.121
t=0 0
m=audio 17924 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

--- Called SIP/7573342035@trunk_test

<--- SIP read from TCP:64.2.142.26:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.1.121:5060;received=192.168.1.121;branch=z9hG4bK0cc34020;rport=63268
From: <sip:2065621001@192.168.1.121>;tag=as2db0452d
To: <sip:7573342035@xxxxx.xxxx:5060>
Call-ID: 2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060
CSeq: 102 INVITE
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog '4f4b42ba2bc86c22-12046@127.0.0.1' in 32000 ms (Method: OPTIONS)

<--- SIP read from TCP:64.2.142.26:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TCP 192.168.1.121:5060;received=192.168.1.121;branch=z9hG4bK0cc34020;rport=63268
From: <sip:2065621001@192.168.1.121>;tag=as2db0452d
To: <sip:7573342035@xxxxx.xxxx:5060>;tag=as52fc6a00
Call-ID: 2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060
CSeq: 102 INVITE
Server: packetrino
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Contact: <sip:7573342035@64.2.142.26:5060;transport=tcp>
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:7573342035@64.2.142.26:5060;transport=tcp>
    -- SIP/trunk_test-000003c6 is ringing
    -- Local/1698891981@outreach-000003b4;1 is ringing
Really destroying SIP dialog '48a0e46d71b5278d34b900da01b893bc@192.168.1.121:5060' Method: OPTIONS
Retransmitting #3 (NAT) to 64.190.63.111:5060:
REGISTER sip:yourdomain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.121:5060;branch=z9hG4bK5946980a;rport
Max-Forwards: 70
From: <sip:0123456789@yourdomain.com>;tag=as4a792ec6
To: <sip:0123456789@yourdomain.com>
Call-ID: 2957a17e04b938004af90b915a0b900a@127.0.1.1
CSeq: 2771 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 18.14.0
Expires: 120
Contact: <sip:trunk%2001@192.168.1.121:5060>
Content-Length: 0

---
Really destroying SIP dialog '4f4b42ba2bc86c1c-12046@127.0.0.1' Method: OPTIONS

<--- SIP read from TCP:64.2.142.26:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TCP 192.168.1.121:5060;received=192.168.1.121;branch=z9hG4bK0cc34020;rport=63268
From: <sip:2065621001@192.168.1.121>;tag=as2db0452d
To: <sip:7573342035@xxxxx.xxxx:5060>;tag=as52fc6a00
Call-ID: 2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060
CSeq: 102 INVITE
Server: packetrino
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Contact: <sip:7573342035@64.2.142.26:5060;transport=tcp>
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:7573342035@64.2.142.26:5060;transport=tcp>
    -- SIP/trunk_test-000003c6 is ringing

<--- SIP read from TCP:64.2.142.26:5060 --->
SIP/2.0 480 Temporarily unavailable
Via: SIP/2.0/TCP 192.168.1.121:5060;received=192.168.1.121;branch=z9hG4bK0cc34020;rport=63268
From: <sip:2065621001@192.168.1.121>;tag=as2db0452d
To: <sip:7573342035@xxxxx.xxxx:5060>;tag=as52fc6a00
Call-ID: 2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060
CSeq: 102 INVITE
Server: packetrino
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Transmitting (NAT) to 64.2.142.26:5060:
ACK sip:7573342035@64.2.142.26:5060;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.121:5060;branch=z9hG4bK0cc34020;rport
Max-Forwards: 70
From: <sip:2065621001@192.168.1.121>;tag=as2db0452d
To: <sip:7573342035@xxxxx.xxxx:5060>;tag=as52fc6a00
Contact: <sip:2065621001@192.168.1.121:5060;transport=tcp>
Call-ID: 2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 18.14.0
Content-Length: 0


---SIP/trunk_test-000003c6 redirecting info has changed, passing it to Local/1698891981@outreach-000003b4;2
--- SIP/trunk_test-000003c6 is busy
Scheduling destruction of SIP dialog '2d7086e628392405358d2c2b1422e84c@192.168.1.121:5060' in 14848 ms (Method: INVITE)
  == Everyone is busy/congested at this time (1:1/0/0)
 callflow/outreach.php,1698891981: DIALSTATUS: BUSY
 callflow/outreach.php,1698891981: Go to action: Update  - Busy

In the above sip trace, I have censored the sip trunk address with xxxxx and changed the real phone number. Please let me know if you ever need more information. Thanks

If the given SIP trace and log is all there is, the problem is not in Asterisk and doesn’t appear as though it can be resolved there. It sends a call out, gets a ringing indication, then ultimately gets a temporarily unavailable. It’s not the one behaving as you describe.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.