magnusbilling7 icon indicating copy to clipboard operation
magnusbilling7 copied to clipboard

Custom SIP header

Open zeventh opened this issue 2 years ago • 6 comments
trafficstars

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)

zeventh avatar Sep 01 '23 07:09 zeventh

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

notyourthing avatar Sep 04 '23 20:09 notyourthing

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?

zeventh avatar Sep 07 '23 12:09 zeventh

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 avatar Sep 08 '23 23:09 uzair329

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()

zeventh avatar Sep 13 '23 06:09 zeventh

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.

xceedconnections avatar Sep 15 '23 12:09 xceedconnections