Hi guys, I have a similar problem, maybe easier. I'm new in openser so I'd like to have some help.
I'd like openser create a table in MySQL db when receive an INVITE, a row with from uri, method and something else, I've look into modules docs but I've not understanding at all...could you help me, please?
Thanks for reply
Davide
________________________________
Da: users-bounces(a)openser.org [mailto:users-bounces@openser.org] Per conto di Jayesh Nambiar
Inviato: mercoledì 5 aprile 2006 15.53
A: Bogdan-Andrei Iancu
Cc: openser
Oggetto: Re: [Users] using AVPs to write into database
Hi Bogdan,
Thanks for the reply and sorry for sending the earlier mail 4 times as yahoo was not responding peoperly.
When I do an avp_write(), why does the avp name get stored in the uuid column?
I am not using any uuid as of now. I also tried to add the username of the person who is calling but it again creates two rows, one with the value as
username and other row with the value as forwarded number.
I thought if there is a way to insert the username also, it wud be easier to check, if the incoming call for that user is to be forwarded or not.
I get the following in my usr_preferences table after I dial 86 followed by any number.
+-----------+----------+--------+-----------+------+-----------------------------+---------------------+
| uuid | username | domain | attribute | type | value | modified |
+-----------+----------+--------+-----------+------+-----------------------------+---------------------+
| s:callfwd | | | callfwd | 0 | sip:5515551478@202.80.61.10 | 2006-04-05 19:10:49 |
+-----------+----------+--------+-----------+------+-----------------------------+---------------------+
The script snippet is as follows:
if(uri=~"^sip:86[0-9]*@") {
strip(2);
avp_write("$ruri", "s:callfwd");
#avp_write("$from/username", "i:999");
#avp_db_store("i:999", "i:/usr_preferences");
avp_db_store("s:callfwd", "s:callfwd/usr_preferences");
sl_send_reply("200", "OK");
exit;
};
Bogdan-Andrei Iancu <bogdan(a)voice-system.ro> wrote:
Hi,
you need two steps:
1) write the ruri (after strip) into an AVP - use avp_write()
2) write the avp into the db - use avp_db_store()
regards,
bogdan
Jayesh Nambiar wrote:
> Hi all,
> I am trying to implement the call forwarding feature in openser. The
> forwarding part is fine. But I have the follwing scenario:
> Whenever a user needs to change his forwarding number, he should be
> able to do so from his end device only.
> For eg: He first presses 86 and then the 10 digit number to be
> forwarded. Here the 86 has to be stripped and the 10 digit number
> should be inserted into the call forward value column of the
> preferences table.
> Also if he wants to remove the forwarded number, he can do so by
> pressing say for eg: 87. on receiving this number openser should
> delete that value from the
> table.
> Is this possible. I tried to do the following, but somehow it does not
> change the
> value.
> if(uri=~"^sip:86[0-9]*@") {
> if(avp_db_load("$from/username", "s:callfwd")) { #check
> if call-fwd feature is enabled for the user
> log(1,"AVP condition returned true");
> strip(2);
> avp_write("$ruri", "s:callfwd");
> avp_print();
> log(1,"AVP written");
> sl_send_reply("200", "OK");
> exit;
> };
> };
> Is avp_write the proper method or I guess avp_db_store can also help
> me. The avp_print() function also does not show me anything in the
> log. Are there any
> logical mistakes or I have mis-interpreted the syntax of avpops functions.
> Please help me in thsi regard.
> Thanks a lot in advance.
> Jayesh.
>
> ------------------------------------------------------------------------
> Jiyo cricket on Yahoo! India cricket
>
> Yahoo! Messenger Mobile
>
> Stay in touch with your buddies all the time.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Users mailing list
>Users(a)openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>
>
________________________________
Jiyo cricket on Yahoo! India cricket <http://us.rd.yahoo.com/mail/in/mailcricket/*http:/in.sports.yahoo.com/crick…>
Yahoo! Messenger Mobile <http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http:/in.mobile.yahoo.c…> Stay in touch with your buddies all the time.
Hi all
We are trying to install a firewall in our structure. The problem is: the firewall (between X.Y.Z.A and X.Y.Z.B) manipulates the packets, but it changes de SRC port when it sends to the SER (X.Y.Z.B).
X.Y.Z.A:5060 ----> X.Y.Z.B:5060
(dump in X.Y.Z.A)
X.Y.Z.A:10080 ----> X.Y.Z.B:5060
(doing a dump in X.Y.Z.B)
When X.Y.Z.B answer to X.Y.Z.A, it uses the port 10080:
X.Y.Z.B:5060 ----> X.Y.Z.A:10080
It break the comunication, because X.Y.Z.A isnt listening at 10080.
I need to force the SER to send the messages back to 5060. There are any way to do it?
Thanks a lot.
Bruno Machado
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/
Hi,
We are using SIPPS as the softphone for our ISP customers, all of whom
are on DSL and behind some sort of NAT'ed firewall.
SIPPS does not always pick up the need for STUN when it checks the
network, and then the user has problems until STUN is enabled.
My question is - would there be any downside in us just hard coding the
client to use STUN, given that the end user is a home user on DSL?
Thanks.
--
-Barry Flanagan
Dear All
I am new to SER and wanted to figure out how to manage
callerid when displayed on a end phone.
I have a E1 line terminating on a Cisco Router which
we use for inbound/outbound calls.
We dial 9 to make a outbound call via this e1.
When a incoming call comes, it displays the callerd as
presented by my operator.
Now, if the user wants to call back, he cant do by the
menu of callback since dialing out from pstn needs a
digit 9 prefix.
I would like to know if I can prefix 9 before
forwarding call to PSTN so that the callback from the
extension works smoothly.
Thanks in advance.
Vish
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Hi,
I need to rewrite the destination uri to replace "+353" with "0" before
passing it on to our PSTN gateway..
What is the cleanest way to do this?
Thanks.
--
-Barry Flanagan
My name is Jahangir
I am configuring SER on SuSE Linux.I have some problem
to configure it.Any one wants to help me?
Jahangir
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Just to have the confirmation :
When acting as a stateless proxy (not using tm at all), the variable
syn_branch have to be 0. syn_branch = 1 is meaningful only in case we use tm
?
And the documentation says the default value of syn_branch is 0 but the code
initialize the variable to 1. I have to manually set it to 0.
--
Simon.
Hello,
I have an issue with the fix_nated_contact() function. OpenSer is supposed
to change Contact header, but it only changes it in the INVITE message, but
not in the OK response. As a consequence, ACK messages contain
sip:test@192.168.1.1:5060 and not the public ip. OpenSer doesn't know how to
handle that ACK and forward it to 192.168.1.1:5060.
The same issue occurs in CANCEL/487. Changes are done in CANCEL Contact
header, but not in 487 reply. No problem for BYE, as OK response doesn't
need an ACK
I suppose I have something wrong in my cfg file, but I can't find it out.
Regards,
Paul
Openser.Cfg:
...default loadmodules and modparam ...
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER"){
record_route();
force_rport();
fix_nated_register();
fix_nated_contact();
};
#if(search("Contact")){
#setflag(6);
#force_rport();
# fix_nated_contact();
#};
if(method!="REGISTER" && method!="ACK")
{
#record everything besides registers and acks
setflag(1);
setflag(3);
};
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
# if you have some interdomain connections via TLS
#if(uri=~"@tls_domain1.net") {
# t_relay_to_tls("IP_domain1","port_domain1");
# exit;
#} else if(uri=~"@tls_domain2.net") {
# t_relay_to_tls("IP_domain2","port_domain2");
# exit;
#}
route(1);
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
#change contact field IP and port by those received really
used after NAT rewritting by router
#fix_nated_contact();
#force openSer to respond on the port from which the
request has been sent insteed of the port
#in contact field.
force_rport();
# Uncomment this if you want to use digest authentication
if (!www_authorize("mydomain", "subscriber")) {
www_challenge("mydomain ", "0");
exit;
};
setflag(1);
setflag(3);
fix_nated_register();
save("location");
exit;
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};
route(1);
}
route[1] {
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
exit;
}
We have a commercial SIP server which currently does our registering,
low cost routing and customer billing. However, it doesn't handle NATed
connections well. To fix this, I wanted to use openser in front of it
for customer connections using mediaproxy/rtpproxy. However, I have a
problem with this setup.
>From what I gather, for the proxy to work properly, the end user need to
be registered with the proxy so that it can do nat pings and keep the
nat connection alive. But for users to make calls using our commercial
server (which is what we want), they must be registered there. Is it
possible (or even a good idea) to have a user registered on 2 servers at
the same time? How else can we do this?
This is what I want to achieve:
- from the end user perspective, they register and initiate calls only
via the openser proxy. They know nothing of our commercial server.
- calls between users is done on the openser proxy
- calls to external destinations (i.e. PSTN) go via our commercial
server and require that the user is registered there
Is this possible?
Jeff