So Im writing a custom module to implement some of our business logic, there are a few steps that im building into the module, for example
conform_callerid conform_destination
what I want to achive should be fairly simple, but let me explain and im sure someone will tell me where to look.
when I call conform_callerid, I want to store a few bits of info so Initially I store them in a global variable ( yup lazy & dangerous I guess )
then I write the pv "get" function, to return the value from the global.
this was only done as a quick proof of concept. but being global, im sure the variable will be overwritten by other message etc etc..
so I effectively want to store some custom fields against the message. I didnt see this on the msg structure, but maybe I missed something
or is there a better way to achieve this ??
basically I want to be able to call conform_callerid then when I call conform_destination I want to look at some fields from the conform_callerid process ( within the context of the message we are processing )
any pointers would be appreciated.
Sorry to repost this but, Im still looking for answers. is there a better place to be asking these questions ??
Jay
---------- Forwarded message ---------- From: jay binks jaybinks@gmail.com Date: 19 March 2014 19:18 Subject: module writing & per message variable within my module To: sr-dev sr-dev@lists.sip-router.org
So Im writing a custom module to implement some of our business logic, there are a few steps that im building into the module, for example
conform_callerid conform_destination
what I want to achive should be fairly simple, but let me explain and im sure someone will tell me where to look.
when I call conform_callerid, I want to store a few bits of info so Initially I store them in a global variable ( yup lazy & dangerous I guess )
then I write the pv "get" function, to return the value from the global.
this was only done as a quick proof of concept. but being global, im sure the variable will be overwritten by other message etc etc..
so I effectively want to store some custom fields against the message. I didnt see this on the msg structure, but maybe I missed something
or is there a better way to achieve this ??
basically I want to be able to call conform_callerid then when I call conform_destination I want to look at some fields from the conform_callerid process ( within the context of the message we are processing )
any pointers would be appreciated.
On 08 May 2014, at 08:49, jay binks jaybinks@gmail.com wrote:
Sorry to repost this but, Im still looking for answers. is there a better place to be asking these questions ??
Jay
---------- Forwarded message ---------- From: jay binks jaybinks@gmail.com Date: 19 March 2014 19:18 Subject: module writing & per message variable within my module To: sr-dev sr-dev@lists.sip-router.org
So Im writing a custom module to implement some of our business logic, there are a few steps that im building into the module, for example
conform_callerid conform_destination
what I want to achive should be fairly simple, but let me explain and im sure someone will tell me where to look.
when I call conform_callerid, I want to store a few bits of info so Initially I store them in a global variable ( yup lazy & dangerous I guess )
then I write the pv "get" function, to return the value from the global.
this was only done as a quick proof of concept. but being global, im sure the variable will be overwritten by other message etc etc..
so I effectively want to store some custom fields against the message. I didnt see this on the msg structure, but maybe I missed something
or is there a better way to achieve this ??
basically I want to be able to call conform_callerid then when I call conform_destination I want to look at some fields from the conform_callerid process ( within the context of the message we are processing )
any pointers would be appreciated.
avps are stored in the transaction, process variablees in the process. You don't clearly say in which context you want to "save" the data and when you want to "use" it so it's hard to answer this.
Why do you need to write a module for this? What is it you can not do in the scripts?
/O
So id love to read somewhere more about structures in kamailio at a high level.. is there a more interactive place to discuss these concepts ?? say IRC, google hangouts or something ?? ( without having to bug the whole list )
can you explain what the differences are when you say "avp stored in the transaction" and process variables ? do you literally mean variables in my module here, or are these some kind of structure attached to the sip_msg ?
effectively what im looking to do is store some custom data against sip_msg* that I can use later if I need to.
my reason for doing a module is that I had a few things I wanted to do in a module ( looking up large data structures for performance reasons ), and im implementing a few other bits of business logic in this module.
im happy to discuss further if you want to gtalk me ( on this email address )
Jay
On 8 May 2014 16:52, Olle E. Johansson oej@edvina.net wrote:
On 08 May 2014, at 08:49, jay binks jaybinks@gmail.com wrote:
Sorry to repost this but, Im still looking for answers. is there a better place to be asking these questions ??
Jay
---------- Forwarded message ---------- From: jay binks jaybinks@gmail.com Date: 19 March 2014 19:18 Subject: module writing & per message variable within my module To: sr-dev sr-dev@lists.sip-router.org
So Im writing a custom module to implement some of our business logic, there are a few steps that im building into the module, for example
conform_callerid conform_destination
what I want to achive should be fairly simple, but let me explain and im sure someone will tell me where to look.
when I call conform_callerid, I want to store a few bits of info so Initially I store them in a global variable ( yup lazy & dangerous I guess )
then I write the pv "get" function, to return the value from the global.
this was only done as a quick proof of concept. but being global, im sure the variable will be overwritten by other message etc etc..
so I effectively want to store some custom fields against the message. I didnt see this on the msg structure, but maybe I missed something
or is there a better way to achieve this ??
basically I want to be able to call conform_callerid then when I call conform_destination I want to look at some fields from the conform_callerid process ( within the context of the message we are processing )
any pointers would be appreciated.
avps are stored in the transaction, process variablees in the process. You don't clearly say in which context you want to "save" the data and when you want to "use" it so it's hard to answer this.
Why do you need to write a module for this? What is it you can not do in the scripts?
/O
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
On 08 May 2014, at 08:59, jay binks jaybinks@gmail.com wrote:
So id love to read somewhere more about structures in kamailio at a high level.. is there a more interactive place to discuss these concepts ?? say IRC, google hangouts or something ?? ( without having to bug the whole list )
We have a channel on IRC, but there is not a lot of activity there. A few of us are always connected.
can you explain what the differences are when you say "avp stored in the transaction" and process variables ? do you literally mean variables in my module here, or are these some kind of structure attached to the sip_msg ?
Read the docs on AVPs, shared variables (shv) process variables (var). They are all stored in different memory and related to different things.
effectively what im looking to do is store some custom data against sip_msg* that I can use later if I need to.
When is later? In another request or in the response to the same request? If there's a stateful transaction, AVPs are reachable in response processing.
my reason for doing a module is that I had a few things I wanted to do in a module ( looking up large data structures for performance reasons ), and im implementing a few other bits of business logic in this module.
Still doesn't explain why you need to code it in c and make it a modules. You can do a lot in the existing logic.
im happy to discuss further if you want to gtalk me ( on this email address )
I would suggest that you read up on the available docs and then find us in the IRC channel where we try to be available and answer when it works for us. If you really need fast help and responses, many of us are available as consultants.
In general, you have to be a bit more exact in your questions to get good answers on -dev, a bit less on -users. Your original e-mail was a bit too inexact so it wasn't easy to answer, which lead to everyone thinking that someone else may understand and may answer... Before reposting to a mailing list, try to figure out why no one answered and add information to make it easier to answer.
/O
Jay
On 8 May 2014 16:52, Olle E. Johansson oej@edvina.net wrote:
On 08 May 2014, at 08:49, jay binks jaybinks@gmail.com wrote:
Sorry to repost this but, Im still looking for answers. is there a better place to be asking these questions ??
Jay
---------- Forwarded message ---------- From: jay binks jaybinks@gmail.com Date: 19 March 2014 19:18 Subject: module writing & per message variable within my module To: sr-dev sr-dev@lists.sip-router.org
So Im writing a custom module to implement some of our business logic, there are a few steps that im building into the module, for example
conform_callerid conform_destination
what I want to achive should be fairly simple, but let me explain and im sure someone will tell me where to look.
when I call conform_callerid, I want to store a few bits of info so Initially I store them in a global variable ( yup lazy & dangerous I guess )
then I write the pv "get" function, to return the value from the global.
this was only done as a quick proof of concept. but being global, im sure the variable will be overwritten by other message etc etc..
so I effectively want to store some custom fields against the message. I didnt see this on the msg structure, but maybe I missed something
or is there a better way to achieve this ??
basically I want to be able to call conform_callerid then when I call conform_destination I want to look at some fields from the conform_callerid process ( within the context of the message we are processing )
any pointers would be appreciated.
avps are stored in the transaction, process variablees in the process. You don't clearly say in which context you want to "save" the data and when you want to "use" it so it's hard to answer this.
Why do you need to write a module for this? What is it you can not do in the scripts?
/O
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
-- Sincerely
Jay _______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
can you explain what the differences are when you say "avp stored in the transaction" and process variables ? do you literally mean variables in my module here, or are these some kind of structure attached to the sip_msg ?
Read the docs on AVPs, shared variables (shv) process variables (var). They are all stored in different memory and related to different things.
Thanks, Ill look into these.
effectively what im looking to do is store some custom data against sip_msg* that I can use later if I need to.
When is later? In another request or in the response to the same request? If there's a stateful transaction, AVPs are reachable in response processing.
Sorry... by later, I mean, later while processing the same message. Not later on in the call, in that case I know it must be persisted in a dialog.
my reason for doing a module is that I had a few things I wanted to do in a
module ( looking up large data structures for performance reasons ), and im implementing a few other bits of business logic in this module.
Still doesn't explain why you need to code it in c and make it a modules. You can do a lot in the existing logic.
Fair call, I know I can do a lot in kamailio, its quite surprising actually what you can do. Ill re-evaluate my reasons for writing a module.
im happy to discuss further if you want to gtalk me ( on this email address )
I would suggest that you read up on the available docs and then find us in the IRC channel where we try to be available and answer when it works for us. If you really need fast help and responses, many of us are available as consultants.
Ill try IRC again, but yea... there were not many people around last I was on there :) I understand maybe time zones didnt work, or people were too busy.
In general, you have to be a bit more exact in your questions to get good answers on -dev, a bit less on -users. Your original e-mail was a bit too inexact so it wasn't easy to answer, which lead to everyone thinking that someone else may understand and may answer... Before reposting to a mailing list, try to figure out why no one answered and add information to make it easier to answer.
Fair enough, sorry for being vague.
On 08 May 2014, at 09:21, jay binks jaybinks@gmail.com wrote:
can you explain what the differences are when you say "avp stored in the transaction" and process variables ? do you literally mean variables in my module here, or are these some kind of structure attached to the sip_msg ?
Read the docs on AVPs, shared variables (shv) process variables (var). They are all stored in different memory and related to different things.
Thanks, Ill look into these.
Great! Reading docs usually doesn't hurt people. A few animals where killed in the process though ;-)
effectively what im looking to do is store some custom data against sip_msg* that I can use later if I need to.
When is later? In another request or in the response to the same request? If there's a stateful transaction, AVPs are reachable in response processing.
Sorry... by later, I mean, later while processing the same message. Not later on in the call, in that case I know it must be persisted in a dialog.
Then you want to use the process memory - $var.
my reason for doing a module is that I had a few things I wanted to do in a module ( looking up large data structures for performance reasons ), and im implementing a few other bits of business logic in this module.
Still doesn't explain why you need to code it in c and make it a modules. You can do a lot in the existing logic.
Fair call, I know I can do a lot in kamailio, its quite surprising actually what you can do. Ill re-evaluate my reasons for writing a module.
Please do. During many years of using Kamailio, I've been able to do almost everything I want to do with the existing set of modules. Developing our own module put a lot of burden on the company - someone will have to maintain it for as long as Kamailio is used.
We also have the lua, perl, python and java modules that you can use to extend our script language even more.
im happy to discuss further if you want to gtalk me ( on this email address )
I would suggest that you read up on the available docs and then find us in the IRC channel where we try to be available and answer when it works for us. If you really need fast help and responses, many of us are available as consultants.
Ill try IRC again, but yea... there were not many people around last I was on there :) I understand maybe time zones didnt work, or people were too busy.
It's not as active as a few other projects. But it heats up from time to time. ;-)
In general, you have to be a bit more exact in your questions to get good answers on -dev, a bit less on -users. Your original e-mail was a bit too inexact so it wasn't easy to answer, which lead to everyone thinking that someone else may understand and may answer... Before reposting to a mailing list, try to figure out why no one answered and add information to make it easier to answer.
Fair enough, sorry for being vague.
Don't apologize, just learn from the experience. Open Source is a different world and everyone has to learn how to interact with the community to get answers and provide knowledge back.
/O