magnussolution / magnusbilling7

MagnusBilling is a fast, secure, efficient, high availability, VOIP Billing.
https://www.magnusbilling.org
GNU Lesser General Public License v3.0
174 stars 106 forks source link

Custom SIP header #653

Open zeventh opened 11 months ago

zeventh commented 11 months ago

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 commented 10 months ago

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

zeventh commented 10 months ago

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 https://github.com/magnussolution/magnusbilling7/issues/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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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.