Hello,
I read a previous post by Iqbal (missed caller call back) where a subscriber can ring a pre-defined number which calls back their last missed call...
Is my logic correct as follows?:
In the missed call section (i.e. when theres a 408/487 message) do:
avp_db_store("$ruri", "i:1000");
Then when the caller dials the callback number e.g.1471 this code is invoked:
if (uri=~"^sip:1471@x.x.x.x"){ log(1, "in missed call return section"); avp_db_load("$from/username", "i:1000"); avp_pushto("i:1000", "$ruri"); // route as normal };
I am getting an error when restarting SER:
ERROR: avops: fixup_pushto_avp: bad param 1; expected : $[ruri|hdr_name|..]
Is it correct to push the AVP i:1000 to the ruri? Do I need to define aliases in the modparam perhaps?
Any help would be appreciated. Many thanks, Aisling.
p.s. In case anyone was following my other post regarding asterisk voicemail - It's now working using avpops, the problem was with my asterisk config. There is still a problem playing back the messages though.
-------------------Legal Disclaimer---------------------------------------
The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.
Hi
I never got round to tying this, just got bogged down with other configs, if you have any luck give me a shout, I might take a look towards the end of the week
iqbal
Aisling wrote:
Hello,
I read a previous post by Iqbal (missed caller call back) where a subscriber can ring a pre-defined number which calls back their last missed call…..
Is my logic correct as follows?:
In the missed call section (i.e. when theres a 408/487 message) do:
avp_db_store(“$ruri”, “i:1000”);
Then when the caller dials the callback number e.g.1471 this code is invoked:
if (uri=~”^sip:1471@x.x.x.x”){
log(1, “in missed call return section”);
avp_db_load(“$from/username”, “i:1000”);
avp_pushto(“i:1000”, “$ruri”);
// route as normal
};
I am getting an error when restarting SER:
ERROR: avops: fixup_pushto_avp: bad param 1; expected : $[ruri|hdr_name|..]
Is it correct to push the AVP i:1000 to the ruri? Do I need to define aliases in the modparam perhaps?
Any help would be appreciated.
Many thanks,
Aisling.
p.s. In case anyone was following my other post regarding asterisk voicemail – It’s now working using avpops, the problem was with my asterisk
config. There is still a problem playing back the messages though.
-------------------Legal Disclaimer--------------------------------------- The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Iqbal wrote:
I never got round to tying this, just got bogged down with other configs, if you have any luck give me a shout, I might take a look towards the end of the week
I played around a little with it and got it to work with SER 0.9.x. Here is the config snippet (assuming you use 1000@your.domain for callbacks):
modparam("avpops", "use_domain", 1) modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser") modparam("avpops", "avp_table", "dummy") # it complains if not set modparam("avpops", "avp_aliases","callback=i:995")
route {
# the usual stuff like basic checks, NAT fixes and proxy # authentication goes here...
# check for callback if(uri =~ "^sip:1000@") { # load callback-avp from callback table if(avp_db_load("$from", "$callback/callback")) { avp_pushto("$ruri", "$callback"); avp_db_delete("$from", "$callback/callback"); avp_delete("$callback"); } else { # announcement that no callback available or a 4xx reply # goes here... } }
# lookup aliases and location here...
# if it's a call to a local user, prepare for storing callback t_on_failure("2");
# then do some additional stuff and t_relay() here... }
failure_route[2] { # set callback if callee is busy or N/A if(t_check_status("480|486") && method == "INVITE") {
# store caller into callback table avp_write("$from", "$callback"); avp_db_store("$ruri", "$callback/callback"); avp_delete("$callback"); } }
And here's the callback table for MySQL:
CREATE TABLE `callback` ( `uuid` varchar(64) NOT NULL default '', `username` varchar(100) NOT NULL default '', `domain` varchar(128) NOT NULL default '', `attribute` varchar(32) NOT NULL default '', `value` varchar(128) NOT NULL default '', `type` int(11) NOT NULL default '0', `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`username`,`domain`,`attribute`,`value`) );
Hth, Andy
nice, how do you pick the last number only, or would it be better when you stored a missed call, that you deleted other entries in the table.
Iqbal
Andreas Granig wrote:
Iqbal wrote:
I never got round to tying this, just got bogged down with other configs, if you have any luck give me a shout, I might take a look towards the end of the week
I played around a little with it and got it to work with SER 0.9.x. Here is the config snippet (assuming you use 1000@your.domain for callbacks):
modparam("avpops", "use_domain", 1) modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser") modparam("avpops", "avp_table", "dummy") # it complains if not set modparam("avpops", "avp_aliases","callback=i:995")
route {
# the usual stuff like basic checks, NAT fixes and proxy # authentication goes here... # check for callback if(uri =~ "^sip:1000@") { # load callback-avp from callback table if(avp_db_load("$from", "$callback/callback")) { avp_pushto("$ruri", "$callback"); avp_db_delete("$from", "$callback/callback"); avp_delete("$callback"); } else { # announcement that no callback available or a 4xx reply # goes here... } } # lookup aliases and location here... # if it's a call to a local user, prepare for storing callback t_on_failure("2"); # then do some additional stuff and t_relay() here...
}
failure_route[2] { # set callback if callee is busy or N/A if(t_check_status("480|486") && method == "INVITE") {
# store caller into callback table avp_write("$from", "$callback"); avp_db_store("$ruri", "$callback/callback"); avp_delete("$callback"); }
}
And here's the callback table for MySQL:
CREATE TABLE `callback` ( `uuid` varchar(64) NOT NULL default '', `username` varchar(100) NOT NULL default '', `domain` varchar(128) NOT NULL default '', `attribute` varchar(32) NOT NULL default '', `value` varchar(128) NOT NULL default '', `type` int(11) NOT NULL default '0', `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`username`,`domain`,`attribute`,`value`) );
Hth, Andy
.
Iqbal wrote:
nice, how do you pick the last number only, or would it be better when you stored a missed call, that you deleted other entries in the table.
A valid objection... in this case it's just luck, because avps are pushed in reverse order. And SER logs an error if the same caller calls the callee twice because user/domain/attribute/value is the primary key.
So you're right, it would be nicer to call avp_db_delete before avp_db_store in failure_route.
Andy
I wrote:
So you're right, it would be nicer to call avp_db_delete before avp_db_store in failure_route.
So finally the corrected failure-route looks like this (needs an additional DB query though):
failure_route[2] { if(t_check_status("480|486") && method == "INVITE") { avp_write("$from", "$callback"); revert_uri(); avp_db_delete("$ruri", "$callback/callback"); avp_db_store("$ruri", "$callback/callback"); avp_delete("$callback"); } }
Andy
cool will try it out, thanks Andreas
iqbal PS have you worked on reading out the missed number, I was thinking asterisk with Festival or something
Andreas Granig wrote:
I wrote:
So you're right, it would be nicer to call avp_db_delete before avp_db_store in failure_route.
So finally the corrected failure-route looks like this (needs an additional DB query though):
failure_route[2] { if(t_check_status("480|486") && method == "INVITE") { avp_write("$from", "$callback"); revert_uri(); avp_db_delete("$ruri", "$callback/callback"); avp_db_store("$ruri", "$callback/callback"); avp_delete("$callback"); } }
Andy
.
Iqbal wrote:
PS have you worked on reading out the missed number, I was thinking asterisk with Festival or something
No, it was just a quick try because I found the feature quite interesting.
But I've set up and played with asterisk with festival using the howto at [1] once and it was quite straight-forward writing custom perl scripts for it using Asterisk::AGI [2].
Andy
[1] http://www.voip-info.org/wiki-Asterisk+Festival+installation [2] http://asterisk.gnuinter.net/
Hi Andreas,
Thanks a lot for that answer and sorry for the late reply - I'll give it a try now and keep ye posted with how I get on.
Many thanks again.
Aisling.
-----Original Message----- From: Andreas Granig [mailto:andreas.granig@inode.info] Sent: 11 October 2005 16:41 To: Iqbal Cc: serusers@lists.iptel.org; Aisling Subject: Re: [Serusers] Missed Call Return
I wrote:
So you're right, it would be nicer to call avp_db_delete before avp_db_store in failure_route.
So finally the corrected failure-route looks like this (needs an additional DB query though):
failure_route[2] { if(t_check_status("480|486") && method == "INVITE") { avp_write("$from", "$callback"); revert_uri(); avp_db_delete("$ruri", "$callback/callback"); avp_db_store("$ruri", "$callback/callback"); avp_delete("$callback"); } }
Andy
-------------------Legal Disclaimer---------------------------------------
The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.
-------------------Legal Disclaimer---------------------------------------
The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.
I wrote a module that handles call return as I couldn't figure out a reasonable way of handling it with AVP.
If you figure out a way to do it, let me know.
N.
On Tue, 11 Oct 2005 12:25:59 +0100, Aisling wrote
Hello, I read a previous post by Iqbal (missedcaller call back) where a subscriber can ring a pre-defined number which callsback their last missed call .. Is my logic correct as follows?: In the missed call section (i.e. when theresa 408/487 message) do: avp_db_store($ruri, i:1000); Then when the caller dials the callback number e.g.1471 thiscode is invoked: if (uri=~^sip:1471@x.x.x.x){ log(1, in missed call return section); avp_db_load($from/username,i:1000); avp_pushto(i:1000,$ruri); //route as normal }; I am getting an error when restarting SER: ERROR: avops: fixup_pushto_avp:bad param 1; expected : $[ruri|hdr_name|..] Is it correct to push the AVP i:1000to the ruri? Do I need to define aliases in the modparam perhaps? Any help would be appreciated. Many thanks, Aisling. p.s. In case anyone was following my other post regarding asteriskvoicemail Its now working using avpops,the problem was with my asterisk config. There isstill a problem playing back the messages though. -------------------Legal Disclaimer---------------------------------------The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.