Asterisk not sending media packets using music on hold - asterisk

My asterisk version is 1.4.22. I am trying to Dial to a third party using asterisk using music on hold.
When I called, on its console it showed 'started music on hold', however, I didn't heard anything . When I took a wireshark trace I found asterisk was not sending any media packets . Below is a trace taken at console :
-- Started music on hold, class 'default', on SIP/test-b73eb410
-- SIP/LocalCarrierOut-b76a75c8 is ringing
-- SIP/LocalCarrierOut-b76a75c8 is ringing
-- Stopped music on hold on SIP/test-b73eb410
My .conf file :
[CodeTest]
exten = 1234,1,Answer()
exten = 1234,n,wait(1)
exten = 1234,n,Dial(SIP/1234#LocalCarrierOut,,rm)
Thanks
Himanshu

Very likly you have no moh classes.
For more info see /etc/asterisk/musiconhold.conf or do
asterisk -rx "moh show files "

Related

Asterisk BridgeWait How to bridge into a general bridge

I need to connect two channels from a bunch of channels. The upcoming channel is pushed into BridgeWait. Waiting music is played. Under the data is placed about the current case. I want to find out why we need BridgeWait. I try to create new ordinal bridge with the channel by AMI Bridge I do not see an error. New bridge is not created. Channels are still in the bridge "Waiting". If I kick from the waiting bridge the channel is closed so it is impossible to bridge them again.
How should I bridge channels from the waiting bridge correctly.
extensions.conf
exten => 2002,1,NoOp
exten => 2002,n,BridgeWait("Waiting")
exten => 2002,n,Hangup
Channels
924fa28457df*CLI> core show channels
Channel Location State Application(Data)
SIP/100-0000000a 2002#default:2 Up BridgeWait("Waiting")
SIP/103-00000009 2002#default:2 Up BridgeWait("Waiting")
2 active channels
2 active calls
11 calls processed
Holding bridge There are two channels.
924fa28457df*CLI> bridge show f57050e0-b6ae-4bfc-b8e3-295ce7371fef
Id: f57050e0-b6ae-4bfc-b8e3-295ce7371fef
Type: base
Technology: holding_bridge
Num-Channels: 2
Channel: SIP/103-00000009
Channel: SIP/100-0000000a
It is not possible to implement without AGI.
; Queue processing pipe.
exten => 2002,1,NoOp
exten => 2002,n,BridgeWait("Waiting")
exten => 2002,n,AGI(agi://10.1.2.1:3007)
exten => 2002,n,Hangup
BridgeWait Asterisk application holds the call for further processing with less resources.
Dialplan consists of piped operations: bridge wait and the next AGI management.
BridgeWait is broken from outside through the AMI interface to be managed by AGI when an operator is defined.
Short AGI pipe connects this predefined client and operator by dial command.

Call forwarding GOIP16 with asterisk

I am trying to dial a call to GOIP and want to forward it to another GSM phone. I have added following lines in my extensions.conf (asterisk)
[goip_context]
exten=> 105,1,Set(NUMBER=913579865476)
exten=> 105,2,Dial(SIP/${NUMBER}#${GW2},20)
where 105 is my GOIP extension
NUMBER is the dialled number
and GW2=goip
On dialing a call, following logs appear on asterisk terminal
Call to peer 'goip' rejected due to usage limit of 1
-- Couldn't call SIP/913579865476#goip
Please guide in this regard
Acordinly to message you have call-limit in sip.conf set to 1 for this section
Also you need at least 2 gsm modules to do that.

Send DTMF to DAHDI channel

I am trying to figure out a way to send DTMF commands to my ISDN modem (throught BRI Card) to enable some services it provides. For example, for call forward I need to send the DTMF 21#. I have successfully did that with mISDN but I need to do it with DAHDI now.
So far I have managed to do this that does not work:
[from-internal-custom]
exten => 4321,1,Answer
exten => 4321,n,Noop(Enable Callforward)
exten => 4321,n,Dial(DAHDI/g0/,10,M(dtmf))
[macro-dtmf]
exten => s,1,SendDTMF(*21*<number>#,,DAHDI)
Where number is the number I want to to do the call forward (without the <>).
If I put a ISDN Phone on the ISDN Modem I just need to dial the featurecode 21< number ># and it works.
Is there a way to do this with DAHDI?
There is special key for that
D([called][:calling[:progress]]): Send the specified DTMF strings
*after* the called party has answered, but before the call gets bridged.
The <called> DTMF string is sent to the called party, and the <calling>
DTMF string is sent to the calling party. Both arguments can be used
alone. If <progress> is specified, its DTMF is sent immediately after
receiving a PROGRESS message.

asterisk dialplan, forward call to gateway/pstn

i have VoIP infrastructure in company,
end points can dial mobile numbers in this case:
they call 9... they wait for pstn dial ton...after dial-ton they can dial their number.
i do this in this way:
exten => 9,1,dial(sip/8003)
witch sip/8003 is a sip account that is connected to FXO gateway and connected to asterisk via sip trunk.
i want to do this:
the end points dial:
909121111111
instead of
9... after-dialton.... 09121111111
Without having seen more of your dial plan, typically what you can do is, in an accessible context, a way to dial the whole thing -- and then use a substring to strip out parts of it.
exten => _9XXXXXXXXXX,1,Dial(SIP/8003/${EXTEN:1})
The first part of the extension matches a 10-digit number prefixed with a 9: _9XXXXXXXXXX. Check out the article on pattern matching on the Asterisk wiki
Next, on our dial application, what we do is dial your sip device, but, we pass it back the dialed extension, but, notice the colon? Like ${EXTEN:1} That's to strip digits. Namely it strips the first digit. You can learn more about manipulating variables on the wiki, too.

Ring Group # Asterisk. Is it possible to use dial and goto on the same priority?

I need to create a ring group (222) which would dial several SIP accounts, and PSTN numbers as well.
For PSTN I have a different context (ToPSTN) with it's own billing rules, so the question is:
How can I ring several SIP acc's and PSTN's simultaneously ?
Here is how I am trying to do that:
exten => 222,1,Dial(SIP/ca-444&SIP/ca-433)
exten => 433,1,Goto(ToPSTN,0035853855453,1)
Or maybe it's possible to do several tasks at the same priority somehow ?
To make dialing into dialplan instead of real channel driver you should use Local channel. This is how it look in your case:
exten => 222,1,Dial(SIP/ca-444&Local/0035853855453#ToPSTN)
So first call goes to SIP peer ca-444 and second directly to dialplan extension 0035853855453 and context ToPSTN.

Resources