Please don't forget to copy your responses back to the list so that others can benefit from this discussion.
I must have misunderstood your intended meaning of "user-defined." $hdr(...) takes only string literals as arguments, not pseudovariables.
I do not believe that what you are wanting is possible.
RAJNIKANT VANZA wrote:
Ranikant,
You can you use Perl module for this, please look at :
http://kamailio.org/docs/modules/1.6.x/perl.html
See the script example, headers.pl
-Thiago Rondon
Alex Balashov escreveu:
I'm experimenting some modification in kamailio to add support for a new "SIP event package". Unfortunalty, it seems the parser of kamailio and its presence module both are limited to accept:
#define EVENT_OTHER 0 #define EVENT_PRESENCE 1 #define EVENT_PRESENCE_WINFO 2 #define EVENT_SIP_PROFILE 3 #define EVENT_XCAP_CHANGE 4 #define EVENT_DIALOG 5 #define EVENT_MWI 6 #define EVENT_DIALOG_SLA 7
If any other module define support for a new event package, the presence module will not accept the subscription and reject it with 489 because it is considered an EVENT_OTHER.
I'm working with 1.5.x branch. Would that be different in newer core?
If I propose to write a patch, would you consider it? What alternative do I have to add unknown event package as module without modifying the core? Did I missed any key?
Regards, Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
Already, I got a patch:
http://sip.antisip.com/kamailio153-allow-any-event-package-v1.patch
very simple in fact, but yet not much tested! Please post any remark as I'm not 100% sure about it...
Tks, Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
On Mon, 23 Nov 2009, Aymeric Moizard wrote:
Hello,
On 23.11.2009 13:38 Uhr, Aymeric Moizard wrote:
it is the same architecture of the presence server implementation, just the event parser from core is slightly different.
If I propose to write a patch, would you consider it?
yes, that would be good. At this time I see you sent already one, I will check.
The event id is used to identify the records in db, you should take care of that. Probably is better to change it to the string version as it is not a big improvement now, or at least allow easy extensibility without hardcoding values.
Cheers, Daniel
Hi again,
On Tue, 24 Nov 2009, Daniel-Constantin Mierla wrote:
Which table from the database are you talking about? In presentity as well as watchers, I can see that the "event" is a string.
Have you checked my patch?
Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
Hello,
On 23.11.2009 11:37 Uhr, Alex Balashov wrote:
actually $hdr(...) should be able to take PV as header name:
$var(n) = "From"; xlog("--- $hdr($var(n))\n");
If it is no longer working, that should be fixed.
Cheers, Daniel
Daniel-Constantin Mierla wrote:
I came to the same conclusion a few hours ago after reviewing the code. It is strange that it does not work.
Hello,
On 24.11.2009 9:50 Uhr, Alex Balashov wrote:
have you tested and does not work? Any error message in the logs? I can test later today...
Thanks, Daniel
Daniel-Constantin Mierla wrote:
It does not with Kamailio 1.5.1:
Nov 24 03:45:25 diminuendo-1 /usr/local/sbin/kamailio[25362]: ERROR:core:pv_get_spec_name: name type is PV_NAME_OTHER - cannot resolve Nov 24 03:45:25 diminuendo-1 /usr/local/sbin/kamailio[25362]: ERROR:pv:pv_get_hdr: invalid name Nov 24 03:45:25 diminuendo-1 /usr/local/sbin/kamailio[25362]: [R-2:SDl9o0101-a1aa80162d5fbfc1911a608785ad814e-omv02r3] -> From header:
This is attempting to do:
$var(n) = "From"; xlog("L_INFO", "[R-2:$ci] -> From header: $hdr($var(n))\n");
On 24.11.2009 9:57 Uhr, Alex Balashov wrote:
I tested with 1.5.3 and works. It was an issue fixed after 1.5.1: http://openser.svn.sourceforge.net/viewvc/openser?view=rev&revision=5869
Cheers, Daniel