Hi,
The exec module has a nice variable that holds the destination user of an URI request ($SIP_OUSER).
Is there a variable that holds the originating user as well?
Basically we want to perform a mysql lookup of a custom table where the username resides.
Regards, Andres
see http://www.iptel.org/ser/doc/seruser/seruser.html#USINGEXEC
SIP_HF_FROM="alice" sip:alice@iptel.org;tag=76ff7a07-c091-4192-84a0-d56e91fe104f
-jiri
At 10:36 PM 1/14/2004, Andres wrote:
Hi,
The exec module has a nice variable that holds the destination user of an URI request ($SIP_OUSER).
Is there a variable that holds the originating user as well?
Basically we want to perform a mysql lookup of a custom table where the username resides.
Regards, Andres
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/
On Wednesday 14 January 2004 17:02, Jiri Kuthan wrote:
see http://www.iptel.org/ser/doc/seruser/seruser.html#USINGEXEC
SIP_HF_FROM="alice" sip:alice@iptel.org;tag=76ff7a07-c091-4192-84a0-d56e91fe104f
I don't see how I can use this variable for an SQL query. On the other hand the SIP_OUSER variable can be used like this:
QUERY="select email_address from subscriber where user="$SIP_OUSER""; EMAIL=`mysql -Bsuser -pheslo -e "$QUERY" ser`;
I want the same type of query but for the originating user. Is there any way to take apart the SIP_HF_FROM and extract just the username?
Andres.
-jiri
At 10:36 PM 1/14/2004, Andres wrote:
Hi,
The exec module has a nice variable that holds the destination user of an URI request ($SIP_OUSER).
Is there a variable that holds the originating user as well?
Basically we want to perform a mysql lookup of a custom table where the username resides.
Regards, Andres
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
At 12:01 AM 1/15/2004, Andres wrote:
On Wednesday 14 January 2004 17:02, Jiri Kuthan wrote:
see http://www.iptel.org/ser/doc/seruser/seruser.html#USINGEXEC
SIP_HF_FROM="alice" sip:alice@iptel.org;tag=76ff7a07-c091-4192-84a0-d56e91fe104f
I don't see how I can use this variable for an SQL query.
use text processing utils such as awk, sed, whatever you like better. That's not so difficult, is it?
On the other hand the SIP_OUSER variable can be used like this:
QUERY="select email_address from subscriber where user=\"$SIP_OUSER\""; EMAIL=`mysql -Bsuser -pheslo -e "$QUERY" ser`;
I want the same type of query but for the originating user. Is there any way to take apart the SIP_HF_FROM and extract just the username?
you need to do it yourself. There is infitnitely many interesting elemenents in a sip message and it makes little sense to break all of them in separate variables.
-jiri
On Wednesday 14 January 2004 18:38, Jiri Kuthan wrote:
At 12:01 AM 1/15/2004, Andres wrote:
On Wednesday 14 January 2004 17:02, Jiri Kuthan wrote:
see http://www.iptel.org/ser/doc/seruser/seruser.html#USINGEXEC
SIP_HF_FROM="alice" sip:alice@iptel.org;tag=76ff7a07-c091-4192-84a0-d56e91fe104f
I don't see how I can use this variable for an SQL query.
use text processing utils such as awk, sed, whatever you like better. That's not so difficult, is it?
No problem. I was just trying to avoid yet another external command in the ser.cfg file.
Thanks, Andres.
On the other hand the SIP_OUSER variable can be used like this:
QUERY="select email_address from subscriber where user=\"$SIP_OUSER\""; EMAIL=`mysql -Bsuser -pheslo -e "$QUERY" ser`;
I want the same type of query but for the originating user. Is there any way to take apart the SIP_HF_FROM and extract just the username?
you need to do it yourself. There is infitnitely many interesting elemenents in a sip message and it makes little sense to break all of them in separate variables.
-jiri