Hi I want to add a macro to a2billing.php how can I do that and is there a provision to pass additional parameters to a2billing.php and retrieve it in dialplan ?
Following is the macro that I want to add :- How it works is this.
1.) Call comes in and the person is greeted with Please say your name after the tone. 2.) After the person does that it will fire off a call to your extension, cell phone or whatever. 3.) You answer the phone and Asterisk says "You have a call from Person name here." 4.) Asterisk will then ask say, Press 1 to accept the call, 2 to transfer the call or 3 send to voicemail.
[custom-screen] ;screen-record: Please record your name press pound when finished. ;screen-from: You have a call from ;screen-accept: Press 1 to accept 2 to reject, and 3 to transfer. exten => s,1,Wait(0.2) exten => s,2,Playback(vm-rec-name) exten => s,3,SetVar(SCREEN_FILE=/tmp/${CALLERIDNUM}-${EPOCH}) exten => s,4,Record(${SCREEN_FILE}.gsm|2|4) exten => s,5,Playback(pls-wait-connect-call) ;exten => s,6,Dial(${ARG2},30,mtM(screen^${SCREEN_FILE})) exten => s,6,Dial(IAX2/prod-server/203,30,mtM(screen^${SCREEN_FILE})); change to your dial command exten => s,7,Goto(17);VM ;exten => s,17,Voicemail(u${ARG1})exten => s,17,Voicemail(u203@default);change to your voicemail exten => s,18,Playback(goodbye) exten => s,19,Hangup exten => s,107,Goto(17)
exten => h,1,System(/bin/rm ${ARG1}.gsm)
[macro-screen] ;this is called in the Dial statement using M ;ARG1 recorded name to play back ;TODO: add a response timeout, after which the message is repeated (needed for outgoing zap fxo channels) and absolute timeout, after which VM is used ;exten => s,1,noop(${ARG1}) exten => s,1,noop(${ARG1}) exten => s,2,Playback(custom/screen-from) ;you have an incoming call from: exten => s,3,Playback(${ARG1}) ;press 1 to accept 2 to reject 3 to transfer exten => s,4,Read(ACCEPT|custom/screen-accept|1) exten => s,5,Gotoif($[${ACCEPT} = 1] ?50) ;connect exten => s,6,Gotoif($[${ACCEPT} = 2] ?30) ;reject to vm exten => s,7,Gotoif($[${ACCEPT} = 3] ?40) ;TRANSFER exten => s,8,Gotoif($[${ACCEPT} = 4] ?30:30) ;any thing else vm exten => s,30,SetVar(MACRO_RESULT=CONTINUE) exten => s,31,Goto(50) exten => s,40,Read(TEXTEN|custom/screen-exten|3);ask for extension then set macro to goto that and continue exten => s,41,Gotoif($[${LEN(${TEXTEN})} = 3]?42:45) exten => s,42,SetVar(MACRO_RESULT=GOTO:from-internal^${TEXTEN}^1) exten => s,43,Goto(50) exten => s,45,Gotoif($[${TEXTEN} = 0] ?46:46);the logic is here to allow transfer to operator, i just didn't imlepent;it yet exten => s,46,SetVar(MACRO_RESULT=CONTINUE) exten => s,47,Goto(50) exten => s,50,System(/bin/rm ${ARG1}.gsm) exten => h,1,System(/bin/rm ${ARG1}.gsm)
;You need to record these prompts
;screen-from ;screen-accept ;screen-exten
Also is there any one who is into custom development on a2billing i mean an individual not a company ?
|