I am trying to implement the following dialplan where if someone calls 8XX asterisk will page extension 1XX. The Devices that register for 1XX have been set to auto answer paging/intercom.
exten => _8XX,1,NoOp(Testing calls to autoanswer)
same => n,Set(number=${EXTEN:-2})
same => n,Page(${PJSIP_DIAL_CONTACTS(1${number})})
same => n,Hangup()
So when I dial 804 it should page the devices registered with endpoint 104 and the device should autoanswer, on contrary if I dial 104 it should dial the PJSIP contacts for 104 and the device should not auto answer as autoanswer is selected for paging only. In my situation, the device won’t auto answer 804.
here is what I get on the cli
== Setting global variable 'SIPDOMAIN' to '192.168.1.18'
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
-- Executing [804@default:1] NoOp("PJSIP/103-00000012", "Testing calls to autoanswer") in new stack
-- Executing [804@default:2] Set("PJSIP/103-00000012", "number=04") in new stack
-- Executing [804@default:3] Page("PJSIP/103-00000012", "PJSIP/104/sip:104@192.168.1.237:5062") in new stack
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
-- Called 104/sip:104@192.168.1.237:5062
-- <PJSIP/103-00000012> Playing 'beep.gsm' (language 'en')
-- PJSIP/104-00000013 is ringing
> 0x154a160 -- Strict RTP learning after remote address set to: 192.168.1.243:23440
> 0x154a160 -- Strict RTP switching to RTP target address 192.168.1.243:23440 as source
-- Channel CBAnn/790859887-00000002;2 joined 'softmix' base-bridge <4c4f905c-a573-41ce-9ea8-e106b1010022>
-- Channel PJSIP/103-00000012 joined 'softmix' base-bridge <4c4f905c-a573-41ce-9ea8-e106b1010022>
> 0x154a160 -- Strict RTP learning complete - Locking on source address 192.168.1.243:23440
-- Channel PJSIP/103-00000012 left 'softmix' base-bridge <4c4f905c-a573-41ce-9ea8-e106b1010022>
-- Channel CBAnn/790859887-00000002;2 left 'softmix' base-bridge <4c4f905c-a573-41ce-9ea8-e106b1010022>
== Spawn extension (default, 804, 3) exited non-zero on 'PJSIP/103-00000012'
The softphone from where I dialed starts the call timmer but the phones registered to 104 keeps ringing
No. Timestamp (Dir) Address SIP Message
===== ========== ============================== ===================================
00000 1553170249 * <== 192.168.1.243:19081 INVITE sip:804@192.168.1.18 SIP/2.0
00001 1553170249 * ==> 192.168.1.243:19081 SIP/2.0 401 Unauthorized
00002 1553170249 * <== 192.168.1.243:19081 ACK sip:804@192.168.1.18 SIP/2.0
00003 1553170249 * <== 192.168.1.243:19081 INVITE sip:804@192.168.1.18 SIP/2.0
00004 1553170249 * ==> 192.168.1.243:19081 SIP/2.0 100 Trying
00005 1553170249 * ==> 192.168.1.237:5062 INVITE sip:104@192.168.1.237:5062 SIP/2.0
00006 1553170249 * <== 192.168.1.237:5062 SIP/2.0 100 Trying
00007 1553170249 * <== 192.168.1.237:5062 SIP/2.0 180 Ringing
00008 1553170249 * ==> 192.168.1.243:19081 OPTIONS sip:103@192.168.1.243:19081 SIP/2.0
00009 1553170249 * <== 192.168.1.243:19081 SIP/2.0 200 OK
00010 1553170249 * ==> 192.168.1.243:19081 SIP/2.0 200 OK
00011 1553170249 * <== 192.168.1.243:19081 ACK sip:192.168.1.18:5060 SIP/2.0
00012 1553170260 * <== 192.168.1.243:19081 BYE sip:192.168.1.18:5060 SIP/2.0
00013 1553170260 * ==> 192.168.1.243:19081 SIP/2.0 200 OK
00014 1553170260 * ==> 192.168.1.237:5062 CANCEL sip:104@192.168.1.237:5062 SIP/2.0
00015 1553170261 * <== 192.168.1.237:5062 SIP/2.0 200 OK
00016 1553170261 * <== 192.168.1.237:5062 SIP/2.0 487 Request Terminated
00017 1553170261 * ==> 192.168.1.237:5062 ACK sip:104@192.168.1.237:5062 SIP/2.0
Below is te verbose output of logs on the cli
INVITE sip:104@192.168.1.237:5062 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.18:5060;rport;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>
Contact: <sip:asterisk@192.168.1.18:5060>
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "103" <sip:Zone_3@192.168.1.18>
Max-Forwards: 70
User-Agent: Asterisk PBX 15.2.2
Content-Type: application/sdp
Content-Length: 315
v=0
o=- 1851903853 1851903853 IN IP4 192.168.1.18
s=Asterisk
c=IN IP4 192.168.1.18
t=0 0
m=audio 30698 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G -- Called 104/sip:104@192.168.1.237:5062
-- <PJSIP/103-00000018> Playing 'beep.gsm' (language 'en')
<--- Received SIP response (488 bytes) from UDP:192.168.1.237:5062 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.18:5060;rport=5060;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 INVITE
Supported: replaces, path, eventlist
User-Agent: Grandstream GXV3275 1.0.3.207
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<--- Received SIP response (576 bytes) from UDP:192.168.1.237:5062 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.1.18:5060;rport=5060;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>;tag=1405952063
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 INVITE
Contact: <sip:104@192.168.1.237:5062>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream GXV3275 1.0.3.207
Allow-Events: talk, hold
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
-- PJSIP/104-00000019 is ringing
> 0x13a5640 -- Strict RTP learning after remote address set to: 192.168.1.243:12824
<--- Transmitting SIP response (862 bytes) to UDP:192.168.1.243:19081 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.243:19081;rport=19081;received=192.168.1.243;branch=z9hG4bK25500860
Call-ID: 255484480-19081-17@BJC.BGI.B.CED
From: <sip:103@192.168.1.18>;tag=33030935
To: <sip:804@192.168.1.18>;tag=ff072b28-e1d4-45c1-a153-d3c634f9f9bd
CSeq: 161 INVITE
Server: Asterisk PBX 15.2.2
Contact: <sip:192.168.1.18:5060>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 299
v=0
o=- 8000 8002 IN IP4 192.168.1.18
s=Asterisk
c=IN IP4 192.168.1.18
t=0 0
m=audio 34942 RTP/AVP 0 8 3 2 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
<--- Received SIP request (527 bytes) from UDP:192.168.1.243:19081 --->
ACK sip:192.168.1.18:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.243:19081;branch=z9hG4bK833348070;rport
From: <sip:103@192.168.1.18>;tag=33030935
To: <sip:804@192.168.1.18>;tag=ff072b28-e1d4-45c1-a153-d3c634f9f9bd
Call-ID: 255484480-19081-17@BJC.BGI.B.CED
CSeq: 161 ACK
Contact: <sip:103@192.168.1.243:19081>
Max-Forwards: 70
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream Wave 1.0.3.26
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
> 0x13a5640 -- Strict RTP switching to RTP target address 192.168.1.243:12824 as source
-- Channel CBAnn/1507844121-00000004;2 joined 'softmix' base-bridge <8e377ad9-d0ba-4ae9-91ec-e740b74445e8>
-- Channel PJSIP/103-00000018 joined 'softmix' base-bridge <8e377ad9-d0ba-4ae9-91ec-e740b74445e8>
> 0x13a5640 -- Strict RTP learning complete - Locking on source address 192.168.1.243:12824
<--- Received SIP request (300 bytes) from UDP:192.168.1.161:5060 --->
OPTIONS sip:192.168.1.18 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.161:5060;rport;branch=z9hG4bK893451099
From: <sip:161@192.168.1.18>;tag=1807653022
To: <sip:192.168.1.18>
Call-ID: 957209068
CSeq: 20 OPTIONS
Accept: application/sdp
Max-Forwards: 70
User-Agent: DnakeVoip v1.0
Content-Length: 0
<--- Transmitting SIP response (447 bytes) to UDP:192.168.1.161:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.161:5060;rport=5060;received=192.168.1.161;branch=z9hG4bK893451099
Call-ID: 957209068
From: <sip:161@192.168.1.18>;tag=1807653022
To: <sip:192.168.1.18>;tag=z9hG4bK893451099
CSeq: 20 OPTIONS
WWW-Authenticate: Digest realm="asterisk",nonce="1553170682/4daf5dfff9255d57821296f3ab0573a6",opaque="3117b4a64f73c1c7",algorithm=md5,qop="auth"
Server: Asterisk PBX 15.2.2
Content-Length: 0
<--- Received SIP request (563 bytes) from UDP:192.168.1.161:5060 --->
OPTIONS sip:192.168.1.18 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.161:5060;rport;branch=z9hG4bK1273594464
From: <sip:161@192.168.1.18>;tag=1807653022
To: <sip:192.168.1.18>
Call-ID: 957209068
CSeq: 21 OPTIONS
Authorization: Digest username="161", realm="asterisk", nonce="1553170682/4daf5dfff9255d57821296f3ab0573a6", uri="sip:192.168.1.18", response="cf017a339cd50b2cffb0199b39b0439c", algorithm=MD5, cnonce="0a4f113b", opaque="3117b4a64f73c1c7", qop=auth, nc=00000001
Accept: application/sdp
Max-Forwards: 70
User-Agent: DnakeVoip v1.0
Content-Length: 0
<--- Transmitting SIP response (779 bytes) to UDP:192.168.1.161:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.161:5060;rport=5060;received=192.168.1.161;branch=z9hG4bK1273594464
Call-ID: 957209068
From: <sip:161@192.168.1.18>;tag=1807653022
To: <sip:192.168.1.18>;tag=z9hG4bK1273594464
CSeq: 21 OPTIONS
Accept: application/sdp, application/xpidf+xml, application/cpim-pidf+xml, application/dialog-info+xml, application/simple-message-summary, application/pidf+xml, application/pidf+xml, application/dialog-info+xml, application/simple-message-summary, message/sipfrag;version=2.0
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Accept-Encoding: text/plain
Accept-Language: en
Server: Asterisk PBX 15.2.2
Content-Length: 0
<--- Received SIP request (528 bytes) from UDP:192.168.1.243:19081 --->
BYE sip:192.168.1.18:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.243:19081;branch=z9hG4bK1885072078;rport
From: <sip:103@192.168.1.18>;tag=33030935
To: <sip:804@192.168.1.18>;tag=ff072b28-e1d4-45c1-a153-d3c634f9f9bd
Call-ID: 255484480-19081-17@BJC.BGI.B.CED
CSeq: 162 BYE
Contact: <sip:103@192.168.1.243:19081>
Max-Forwards: 70
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream Wave 1.0.3.26
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<--- Transmitting SIP response (335 bytes) to UDP:192.168.1.243:19081 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.243:19081;rport=19081;received=192.168.1.243;branch=z9hG4bK1885072078
Call-ID: 255484480-19081-17@BJC.BGI.B.CED
From: <sip:103@192.168.1.18>;tag=33030935
To: <sip:804@192.168.1.18>;tag=ff072b28-e1d4-45c1-a153-d3c634f9f9bd
CSeq: 162 BYE
Server: Asterisk PBX 15.2.2
Content-Length: 0
-- Channel PJSIP/103-00000018 left 'softmix' base-bridge <8e377ad9-d0ba-4ae9-91ec-e740b74445e8>
-- Channel CBAnn/1507844121-00000004;2 left 'softmix' base-bridge <8e377ad9-d0ba-4ae9-91ec-e740b74445e8>
<--- Transmitting SIP request (409 bytes) to UDP:192.168.1.237:5062 --->
CANCEL sip:104@192.168.1.237:5062 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.18:5060;rport;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 CANCEL
Reason: Q.850;cause=0
Max-Forwards: 70
User-Agent: Asterisk PBX 15.2.2
Content-Length: 0
== Spawn extension (default, 804, 3) exited non-zero on 'PJSIP/103-00000018'
<--- Received SIP response (545 bytes) from UDP:192.168.1.237:5062 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.18:5060;rport=5060;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>;tag=1405952063
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 CANCEL
Contact: <sip:104@192.168.1.237:5062>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream GXV3275 1.0.3.207
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<--- Received SIP response (522 bytes) from UDP:192.168.1.237:5062 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 192.168.1.18:5060;rport=5060;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>;tag=1405952063
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 INVITE
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream GXV3275 1.0.3.207
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<--- Transmitting SIP request (395 bytes) to UDP:192.168.1.237:5062 --->
ACK sip:104@192.168.1.237:5062 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.18:5060;rport;branch=z9hG4bKPj14452f07-629f-4038-b45f-c20cfe46cbca
From: "103" <sip:Zone_3@192.168.1.18>;tag=73263b6d-4a36-49ad-ab1c-3ba2572272eb
To: <sip:104@192.168.1.237>;tag=1405952063
Call-ID: 613097ee-8a29-4344-b186-990b01be49b7
CSeq: 9664 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 15.2.2
Content-Length: 0