Hello everyone, Till now we were working with asterisk to handle BLF. But then we decided to move everything to kamailio and hence i started working on BLF with kamailio. I have already configured kamailio for Call handling and presence information.
From different pages on Internet, I have found some information about configuration of kamailio+blf. And i did so, but somehow things are not working as they should.
I have done following changes to kamailio.cfg file
loadmodule "presence.so" loadmodule "presence_xml.so" loadmodule "presence_dialoginfo.so" loadmodule "presence_mwi.so" loadmodule "dialog.so" loadmodule "pua.so" loadmodule "pua_dialoginfo.so"
modparam("presence", "fallback2db", 1) modparam("dialog", "dlg_flag", 4) modparam("dialog", "db_url", "mysql://xxxxxxxxx:xxxxxxxxxxxxxx@localhost/openser") modparam("dialog", "db_mode", 1) modparam("pua", "db_url", "mysql://xxxxxxxxx:xxxxxxxxxxxxxx@localhost/openser")
Now when my phone(yealink VP530), sends subscribe request it looks as below:
SUBSCRIBE sip:1001@172.16.27.66 SIP/2.0 Via: SIP/2.0/UDP 172.16.27.61:5063;branch=z9hG4bK10464096 From: "1000" sip:1000@172.16.27.66;tag=393923564 To: sip:1001@172.16.27.66 Call-ID: 1572901975@172.16.27.61 CSeq: 1 SUBSCRIBE Contact: sip:1000@172.16.27.61:5063 Accept: application/dialog-info+xml Max-Forwards: 70 User-Agent: VP530P 23.70.0.40 Expires: 120 Event: dialog Content-Length: 0
In response to this message, Kamailio returns 202 with following information
SIP/2.0 202 OK Via: SIP/2.0/UDP 172.16.27.61:5063;branch=z9hG4bK245273058 From: "1000" sip:1000@172.16.27.66;tag=393923564 To: sip:1001@172.16.27.66;tag=a6a1c5f60faecf035a1ae5b6e96e979a-8ee2 Call-ID: 1572901975@172.16.27.61 CSeq: 2 SUBSCRIBE Expires: 120 Contact: sip:172.16.27.66:5060 Server: kamailio (3.0.0 (i386/linux)) Content-Length: 0
Followed by a NOTIFY
NOTIFY sip:1000@172.16.27.61:5063 SIP/2.0 Via: SIP/2.0/UDP 172.16.27.66;branch=z9hG4bK3ccd.adfbc416.0 To: sip:1000@172.16.27.66;tag=2058189864 From: sip:1001@172.16.27.66;tag=a6a1c5f60faecf035a1ae5b6e96e979a-6cd8 CSeq: 1 NOTIFY Call-ID: 2040123403@172.16.27.61 Content-Length: 0 User-Agent: kamailio (3.0.0 (i386/linux)) Max-Forwards: 70 Event: dialog Contact: sip:172.16.27.66:5060 Subscription-State: active;expires=170
During subscribe message asked for XML based reply, yet NOTIFY doesnt send any XML. and hence there is no impact of this message on device. Nothing is changed.Also there's nothing when i call from this device to another, ideally i should get some NOTIFY messages
So, i think i am doing something wrong in Configuration.
Can anyone please help me in it. If you need any other info, i'll provide you.
The NOTIFY without an XML body you received just after a subscription is correct. rfc3265 says:
This SUBSCRIBE request will be confirmed with a final response. 200-class responses indicate that the subscription has been accepted, and that a NOTIFY will be sent immediately.
You can disable such notifies via send_fast_notify presence module parameter.
What about further notifications. Kamailio handles subscriptions and sends notifications when it receives PUBLISH requests. Using terms of the rfc3856 kamailio is a "presence server" and you need something to act as "Presence User Agent".
You can take a look at pua_dialoginfo module. I haven't used it, but its documentation says it can send PUBLISH requests based on active dialogs from the "dialog" module.
Hi vitaliy,
thank you very much for your reply. Here I am not talking about kamailio as Presence server, I am asking about BLF handling
For SUBSCRIBE+NOTIFY+PUBLISH in case of presence, everything is working fine
In case of BFL, once the phone/user subcribes, he doesnt send any PUBLISH message, only Server sends him NOTIFY based upon the status of the user he subscribed for, like IDLE, TALKING, RINGING,etc,etc.
Hope I could explain you good enough about my requirements. So according to your, first NOTIFY without XML is perfectly OK. But then there should be another NOTIFICATIONS based on the activity of subscribed user. as of now I am not getting any.
On 11/27/2012 06:30 AM, Hemanshu Patel wrote:
Hi vitaliy,
thank you very much for your reply. Here I am not talking about kamailio as Presence server, I am asking about BLF handling
For SUBSCRIBE+NOTIFY+PUBLISH in case of presence, everything is working fine
In case of BFL, once the phone/user subcribes, he doesnt send any PUBLISH message, only Server sends him NOTIFY based upon the status of the user he subscribed for, like IDLE, TALKING, RINGING,etc,etc.
As I understand BLF is a subscription to a "dialog" event. So you need a source of PUBLISH requests with "dialog" event them.
What phone you are talking about ? Does it have an option to send its line status to a proxy via PUBLISH with a "dialog" event? If your phones can't send PUBLISH requests with a "dialog" event you can try "dialog" + "pua_dialoginfo" modules.
No as per my belief in BLF, phone doesnt send any PUBLISH request. Server/Kamailio sends NOTIFY request based on dialog status to phones, if phone tries to create new dialog or so. Let me see dialog+pua_dialoginfo modules.
Dear friends,
I have to select entries from table which has a phone nomber in to or from column in a table.
Say a dialog tables and phone number is 1000. So i need to fetch all queries where to_uri or from_uri is like 1000. I have checked the code, but i didnt find any way to do this OR behaviour. Like in following simple example
db_keys[0] = &str_expires_col; db_ops[0] = OP_LT; db_vals[0].type = DB1_INT; db_vals[0].nul = 0; db_vals[0].val.int_val = (int)time(NULL);
result_cols[user_col= n_result_cols++] = &str_username_col; result_cols[domain_col=n_result_cols++] = &str_domain_col; result_cols[etag_col=n_result_cols++] = &str_etag_col; result_cols[event_col=n_result_cols++] = &str_event_col;
This can be used where expires coloumn is less then current unix time. But say i want to change the query like expire value is less then xxxxxx but greater then yyyyy Then how can i do that?
Should i need to use another db_key with OP_GT value?
What is Operation info we should use for LIKE. I mean i need to select value which is sip:1000@xx.xx.xx.xx via searching for 1000.
I Hope i had explain the question well. Please let me know in case any confusion in question.
Hello,
db api has support only for AND in WHERE for the db_query member. You can print your own query and ship it to the API via db_raw_query() (this will work of course only for SQL databases).
Alternatives, - do two queries (probably not that optimal) - detect which value to use (from/to header) based on direction, which can be detected using rr module.
Cheers, Daniel
On 12/6/12 11:08 AM, Hemanshu Patel wrote:
Dear friends,
I have to select entries from table which has a phone nomber in to or from column in a table.
Say a dialog tables and phone number is 1000. So i need to fetch all queries where to_uri or from_uri is like 1000. I have checked the code, but i didnt find any way to do this OR behaviour. Like in following simple example
db_keys[0] = &str_expires_col; db_ops[0] = OP_LT; db_vals[0].type = DB1_INT; db_vals[0].nul = 0; db_vals[0].val.int_val = (int)time(NULL);
result_cols[user_col= n_result_cols++] = &str_username_col; result_cols[domain_col=n_result_cols++] = &str_domain_col; result_cols[etag_col=n_result_cols++] = &str_etag_col; result_cols[event_col=n_result_cols++] = &str_event_col;
This can be used where expires coloumn is less then current unix time. But say i want to change the query like expire value is less then xxxxxx but greater then yyyyy Then how can i do that?
Should i need to use another db_key with OP_GT value?
What is Operation info we should use for LIKE. I mean i need to select value which is sip:1000@xx.xx.xx.xx via searching for 1000.
I Hope i had explain the question well. Please let me know in case any confusion in question.
-- Regards,
Hemanshu Patel
*P*Help the environment -- please don't print this email unless you really need to!
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
thanks daniel I guess i have to use two queries here.
By the way is there any LIKE operation, I mean if i want to select sip:1000@xx.xx.xx.xx value by using key 1000, then which DB operation I have to use. As far as i have seen in code file, there is no LIKE operation, only GT,LT,GET,LET,EQ,NEQ,etc.