返回列表 發帖

Callback in IP01

The same as described in last callback post.
1. Add a few rows to your dialplan, say, you want to callback to phone number 01234567890:
  1.   exten=s,1,NoOp(Incoming call from # ${CALLERID(num)})
  2.   exten=s,2,GotoIf($["${CALLERID(num)}"="01234567890"]?mycallback,s,1)
  3.   ;other original codes
複製代碼
2. Use File Editor to edit extensions.conf
Create an extension, mycallback using Add context:
  1. exten=s,1,NoOp(Hangup then callback to cellphone)
  2. exten=s,2,Wait(1)
  3. exten=s,3,system(cp /persistent/var/lib/asterisk/agi-bin/template.call /var/lib/asterisk/tmp.call)
  4. exten=s,4,system(echo "Channel: SIP/mysiptrunk/${CALLERID(num)}" >> /var/lib/asterisk/tmp.call)
  5. exten=s,5,Hangup()
  6. exten=h,1,NoOp(copy tmp.call file to /var/spool/asterisk/outgoing)
  7. exten=h,2,system(/persistent/var/lib/asterisk/agi-bin/callback.sh)
  8. exten=h,3,Hangup()
複製代碼
3. The callback template file template.call is
  1. context: customCallback
  2. Extension: s
  3. Priority: 1
  4. CallerID: 1380013800
複製代碼
and the shell script file callback.sh is
  1. #!/bin/sh
  2. sleep 10
  3. mv /var/lib/asterisk/tmp.call /var/spool/asterisk/outgoing
  4. exit 0;
複製代碼
4. Related settings in module.conf, especially pbx_spool.so must be loaded.
5. Do not forget add an context named customCallback!

Enjoy the callback function in IP01!

回復 8# ckleea


    Of cause you can. Here we share !

In fact, it is better to modify it to some kind of macro.

TOP

回復 1# Qnewbie

Can I just adapt the code into the asterisk server?

TOP

回復 6# 角色


    I place IP01 in Sweden.

Yes, I would use the callback as soon as the phone list(to work around the blocking of China mobile ) is available for me.

TOP

回復 1# Qnewbie

You have a got an IP01, don't you? Where is it placed? In Sweden?

Concerning the callback. In fact, I have already done for you in my Shenzhen server but I do not know if you have used it or not?

YH

TOP

Newbie is Q

TOP

You are welcome. We just learn and share together.
Good things must be shared.

TOP

回復 2# bubblestar


    I am just a newbie but concentrate on the specific applications(callback and DISA). Both are well-written on the web and you can get them simply by your finger tips(google)

   Other things, like security, I think you and ckleea are really experts. I got more from all C-hings in this forum but just share my experience.

TOP

It seems IP01 is only a TOY to Qnewbie.  As far as I know, this tiny Asterisk Server arrive to your place in just a few days.  You can master it in your finger tips.  高手即是高手,厲害

The new callback usage is wonderful and will try it in next two days.

Many thanks for your sharing.

TOP

返回列表