I have Asterisk 13.4.0 running on Ubuntu 12.04.3 and I need to log SIMPLE messages to MySQL CDR.
Messages are sending between extensions and all other CDRs are recorded properly, but there are no any SIMPLE records in CDR. Is it possible to use Asterisk built-in functionality or some kind of workaround to solve this problem?
Put in sip_general_custom.conf
accept_outofcall_message=yes
outofcall_message_context=messages
auth_message_requests=no
Into extensions_custom.conf
[messages]
exten => _.,1,NoOp(SMS receiving dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),#,1)})
exten => _.,n,Set(CDR(message)=${MESSAGE(from)})
exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != «SUCCESS»]?sendfailedmsg)
exten => _.,n,Hangup()
;
; Handle failed messaging
exten => _.,n(sendfailedmsg),Set(MESSAGE(body)="[${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.")
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,#,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,Hangup()
exten => _.,n,Hangup()
Also you need add into table message column type text
Related
I am trying to originate a call using rawman, sending a phone number (57522666) as a parameter and playing a message to the answering party.
This is what I have so far:
http://192.168.11.11:8088/rawman?action=originate&channel=????&context=outboundmsg1&exten=s&priority=1&timeout=30000
And in extensions.conf:
[outboundmsg1]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Background(custom/message)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
I have a SIP ATA as trunk with the following name: 23656429
I have no clue what to put in the channel parameter. I have tried SIP/23656429#57522666, but I don't get the outbound call.
In case someone else runs into this question... I got it to work by using the following:
http://192.168.11.11:8088/rawman?action=originate&channel=SIP/23656429/57522666&context=outboundmsg1&exten=s&priority=1&timeout=30000&callerid=23656429
And in extensions.conf
[outboundmsg1]
exten => s,1,Answer
exten => s,2,WaitExten()
exten => s,n,Wait(1)
exten => s,n,Playback(custom/elcodigo) ; "play outbound msg"
exten => s,n,SayDigits(1498)
exten => 2,n, Wait(1)
exten => s,n,Hangup
I am trying to learn ASterisk PBX and i have a problem that i did not saw in any tutorial.
I want to have and extension to automatically anser the call and transfert to extension 101 or 102 depending on the user selection from the softphone keyboard or voice. How can i implement that?
[default]
Exten => 101,1,Answer
Exten => 101,n,NoOp(Test101)
Exten => 101,n,Dial(SIP/101,12,r)
Exten => 101,n,VoiceMail(101#interno-ipca)
Exten => 101,n,Hangup()
Exten => 102,1,Answer
Exten => 102,n,NoOp(Test102)
Exten => 102,n,Dial(SIP/102,12,r)
Exten => 102,n,VoiceMail(102#interno-ipca)
Exten => 102,n,Hangup()
Hi if you want to anwser any call you can use
exten => _X,1,Answer()
exten => _X,2,Read($Number,,[max digits])
exten => _X,3,Dial(SIP/$Number)
You can use [max digits], otherwise asterisk waits until the maximum of digits is reached, or you end the typing with "#"
I have the following dialplan:
exten => 224,1,NoOp(IN CALL : ${CALLERID(num)} => ${EXTEN})
exten => 224,n,Dial(${PJSIP_DIAL_CONTACTS(97,97)})
;exten => 224,n,Wait(3)
exten => 224,n,SendDTMF(*11234*,200)
exten => 224,n,Wait(3)
exten => 224,n,SendDTMF(#*)
exten => 224,n,Hangup()
When I call the extension 97 and it is connected, it doesnt seem to go next in line SendDTMF. What am I doing wrong?
Greetings
For who is looking for something like this without SendDTMF application, you can send DTMF with D option:
exten => n, Dial (SIP/97,60,D(1234))
If the DTMF passed are getted on the other side incomplete, use w option to delay 500 milliseconds.
Here I'm delaying 1 second
exten => n,Dial (SIP/97,60,D(ww1234))
Did you try using macros
[macro-send]
exten => s,1,SendDTMF(*11234*,200)
exten => s,n,Wait(3)
exten => s,n,SendDTMF(#*)
[yourDialPlan]
exten => 224,1,NoOp(IN CALL : ${CALLERID(num)} => ${EXTEN})
exten => 224,n,Dial(${PJSIP_DIAL_CONTACTS(97,97)},,M(send))
exten => 224,n,Hangup()
I am setting up IVR and encountered following trouble there is no dealing tone when client gets to "Dial", it just silently dialing. How to fix this?
exten => s,1,Background(custom/welcome-msg)
exten => s,n,WaitExten(10)
exten => s,n,Dial(SIP/0773,20)
exten => _X,1,Read(NUMBER,,4,n,,10)
exten => _X,n,Dial(SIP/${NUMBER},20)
exten => _X,n,HangUp()
You need add 'r' option in params.
exten => _X,n,Dial(SIP/${NUMBER},20,r)
https://wiki.asterisk.org/wiki/display/AST/Dial+Application
This is my dialplan:
[default]
exten => 100,1,Background(beep)
exten => 100,n,Goto(test,1,1)
exten => 100,n,Background(beep)
exten => 100,n,Hunup()
[test]
exten => 1,1,Dial(SIP/0622423078#provider)
I want that the context default execute the context test. I gues that Goto is not the right function. So what I want is: you hear two times a beep and in the meantime it dials a phonenumber.
If you need on extension 1 go as described in context test you have do
[default]
exten => 100,1,Background(beep)
exten => 100,n,Goto(test,1,1)
exten => 100,n,Background(beep)
exten => 100,n,Hunup()
include =>test
[test]
exten => 1,1,Dial(SIP/0622423078#provider)
if you need on some other extension do extension 1 in context test, you can do something like this
[default]
exten => 100,1,Background(beep)
exten => 100,n,Goto(test,1,1)
exten => 100,n,Background(beep)
exten => 100,n,Hunup()
exten => 101,1,goto(test,1,1)
[test]
exten => 1,1,Dial(SIP/0622423078#provider)
Both will not realize task you described. That task is not doable this way.
You can play sound OR dial. You can't dial&play sound, except variant with Musiconhold
For musiconhold you can set music which have 2 beeps and ringing, and set that in dial command parameter.
I used the auto dial out.
exten => 100,n,System(sh /root/test.sh 0622423078)
And this is the test.sh
echo "Channel: SIP/provider/$1
Context: fop
Extension: 1
" > /var/spool/asterisk/outgoing/test.call