Hi, Yate people !
Please, help me give answer on one question:
Posible to change param in call.route message by regfile module ?
From text of regfile.conf, a I thought that YES,
But practically i think that NO.
In generally, I want to send voicemail to email from regfile.conf (expiriment with database will be later) for offline sip client.
For this I do :
1. in regexroute.conf add param 'email'
[priorities]
route=110
[default]
^118$=return;email=change_me
2. in regfile.conf change value of param 'email' to real email (what I have not obtained)
[general]
route=120
[118]
pass=qweqwe
email=real@mail
3. Global script (which executed only if client ofline) run external script 'leavemail.php' ( which send voicemail to specified address)
...
Yate::Install("call.route",150);
...
switch ($ev->type) {
case "incoming":
$calee=$ev->params["called"];
$mask='/^1..$/';
if (preg_match($mask,$calee)) {
debug("Local call: " . $ev->name . " id: " . $ev->id . " called: " . $calee . " caller: " . $ev->params["caller"]);
$ev->retval = "external/nodata/leavemail.php";
$ev->handled = true;
} else {
debug("Called number invalid: " . $calee . ", caller: " . $ev->>params["caller"]);
$ev->retval = "wave/play//var/spool/yate/sounds/notexsist.slin";
$ev->handled = true;
}
...
4. In sniffer of call.route message I see:
Returned true 'call.route' delay=0.015558
thread=0x1bfe990 'Call Router'
data=(nil)
retval='external/nodata/my_leavemail.php'
param['id'] = 'sip/2'
param['module'] = 'sip'
param['status'] = 'incoming'
param['address'] = '192.168.206.95:5060'
param['billid'] = '1361254105-2'
param['answered'] = 'false'
param['direction'] = 'incoming'
param['callid'] = 'sip/D1B9-DF70-46685013FBDEDBA14B69-008@SipHost/43e52fdd-685013/'
param['caller'] = '120'
param['called'] = '118'
param['callername'] = '120'
param['antiloop'] = '19'
param['ip_host'] = '192.168.206.95'
param['ip_port'] = '5060'
param['ip_transport'] = 'UDP'
param['sip_uri'] = 'sip:118@192.168.154.18;user=phone'
param['sip_from'] = 'sip:120@192.168.154.18'
param['sip_to'] = '<sip:118@192.168.154.18;user=phone>'
param['sip_callid'] = 'D1B9-DF70-46685013FBDEDBA14B69-008@SipHost'
param['device'] = 'dlink 12-38-39811651-0.10.37.1-DSA'
param['sip_allow'] = 'INVITE,ACK,OPTIONS,BYE,CANCEL,INFO,PRACK,REFER,SUBSCRIBE,NOTIFY,UPDATE'
param['sip_contact'] = '<sip:120@192.168.206.95:5060>'
param['sip_expires'] = '90'
param['sip_supported'] = 'replaces'
param['sip_user-agent'] = 'dlink 12-38-39811651-0.10.37.1-DSA'
param['sip_content-type'] = 'application/sdp'
param['rtp_addr'] = '192.168.206.95'
param['media'] = 'yes'
param['formats'] = 'mulaw,alaw'
param['transport'] = 'RTP/AVP'
param['rtp_rfc2833'] = '101'
param['rtp_port'] = '9000'
param['rtp_forward'] = 'possible'
param['handlers'] = 'regexroute:100,cdrbuild:50,sip:100,regexroute:110,regfile:120'
param['context'] = 'local'
param['email'] = 'change_me'
param['error'] = 'offline'
Or am I wrong something done, or is it impossible.
That suggest?