Hi there,
Our company is a VoIP service provider and have many users registered with us and using our calling services. I am starting a project related to the collect call concept. In this scenario the called party will bear the cost of the entire call ( i think the caller and called party should be client of the same company so to charge the called party).
The caller calls the desired number with some specific number appended in from (for example if then number to dial is 12345678 then caller dials 9912345678) and when called party answers the call then he will hear an announcement asking him to press 1 to allow collect call or press 2 to reject.
Below is the basic flow up to the confirmation from the called party.
exten => 890,1,Wait(0.2)
exten => 890,n,Playback(screen-record)
exten => 890,n,SetVar(SCREEN_FILE=/tmp/${CALLERID(number)}-${EPOCH})
exten => 890,n,Record(${SCREEN_FILE}.gsm|6|25)
exten => 890,n,Dial(SIP/16|60|gM(screen^${SCREEN_FILE}))
exten => 890,n,Voicemail(10@default)
[macro-screen]
exten => s,1,Wait(0.2)
exten => s,n,Playback(screen-from)
exten => s,n,Playback(${ARG1})
exten => s,n,Read(ACCEPT|screen-accept|1)
exten => s,n,GotoIf($[${ACCEPT} = 1 ] ?yes:no)
exten => s,n(yes),SetVar(MACRO_RESULT=CONTINUE)
exten => s,n(no),System(/bin/rm ${ARG1})
Now my question is, if the called party accepts the collect call, how can I charge the called party. My idea is to switch the caller’s account code with called party so that the billing will be done on the called party’s account code.
I will like to hear from you guys there if this idea will work and also i will like to hear any other idea from you guys.
Regards,
Nasir Javaid
Software Engineer