Hello,
never used this profile thing from dialog, but having a parameter in the
middle being optional is strange. Please try attached patch and let me
know if ok.
Cheers,
Daniel
On 04/08/2009 03:42 PM, Alex Balashov wrote:
Yeah, I know. I just figured I was missing some of the erudite PV magic
in the fixup functions I was looking at, and that it is somehow able to
tell whether the parameter in the middle is optional or not via some
sort of crude scheme. Your interpretation confirms my suspicion that it
in fact cannot.
Henning Westerholt wrote:
On Wednesday 08 April 2009, Alex Balashov wrote:
The optional parameter should be always the last one(s), as its
not possible to ommit a parameter from the middle of the given list.
That's what I thought too, and wondered how the config lexer and fixup
functions magically get around this problem.
Normally there is not that much magic, its a simple array of parameters that
get filled, and then the module fixup functions are called for each of them.
sr_module.h: typedef int (*cmd_function)(struct sip_msg*, char*, char*, char*,
char*, char*, char*);
But i did not wrote this code, perhaps one of the authors can comment here
too.
Cheers,
Henning
--
Daniel-Constantin Mierla
http://www.asipto.com/
Index: modules/dialog/dialog.c
===================================================================
--- modules/dialog/dialog.c (revision 5791)
+++ modules/dialog/dialog.c (working copy)
@@ -680,9 +680,14 @@
unsigned int size;
pv_value_t val;
- pve = (pv_elem_t *)value;
- sp_dest = (pv_spec_t *)result;
-
+ if(result!=NULL)
+ {
+ pve = (pv_elem_t *)value;
+ sp_dest = (pv_spec_t *)result;
+ } else {
+ pve = NULL;
+ sp_dest = (pv_spec_t *)value;
+ }
if ( pve!=NULL && ((struct dlg_profile_table*)profile)->has_value) {
if ( pv_printf_s(msg, pve, &val_s)!=0 ||
val_s.len == 0 || val_s.s == NULL) {
_______________________________________________
Kamailio (OpenSER) - Users mailing list
[email protected]
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users