[SR-Users] Making dialog module work for me !!

Daniel-Constantin Mierla miconda at gmail.com
Thu Jun 14 10:26:09 CEST 2012


Hello,

On 6/12/12 11:49 AM, SamyGo wrote:
> Yes, I saw the event routes in new version and that seems relevant. 
> Yes deleting entries from hash table is definitely logical but what 
> about hash entries for calls which are in-call for like 4~10 hours !! 
> will hashtable delete those entries !
auto-expire was designed for this purpose, but, iirc, you said you don't 
want to use it, any reason?
>
> So I was thinking that I definitely need a mechanism in my hash table 
> entries to refresh which enteries have corresponding active calls 
> (dialogs) and which entries should be deleted as no call for them is 
> found !

You can correlate by call-id/dialog id the hash table content and the 
list of active dialogs from dialog module -- you will have to write some 
code for it.

> I simply can't depend on the expiry time of hased entries - that will 
> render the logic useless. Think of an entry which shouldn't be in the 
> table , an new call for that destination comes in and Kamailio will 
> think that (due to useless entry in h-table) destination is in call 
> and lets not send him any more calls !!

This is only when BYE is missing, which with old version of dialog was 
more or less the same -- dialog will look like being active until dialog 
timeout is triggered (if auto-exipre and dialog timout are the same 
value, then practically both modules will remove the data associated 
with that call at the same time). With newest version 3.3, dialog can do 
options keepalives, practically able to detect if a call is down, then 
the event route is triggered and you can delete from htable as well.

Cheers,
Daniel
>
>
>
> On Tue, Jun 12, 2012 at 2:36 PM, Daniel-Constantin Mierla 
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>     Hello,
>
>
>     On 6/7/12 1:34 PM, SamyGo wrote:
>>     Hi,
>>
>>     sure, I'll give that debug messages a try tonight, Also I was
>>     thinking of alternative approach and like you said, you are using
>>     htable. If I've to use that htable entry manually how do I make
>>     sure that any call data gets only deleted/erased after the call
>>     hangsup !? i.e I don't want the htable entry to get expired and
>>     removed automatically for a call length greater than 3 hours !!
>
>     the call ends when the BYE is coming through, so at that time you
>     can delete from htable -- if the BYE is missing, then the htable
>     auto-expire will clean it (like dialog auto-expires will do it for
>     dlg case).
>
>     Just as side note, in 3.3.0, dialog module exports events routes
>     executed when a call is started or ended, so you can do easier
>     operations related to this events (e.g., no matter dialog is ended
>     by a bye or timeout, you will get a specific event route
>     executed), see:
>       *
>     http://kamailio.org/docs/modules/3.3.x/modules_k/dialog.html#id2556156
>
>     Cheers,
>     Daniel
>
>>
>>     Thanks alot,
>>     Sammy
>>
>>
>>     On Thu, Jun 7, 2012 at 4:17 PM, Daniel-Constantin Mierla
>>     <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>>
>>         Hello,
>>
>>         do you get any hints about what happens if you run with
>>         debug=3? When dialog is deleted from database, is any other
>>         query sent to delete the dialog vars? This features was not
>>         used by me so far, still relying on htable for my needs of
>>         such cases.
>>
>>         You can send the logs here for troubleshooting.
>>
>>         Cheers,
>>         Daniel
>>
>>
>>         On 6/6/12 6:45 PM, SamyGo wrote:
>>>         Hi Sir,
>>>         I've used the funcation as you informed. /$dlg_var(incall) =
>>>         $fU; / It do insert my desired value into the dialog_var
>>>         table but it don't gets deleted on call hangup !
>>>
>>>         I'm executing this code in my ON_REPLY route:
>>>
>>>         onreply_route[REPLY_ONE] {
>>>         xdbg("incoming reply\n");
>>>         if(is_method("BYE"))
>>>                 {
>>>         unset_dlg_profile("incall","$fU");
>>>         dlg_resetflag("4");
>>>                 }
>>>         ....
>>>
>>>
>>>         Still I can't seem to erase the values :(
>>>
>>>         Please suggest.
>>>
>>>         Best Regards,
>>>         Sammy G.
>>>
>>>
>>>         On Mon, Jun 4, 2012 at 12:41 PM, SamyGo <govoiper at gmail.com
>>>         <mailto:govoiper at gmail.com>> wrote:
>>>
>>>             Thanks,
>>>
>>>             The reason why I didn't scroll down to it was because it
>>>             was not listed under the functions list. Thanks for
>>>             this. I'll give it a try.
>>>             Next question is, will the values stored in this
>>>             dialog_vars be matched if I execute the function
>>>             /is_in_profile("my-profile") ?/
>>>
>>>             The problem with the alternative approach ,what I think,
>>>             could be that I'd have to make sure that the required
>>>             KVPs are stored in my hashtable for the length of the
>>>             call active.
>>>             I'd definitely not want my configurations file to behave
>>>             abnormally if the hastable entry value gets expired
>>>             meanwhile the corresponding call is still active.
>>>
>>>             Also Sir, I posted a previous email regarding the values
>>>             not getting expired from "dialog" table even after the BYE !
>>>
>>>             Thanks again,
>>>             Regards,
>>>             Sammy G.
>>>
>>>
>>>             On Mon, Jun 4, 2012 at 12:02 PM, Daniel-Constantin
>>>             Mierla <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>>>
>>>                 Hello,
>>>
>>>                 to store in a value in a dialog_var record, you have
>>>                 to set a PV for it:
>>>
>>>                 http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2555403
>>>
>>>                 Alternative, you can use hashtable with a key
>>>                 composed from dialog id (or callid) and some other
>>>                 string to identify your value.
>>>
>>>                 Cheers,
>>>                 Daniel
>>>
>>>
>>>                 On 6/2/12 9:47 AM, SamyGo wrote:
>>>>                 Hello
>>>>
>>>>
>>>>                 I've two problems regarding dialog module- used for
>>>>                 profiling users that are in-a-call.
>>>>
>>>>                 My topology is quiet simple.
>>>>
>>>>
>>>>                 SIP-USER-71141---->Kamailio------------->Asterisk[AGI]||
>>>>                 CALLEE<-----------------Kamailio<--------------------------------||
>>>>
>>>>
>>>>                 1- I wish to store my custom SIP header value in
>>>>                 profiles.
>>>>
>>>>                 I'm having trouble in figuring out on how to use
>>>>                 Dialog_vars table in my kamailio server. I'm using
>>>>                 dialog module to profile SIP users that are in call
>>>>                 or making a call. It works well and the dialog
>>>>                 maintains an entry when the call is established.
>>>>                 Now, the difficult part is that I want my custom
>>>>                 header to be inserted into either dialog table or
>>>>                 dialog_vars table such that when I do a query
>>>>                 "*is_in_profile("$avp(my_value)")*" it returns me a
>>>>                 result.
>>>>
>>>>
>>>>                 2- Alternative to 1, I can log A,B leg separately
>>>>                 but it doesn't erase all data on call hangup.
>>>>
>>>>                 Asterisk AGI changes the caller-id of SIP-USERA
>>>>                 such that if it was 71141 it would be something
>>>>                 like "007" on its way out to destination via
>>>>                 kamailio. Now, at this point in kamailio when the
>>>>                 call is answered by destination the dialog module
>>>>                 saves the call data with values corresponding to
>>>>                 "007" and not "71141".
>>>>                 I have to disable the "dialog", "detect_spirals" in
>>>>                 order to count this one call as two separate
>>>>                 entities BUT problem occurs when on hangup the
>>>>                 B-Leg gets erased from the table but the A-leg
>>>>                 remains in DB for as long as  infinity.
>>>>
>>>>                 Please help me in this.
>>>>                 Let me know if more details are required from me.
>>>>
>>>>                 Regards,
>>>>                 Sammy G.
>>>>
>>>>
>>>>                 _______________________________________________
>>>>                 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>>                 sr-users at lists.sip-router.org  <mailto:sr-users at lists.sip-router.org>
>>>>                 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>                 -- 
>>>                 Daniel-Constantin Mierla -http://www.asipto.com
>>>                 http://twitter.com/#!/miconda  <http://twitter.com/#%21/miconda>  -http://www.linkedin.com/in/miconda
>>>                 Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -http://asipto.com/u/katu
>>>                 Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -http://asipto.com/u/kpw
>>>
>>>
>>>
>>>
>>>
>>
>>         -- 
>>         Daniel-Constantin Mierla -http://www.asipto.com
>>         http://twitter.com/#!/miconda  <http://twitter.com/#%21/miconda>  -http://www.linkedin.com/in/miconda
>>         Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -http://asipto.com/u/katu
>>         Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -http://asipto.com/u/kpw
>>
>>
>>
>>
>
>     -- 
>     Daniel-Constantin Mierla -http://www.asipto.com
>     http://twitter.com/#!/miconda  <http://twitter.com/#%21/miconda>  -http://www.linkedin.com/in/miconda
>     Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -http://asipto.com/u/katu
>     Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -http://asipto.com/u/kpw
>
>
>
>

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - http://asipto.com/u/kpw



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120614/1854d226/attachment-0001.htm>


More information about the sr-users mailing list