Unfortunately when I posted this message yesterday, the carriage returns were lost and each paragraph came out as a single line. Sorry about that; I'm trying again now. I have also modified the message to reflect the fact that I've learned something in the intervening hours ;-). Tx to anyone who can help. Mike --------------------------------------------------- I am in the process of establishing a SIP-based system using SER which will allow my end users to connect to each other and to dial out to the pstn using a SIP/pstn gateway run by a provider downstream.
Some of the users on my system are consultants who work on several projects at once. They would like to prefix the numbers they dial with their own arbitrary 4-digit project codes for different calls and have the accounting I send them show the project code they used for each call. Since my accounting is done downstream at the pstn gateway, and it shows the username for each call, I would like to change the username on each of the calls going out of my SER to include the project code. Then no changes would need to be made in the billing software and each call will be easy to identify as to user and project.
I believe that the username which shows up in the billing comes from the FROM field that is transmitted for the call from my SIP, so that is the value I need to change (ie. the value of the environment variable SIP_HF_FROM).
Of course the project code would get stripped off the uri itself so that just the correct uri is sent, and I have figured out how to do that using the strip function. But I am new to SER and just figuring my way through this, so I need a bit of help with the rest of it.
Here is an example of what I want to set up.
If user Mike wishes to call 1-111-1111 and wants to code it to project 1234, he would dial: *123411111111@wherever.com and the outgoing uri would be just: 11111111@wherever.com (this is done using strip)
The FROM value generated would be something like: Mike SER <SIP:Mike@here.com:5060 >;tag=xxxxxxxxxx and I need to change it to include the original name+project code: Mike1234 SER <SIP:Mike@here.com:5060 >;tag=xxxxxxxxxx
Note: the asterisk in the dial string just indicates that a project code follows. Not all users will want this feature and calls without an asterisk will be handled differently.
If I can do the last part (change the outgoing FROM to mike1234) I'll have it cracked. It would be best to do this within SER, but I don't see a way to do it. If there is a way, please let me know.
So then it seems to me that the best thing might be to use the exec_dst command to pass a set of commands to the shell would cause characters 2 through 5 of SIP_ORURI (in this example 1234) to be inserted into SIP_HF_FROM. So something like:
EXPORT SIP__HF_FROM=first_part_of_SIP_HF_FROM+(characters 2-5 of SIP_ORURI)+last_part_of_SIP_HF_FROM ...... Obviously my bash-knowledge needs a bit of work here ;-)
If this would work, can someone tell me the shell commands to use? I am not concerned with the exact logic of how to separate the first and last parts of the FROM field as I am in understanding how to tell the shell to modify the environmental variables so that when control returns to SER it will have the correct values.
Alternatively, what about calling a small executable that reads the appropriate environment variables and changes the value of $SIP_USER before returning to SER? I had at first thought this might be the simplest way to do it, but now I understand that when a program modifies an environment variable the variable returns to its original value when the child process ends. If that is correct, then SER would never see the change.
Note that I'm aware that it would be easier to do this accounting on my own SER system, where I could pick off the appropriate information. However, since the pstn gateway at the next hop does the official accounting and billing, I want the billing it produces to include the project codes, and I think the easiest way to do this is for me to modify the outgoing FROM.
I have been working away at this, starting from zero knowledge of Linux, but I've come about as far as I can get. I would appreciate any advice.
Thanks, Mike
Hello,
first of all, it is not possible to change From header field, you can change the Request-URI only. That means your attempts to rewrite it from executed script will be not successfull.
One possibility how to do that would be using Remote-Party-ID header field. Does the gateway of your provider support that ?
It is possible to append Remote-Party-ID header field to the message and the header field can contain another username (it is usually used when phones behind a PSTN gateway can't display usernames, in that case it is possible to put a number into this header field and the gateway will display it instead of From username).
However, some coding would be necesarry to make that possible because currently it is not possible to create Remote-Party-ID header field based on the contents of the Request-URI.
Jan.
On 19-10 14:55, Mike Dehn wrote:
Unfortunately when I posted this message yesterday, the carriage returns were lost and each paragraph came out as a single line. Sorry about that; I'm trying again now. I have also modified the message to reflect the fact that I've learned something in the intervening hours ;-). Tx to anyone who can help. Mike
I am in the process of establishing a SIP-based system using SER which will allow my end users to connect to each other and to dial out to the pstn using a SIP/pstn gateway run by a provider downstream.
Some of the users on my system are consultants who work on several projects at once. They would like to prefix the numbers they dial with their own arbitrary 4-digit project codes for different calls and have the accounting I send them show the project code they used for each call. Since my accounting is done downstream at the pstn gateway, and it shows the username for each call, I would like to change the username on each of the calls going out of my SER to include the project code. Then no changes would need to be made in the billing software and each call will be easy to identify as to user and project.
I believe that the username which shows up in the billing comes from the FROM field that is transmitted for the call from my SIP, so that is the value I need to change (ie. the value of the environment variable SIP_HF_FROM).
Of course the project code would get stripped off the uri itself so that just the correct uri is sent, and I have figured out how to do that using the strip function. But I am new to SER and just figuring my way through this, so I need a bit of help with the rest of it.
Here is an example of what I want to set up.
If user Mike wishes to call 1-111-1111 and wants to code it to project 1234, he would dial: *123411111111@wherever.com and the outgoing uri would be just: 11111111@wherever.com (this is done using strip)
The FROM value generated would be something like: Mike SER <SIP:Mike@here.com:5060 >;tag=xxxxxxxxxx and I need to change it to include the original name+project code: Mike1234 SER <SIP:Mike@here.com:5060 >;tag=xxxxxxxxxx
Note: the asterisk in the dial string just indicates that a project code follows. Not all users will want this feature and calls without an asterisk will be handled differently.
If I can do the last part (change the outgoing FROM to mike1234) I'll have it cracked. It would be best to do this within SER, but I don't see a way to do it. If there is a way, please let me know.
So then it seems to me that the best thing might be to use the exec_dst command to pass a set of commands to the shell would cause characters 2 through 5 of SIP_ORURI (in this example 1234) to be inserted into SIP_HF_FROM. So something like:
EXPORT SIP__HF_FROM=first_part_of_SIP_HF_FROM+(characters 2-5 of SIP_ORURI)+last_part_of_SIP_HF_FROM ...... Obviously my bash-knowledge needs a bit of work here ;-)
If this would work, can someone tell me the shell commands to use? I am not concerned with the exact logic of how to separate the first and last parts of the FROM field as I am in understanding how to tell the shell to modify the environmental variables so that when control returns to SER it will have the correct values.
Alternatively, what about calling a small executable that reads the appropriate environment variables and changes the value of $SIP_USER before returning to SER? I had at first thought this might be the simplest way to do it, but now I understand that when a program modifies an environment variable the variable returns to its original value when the child process ends. If that is correct, then SER would never see the change.
Note that I'm aware that it would be easier to do this accounting on my own SER system, where I could pick off the appropriate information. However, since the pstn gateway at the next hop does the official accounting and billing, I want the billing it produces to include the project codes, and I think the easiest way to do this is for me to modify the outgoing FROM.
I have been working away at this, starting from zero knowledge of Linux, but I've come about as far as I can get. I would appreciate any advice.
Thanks, Mike
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not able to register the gateway on the SIP server. Is there a way I check the logs on the SER to see if it is really registering or not? And can someone please suggest why is the SIP Gateway not registering with the SER? Thank you very much.
Hello, I have never played with a Mediatrix so I can't help you about, maybe someone else on the list, but if you want to see more debug messages from ser you need to set:
debug=7 log_stderror=yes
in your config file (ser.cfg). Also, when ser demonizes, it writes the messages into the system log file (on RH is /var/log/messages).
Generally, to see the users registered with ser you can use 'serctl ul show' from a console -- that will print the list with them.
Best regards, }Daniel
On 10/20/2003 11:02 PM, Sesha B wrote:
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not able to register the gateway on the SIP server. Is there a way I check the logs on the SER to see if it is really registering or not? And can someone please suggest why is the SIP Gateway not registering with the SER? Thank you very much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
I used Mediatrix 1204. Have set up all the accounts that Mediatrix should use in registering to SER? What software version are your Mediatrix using? You sometimes need to upgrade your firmaware. Also, the same Mediatrix can be H.323 or SIP. Are you sure that yours is using SIP?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: serusers@lists.iptel.org Sent: Monday, October 20, 2003 23:02 Subject: RE: [Serusers]SIP Gateway
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not able
to
register the gateway on the SIP server. Is there a way I check the logs on the SER to see if it is really registering or not? And can someone please suggest why is the SIP Gateway not registering with the SER? Thank you
very
much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi, I'm using Unit Manager Express version 1.1.1.5 to configure Mediatrix 1204. I have configured it to use SIP. I am confused about setting up accounts on Mediatrix. Is there a way to set up accounts on mediatrix? I'm testing it with one SIP phone.
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 4:55 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I used Mediatrix 1204. Have set up all the accounts that Mediatrix should use in registering to SER? What software version are your Mediatrix using? You sometimes need to upgrade your firmaware. Also, the same Mediatrix can be H.323 or SIP. Are you sure that yours is using SIP?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: serusers@lists.iptel.org Sent: Monday, October 20, 2003 23:02 Subject: RE: [Serusers]SIP Gateway
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not able
to
register the gateway on the SIP server. Is there a way I check the logs on the SER to see if it is really registering or not? And can someone please suggest why is the SIP Gateway not registering with the SER? Thank you
very
much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
I was asking the firmware version (the software installed on the 1204). Not the Unit Manager.
I am going to send you instructions on how to set up accounts in the unit. These are accounts the unit uses in registering with the SER server. Note that you will need to configure the same accounts within SER.
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: "Director General: NEFACOMP" dg@nefacomp.net; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 14:55 Subject: RE: [Serusers]SIP Gateway
Hi, I'm using Unit Manager Express version 1.1.1.5 to configure Mediatrix
1204.
I have configured it to use SIP. I am confused about setting up accounts
on
Mediatrix. Is there a way to set up accounts on mediatrix? I'm testing it with one SIP phone.
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 4:55 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I used Mediatrix 1204. Have set up all the accounts that Mediatrix should use in registering to SER? What software version are your Mediatrix using? You sometimes need to upgrade your firmaware. Also, the same Mediatrix can be H.323 or SIP. Are you sure that yours is using SIP?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: serusers@lists.iptel.org Sent: Monday, October 20, 2003 23:02 Subject: RE: [Serusers]SIP Gateway
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not
able
to
register the gateway on the SIP server. Is there a way I check the logs
on
the SER to see if it is really registering or not? And can someone
please
suggest why is the SIP Gateway not registering with the SER? Thank you
very
much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
I will send instructions for the first port and you will be able to do the same for the other ports.
In the provisioning MIB, find the key: sipMib -> sipUAGroup Start by configuring the SER address: sipMib -> sipUAGroup -> sipUAServerGroup -> sipUAServerStaticGroup and configure the parameters therein. Such as Registrar Host, Port ...
Second, configure the port 1 as follows: sipMib -> sipUAGroup -> sipUA1Group configure the main alias entry which should be the account created on the SER server for that port you may even configure other things if needed such as other aliases, .... For other ports, just replace # in sipUA#Group by the correct port number (2, 3 or 4)
Also, you may need to enable some options in the provisioningMib key.
Thanks Emery ----- Original Message ----- From: "Director General: NEFACOMP" dg@nefacomp.net To: sesha@iic.com; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 15:53 Subject: Re: [Serusers]SIP Gateway
I was asking the firmware version (the software installed on the 1204).
Not
the Unit Manager.
I am going to send you instructions on how to set up accounts in the unit. These are accounts the unit uses in registering with the SER server. Note that you will need to configure the same accounts within SER.
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: "Director General: NEFACOMP" dg@nefacomp.net; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 14:55 Subject: RE: [Serusers]SIP Gateway
Hi, I'm using Unit Manager Express version 1.1.1.5 to configure Mediatrix
I have configured it to use SIP. I am confused about setting up accounts
on
Mediatrix. Is there a way to set up accounts on mediatrix? I'm testing
it
with one SIP phone.
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 4:55 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I used Mediatrix 1204. Have set up all the accounts that Mediatrix should use in registering to SER? What software version are your Mediatrix using? You sometimes need to upgrade your firmaware. Also, the same Mediatrix can be H.323 or SIP. Are you sure that yours is using SIP?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: serusers@lists.iptel.org Sent: Monday, October 20, 2003 23:02 Subject: RE: [Serusers]SIP Gateway
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not
able
to
register the gateway on the SIP server. Is there a way I check the
logs
on
the SER to see if it is really registering or not? And can someone
please
suggest why is the SIP Gateway not registering with the SER? Thank you
very
much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
I have these parameters already set. I also restarted mediatrix after setting these MIB variables but I can see only the SIP phone registering with the SER in the ser diagnostics but I dont see the SIP gateway's address at all !!!
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 10:47 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I will send instructions for the first port and you will be able to do the same for the other ports.
In the provisioning MIB, find the key: sipMib -> sipUAGroup Start by configuring the SER address: sipMib -> sipUAGroup -> sipUAServerGroup -> sipUAServerStaticGroup and configure the parameters therein. Such as Registrar Host, Port ...
Second, configure the port 1 as follows: sipMib -> sipUAGroup -> sipUA1Group configure the main alias entry which should be the account created on the SER server for that port you may even configure other things if needed such as other aliases, .... For other ports, just replace # in sipUA#Group by the correct port number (2, 3 or 4)
Also, you may need to enable some options in the provisioningMib key.
Thanks Emery ----- Original Message ----- From: "Director General: NEFACOMP" dg@nefacomp.net To: sesha@iic.com; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 15:53 Subject: Re: [Serusers]SIP Gateway
I was asking the firmware version (the software installed on the 1204).
Not
the Unit Manager.
I am going to send you instructions on how to set up accounts in the unit. These are accounts the unit uses in registering with the SER server. Note that you will need to configure the same accounts within SER.
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: "Director General: NEFACOMP" dg@nefacomp.net; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 14:55 Subject: RE: [Serusers]SIP Gateway
Hi, I'm using Unit Manager Express version 1.1.1.5 to configure Mediatrix
I have configured it to use SIP. I am confused about setting up accounts
on
Mediatrix. Is there a way to set up accounts on mediatrix? I'm testing
it
with one SIP phone.
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 4:55 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I used Mediatrix 1204. Have set up all the accounts that Mediatrix should use in registering to SER? What software version are your Mediatrix using? You sometimes need to upgrade your firmaware. Also, the same Mediatrix can be H.323 or SIP. Are you sure that yours is using SIP?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: serusers@lists.iptel.org Sent: Monday, October 20, 2003 23:02 Subject: RE: [Serusers]SIP Gateway
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not
able
to
register the gateway on the SIP server. Is there a way I check the
logs
on
the SER to see if it is really registering or not? And can someone
please
suggest why is the SIP Gateway not registering with the SER? Thank you
very
much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
What phone? Can you send me the GetWalk generated by your Unit?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: "Director General: NEFACOMP" dg@nefacomp.net; serusers@lists.iptel.org Sent: Thursday, October 23, 2003 00:34 Subject: RE: [Serusers]SIP Gateway
I have these parameters already set. I also restarted mediatrix after setting these MIB variables but I can see only the SIP phone registering with the SER in the ser diagnostics but I dont see the SIP gateway's
address
at all !!!
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 10:47 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I will send instructions for the first port and you will be able to do the same for the other ports.
In the provisioning MIB, find the key: sipMib -> sipUAGroup Start by configuring the SER address: sipMib -> sipUAGroup -> sipUAServerGroup -> sipUAServerStaticGroup and configure the parameters therein. Such as Registrar Host, Port ...
Second, configure the port 1 as follows: sipMib -> sipUAGroup -> sipUA1Group configure the main alias entry which should be the account created on the SER server for that port you may even configure other things if needed such as other aliases, .... For other ports, just replace # in sipUA#Group by the correct port number (2, 3 or 4)
Also, you may need to enable some options in the provisioningMib key.
Thanks Emery ----- Original Message ----- From: "Director General: NEFACOMP" dg@nefacomp.net To: sesha@iic.com; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 15:53 Subject: Re: [Serusers]SIP Gateway
I was asking the firmware version (the software installed on the 1204).
Not
the Unit Manager.
I am going to send you instructions on how to set up accounts in the
unit.
These are accounts the unit uses in registering with the SER server. Note that you will need to configure the same accounts within SER.
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: "Director General: NEFACOMP" dg@nefacomp.net; serusers@lists.iptel.org Sent: Wednesday, October 22, 2003 14:55 Subject: RE: [Serusers]SIP Gateway
Hi, I'm using Unit Manager Express version 1.1.1.5 to configure Mediatrix
I have configured it to use SIP. I am confused about setting up
accounts
on
Mediatrix. Is there a way to set up accounts on mediatrix? I'm
testing
it
with one SIP phone.
-----Original Message----- From: Director General: NEFACOMP [mailto:dg@nefacomp.net] Sent: Wednesday, October 22, 2003 4:55 AM To: sesha@iic.com; serusers@lists.iptel.org Subject: Re: [Serusers]SIP Gateway
I used Mediatrix 1204. Have set up all the accounts that Mediatrix should use in registering
to
SER? What software version are your Mediatrix using? You sometimes need to upgrade your firmaware. Also, the same Mediatrix can be H.323 or SIP. Are you sure that yours
is
using SIP?
Thanks Emery ----- Original Message ----- From: "Sesha B" sesha@iic.com To: serusers@lists.iptel.org Sent: Monday, October 20, 2003 23:02 Subject: RE: [Serusers]SIP Gateway
Hi,
I'm using a SIP gateway (Mediatrix 1204) on 4 ports on PBX. I am not
able
to
register the gateway on the SIP server. Is there a way I check the
logs
on
the SER to see if it is really registering or not? And can someone
please
suggest why is the SIP Gateway not registering with the SER? Thank
you
very
much.
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Mike,
I don't think rewriting the From header field is a viable option. Such a technique could affect interoperability quite a lot since many implementations use From for transaction/dialog matching.
What to do best depends on other parts of your system. I don't think there is an easy way without touching code anywhere, be it on the SIP path, in the accounting system or elsewhere.
An easy option is use of phones with multiple identities (like Cisco).
Another option is including the identification of charged party somewhere else then in From. Particularly, it may be remote part id -- if it is used for generation of CDRs depends on capabilities of the CDR-generating devices. You would then have to write a module which appends an RPID header-field calculated from request-uri. (In the future, it should be easy to calculate using variables but we don't have them yet.)
Accounting from SER, as you mentioned, would be an option too, though I like accounting from gateways better -- they are best informed about call status (including media status and PSTN status) and can thus generate most precise reports.
-jiri
At 11:55 PM 10/19/2003, Mike Dehn wrote:
Unfortunately when I posted this message yesterday, the carriage returns were lost and each paragraph came out as a single line. Sorry about that; I'm trying again now. I have also modified the message to reflect the fact that I've learned something in the intervening hours ;-). Tx to anyone who can help. Mike
I am in the process of establishing a SIP-based system using SER which will allow my end users to connect to each other and to dial out to the pstn using a SIP/pstn gateway run by a provider downstream.
Some of the users on my system are consultants who work on several projects at once. They would like to prefix the numbers they dial with their own arbitrary 4-digit project codes for different calls and have the accounting I send them show the project code they used for each call. Since my accounting is done downstream at the pstn gateway, and it shows the username for each call, I would like to change the username on each of the calls going out of my SER to include the project code. Then no changes would need to be made in the billing software and each call will be easy to identify as to user and project.
I believe that the username which shows up in the billing comes from the FROM field that is transmitted for the call from my SIP, so that is the value I need to change (ie. the value of the environment variable SIP_HF_FROM).
Of course the project code would get stripped off the uri itself so that just the correct uri is sent, and I have figured out how to do that using the strip function. But I am new to SER and just figuring my way through this, so I need a bit of help with the rest of it.
Here is an example of what I want to set up.
If user Mike wishes to call 1-111-1111 and wants to code it to project 1234, he would dial: *123411111111@wherever.com and the outgoing uri would be just: 11111111@wherever.com (this is done using strip)
The FROM value generated would be something like: Mike SER <SIP:Mike@here.com:5060 >;tag=xxxxxxxxxx and I need to change it to include the original name+project code: Mike1234 SER <SIP:Mike@here.com:5060 >;tag=xxxxxxxxxx
Note: the asterisk in the dial string just indicates that a project code follows. Not all users will want this feature and calls without an asterisk will be handled differently.
If I can do the last part (change the outgoing FROM to mike1234) I'll have it cracked. It would be best to do this within SER, but I don't see a way to do it. If there is a way, please let me know.
So then it seems to me that the best thing might be to use the exec_dst command to pass a set of commands to the shell would cause characters 2 through 5 of SIP_ORURI (in this example 1234) to be inserted into SIP_HF_FROM. So something like:
EXPORT SIP__HF_FROM=first_part_of_SIP_HF_FROM+(characters 2-5 of SIP_ORURI)+last_part_of_SIP_HF_FROM ...... Obviously my bash-knowledge needs a bit of work here ;-)
If this would work, can someone tell me the shell commands to use? I am not concerned with the exact logic of how to separate the first and last parts of the FROM field as I am in understanding how to tell the shell to modify the environmental variables so that when control returns to SER it will have the correct values.
Alternatively, what about calling a small executable that reads the appropriate environment variables and changes the value of $SIP_USER before returning to SER? I had at first thought this might be the simplest way to do it, but now I understand that when a program modifies an environment variable the variable returns to its original value when the child process ends. If that is correct, then SER would never see the change.
Note that I'm aware that it would be easier to do this accounting on my own SER system, where I could pick off the appropriate information. However, since the pstn gateway at the next hop does the official accounting and billing, I want the billing it produces to include the project codes, and I think the easiest way to do this is for me to modify the outgoing FROM.
I have been working away at this, starting from zero knowledge of Linux, but I've come about as far as I can get. I would appreciate any advice.
Thanks, Mike
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/