Music On Hold Can't hear

I have configured correct as documentation said
but can’t hear an sound at caller.

here is the logs

Connected to Asterisk GIT-18-591c1c77c7 currently running on asteriskstaging (pid = 214078)
  == Using SIP RTP CoS mark 5
       > 0x73ce7002a7e0 -- Strict RTP learning after remote address set to: 192.168.130.20:13712
    -- Executing [2399009@inbound:1] NoOp("SIP/mgluaye-00000002", "Call to sales queue") in new stack
    -- Executing [2399009@inbound:2] GotoIfTime("SIP/mgluaye-00000002", "09:00-17:00,mon-sat,*,*?within-office-hours,s,1") in new stack
    -- Goto (within-office-hours,s,1)
    -- Executing [s@within-office-hours:1] NoOp("SIP/mgluaye-00000002", "Within office hours") in new stack
    -- Executing [s@within-office-hours:2] Queue("SIP/mgluaye-00000002", "sales") in new stack
    -- Started music on hold, class 'default', on channel 'SIP/mgluaye-00000002'
[Aug  3 16:41:21] WARNING[214169]: db.c:363 ast_db_put: Couldn't execute statement: SQL logic error
    -- Stopped music on hold on SIP/mgluaye-00000002
  == Spawn extension (within-office-hours, s, 2) exited non-zero on 'SIP/mgluaye-00000002'

musiconhold.conf

[sales-queue]
mode=playlist
entry=/var/lib/asterisk/moh/custom/music_onhold

queues.conf

[queue_template](!)
musicclass=default; play [default] music
musiconhold=default
strategy=ringall ; use the Round Robin Memory strategy
joinempty=yes ; join the queue when no members available
leavewhenempty=no ; don't leave the queue no members available
ringinuse=no ; don't ring members when already InUse

[sales](queue_template)
; Sales queue

[support](queue_template)
; Support queue

extensions.conf

[default]
exten => 2399009,1,NoOp(executing inbound call); Dialing 1060 will call the SIP client registered to 1060
exten => 012399000,hint,SIP/012399000
exten => 012399009,hint,SIP/012399009


[outbound]
exten => _X,1,NoOp("Calling ")
same => n,Dial(SIP/${EXTEN}@192.168.130.20)
same => n,Hangup()

[inbound]
exten => 2399009,1,NoOp(Call to sales queue)
same => n,GotoIfTime(09:00-17:00,mon-sat,*,*?within-office-hours,s,1)
same => n,Stasis(my-ari-client)
same => n,Hangup()

[within-office-hours]
exten => s,1,NoOp(Within office hours)
same => n,Queue(sales)
same => n,Return()

[stasisapp]
exten => 2399009,1,Stasis(my-ari-client)
same => n,Hangup()

Like most providers, your provider probably doesn’t permit the use of early media. Another possibility is that they have a poor NAT configuration. Unless early media is supported, you will need to answer the call, before invoking Queue.

As I think has been noted on your other threads, you should not be using chan_sip on new systems.

1 Like

Thank you for the answer david551,i will try that when i get access to Office network.my provider doesn’t seems to be compitable with res_pjsip they also uses chan_sip and they are running with outdated asterisk version (13) i tried to use pjsip as you may notice in other threads.When i offer a call then they rejected it.That’s why i moved to chan sip but i will test with res pjsip to their system on later projects.For now chan sip seems fine to me.But i like pjsip. :grin:

Thank you david it works.

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