Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom SIP header #653

Open
zeventh opened this issue Sep 1, 2023 · 5 comments
Open

Custom SIP header #653

zeventh opened this issue Sep 1, 2023 · 5 comments

Comments

@zeventh
Copy link

zeventh commented Sep 1, 2023

Is it possible to add a custom header on all outbound calls?
I've tried to add in extensions.conf and also in mbilling.php but it doesn't seem to work.
The custom header is needed for our supplier to set the call as a private number.

The custom SIP header should look like below.

Privacy: Id

And I believe the command should look like below in Asterisk config?

exten => s,n,SIPAddHeader(Privacy: Id)
@notyourthing
Copy link
Contributor

For this, you would have to create a Custom Context & use it!

@zeventh
Copy link
Author

zeventh commented Sep 7, 2023

Ok, I have done some research on how to forward a context to a different context, but really don't know how to make that work.
For example if I add a new context in extensions_magnus.conf how do I forward this to billing extension? Should i set my custom context on the trunk in the web gui?

I found this issue #375 that looks like a similair question as mine, but in the end it wasn't solved.

I've tried using include and goto in extensions_magnus.conf but can't get it to work. How do I pass the custom SIPheader to the outbound call?

@uzair329
Copy link

uzair329 commented Sep 8, 2023

make a custom context in extensions.conf
[customcontext]
exten => _X.,1,Noop()
exten => _X.,n,Set(cli2=${SIP_HEADER(Privacy: Id)})
exten => _X.,n,Goto(billing,${EXTEN},1)
exten => _X.,n,Hangup()

this is what i understand you need

@zeventh
Copy link
Author

zeventh commented Sep 13, 2023

thank you @uzair329 I got it working with below context, I had to use SIPAddHeader on line 2.

[privacy]
exten => _X.,1,NoOp()
exten => _X.,n,SIPAddHeader(Privacy: id)
exten => _X.,n,Goto(billing,${EXTEN},1)
exten => _X.,n,Hangup()

@xceedconnections
Copy link

make a custom context in extensions.conf [customcontext] exten => _X.,1,Noop() exten => _X.,n,Set(cli2=${SIP_HEADER(Privacy: Id)}) exten => _X.,n,Goto(billing,${EXTEN},1) exten => _X.,n,Hangup()

this is what i understand you need

@uzair329 please provide your number or email. need to get in touch with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants