This is the CLI of my call test for the music on hold in the same time ringing when we call a Ip Phone:
== Setting global variable 'SIPDOMAIN' to 'IP_Address'
<--- Transmitting SIP response (484 bytes) to UDP:188.66.8.19:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 188.66.8.19;rport=5060;received=188.66.8.19;branch=z9hG4bK88ff.8d01ac6e4ed1b5e8a829b28949f72c1f.0
Via: SIP/2.0/UDP 188.66.8.30:5060;rport=5060;received=188.66.8.30;branch=z9hG4bK0b3a43eb
Record-Route: <sip:188.66.8.19;lr>
Call-ID: 4e7f77ed295d77bf022cb43b718d5ad7@188.66.8.30:5060
From: "Arnold" <sip:028992018@188.66.8.30>;tag=as36a77adf
To: <sip:042770677@IP_Address>
CSeq: 102 INVITE
Server: Asterisk PBX 13.23.0
Content-Length: 0
-- Executing [042770677@from-external:1] NoOp("PJSIP/belgium-voip-000004d0", "## Incoming Call from "Arnold" <028992018> ##") in new stack
-- Executing [042770677@from-external:2] Verbose("PJSIP/belgium-voip-000004d0", "Call start time: 2018-10-17 11:34:43") in new stack
Call start time: 2018-10-17 11:34:43
-- Executing [042770677@from-external:3] Set("PJSIP/belgium-voip-000004d0", "CDR(calldate)=2018-10-17 11:34:43") in new stack
-- Executing [042770677@from-external:4] Set("PJSIP/belgium-voip-000004d0", "CDR(useragent)=Arnold") in new stack
-- Executing [042770677@from-external:5] Set("PJSIP/belgium-voip-000004d0", "POSTE_EXT=028992018") in new stack
-- Executing [042770677@from-external:6] Ringing("PJSIP/belgium-voip-000004d0", "") in new stack
-- Executing [042770677@from-external:7] System("PJSIP/belgium-voip-000004d0", "echo "--appel_sortant --- callerid : 028992018 ---- 2018/10/17 11:34:43 ----" >> /var/spool/asterisk/log/debug.txt") in new stack
<--- Transmitting SIP response (671 bytes) to UDP:188.66.8.19:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 188.66.8.19;rport=5060;received=188.66.8.19;branch=z9hG4bK88ff.8d01ac6e4ed1b5e8a829b28949f72c1f.0
Via: SIP/2.0/UDP 188.66.8.30:5060;rport=5060;received=188.66.8.30;branch=z9hG4bK0b3a43eb
Record-Route: <sip:188.66.8.19;lr>
Call-ID: 4e7f77ed295d77bf022cb43b718d5ad7@188.66.8.30:5060
From: "Arnold" <sip:028992018@188.66.8.30>;tag=as36a77adf
To: <sip:042770677@IP_Address>;tag=77357f22-ec3d-4599-b1df-0d896bfe7b7a
CSeq: 102 INVITE
Server: Asterisk PBX 13.23.0
Contact: <sip:IP_Address:5060>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Content-Length: 0
-- Executing [042770677@from-external:8] Set("PJSIP/belgium-voip-000004d0", "REC_FILE_NAME=IN__042770677_028992018.wav") in new stack
<--- Received SIP response (652 bytes) from UDP:188.66.8.19:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP IP_Address:5060;received=IP_Address;rport=39748;branch=z9hG4bKPjec2f7a8d-a3e2-423d-948b-a42c5134e107
Record-Route: <sip:188.66.8.19;lr=on>
From: "Arnold" <sip:028992018@voip.belgium-voip.com>;tag=60605d21-9650-4a60-ba6b-be9fc7d73d25
To: <sip:042770677@voip.belgium-voip.com>;tag=as3a5f3ecc
Call-ID: 2e19392e-0a71-4287-baeb-435b32b577eb
CSeq: 4037 INVITE
Server: 3StarsNet VoipSwitch
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:042770677@188.66.8.30:5060>
Content-Length: 0
-- PJSIP/belgium-voip-000004cf is ringing
-- PJSIP/belgium-voip-000004cf is ringing
-- Executing [042770677@from-external:9] Set("PJSIP/belgium-voip-000004d0", "RETURNED_VALUE=bel") in new stack
-- Executing [042770677@from-external:10] MixMonitor("PJSIP/belgium-voip-000004d0", "IN__042770677_028992018.wav,b V(1)") in new stack
-- Executing [042770677@from-external:11] Set("PJSIP/belgium-voip-000004d0", "CHANNEL(Musicclass)=waiting-audio") in new stack
-- Executing [042770677@from-external:12] Dial("PJSIP/belgium-voip-000004d0", "PJSIP/115,20,m(waiting-audio)") in new stack
-- Called PJSIP/115
-- Started music on hold, class 'waiting-audio', on channel 'PJSIP/belgium-voip-000004d0'
[Oct 17 11:34:43] WARNING[16329][C-000002a5]: translate.c:407 framein: no samples for ulawtolin
<--- Transmitting SIP request (1074 bytes) to UDP:192.168.40.55:5060 --->
INVITE sip:115@192.168.40.55:5060 SIP/2.0
Via: SIP/2.0/UDP IP_Address:5060;rport;branch=z9hG4bKPj034a8beb-1716-43b0-a904-f9864e2e3f50
From: "Arnold" <sip:028992018@IP_Address>;tag=5c7b8e4d-3226-41da-bde6-4b30e51d555a
To: <sip:115@192.168.40.55>
Contact: <sip:asterisk@IP_Address:5060>
Call-ID: d0eb2058-280c-46af-9937-0a2ce39d5b1b
CSeq: 25027 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
Diversion: <sip:042770677@IP_Address>;reason=unknown
Max-Forwards: 70
User-Agent: Asterisk PBX 13.23.0
Content-Type: application/sdp
Content-Length: 353
v=0
o=- 255043158 255043158 IN IP4 IP_Address
s=Asterisk
c=IN IP4 IP_Address
t=0 0
m=audio 19616 RTP/AVP 0 8 3 9 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:9 G722/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
<--- Transmitting SIP response (1061 bytes) to UDP:188.66.8.19:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 188.66.8.19;rport=5060;received=188.66.8.19;branch=z9hG4bK88ff.8d01ac6e4ed1b5e8a829b28949f72c1f.0
Via: SIP/2.0/UDP 188.66.8.30:5060;rport=5060;received=188.66.8.30;branch=z9hG4bK0b3a43eb
Record-Route: <sip:188.66.8.19;lr>
Call-ID: 4e7f77ed295d77bf022cb43b718d5ad7@188.66.8.30:5060
From: "Arnold" <sip:028992018@188.66.8.30>;tag=as36a77adf
To: <sip:042770677@IP_Address>;tag=77357f22-ec3d-4599-b1df-0d896bfe7b7a
CSeq: 102 INVITE
Server: Asterisk PBX 13.23.0
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Contact: <sip:IP_Address:5060>
Content-Type: application/sdp
Content-Length: 347
v=0
o=- 290758 290760 IN IP4 IP_Address
s=Asterisk
c=IN IP4 IP_Address
t=0 0
m=audio 14450 RTP/AVP 0 8 3 9 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:9 G722/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
== Begin MixMonitor Recording PJSIP/belgium-voip-000004d0
<--- Received SIP response (491 bytes) from UDP:192.168.40.55:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP IP_Address:5060;rport=5060;branch=z9hG4bKPj034a8beb-1716-43b0-a904-f9864e2e3f50
From: "Arnold" <sip:028992018@IP_Address>;tag=5c7b8e4d-3226-41da-bde6-4b30e51d555a
To: <sip:115@192.168.40.55>
Call-ID: d0eb2058-280c-46af-9937-0a2ce39d5b1b
CSeq: 25027 INVITE
Supported: replaces, path, timer
User-Agent: Grandstream GXP2160 1.0.9.108
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<--- Received SIP response (572 bytes) from UDP:192.168.40.55:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP IP_Address:5060;rport=5060;branch=z9hG4bKPj034a8beb-1716-43b0-a904-f9864e2e3f50
From: "Arnold" <sip:028992018@IP_Address>;tag=5c7b8e4d-3226-41da-bde6-4b30e51d555a
To: <sip:115@192.168.40.55>;tag=1740564715
Call-ID: d0eb2058-280c-46af-9937-0a2ce39d5b1b
CSeq: 25027 INVITE
Contact: <sip:115@192.168.40.55:5060>
Supported: replaces, path, timer
User-Agent: Grandstream GXP2160 1.0.9.108
Allow-Events: talk, hold
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
<--- Transmitting SIP request (828 bytes) to UDP:192.168.40.55:5060 --->
NOTIFY sip:115@192.168.40.55:5060 SIP/2.0
Via: SIP/2.0/UDP IP_Address:5060;rport;branch=z9hG4bKPj9e25d656-6f0c-493e-8b1c-ef044b17e072
From: <sip:115@IP_Address>;tag=e962f7f1-49f2-4c60-879a-eea5faead69c
To: <sip:115@IP_Address>;tag=1945958132
Contact: <sip:IP_Address:5060>
Call-ID: 672596013-5060-112@BJC.BGI.EA.FF
CSeq: 15438 NOTIFY
Event: dialog
Subscription-State: active;expires=1977
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 13.23.0
Content-Type: application/dialog-info+xml
Content-Length: 247
<?xml version="1.0" encoding="UTF-8"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="24" state="full" entity="sip:115@IP_Address:5060">
<dialog id="115" direction="recipient">
<state>early</state>
</dialog>
</dialog-info>
-- PJSIP/115-000004d1 is ringing
-- PJSIP/115-000004d1 is ringing
<--- Received SIP response (521 bytes) from UDP:192.168.40.55:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP IP_Address:5060;rport=5060;branch=z9hG4bKPj9e25d656-6f0c-493e-8b1c-ef044b17e072
From: <sip:115@IP_Address>;tag=e962f7f1-49f2-4c60-879a-eea5faead69c
To: <sip:115@IP_Address>;tag=1945958132
Call-ID: 672596013-5060-112@BJC.BGI.EA.FF
CSeq: 15438 NOTIFY
Contact: <sip:115@192.168.40.55:5060>
Supported: replaces, path, timer
User-Agent: Grandstream GXP2160 1.0.9.108
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
But this is strange I hear only the ringing tone not my audio file. The file exist and the classe too:
localhost*CLI> moh show files
Class: default
File: /var/lib/asterisk/moh/macroform-cold_day
File: /var/lib/asterisk/moh/macroform-robot_dity
File: /var/lib/asterisk/moh/macroform-the_simplicity
File: /var/lib/asterisk/moh/manolo_camp-morning_coffee
File: /var/lib/asterisk/moh/reno_project-system
Class: waiting-audio
File: /var/lib/asterisk/waiting-audio/waiting-audio
localhost*CLI> moh show class
No such command 'moh show class' (type 'core show help moh show class' for other possible commands)
localhost*CLI> moh show classes
Class: default
Mode: files
Directory: moh
Class: waiting-audio
Mode: files
Directory: waiting-audio
localhost*CLI>