3

On the softphone, I have connected two accounts tom and paul as a testing purpose. On the tom device, I have dialled extention 100 and it did ring on the paul device. When I answer the call I can hear the background music and it did NOT execute same => n,Playback(demo-moreinfo)

What is causing this?

I have two sip trunks in sip.conf file:

[office-phone](!)
type=friend
context=LocalSets
host=dynamic
nat=yes
secret=password
dtmfmode=auto
disallow=all
allow=ulaw
allow=alaw

[tom](office-phone)
[paul](office-phone)

In the extension.conf file:

[LocalSets]
exten =>   100,1,Dial(SIP/paul)
same  =>   n,Playback(demo-moreinfo)
same  =>   n,Hangup()
I'll-Be-Back
  • 10,530
  • 37
  • 110
  • 213

1 Answers1

3
[LocalSets]
; Dial connets the callee and caller channels.
exten =>   100,1,Dial(SIP/paul)
; Otherwise Playback is executed (after a Dial timeout occurs)
same  =>   n,Playback(demo-moreinfo)
same  =>   n,Hangup()

Like in this example, when the call goes unanswered, play the vm-nobodyavail sound.

exten => 123,1,Dial(SIP/100,10,m)
;; if the the call is answered, the next priority is never executed
exten => 123,n,Playback(vm-nobodyavail)
exten => 123,n,Hangup()

If you would like to play a soundfile, the Answer application makes sures the channel connected, and the next priority could execute Playback.

exten => 100,1,Answer()
exten => 100,n,Playback(demo-moreinfo)

In this example, when somebody dials 100, the call will be answered by the Answer application. Then the caller will hear the sound file.

exten => 100,1,Answer()
 same => n,Noop("100 answered")
 same => n,Playback(demo-moreinfo)
 ; same => n,Noop("heard the info, dial 200")
 ; same => Dial(SIP/200);
 same => n,Hangup()

You could execute Dial after Playback.

pce
  • 5,571
  • 2
  • 20
  • 25
  • When the caller answered the call, I would like the caller to hear the `demo-moreinfo` sound – I'll-Be-Back Aug 04 '15 at 21:30
  • yes, Answer makes sure two Channels are connected, and the playback occurs. Have you tried the example? – pce Aug 04 '15 at 21:33